about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2013-01-28 17:26:32 +0100
committerPeter Simons <simons@cryp.to>2013-01-28 17:26:32 +0100
commitad242d38f0116af11fa4057321ef3fae54ccb733 (patch)
tree09f940a40e28cc787286bfa9f7c6677393c8f794
parentd11ca5166cba08ce743bf3a48dab055cb34924ec (diff)
parentecee1be7f12a48bccdd2c6b362371be16ea56384 (diff)
downloadnixlib-ad242d38f0116af11fa4057321ef3fae54ccb733.tar
nixlib-ad242d38f0116af11fa4057321ef3fae54ccb733.tar.gz
nixlib-ad242d38f0116af11fa4057321ef3fae54ccb733.tar.bz2
nixlib-ad242d38f0116af11fa4057321ef3fae54ccb733.tar.lz
nixlib-ad242d38f0116af11fa4057321ef3fae54ccb733.tar.xz
nixlib-ad242d38f0116af11fa4057321ef3fae54ccb733.tar.zst
nixlib-ad242d38f0116af11fa4057321ef3fae54ccb733.zip
Merge remote-tracking branch 'origin/master' into x-updates.
-rw-r--r--doc/meta.xml6
-rwxr-xr-xmaintainers/scripts/copy-tarball.sh10
-rwxr-xr-xmaintainers/scripts/copy-tarballs.sh14
-rw-r--r--maintainers/scripts/eval-release.nix4
-rwxr-xr-xmaintainers/scripts/generate-cpan-package122
-rwxr-xr-xmaintainers/scripts/hydra_eval_check1
-rw-r--r--pkgs/applications/audio/amarok/live.nix37
-rw-r--r--pkgs/applications/audio/audacity/default.nix4
-rw-r--r--pkgs/applications/audio/bristol/default.nix5
-rw-r--r--pkgs/applications/audio/pavucontrol/default.nix8
-rw-r--r--pkgs/applications/display-managers/slim/default.nix6
-rw-r--r--pkgs/applications/editors/ed/default.nix11
-rw-r--r--pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/htmlize/default.nix4
-rw-r--r--pkgs/applications/editors/geany/default.nix4
-rw-r--r--pkgs/applications/editors/jedit/default.nix2
-rw-r--r--pkgs/applications/editors/jedit/wrapper.nix18
-rw-r--r--pkgs/applications/editors/nedit/default.nix4
-rw-r--r--pkgs/applications/editors/vbindiff/default.nix19
-rw-r--r--pkgs/applications/editors/zile/default.nix7
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix13
-rw-r--r--pkgs/applications/graphics/darktable/default.nix8
-rw-r--r--pkgs/applications/graphics/darktable/libpng-15.patch22
-rw-r--r--pkgs/applications/graphics/dia/default.nix4
-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.nix22
-rw-r--r--pkgs/applications/graphics/freecad/pythonpath.patch18
-rw-r--r--pkgs/applications/graphics/gocr/default.nix17
-rw-r--r--pkgs/applications/graphics/ipe/default.nix47
-rw-r--r--pkgs/applications/graphics/kuickshow/builder.sh10
-rw-r--r--pkgs/applications/graphics/openscad/default.nix19
-rw-r--r--pkgs/applications/graphics/qiv/default.nix22
-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.nix (renamed from pkgs/misc/sane-backends/default.nix)26
-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)10
-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.nix4
-rw-r--r--pkgs/applications/misc/goldendict/default.nix4
-rw-r--r--pkgs/applications/misc/gphoto2/src-for-gphotofs.nix1
-rw-r--r--pkgs/applications/misc/ikiwiki/default.nix4
-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.nix6
-rw-r--r--pkgs/applications/misc/nut/2.6.3.nix34
-rw-r--r--pkgs/applications/misc/nut/default.nix32
-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/rxvt_unicode/default.nix10
-rw-r--r--pkgs/applications/misc/semnotes/default.nix2
-rw-r--r--pkgs/applications/misc/st/default.nix4
-rw-r--r--pkgs/applications/misc/xmobar/default.nix7
-rw-r--r--pkgs/applications/misc/xpdf/xpdf-3.01pl2.patch471
-rw-r--r--pkgs/applications/misc/zathura/core/default.nix4
-rw-r--r--pkgs/applications/misc/zathura/default.nix2
-rw-r--r--pkgs/applications/misc/zathura/djvu/default.nix4
-rw-r--r--pkgs/applications/misc/zathura/pdf-poppler/default.nix4
-rw-r--r--pkgs/applications/misc/zathura/ps/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix87
-rw-r--r--pkgs/applications/networking/browsers/chromium/pulse_audio_fix.patch11
-rw-r--r--pkgs/applications/networking/browsers/chromium/sources.nix18
-rw-r--r--pkgs/applications/networking/browsers/firefox/17.0.nix185
-rw-r--r--pkgs/applications/networking/browsers/firefox/18.0.nix (renamed from pkgs/applications/networking/browsers/firefox/16.0.nix)23
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix14
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix4
-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/vimprobable2/default.nix6
-rw-r--r--pkgs/applications/networking/dropbox/default.nix12
-rw-r--r--pkgs/applications/networking/ftp/filezilla/default.nix23
-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/mcabber/default.nix12
-rw-r--r--pkgs/applications/networking/instant-messengers/skype/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/kde/0.3.1.nix13
-rw-r--r--pkgs/applications/networking/instant-messengers/tkabber/default.nix1
-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/mailreaders/notmuch/default.nix2
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix2
-rw-r--r--pkgs/applications/networking/p2p/gnunet/default.nix14
-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/office/abiword/default.nix14
-rw-r--r--pkgs/applications/office/hledger-interest/default.nix4
-rw-r--r--pkgs/applications/office/ledger/const.patch41
-rw-r--r--pkgs/applications/science/astronomy/celestia/default.nix62
-rw-r--r--pkgs/applications/science/astronomy/stellarium/default.nix4
-rw-r--r--pkgs/applications/science/biology/slr/default.nix23
-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/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.nix6
-rw-r--r--pkgs/applications/science/logic/iprover/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/math/maxima/default.nix4
-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/molecular-dynamics/gromacs/default.nix46
-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/git-and-tools/default.nix5
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-annex/default.nix7
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/docbook2texi-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/hub/default.nix28
-rw-r--r--pkgs/applications/version-management/mercurial/default.nix4
-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/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/RealPlayer/builder.sh20
-rw-r--r--pkgs/applications/video/RealPlayer/default.nix19
-rw-r--r--pkgs/applications/video/gpac/default.nix36
-rw-r--r--pkgs/applications/video/mkvtoolnix/default.nix4
-rw-r--r--pkgs/applications/video/mplayer/default.nix (renamed from pkgs/applications/video/MPlayer/default.nix)10
-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.nix4
-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/svn-6642.nix19
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix31
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/default.nix20
-rw-r--r--pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch30
-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.nix58
-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/i3/default.nix4
-rw-r--r--pkgs/applications/window-managers/ion-3/default.nix6
-rw-r--r--pkgs/applications/window-managers/wmii/builder.sh24
-rw-r--r--pkgs/applications/window-managers/xmonad/default.nix19
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-contrib.nix4
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-extras.nix5
-rw-r--r--pkgs/build-support/cabal/default.nix4
-rw-r--r--pkgs/build-support/fetchurl/mirrors.nix4
-rw-r--r--pkgs/build-support/release/source-tarball.nix2
-rw-r--r--pkgs/build-support/replace-dependency.nix79
-rw-r--r--pkgs/build-support/upstream-updater/update-walker-service-specific.sh4
-rwxr-xr-xpkgs/build-support/upstream-updater/update-walker.sh69
-rwxr-xr-xpkgs/build-support/upstream-updater/urls-from-page.sh2
-rw-r--r--pkgs/build-support/vm/deb/deb-closure.pl17
-rw-r--r--pkgs/build-support/vm/default.nix90
-rw-r--r--pkgs/data/documentation/man-pages/default.nix4
-rw-r--r--pkgs/data/fonts/libertine/default.nix21
-rw-r--r--pkgs/data/misc/themes/green.nix5
-rw-r--r--pkgs/data/misc/themes/theme-gnu.nix5
-rw-r--r--pkgs/desktops/kde-4.7/kde-workspace.nix4
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/perlqt.nix10
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/smokekde.nix10
-rw-r--r--pkgs/desktops/kde-4.7/kdenetwork/log-feature.diff60
-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.8/kde-workspace.nix4
-rw-r--r--pkgs/desktops/xfce-4.8/applications/terminal.nix4
-rw-r--r--pkgs/desktops/xfce-4.8/applications/xfce4-notifyd.nix18
-rw-r--r--pkgs/desktops/xfce-4.8/default.nix2
-rw-r--r--pkgs/development/arduino/arduino-core/default.nix42
-rw-r--r--pkgs/development/arduino/ino/default.nix28
-rw-r--r--pkgs/development/compilers/cmucl/binary.nix4
-rw-r--r--pkgs/development/compilers/ecl/default.nix66
-rw-r--r--pkgs/development/compilers/ecl/default.upstream4
-rw-r--r--pkgs/development/compilers/eql/default.nix39
-rw-r--r--pkgs/development/compilers/fpc/lazarus.nix4
-rw-r--r--pkgs/development/compilers/gcc/4.0/gcc-4.0.2-cxx.patch12
-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.7/default.nix12
-rw-r--r--pkgs/development/compilers/ghc/with-packages.nix7
-rw-r--r--pkgs/development/compilers/idris/default.nix8
-rw-r--r--pkgs/development/compilers/jdk/default.nix9
-rw-r--r--pkgs/development/compilers/jdk/jdk6-cygwin.nix48
-rw-r--r--pkgs/development/compilers/julia/default.nix41
-rw-r--r--pkgs/development/compilers/llvm/clang-include-paths.patch21
-rw-r--r--pkgs/development/compilers/llvm/clang-ld-flags.patch57
-rw-r--r--pkgs/development/compilers/llvm/clang-purity.patch137
-rw-r--r--pkgs/development/compilers/llvm/clang.nix12
-rw-r--r--pkgs/development/compilers/llvm/default.nix5
-rw-r--r--pkgs/development/compilers/mit-scheme/default.nix22
-rw-r--r--pkgs/development/compilers/ocaml/cvs.nix31
-rw-r--r--pkgs/development/compilers/opa/default.nix9
-rw-r--r--pkgs/development/compilers/openjdk/cppflags-include-fix.patch16
-rw-r--r--pkgs/development/compilers/openjdk/default.nix43
-rw-r--r--pkgs/development/compilers/openjdk/linux-version-check-fix.patch12
-rw-r--r--pkgs/development/compilers/openjdk/printf-fix.patch12
-rw-r--r--pkgs/development/compilers/sbcl/default.nix9
-rw-r--r--pkgs/development/compilers/tiger/builder.sh15
-rw-r--r--pkgs/development/compilers/tiger/default.nix11
-rw-r--r--pkgs/development/interpreters/clojure/default.nix15
-rw-r--r--pkgs/development/interpreters/guile/default.nix4
-rw-r--r--pkgs/development/interpreters/hiphopvm/default.nix63
-rw-r--r--pkgs/development/interpreters/hiphopvm/tbb.patch13
-rw-r--r--pkgs/development/interpreters/lua-5/5.1.nix23
-rw-r--r--pkgs/development/interpreters/php/5.3.nix13
-rw-r--r--pkgs/development/interpreters/php/fix.patch22
-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/python-linkme-wrapper.nix13
-rw-r--r--pkgs/development/interpreters/python/python-linkme-wrapper.sh34
-rw-r--r--pkgs/development/interpreters/python/pythonhome-wrapper.nix21
-rw-r--r--pkgs/development/interpreters/python/wrapper.nix6
-rw-r--r--pkgs/development/interpreters/spidermonkey/builder.sh31
-rw-r--r--pkgs/development/interpreters/toolbus/default.nix17
-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/apr-util/default.nix6
-rw-r--r--pkgs/development/libraries/boost/1.52-headers.nix2
-rw-r--r--pkgs/development/libraries/boost/1.52.nix7
-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/clucene-core/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.nix5
-rw-r--r--pkgs/development/libraries/despotify/default.nix34
-rw-r--r--pkgs/development/libraries/directfb/src-for-default.nix10
-rw-r--r--pkgs/development/libraries/eigen/2.0.nix23
-rw-r--r--pkgs/development/libraries/eigen/default.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg/1.0.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg/1.1.nix85
-rw-r--r--pkgs/development/libraries/freeglut/freeglut-gcc-4.2.patch13
-rw-r--r--pkgs/development/libraries/ftgl/2.1.2.nix2
-rw-r--r--pkgs/development/libraries/gmp/4.3.1.nix27
-rw-r--r--pkgs/development/libraries/gnutls/default.nix7
-rw-r--r--pkgs/development/libraries/gtk-sharp-2/dllmap-glue.patch65
-rw-r--r--pkgs/development/libraries/gts/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/Boolean/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/Crypto/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/DAV/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/DSH/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/Diff/default.nix4
-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/JuicyPixels/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/MemoTrie/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.2.nix)0
-rw-r--r--pkgs/development/libraries/haskell/active/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/aeson/default.nix4
-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/attoparsec-binary/attoparsec-binary-ghc7.6.1.patch20
-rw-r--r--pkgs/development/libraries/haskell/attoparsec/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/base64-conduit/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/basic-prelude/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/bifunctors/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/binary/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/blaze-html/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/blaze-markup/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/blaze-svg/default.nix14
-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)0
-rw-r--r--pkgs/development/libraries/haskell/bmp/1.2.3.4.nix15
-rw-r--r--pkgs/development/libraries/haskell/bytestring-nums/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/case-insensitive/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cautious-file/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/certificate/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cipher-aes/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/cipher-rc4/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/citeproc-hs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/classy-prelude/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/clientsession/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/comonad-transformers/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/comonad/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/comonads-fd/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/configurator/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cprng-aes/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/crypto-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/crypto-numbers/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/crypto-pubkey/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/crypto-random-api/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/cryptocipher/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/cryptohash/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/dataenc/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/diagrams/cairo.nix12
-rw-r--r--pkgs/development/libraries/haskell/diagrams/contrib.nix18
-rw-r--r--pkgs/development/libraries/haskell/diagrams/core.nix12
-rw-r--r--pkgs/development/libraries/haskell/diagrams/diagrams.nix10
-rw-r--r--pkgs/development/libraries/haskell/diagrams/lib.nix13
-rw-r--r--pkgs/development/libraries/haskell/diagrams/svg.nix19
-rw-r--r--pkgs/development/libraries/haskell/digestive-functors-heist/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/digestive-functors-snap/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/digestive-functors/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/dimensional-tf/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/distributive/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/doctest/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/double-conversion/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/dual-tree/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/editline/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/either/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/errors/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/file-embed/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/filestore/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/force-layout/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/fsnotify/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/generic-deriving/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ghc-mod/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/gitit/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/gloss/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/glpk-hs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/graphviz/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/groupoids/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/hakyll/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/hamlet/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/happstack/happstack-server.nix12
-rw-r--r--pkgs/development/libraries/haskell/hashable/1.1.2.5.nix (renamed from pkgs/development/libraries/haskell/hashable/default.nix)0
-rw-r--r--pkgs/development/libraries/haskell/hashable/1.2.0.5.nix15
-rw-r--r--pkgs/development/libraries/haskell/heist/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/highlighting-kate/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hjsmin/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hledger-lib/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/hledger-web/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/hledger/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hs-bibutils/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hsemail/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hslogger-template/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hspec/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/http-conduit/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/http-date/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/http-reverse-proxy/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/iproute/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/kansas-lava/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/language-c-quote/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/largeword/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/lens/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/liblastfm/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/libmpd/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/lifted-base/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/logict/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/mainland-pretty/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/mime-types/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/minimorph/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/miniutter/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/monad-logger/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/mongoDB/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/monoid-extras/default.nix14
-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/multiarg/default.nix6
-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/syb/default.nix)8
-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/network-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/network/2.4.1.0.nix (renamed from pkgs/development/libraries/haskell/network/2.4.0.1.nix)4
-rw-r--r--pkgs/development/libraries/haskell/numtype-tf/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/optparse-applicative/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/pandoc-types/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/pandoc/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/parallel-io/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/parseargs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/pem/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent-postgresql/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent-sqlite/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent-template/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/pool-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/pretty-show/default.nix10
-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.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/reactive-banana/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/reflection/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/repa-algorithms/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/repa-examples/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/repa-io/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/repa/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/resourcet/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/semigroupoid-extras/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/semigroupoids/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/semigroups/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/shakespeare-js/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/shelly/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/silently/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/simple-sendfile/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/sized-types/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/skein/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/smallcheck/default.nix4
-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/snap.nix25
-rw-r--r--pkgs/development/libraries/haskell/srcloc/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/strptime/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/stylish-haskell/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/syb/0.3.5.nix14
-rw-r--r--pkgs/development/libraries/haskell/system-fileio/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/tabular/default.nix6
-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.nix4
-rw-r--r--pkgs/development/libraries/haskell/test-framework-th/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/test-framework/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/texmath/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.1.12.nix15
-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.2.0.5.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)4
-rw-r--r--pkgs/development/libraries/haskell/tls-extra/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/tls/default.nix13
-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/uniplate/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/unix-compat/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/unix-time/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/unordered-containers/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/uu-parsinglib/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/vault/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/vector-space/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/void/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/wai-app-static/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/wai-extra/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/warp/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/word8/default.nix4
-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/xss-sanitize/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yaml/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-auth/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/yesod-core/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-default/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-form/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/yesod-persistent/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-static/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-test/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/yesod/default.nix41
-rw-r--r--pkgs/development/libraries/haskell/yst/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zeromq3-haskell/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zip-archive/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zlib-bindings/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zlib-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/hunspell/default.nix2
-rw-r--r--pkgs/development/libraries/hwloc/default.nix8
-rw-r--r--pkgs/development/libraries/indilib/default.nix2
-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/levmar/use-atlas.patch37
-rw-r--r--pkgs/development/libraries/libdwarf/default.nix27
-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/libgadu/default.nix6
-rw-r--r--pkgs/development/libraries/libiconv/default.nix20
-rw-r--r--pkgs/development/libraries/libixp/builder.sh32
-rw-r--r--pkgs/development/libraries/liblrdf/default.nix46
-rw-r--r--pkgs/development/libraries/libmcrypt/default.nix16
-rw-r--r--pkgs/development/libraries/libmemcached/default.nix18
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix4
-rw-r--r--pkgs/development/libraries/libmsn/libmsn-4.1-openssl-1.patch17
-rw-r--r--pkgs/development/libraries/libnatspec/default.nix10
-rw-r--r--pkgs/development/libraries/libnova/default.nix2
-rw-r--r--pkgs/development/libraries/libqalculate/default.nix2
-rw-r--r--pkgs/development/libraries/libspotify/default.nix61
-rw-r--r--pkgs/development/libraries/libssh/default.nix13
-rw-r--r--pkgs/development/libraries/libvdpau/default.nix4
-rw-r--r--pkgs/development/libraries/libxklavier/default.nix2
-rw-r--r--pkgs/development/libraries/libxtc_dxtn/default.nix15
-rw-r--r--pkgs/development/libraries/mesa/swrast-settexbuffer.patch24
-rw-r--r--pkgs/development/libraries/muparser/default.nix10
-rw-r--r--pkgs/development/libraries/mygui/default.nix10
-rw-r--r--pkgs/development/libraries/ncbi/default.nix2
-rw-r--r--pkgs/development/libraries/nettle/default.nix2
-rw-r--r--pkgs/development/libraries/nss/default.nix5
-rw-r--r--pkgs/development/libraries/ogre/default.nix6
-rw-r--r--pkgs/development/libraries/oniguruma/default.nix16
-rw-r--r--pkgs/development/libraries/opencascade/default.nix10
-rw-r--r--pkgs/development/libraries/opencv/changeset_r3190.diff20
-rw-r--r--pkgs/development/libraries/opencv/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/default.nix.edited27
-rw-r--r--pkgs/development/libraries/openmotif/default.nix32
-rw-r--r--pkgs/development/libraries/polkit/default.nix2
-rw-r--r--pkgs/development/libraries/qimageblitz/default.nix2
-rw-r--r--pkgs/development/libraries/qjson/default.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix2
-rw-r--r--pkgs/development/libraries/science/biology/bioconductor/bioconductor.nix43
-rw-r--r--pkgs/development/libraries/science/math/atlas/default.nix2
-rw-r--r--pkgs/development/libraries/spice-protocol/default.nix4
-rw-r--r--pkgs/development/libraries/spice/default.nix11
-rw-r--r--pkgs/development/libraries/taglib/live.nix23
-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/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.nix61
-rw-r--r--pkgs/development/libraries/tsocks/default.nix22
-rw-r--r--pkgs/development/libraries/v8/default.nix6
-rw-r--r--pkgs/development/libraries/wxGTK-2.9/default.nix9
-rw-r--r--pkgs/development/misc/avr-gcc-with-avr-libc/default.nix16
-rw-r--r--pkgs/development/mobile/androidenv/addon.xml (renamed from pkgs/development/androidenv/addon.xml)153
-rw-r--r--pkgs/development/mobile/androidenv/addons.nix (renamed from pkgs/development/androidenv/addons.nix)14
-rw-r--r--pkgs/development/mobile/androidenv/androidsdk.nix (renamed from pkgs/development/androidenv/androidsdk.nix)34
-rw-r--r--pkgs/development/mobile/androidenv/build-app.nix (renamed from pkgs/development/androidenv/build-app.nix)0
-rw-r--r--pkgs/development/mobile/androidenv/default.nix (renamed from pkgs/development/androidenv/default.nix)2
-rw-r--r--pkgs/development/mobile/androidenv/emulate-app.nix (renamed from pkgs/development/androidenv/emulate-app.nix)0
-rwxr-xr-xpkgs/development/mobile/androidenv/generate-addons.sh (renamed from pkgs/development/androidenv/generate-addons.sh)0
-rw-r--r--pkgs/development/mobile/androidenv/generate-addons.xsl (renamed from pkgs/development/androidenv/generate-addons.xsl)0
-rwxr-xr-xpkgs/development/mobile/androidenv/generate-platforms.sh (renamed from pkgs/development/androidenv/generate-platforms.sh)0
-rw-r--r--pkgs/development/mobile/androidenv/generate-platforms.xsl (renamed from pkgs/development/androidenv/generate-platforms.xsl)0
-rwxr-xr-xpkgs/development/mobile/androidenv/generate-sysimages.sh (renamed from pkgs/development/androidenv/generate-sysimages.sh)0
-rw-r--r--pkgs/development/mobile/androidenv/generate-sysimages.xsl (renamed from pkgs/development/androidenv/generate-sysimages.xsl)0
-rw-r--r--pkgs/development/mobile/androidenv/platform-tools.nix (renamed from pkgs/development/androidenv/platform-tools.nix)10
-rw-r--r--pkgs/development/mobile/androidenv/platforms-linux.nix (renamed from pkgs/development/androidenv/platforms-linux.nix)14
-rw-r--r--pkgs/development/mobile/androidenv/platforms-macosx.nix (renamed from pkgs/development/androidenv/platforms-macosx.nix)14
-rw-r--r--pkgs/development/mobile/androidenv/repository-7.xml (renamed from pkgs/development/androidenv/repository-7.xml)294
-rw-r--r--pkgs/development/mobile/androidenv/support.nix (renamed from pkgs/development/androidenv/support.nix)6
-rw-r--r--pkgs/development/mobile/androidenv/sysimages.nix (renamed from pkgs/development/androidenv/sysimages.nix)10
-rw-r--r--pkgs/development/mobile/titaniumenv/build-app.nix119
-rw-r--r--pkgs/development/mobile/titaniumenv/default.nix18
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/default.nix38
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix10
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix24
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix8
-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/fixtiverify.sed1
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk.nix60
-rw-r--r--pkgs/development/mobile/xcodeenv/build-app.nix92
-rw-r--r--pkgs/development/mobile/xcodeenv/default.nix15
-rw-r--r--pkgs/development/mobile/xcodeenv/simulate-app.nix17
-rw-r--r--pkgs/development/mobile/xcodeenv/xcodewrapper.nix24
-rw-r--r--pkgs/development/ocaml-modules/lablgtkmathview/configure.patch14
-rw-r--r--pkgs/development/perl-modules/Compress-Raw-Bzip2/default.nix15
-rw-r--r--pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix9
-rw-r--r--pkgs/development/perl-modules/DBD-Pg/default.nix11
-rw-r--r--pkgs/development/perl-modules/Google-ProtocolBuffers-multiline-comments.patch12
-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/generic/default.nix63
-rw-r--r--pkgs/development/python-modules/generic/wrap.sh16
-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/default.nix15
-rw-r--r--pkgs/development/python-modules/pygobject/default.nix14
-rw-r--r--pkgs/development/python-modules/pygtk/default.nix43
-rw-r--r--pkgs/development/python-modules/python-gudev/default.nix25
-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.nix4
-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.nix13
-rw-r--r--pkgs/development/tools/analysis/radare/lua.patch12
-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/leiningen/builder.sh2
-rw-r--r--pkgs/development/tools/build-managers/leiningen/default.nix21
-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.0.0.patch4
-rw-r--r--pkgs/development/tools/casperjs/default.nix46
-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/haskell/BNFC/default.nix8
-rw-r--r--pkgs/development/tools/haskell/SourceGraph/default.nix4
-rw-r--r--pkgs/development/tools/haskell/cabal2nix/default.nix4
-rw-r--r--pkgs/development/tools/haskell/hlint/default.nix4
-rw-r--r--pkgs/development/tools/haskell/splot/default.nix4
-rw-r--r--pkgs/development/tools/haskell/timeplot/default.nix4
-rw-r--r--pkgs/development/tools/haskell/uuagc/cabal.nix4
-rw-r--r--pkgs/development/tools/haskell/uuagc/default.nix4
-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/cflow/default.nix3
-rw-r--r--pkgs/development/tools/misc/cpphs/default.nix4
-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/gdb/default.nix4
-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/neoload/default.nix26
-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/sysprof/default.nix34
-rw-r--r--pkgs/development/web/nodejs/default.nix6
-rw-r--r--pkgs/games/LambdaHack/default.nix14
-rw-r--r--pkgs/games/anki/default.nix67
-rw-r--r--pkgs/games/bsdgames/default.nix11
-rw-r--r--pkgs/games/exult/snapshot.nix44
-rw-r--r--pkgs/games/gnuchess/default.nix49
-rw-r--r--pkgs/games/gnuchess/default.upstream1
-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/naev/default.nix2
-rw-r--r--pkgs/games/pingus/default.nix29
-rw-r--r--pkgs/games/pingus/default.upstream1
-rw-r--r--pkgs/games/scid/default.nix55
-rw-r--r--pkgs/games/stuntrally/default.nix32
-rw-r--r--pkgs/games/super-tux-kart/default.nix23
-rw-r--r--pkgs/games/torcs/default.nix2
-rw-r--r--pkgs/games/ufoai/default.nix52
-rw-r--r--pkgs/games/uqm/default.nix8
-rw-r--r--pkgs/games/urbanterror/default.nix2
-rw-r--r--pkgs/games/vessel/default.nix84
-rw-r--r--pkgs/games/vessel/isatty.c6
-rw-r--r--pkgs/games/warsow/default.nix14
-rw-r--r--pkgs/games/widelands/default.nix3
-rw-r--r--pkgs/games/worldofgoo/default.nix83
-rw-r--r--pkgs/games/xboard/default.nix47
-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/xsokoban/default.nix5
-rw-r--r--pkgs/games/zdoom/default.nix18
-rw-r--r--pkgs/games/zoom/default.nix6
-rw-r--r--pkgs/lib/maintainers.nix4
-rw-r--r--pkgs/lib/modules.nix36
-rw-r--r--pkgs/lib/platforms.nix7
-rw-r--r--pkgs/lib/properties.nix98
-rw-r--r--pkgs/lib/types.nix16
-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/gutenprint/bin.nix3
-rw-r--r--pkgs/misc/emulators/dlx/default.nix28
-rw-r--r--pkgs/misc/emulators/wine/default.nix10
-rw-r--r--pkgs/misc/emulators/wine/default.upstream11
-rw-r--r--pkgs/misc/emulators/wine/wine-warcraft.nix49
-rw-r--r--pkgs/misc/ghostscript/libpng-1.5.patch198
-rw-r--r--pkgs/misc/rosegarden/default.nix59
-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/uboot/default.nix15
-rw-r--r--pkgs/misc/uboot/sheevaplug-config.patch57
-rw-r--r--pkgs/misc/uboot/sheevaplug-sdio.patch1091
-rw-r--r--pkgs/os-specific/linux/acpi/default.nix11
-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.nix4
-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/default.nix8
-rw-r--r--pkgs/os-specific/linux/atop/default.nix4
-rw-r--r--pkgs/os-specific/linux/aufs-util/2.1.nix42
-rw-r--r--pkgs/os-specific/linux/aufs-util/3.nix3
-rw-r--r--pkgs/os-specific/linux/aufs/2.1.nix48
-rw-r--r--pkgs/os-specific/linux/aufs/3.nix4
-rw-r--r--pkgs/os-specific/linux/blcr/default.nix11
-rw-r--r--pkgs/os-specific/linux/cpufrequtils/default.nix2
-rw-r--r--pkgs/os-specific/linux/cryptodev/default.nix5
-rw-r--r--pkgs/os-specific/linux/cryptsetup/default.nix4
-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/firmware/iwlwifi-1000-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.nix5
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-6000g2b-ucode/default.nix5
-rw-r--r--pkgs/os-specific/linux/fuse/default.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix1
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.0.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.2.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.3.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.4.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.5.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.6.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.7.nix273
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix17
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix58
-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/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/lxc/default.nix8
-rw-r--r--pkgs/os-specific/linux/mcelog/default.nix6
-rw-r--r--pkgs/os-specific/linux/module-init-tools/default.nix2
-rw-r--r--pkgs/os-specific/linux/nfs-utils/default.nix4
-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.sh30
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/generated.patch12
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy304.nix51
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy96.nix16
-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/ov511/ov511-2.30-default.nix2
-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.patch13
-rw-r--r--pkgs/os-specific/linux/pam/default.nix2
-rw-r--r--pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix12
-rw-r--r--pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch338
-rw-r--r--pkgs/os-specific/linux/pm-utils/default.nix17
-rw-r--r--pkgs/os-specific/linux/pmtools/default.nix4
-rw-r--r--pkgs/os-specific/linux/powertop/default.nix1
-rw-r--r--pkgs/os-specific/linux/procps-ng/default.nix26
-rw-r--r--pkgs/os-specific/linux/sepolgen/default.nix22
-rw-r--r--pkgs/os-specific/linux/spl/default.nix6
-rw-r--r--pkgs/os-specific/linux/systemd/0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch (renamed from pkgs/os-specific/linux/systemd/reexec.patch)17
-rw-r--r--pkgs/os-specific/linux/systemd/0002-Ignore-duplicate-paths-in-systemctl-start.patch (renamed from pkgs/os-specific/linux/systemd/ignore-duplicates.patch)16
-rw-r--r--pkgs/os-specific/linux/systemd/0003-Start-device-units-for-uninitialised-encrypted-devic.patch (renamed from pkgs/os-specific/linux/systemd/crypt-devices-are-ready.patch)22
-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/default.nix45
-rw-r--r--pkgs/os-specific/linux/systemd/libc-bug-accept4-arm.patch81
-rw-r--r--pkgs/os-specific/linux/systemd/listunitfiles-abort.patch20
-rw-r--r--pkgs/os-specific/linux/sysvinit/default.nix11
-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/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/default.nix7
-rw-r--r--pkgs/os-specific/linux/udisks/no-pci-db.patch13
-rw-r--r--pkgs/os-specific/linux/upower/default.nix6
-rw-r--r--pkgs/os-specific/linux/upstart/cfgdir.patch45
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix3
-rw-r--r--pkgs/os-specific/linux/v4l-utils/default.nix20
-rw-r--r--pkgs/os-specific/linux/v86d/default.nix5
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/default.nix7
-rw-r--r--pkgs/os-specific/linux/x86info/default.nix33
-rw-r--r--pkgs/os-specific/linux/xf86-video-nouveau/default.nix6
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix21
-rw-r--r--pkgs/servers/ftp/vsftpd/default.nix16
-rw-r--r--pkgs/servers/gpm/1.99.6.nix23
-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/couchdb/src-for-default.nix14
-rw-r--r--pkgs/servers/http/myserver/installable-binary.patch14
-rw-r--r--pkgs/servers/mail/freepops/default.nix2
-rw-r--r--pkgs/servers/memcached/default.nix6
-rw-r--r--pkgs/servers/monitoring/zabbix/2.0.nix70
-rw-r--r--pkgs/servers/mpd/default.nix90
-rw-r--r--pkgs/servers/nosql/redis/default.nix10
-rw-r--r--pkgs/servers/portmap/default.nix4
-rw-r--r--pkgs/servers/samba/default.nix6
-rw-r--r--pkgs/servers/sql/mysql55/default.nix7
-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.nix35
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix13
-rw-r--r--pkgs/servers/x11/xorg/xorgserver.sh9
-rw-r--r--pkgs/stdenv/default.nix12
-rw-r--r--pkgs/stdenv/generic/default.nix11
-rw-r--r--pkgs/stdenv/linux/default.nix6
-rw-r--r--pkgs/stdenv/native/default.nix36
-rw-r--r--pkgs/stdenv/nix/default.nix4
-rw-r--r--pkgs/tools/X11/xcalib/default.nix25
-rw-r--r--pkgs/tools/X11/xkb-switch/default.nix22
-rw-r--r--pkgs/tools/archivers/cpio/latest.nix45
-rw-r--r--pkgs/tools/backup/bup/default.nix19
-rw-r--r--pkgs/tools/backup/duplicity/default.nix6
-rw-r--r--pkgs/tools/backup/obnam/default.nix10
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/btrfs-progs-Fix-the-receive-code-pathing.patch146
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/btrfs-receive-help-text.patch13
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/btrfs-receive-lchown.patch12
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c109
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/default.nix19
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/subvol-listing.patch34
-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/jfsutils/default.nix4
-rw-r--r--pkgs/tools/filesystems/reiserfsprogs/default.nix2
-rw-r--r--pkgs/tools/filesystems/unionfs-fuse/default.nix20
-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.nix11
-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/graphviz/default.nix5
-rw-r--r--pkgs/tools/graphics/jbig2enc/default.nix19
-rw-r--r--pkgs/tools/graphics/mscgen/default.nix6
-rw-r--r--pkgs/tools/inputmethods/fcitx/default.nix32
-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/findutils/4.2.27.nix14
-rw-r--r--pkgs/tools/misc/findutils/default.nix5
-rw-r--r--pkgs/tools/misc/findutils/dietlibc-hack.patch58
-rw-r--r--pkgs/tools/misc/gnokii/src-for-default.nix10
-rw-r--r--pkgs/tools/misc/grub/device-mapper-symlinks.patch28
-rw-r--r--pkgs/tools/misc/ised/default.nix2
-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/plowshare/default.nix8
-rw-r--r--pkgs/tools/misc/screen/default.nix2
-rw-r--r--pkgs/tools/misc/system-config-printer/default.nix24
-rw-r--r--pkgs/tools/misc/ttf2pt1/ttf2pt1-cl-pdf.nix20
-rw-r--r--pkgs/tools/misc/youtube-dl/default.nix40
-rw-r--r--pkgs/tools/networking/aircrack-ng/default.nix4
-rw-r--r--pkgs/tools/networking/connect/default.nix33
-rw-r--r--pkgs/tools/networking/dd-agent/default.nix36
-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.nix20
-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/mtr/default.nix4
-rw-r--r--pkgs/tools/networking/mu/default.nix25
-rw-r--r--pkgs/tools/networking/mu0/default.nix25
-rw-r--r--pkgs/tools/networking/network-manager-applet/default.nix4
-rw-r--r--pkgs/tools/networking/network-manager/default.nix14
-rw-r--r--pkgs/tools/networking/nzbget/default.nix12
-rw-r--r--pkgs/tools/networking/p2p/tahoe-lafs/default.nix5
-rw-r--r--pkgs/tools/networking/p2p/tahoe-lafs/test-timeout.patch12
-rw-r--r--pkgs/tools/networking/samplicator/default.nix17
-rw-r--r--pkgs/tools/networking/tcng/default.nix80
-rw-r--r--pkgs/tools/networking/tinc/default.nix30
-rw-r--r--pkgs/tools/networking/wbox/default.nix21
-rw-r--r--pkgs/tools/package-management/dpkg/cache-arch.patch15
-rw-r--r--pkgs/tools/package-management/dpkg/default.nix2
-rw-r--r--pkgs/tools/package-management/nix/custom.nix68
-rw-r--r--pkgs/tools/package-management/nix/default.nix24
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix12
-rw-r--r--pkgs/tools/security/gnupg1/default.nix4
-rw-r--r--pkgs/tools/security/pinentry/duplicate-glib-defs.patch20
-rw-r--r--pkgs/tools/security/tor/default.nix4
-rw-r--r--pkgs/tools/security/tor/torsocks.nix4
-rw-r--r--pkgs/tools/security/vidalia/default.nix6
-rw-r--r--pkgs/tools/system/hardlink/default.nix2
-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/smartmontools/default.nix4
-rw-r--r--pkgs/tools/text/ascii/default.nix25
-rw-r--r--pkgs/tools/typesetting/hevea/builder.sh5
-rw-r--r--pkgs/tools/typesetting/tex/dblatex/default.nix9
-rw-r--r--pkgs/tools/virtualization/ec2-ami-tools/default.nix10
-rw-r--r--pkgs/top-level/all-packages.nix731
-rw-r--r--pkgs/top-level/haskell-defaults.nix10
-rw-r--r--pkgs/top-level/haskell-packages.nix122
-rw-r--r--pkgs/top-level/make-tarball.nix8
-rw-r--r--pkgs/top-level/node-packages.nix15
-rw-r--r--pkgs/top-level/perl-packages.nix2485
-rw-r--r--pkgs/top-level/platforms.nix7
-rw-r--r--pkgs/top-level/python-packages.nix1416
-rw-r--r--pkgs/top-level/release-cross.nix2
-rw-r--r--pkgs/top-level/release-lib.nix50
-rw-r--r--pkgs/top-level/release-python.nix2014
-rw-r--r--pkgs/top-level/release-small.nix1
-rw-r--r--pkgs/top-level/release.nix7
897 files changed, 15341 insertions, 23759 deletions
diff --git a/doc/meta.xml b/doc/meta.xml
index 30b5ad247d16..09252410d807 100644
--- a/doc/meta.xml
+++ b/doc/meta.xml
@@ -177,6 +177,12 @@ following:
   </varlistentry>
 
   <varlistentry>
+    <term><varname>perl5</varname></term>
+    <listitem><para>The Perl 5 license (Artistic License, version 1
+    and GPL, version 1 or later).</para></listitem>
+  </varlistentry>
+
+  <varlistentry>
     <term><varname>free</varname></term>
     <listitem><para>Catch-all for free software licenses not listed
     above.</para></listitem>
diff --git a/maintainers/scripts/copy-tarball.sh b/maintainers/scripts/copy-tarball.sh
index b4c2e93dab17..de325120efc8 100755
--- a/maintainers/scripts/copy-tarball.sh
+++ b/maintainers/scripts/copy-tarball.sh
@@ -10,25 +10,25 @@ base="$(basename "$url")"
 if [ -z "$base" ]; then echo "bad URL"; exit 1; fi
 dstPath="$distDir/$base"
 
-if [ -e "$dstPath" ]; then echo "$dstPath already exists"; exit 0; fi
+if [ -e "$dstPath" ]; then if [ -n "$VERBOSE" ]; then echo "$dstPath already exists"; fi; exit 0; fi
 
 if [ -z "$file" ]; then
 
     echo "downloading $url to $dstPath"
 
-    if [ -n "$dryRun" ]; then exit 0; fi
+    if [ -n "$DRY_RUN" ]; then exit 0; fi
 
     declare -a res
     if ! res=($(PRINT_PATH=1 nix-prefetch-url "$url")); then
-        continue
+        exit
     fi
-    
+
     storePath=${res[1]}
 
 else
     storePath="$file"
 fi
-    
+
 cp $storePath "$dstPath.tmp.$$"
 mv -f "$dstPath.tmp.$$" "$dstPath"
 
diff --git a/maintainers/scripts/copy-tarballs.sh b/maintainers/scripts/copy-tarballs.sh
index 80aeef9d66de..a261f8175859 100755
--- a/maintainers/scripts/copy-tarballs.sh
+++ b/maintainers/scripts/copy-tarballs.sh
@@ -8,7 +8,19 @@ urls=$(nix-instantiate --eval-only --xml --strict '<nixpkgs/maintainers/scripts/
 
 for url in $urls; do
     if echo "$url" | grep -q -E "www.cs.uu.nl|nixos.org|.stratego-language.org|java.sun.com|ut2004|linuxq3a|RealPlayer|Adbe|belastingdienst|microsoft|armijn/.nix|sun.com|archive.eclipse.org"; then continue; fi
-    if ! echo "$url" | grep -q -E "\-.*[0-9].*"; then echo "skipping $url"; continue; fi
+
+    # Check the URL scheme.
+    if ! echo "$url" | grep -q -E "^[a-z]+://"; then echo "skipping $url (no URL scheme)"; continue; fi
+
+    # Check the basename.  It should include something resembling a version.
+    base="$(basename "$url")"
+    #if ! echo "$base" | grep -q -E "[-_].*[0-9].*"; then echo "skipping $url (no version)"; continue; fi
+    if ! echo "$base" | grep -q -E "[a-zA-Z]"; then echo "skipping $url (no letter in name)"; continue; fi
+    if ! echo "$base" | grep -q -E "[0-9]"; then echo "skipping $url (no digit in name)"; continue; fi
+    if ! echo "$base" | grep -q -E "[-_\.]"; then echo "skipping $url (no dot/underscore in name)"; continue; fi
+    if echo "$base" | grep -q -E "[&?=%]"; then echo "skipping $url (bad character in name)"; continue; fi
+    if [ "${base:0:1}" = "." ]; then echo "skipping $url (starts with a dot)"; continue; fi
+
     $(dirname $0)/copy-tarball.sh "$url"
 done
 
diff --git a/maintainers/scripts/eval-release.nix b/maintainers/scripts/eval-release.nix
index 7af2b5b5bd92..ccbe064ee321 100644
--- a/maintainers/scripts/eval-release.nix
+++ b/maintainers/scripts/eval-release.nix
@@ -5,7 +5,7 @@
 with import ../../pkgs/lib;
 
 let
-  trace = if (builtins.getEnv "VERBOSE") == "1" then builtins.trace else (x: y: y);
+  trace = if builtins.getEnv "VERBOSE" == "1" then builtins.trace else (x: y: y);
 
   rel = removeAttrs (import ../../pkgs/top-level/release.nix) [ "tarball" "xbursttools" ];
 
@@ -13,7 +13,7 @@ let
   
   strictAttrs = as: seqList (attrValues as) as;
 
-  maybe = as: let y = builtins.tryEval (strictAttrs as); in if y.success then y.value else builtins.trace "FAIL" null;
+  maybe = as: let y = builtins.tryEval (strictAttrs as); in if y.success then y.value else builtins.trace "FAIL" {};
 
   call = attrs: flip mapAttrs attrs
     (n: v: trace n (
diff --git a/maintainers/scripts/generate-cpan-package b/maintainers/scripts/generate-cpan-package
new file mode 100755
index 000000000000..f091625b6ce7
--- /dev/null
+++ b/maintainers/scripts/generate-cpan-package
@@ -0,0 +1,122 @@
+#! /bin/sh -e
+
+export PERL5LIB=/nix/var/nix/profiles/per-user/eelco/cpan-generator/lib/perl5/site_perl
+
+name="$1"
+[ -n "$name" ] || { echo "no name"; exit 1; }
+
+cpan -D "$name" > cpan-info
+
+url="$(echo $(cat cpan-info | sed '6!d'))"
+[ -n "$url" ] || { echo "no URL"; exit 1; }
+url="mirror://cpan/authors/id/$url"
+echo "URL = $url" >&2
+
+version=$(cat cpan-info | grep 'CPAN: ' | awk '{ print $2 }')
+echo "VERSION = $version"
+
+declare -a xs=($(PRINT_PATH=1 nix-prefetch-url "$url"))
+hash=${xs[0]}
+path=${xs[1]}
+echo "HASH = $hash" >&2
+
+namedash="$(echo $name | sed s/::/-/g)-$version"
+
+attr=$(echo $name | sed s/:://g)
+
+rm -rf cpan_tmp
+mkdir cpan_tmp
+tar xf "$path" -C cpan_tmp
+
+shopt -s nullglob
+meta=$(echo cpan_tmp/*/META.json)
+if [ -z "$meta" ]; then
+    yaml=$(echo cpan_tmp/*/META.yml)
+    [ -n "$yaml" ] || { echo "no meta file"; exit 1; }
+    meta=$(echo $yaml | sed s/\.yml$/.json/)
+    perl -e '
+      use YAML;
+      use JSON;
+      local $/;
+      $x = YAML::Load(<>);
+      print encode_json $x;
+    ' < $yaml > $meta
+fi
+
+description="$(json abstract < $meta | perl -e '$x = <>; print uc(substr($x, 0, 1)), substr($x, 1);')"
+homepage="$(json resources.homepage < $meta)"
+if [ -z "$homepage" ]; then
+    #homepage="$(json meta-spec.url < $meta)"
+    true
+fi
+
+license="$(json license < $meta | json -a 2> /dev/null || true)"
+if [ -z "$license" ]; then
+    license="$(json -a license < $meta)"
+fi
+license="$(echo $license | sed s/perl_5/perl5/)"
+
+f() {
+    local type="$1"
+    perl -e '
+      use JSON;
+      local $/;
+      $x = decode_json <>;
+      if (defined $x->{prereqs}) {
+        $x2 = $x->{prereqs}->{'$type'}->{requires};
+      } elsif ("'$type'" eq "runtime") {
+        $x2 = $x->{requires};
+      } elsif ("'$type'" eq "configure") {
+        $x2 = $x->{configure_requires};
+      } elsif ("'$type'" eq "build") {
+        $x2 = $x->{build_requires};
+      }
+      foreach my $y (keys %{$x2}) {
+        next if $y eq "perl";
+        eval "use $y;";
+        if (!$@) {
+          print STDERR "skipping Perl-builtin module $y\n";
+          next;
+        }
+        print $y, "\n";
+      };
+    ' < $meta | sed s/:://g
+}
+
+confdeps=$(f configure)
+builddeps=$(f build)
+testdeps=$(f test)
+runtimedeps=$(f runtime)
+
+buildInputs=$(echo $(for i in $confdeps $builddeps $testdeps; do echo $i; done | sort | uniq))
+propagatedBuildInputs=$(echo $(for i in $runtimedeps; do echo $i; done | sort | uniq))
+
+echo "===" >&2
+
+cat <<EOF
+  $attr = buildPerlPackage {
+    name = "$namedash";
+    src = fetchurl {
+      url = $url;
+      sha256 = "$hash";
+    };
+EOF
+if [ -n "$buildInputs" ]; then
+    cat <<EOF
+    buildInputs = [ $buildInputs ];
+EOF
+fi
+if [ -n "$propagatedBuildInputs" ]; then
+    cat <<EOF
+    propagatedBuildInputs = [ $propagatedBuildInputs ];
+EOF
+fi
+cat <<EOF
+    meta = {
+      homepage = $homepage;
+      description = "$description";
+      license = "$license";
+    };
+  };
+EOF
+
diff --git a/maintainers/scripts/hydra_eval_check b/maintainers/scripts/hydra_eval_check
index 07bf576df4b3..e16a40455a31 100755
--- a/maintainers/scripts/hydra_eval_check
+++ b/maintainers/scripts/hydra_eval_check
@@ -5,7 +5,6 @@ hydra_eval_jobs \
   --argstr system x86_64-linux \
   --argstr system i686-linux \
   --argstr system x86_64-darwin \
-  --argstr system i686-darwin \
   --argstr system i686-cygwin \
   --argstr system i686-freebsd \
   --arg officialRelease false \
diff --git a/pkgs/applications/audio/amarok/live.nix b/pkgs/applications/audio/amarok/live.nix
deleted file mode 100644
index e90ca8748274..000000000000
--- 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/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix
index 72b58b5b33e5..306620ca1c93 100644
--- a/pkgs/applications/audio/audacity/default.nix
+++ b/pkgs/applications/audio/audacity/default.nix
@@ -4,12 +4,12 @@
   }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.0";
+  version = "2.0.2";
   name = "audacity-${version}";
 
   src = fetchurl {
     url = "http://audacity.googlecode.com/files/audacity-minsrc-${version}.tar.bz2";
-    sha256 = "0spbib3f86b4qri0g13idyxvysg28hkpsglmjza681zrln62hjfq";
+    sha256 = "17c7p5jww5zcg2k2fs1751mv5kbadcmgicszi1zxwj2p5b35x2mc";
   };
   buildInputs = [ pkgconfig wxGTK libsndfile expat alsaLib libsamplerate
                   libvorbis libmad flac id3lib ffmpeg gettext ];
diff --git a/pkgs/applications/audio/bristol/default.nix b/pkgs/applications/audio/bristol/default.nix
index 81d44fdcb74a..0978b15bfaf0 100644
--- a/pkgs/applications/audio/bristol/default.nix
+++ b/pkgs/applications/audio/bristol/default.nix
@@ -14,6 +14,11 @@ stdenv.mkDerivation  rec {
     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;
diff --git a/pkgs/applications/audio/pavucontrol/default.nix b/pkgs/applications/audio/pavucontrol/default.nix
index d25cfeb3cd15..a73744ebbe85 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/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix
index 0675b02a314e..601aa7bf53a7 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/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index 1b3e4e27f5bc..01b4ff547e8a 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -8,7 +8,16 @@ stdenv.mkDerivation rec {
     sha256 = "18gvhyhwpabmgv4lh21lg8vl3z7acdyhh2mr2kj9g75wksj39pcp";
   };
 
-  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-modes/flymake-cursor/default.nix b/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
index b629186033f0..0a26e8fd43df 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/htmlize/default.nix b/pkgs/applications/editors/emacs-modes/htmlize/default.nix
index d4de24d394c1..da3bde88d752 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.40";
+  name = "htmlize-1.43";
 
   builder = ./builder.sh;
 
   src = fetchurl {
     url = http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi;
-    sha256 = "1v7pzif5b7dr6iyllqvzka8i6s23rsjdnmilnma054gv8d4shw6a";
+    sha256 = "0bdaxh3pjf4z55i7vz4yz3yz45720h8aalhmx13bgkrpijzn93bi";
   };
 
   meta = {
diff --git a/pkgs/applications/editors/geany/default.nix b/pkgs/applications/editors/geany/default.nix
index 1c08dc6db8d7..289cf7ff8d63 100644
--- a/pkgs/applications/editors/geany/default.nix
+++ b/pkgs/applications/editors/geany/default.nix
@@ -18,6 +18,10 @@ stdenv.mkDerivation rec {
 
   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 = ''
diff --git a/pkgs/applications/editors/jedit/default.nix b/pkgs/applications/editors/jedit/default.nix
index 194f13a090cd..efaf719c7c47 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 1126a7278d6c..000000000000
--- 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/nedit/default.nix b/pkgs/applications/editors/nedit/default.nix
index 41028601da74..bd53f8d81d08 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/vbindiff/default.nix b/pkgs/applications/editors/vbindiff/default.nix
new file mode 100644
index 000000000000..a03ce539d50d
--- /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/zile/default.nix b/pkgs/applications/editors/zile/default.nix
index 0d765a0ad5c0..13a36e258fde 100644
--- a/pkgs/applications/editors/zile/default.nix
+++ b/pkgs/applications/editors/zile/default.nix
@@ -1,16 +1,19 @@
 { 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 ];
 
+  # `help2man' wants to run Zile, which fails when cross-compiling.
+  crossAttrs.buildNativeInputs = [];
+
   # Tests can't be run because most of them rely on the ability to
   # fiddle with the terminal.
   doCheck = false;
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index cbab2da551a9..b96d1bc84f74 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/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index 15d7042e7dd8..801fdeeaaae5 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, bash }:
+, openexr, pixman, pkgconfig, sqlite, bash, libxslt }:
 
 assert stdenv ? glibc;
 
 stdenv.mkDerivation rec {
-  version = "1.0.5";
+  version = "1.1.1";
   name = "darktable-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/darktable/darktable-${version}.tar.gz";
-    sha256 = "0c18530446d2f2459fe533a1ef6fc2711300efe7466f36c23168ec2230fb5fbd";
+    sha256 = "0k1m7nd42yn4c2jr1ps1g96fqk9pq20cxjp7dmlza61pj2j9nads";
   };
 
   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 = ''
diff --git a/pkgs/applications/graphics/darktable/libpng-15.patch b/pkgs/applications/graphics/darktable/libpng-15.patch
deleted file mode 100644
index f817a3264488..000000000000
--- 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 7662d64e9de7..769acd2a3b6f 100644
--- a/pkgs/applications/graphics/dia/default.nix
+++ b/pkgs/applications/graphics/dia/default.nix
@@ -22,6 +22,10 @@ stdenv.mkDerivation rec {
 
   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/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index e19d06927a29..0cd340279665 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 6b8f9fb1a60f..000000000000
--- 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 cfe97e12476d..c681bc415e32 100644
--- a/pkgs/applications/graphics/freecad/default.nix
+++ b/pkgs/applications/graphics/freecad/default.nix
@@ -1,17 +1,15 @@
-{ fetchsvn, stdenv, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts,
+{ fetchgit, 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 = "git-20121213";
 
-  src = fetchsvn {
-    url = https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk;
-    rev = "4184";
-    sha256 = "26bd8407ce38f070b81ef39145aed093eed3c200d165a605b8169162d66568ce";
+  src = fetchgit {
+    url = git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad;
+    rev = "d3949cedc7e3c924d426660515e06eaf55d1a67f";
+    sha256 = "0a07ih0z5d8m69zasmvi7z4lgq0pa67k2g7r1l6nz2d0b30py61w";
   };
 
   buildInputs = [ cmake coin3d xercesc ode eigen qt4 opencascade gts boost
@@ -19,12 +17,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 +27,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 849c778aedba..8b09a5748071 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/gocr/default.nix b/pkgs/applications/graphics/gocr/default.nix
index 4b2ebceda47e..0f42ac7743e3 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/ipe/default.nix b/pkgs/applications/graphics/ipe/default.nix
new file mode 100644
index 000000000000..df50dd5bd793
--- /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/kuickshow/builder.sh b/pkgs/applications/graphics/kuickshow/builder.sh
deleted file mode 100644
index 2283e956f7b3..000000000000
--- 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/openscad/default.nix b/pkgs/applications/graphics/openscad/default.nix
index b09a38dcaa44..9343f3ec135d 100644
--- a/pkgs/applications/graphics/openscad/default.nix
+++ b/pkgs/applications/graphics/openscad/default.nix
@@ -1,19 +1,24 @@
-{stdenv, fetchurl, qt4, bison, flex, eigen, boost, mesa, glew, opencsg, cgal
+{stdenv, fetchgit, qt4, bison, flex, eigen, boost, mesa, glew, opencsg, cgal
   , mpfr, gmp
   }:
 
 stdenv.mkDerivation rec {
-  version = "2011.12";
+  version = "git-20121213";
   name = "openscad-${version}";
-  src = fetchurl {
-    url = "https://github.com/downloads/openscad/openscad/${name}.src.tar.gz";
-    sha256 = "0gaqwzxbbzc21lhb4y26j8g0g28dhrwrgkndizp5ddab5axi4zjh";
-  };
+  # src = fetchurl {
+  #   url = "https://github.com/downloads/openscad/openscad/${name}.src.tar.gz";
+  #   sha256 = "0gaqwzxbbzc21lhb4y26j8g0g28dhrwrgkndizp5ddab5axi4zjh";
+  # };
+  src = fetchgit {
+    url = "https://github.com/openscad/openscad.git";
+    rev = "c0612a9ed0899c96963e04c848a59b0164a689a2";
+    sha256  = "1zqiwk1cjbj7sng9sdarbrs0zxkn9fsa84dyv8n0zlyh40s7kvw2";
+  };        
 
   buildInputs = [qt4 bison flex eigen boost mesa glew opencsg cgal gmp mpfr];
 
   configurePhase = ''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I ${eigen}/include/eigen2 "
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${eigen}/include/eigen*) "
     qmake PREFIX="$out"
   '';
 
diff --git a/pkgs/applications/graphics/qiv/default.nix b/pkgs/applications/graphics/qiv/default.nix
new file mode 100644
index 000000000000..df18c6d1520c
--- /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/rawtherapee/optional-rawzor.patch b/pkgs/applications/graphics/rawtherapee/optional-rawzor.patch
deleted file mode 100644
index bc0210803a1b..000000000000
--- 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 000000000000..2455923bbb80
--- /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/misc/sane-backends/default.nix b/pkgs/applications/graphics/sane/backends.nix
index ac6fed5deb46..0fcfca747410 100644
--- a/pkgs/misc/sane-backends/default.nix
+++ b/pkgs/applications/graphics/sane/backends.nix
@@ -1,20 +1,19 @@
-{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null
-, pkgconfig ? null
-, gt68xxFirmware ? null }:
-let
-  firmware = gt68xxFirmware {inherit fetchurl;};
-in
+{ 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 = []
@@ -32,8 +31,17 @@ stdenv.mkDerivation rec {
   '';
 
   preInstall =
-    if gt68xxFirmware != null then 
+    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 000000000000..1c768e29873e
--- /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 8dd99c3c74d0..c4fdf3a00440 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";
   };
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     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/misc/fetchmail/security-fix.patch b/pkgs/applications/misc/fetchmail/security-fix.patch
deleted file mode 100644
index 4d48c7aa0556..000000000000
--- 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 000000000000..163cb04c27eb
--- /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.1-3";
+  name = "freicoin-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/freicoin/freicoin/archive/v${version}.zip";
+    sha256 = "19q4llv67kmvfr0x56rnqcf0d050dayv246q4i51mmkvjijc1qpf";
+  };
+
+  # 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
index 2fa36b33eb06..73db728b1a63 100644
--- a/pkgs/applications/misc/girara/default.nix
+++ b/pkgs/applications/misc/girara/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, gtk, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "girara-0.1.2";
+  name = "girara-0.1.4";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/girara/download/${name}.tar.gz";
-    sha256 = "89231d0da3c790e0765ad85d74f64cf50051b8bafe6065882e34e378ab14ec99";
+    sha256 = "831cf523b131bfa1c182efbf146d68fb642fe62d22ee199caf0cd71408a85739";
   };
 
   buildInputs = [ pkgconfig gtk gettext ];
diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix
index 881f5339bdf8..f7b8a511bc66 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/gphoto2/src-for-gphotofs.nix b/pkgs/applications/misc/gphoto2/src-for-gphotofs.nix
deleted file mode 100644
index 0967ef424bce..000000000000
--- a/pkgs/applications/misc/gphoto2/src-for-gphotofs.nix
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/pkgs/applications/misc/ikiwiki/default.nix b/pkgs/applications/misc/ikiwiki/default.nix
index 1f99a02f429f..bbc8aaac49bd 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.20120725";
+  version = "3.20121212";
 
   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 = "b600096a77b17e4a9e8a9552c4d36e01ed9217a0f8ff8a4f15110cf80e7adfad";
+    sha256 = "1frsr2sqzsnagbxvyjsgk4nrl1p1048vybsd1zw1ln1mqik31ydz";
   };
 
   buildInputs = [ perl TextMarkdown URI HTMLParser HTMLScrubber HTMLTemplate
diff --git a/pkgs/applications/misc/krusader/krusader-gcc44.patch b/pkgs/applications/misc/krusader/krusader-gcc44.patch
deleted file mode 100644
index f8840d5f33c6..000000000000
--- 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 000000000000..2394d116314e
--- /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 bcf0f1aee792..59bd4888e4a6 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 cb832ed99f5c..798b0e5162f3 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.5.1";
   name = "lyx-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.lyx.org/pub/lyx/stable/2.0.x/${name}.tar.xz";
-    sha256 = "137dzmz1z6aqz9mdj8gmmi0k60s9sfn6gy916j175cwzq6hpncb8";
+    sha256 = "18k9qbz40v6lqmkfcg98wvcv4wi4p36ach1jz3z2b15gbmv2gr9n";
   };
 
   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 = [
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 471529675dbf..000000000000
--- 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 51ae8633a7c0..b89a35d2f814 100644
--- a/pkgs/applications/misc/nut/default.nix
+++ b/pkgs/applications/misc/nut/default.nix
@@ -1,21 +1,28 @@
-{ stdenv, fetchurl, pkgconfig, neon, libusb, openssl, udev }:
+{ stdenv, fetchurl, pkgconfig, neon, libusb, openssl, udev, avahi, freeipmi }:
 
-stdenv.mkDerivation {
-  name = "nut-2.6.1";
+stdenv.mkDerivation rec {
+  name = "nut-2.6.5";
 
   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 openssl udev ];
+  buildInputs = [ neon libusb openssl udev avahi freeipmi ];
 
-  configureFlags = [
-    "--with-all"
-    "--without-snmp" # Until we have it ...
-    "--without-powerman" # Until we have it ...
-    "--without-cgi"
-  ];
+  buildNativeInputs = [ 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"
+    ];
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "Network UPS Tools";
@@ -27,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/qcad/default.nix b/pkgs/applications/misc/qcad/default.nix
deleted file mode 100644
index ee8876e6b334..000000000000
--- 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 6d8b6acca5b5..000000000000
--- 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 bc68e81c715b..000000000000
--- 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/rxvt_unicode/default.nix b/pkgs/applications/misc/rxvt_unicode/default.nix
index a1297d64a180..d52fd178165e 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 fbc4df3a0b77..52a575130c0e 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 86b24e7e4018..70089759626f 100644
--- a/pkgs/applications/misc/st/default.nix
+++ b/pkgs/applications/misc/st/default.nix
@@ -4,8 +4,8 @@ stdenv.mkDerivation rec {
   name = "st-0.3";
   
   src = fetchurl {
-    url = http://hg.suckless.org/st/archive/0.3.tar.gz;
-    sha256 = "12ypldjjpsq3nvhszgjsk4wgqkwcvz06qiqw8k5npv3rd1nbx9cl";
+    url = "http://dl.suckless.org/st/${name}.tar.gz";
+    sha256 = "0d0fjixiis4ixbz4l18rqhnssa7cy2bap3jkjyphqlqhl7lahv3d";
   };
   
   buildInputs = [ libX11 ncurses libXext libXft ];
diff --git a/pkgs/applications/misc/xmobar/default.nix b/pkgs/applications/misc/xmobar/default.nix
index 73eefef25055..0ef9acbcef4d 100644
--- a/pkgs/applications/misc/xmobar/default.nix
+++ b/pkgs/applications/misc/xmobar/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xmobar";
-  version = "0.15";
-  sha256 = "1wa141bf3krzr8qcd9cyix3cflbw1yr1l3299ashjs7skqnjadcl";
+  version = "0.16";
+  sha256 = "1dx4kwygzp4c5j4jj4lsfgjfvhh863v68s106lmwc86a30h60p8i";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
@@ -13,9 +13,6 @@ cabal.mkDerivation (self: {
   ];
   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 3ea3cb8c923c..000000000000
--- 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/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix
index 0c58965fc19f..6c3ff038c74a 100644
--- a/pkgs/applications/misc/zathura/core/default.nix
+++ b/pkgs/applications/misc/zathura/core/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
 
-  version = "0.1.2";
+  version = "0.2.1";
 
   name = "zathura-core-${version}";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/download/zathura-${version}.tar.gz";
-    sha256 = "a496c25071e54f675b65ee5eab02fd002c04c2d7d5cf4aa8a1cb517cc13beaef";
+    sha256 = "075b9def201c77ca738dc9e15b252bc23c085b7c4671a1810d1d962e8d0bd790";
   };
 
   buildInputs = [ pkgconfig gtk girara gettext ];
diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix
index b5ba4f9ada75..5ed445b6984d 100644
--- a/pkgs/applications/misc/zathura/default.nix
+++ b/pkgs/applications/misc/zathura/default.nix
@@ -13,7 +13,7 @@ rec {
 
   zathuraWrapper = stdenv.mkDerivation rec {
 
-    name = "zathura-0.1.2";
+    name = "zathura-${zathura_core.version}";
 
     plugins_path = stdenv.lib.makeSearchPath "lib" [
       zathura_pdf_poppler
diff --git a/pkgs/applications/misc/zathura/djvu/default.nix b/pkgs/applications/misc/zathura/djvu/default.nix
index c4656e732364..bddb3471bfe6 100644
--- a/pkgs/applications/misc/zathura/djvu/default.nix
+++ b/pkgs/applications/misc/zathura/djvu/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, djvulibre, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "zathura-djvu-0.1.1";
+  name = "zathura-djvu-0.2.1";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
-    sha256 = "04adad7bf1bb392eae4b7b856fe7d40a137f8185ac274289df922758ae827172";
+    sha256 = "d8bb3c9e30244a0733e49740ee2dd099ce39fa16f2c320af27a0c09d9a25bcc3";
   };
 
   buildInputs = [ pkgconfig djvulibre gettext zathura_core gtk girara ];
diff --git a/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
index 17e00b4e6220..e0fcb0573a48 100644
--- a/pkgs/applications/misc/zathura/pdf-poppler/default.nix
+++ b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, zathura_core, girara, poppler, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "zathura-pdf-poppler-0.1.1";
+  name = "zathura-pdf-poppler-0.2.1";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
-    sha256 = "bec5fee721fcaee9f4b53d3882908b19efa82815393aa8c3619ff948b909d4a7";
+    sha256 = "1c162ea887e52f48d6dc80f8427a773768f2df2e37242dab7efddeb3d2e361cd";
   };
 
   buildInputs = [ pkgconfig poppler gettext zathura_core girara ];
diff --git a/pkgs/applications/misc/zathura/ps/default.nix b/pkgs/applications/misc/zathura/ps/default.nix
index ae9aeee7715e..7f70eb952e11 100644
--- a/pkgs/applications/misc/zathura/ps/default.nix
+++ b/pkgs/applications/misc/zathura/ps/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, libspectre, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "zathura-ps-0.1.0";
+  name = "zathura-ps-0.2.0";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
-    sha256 = "1669fd11e436636cdedb2cde206b562f4f9c666cea9773f6f2014e765fd62789";
+    sha256 = "717eda01213b162421b6b52f29d6b981edc302fddf351ccb2c093b6842751414";
   };
 
   buildInputs = [ pkgconfig libspectre gettext zathura_core gtk girara ];
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 7d41f72df207..e32b31dc8569 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, config, fetchurl, makeWrapper, which
+{ stdenv, fetchurl, makeWrapper, which
 
 # default dependencies
 , bzip2, flac, speex
@@ -15,32 +15,24 @@
 , libXScrnSaver, libXcursor, mesa
 
 # 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
 }:
 
 with stdenv.lib;
 
 let
-  mkConfigurable = mapAttrs (flag: default: attrByPath ["chromium" flag] default config);
-
-  cfg = mkConfigurable {
-    channel = "stable";
-    selinux = false;
-    nacl = false;
-    openssl = false;
-    gnome = false;
-    gnomeKeyring = false;
-    proprietaryCodecs = true;
-    cups = false;
-    pulseaudio = config.pulseaudio or true;
-  };
-
-  sourceInfo = builtins.getAttr cfg.channel (import ./sources.nix);
+  sourceInfo = builtins.getAttr channel (import ./sources.nix);
 
   mkGypFlags =
     let
@@ -62,7 +54,7 @@ let
     use_system_libusb = true;
     use_system_libxml = true;
     use_system_speex = true;
-    use_system_ssl = cfg.openssl;
+    use_system_ssl = useOpenSSL;
     use_system_stlport = true;
     use_system_xdg_utils = true;
     use_system_yasm = true;
@@ -86,11 +78,10 @@ let
 
   post23 = !versionOlder sourceInfo.version "24.0.0.0";
   post24 = !versionOlder sourceInfo.version "25.0.0.0";
+  only24 = post23 && !post24;
 
-  maybeFixPulseAudioBuild = optional (post23 && cfg.pulseaudio) (fetchurl {
-    url = http://archrepo.jeago.com/sources/chromium-dev/pulse_audio_fix.patch;
-    sha256 = "1w91mirrkqigdhsj892mqxlc0nlv1dsp5shc46w9xf8nl96jxgfb";
-  });
+  maybeFixPulseAudioBuild = optional (only24 && pulseSupport)
+    ./pulse_audio_fix.patch;
 
 in stdenv.mkDerivation rec {
   name = "${packageName}-${version}";
@@ -107,44 +98,46 @@ in stdenv.mkDerivation rec {
     which makeWrapper
     python perl pkgconfig
     nspr udev
-    (if cfg.openssl then openssl else nss)
+    (if useOpenSSL then openssl else nss)
     utillinux alsaLib
     gcc bison gperf
     krb5
     glib gtk dbus_glib
     libXScrnSaver libXcursor mesa
-  ] ++ optional cfg.gnomeKeyring libgnome_keyring
-    ++ optionals cfg.gnome [ gconf libgcrypt ]
-    ++ optional cfg.selinux libselinux
-    ++ optional cfg.cups libgcrypt
-    ++ optional cfg.pulseaudio pulseaudio
+  ] ++ optional gnomeKeyringSupport libgnome_keyring
+    ++ optionals gnomeSupport [ gconf libgcrypt ]
+    ++ optional enableSELinux libselinux
+    ++ optional cupsSupport libgcrypt
+    ++ optional pulseSupport pulseaudio
     ++ optional post24 pciutils;
 
-  opensslPatches = optional cfg.openssl openssl.patches;
+  opensslPatches = optional useOpenSSL openssl.patches;
 
   prePatch = "patchShebangs .";
 
-  patches = optional cfg.cups ./cups_allow_deprecated.patch
-         ++ optional cfg.pulseaudio ./pulseaudio_array_bounds.patch
+  patches = optional cupsSupport ./cups_allow_deprecated.patch
+         ++ optional pulseSupport ./pulseaudio_array_bounds.patch
          ++ maybeFixPulseAudioBuild;
 
-  postPatch = optionalString cfg.openssl ''
+  postPatch = optionalString useOpenSSL ''
     cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
+  '' + optionalString post24 ''
+    sed -i -r -e "s/-f(stack-protector)(-all)?/-fno-\1/" build/common.gypi
   '';
 
   gypFlags = mkGypFlags (gypFlagsUseSystemLibs // {
     linux_use_gold_binary = false;
     linux_use_gold_flags = false;
     proprietary_codecs = false;
-    use_gnome_keyring = cfg.gnomeKeyring;
-    use_gconf = cfg.gnome;
-    use_gio = cfg.gnome;
-    use_pulseaudio = cfg.pulseaudio;
-    disable_nacl = !cfg.nacl;
-    use_openssl = cfg.openssl;
-    selinux = cfg.selinux;
-    use_cups = cfg.cups;
-  } // optionalAttrs cfg.proprietaryCodecs {
+    use_gnome_keyring = gnomeKeyringSupport;
+    use_gconf = gnomeSupport;
+    use_gio = gnomeSupport;
+    use_pulseaudio = pulseSupport;
+    disable_nacl = !enableNaCl;
+    use_openssl = useOpenSSL;
+    selinux = enableSELinux;
+    use_cups = cupsSupport;
+  } // optionalAttrs proprietaryCodecs {
     # enable support for the H.264 codec
     proprietary_codecs = true;
     ffmpeg_branding = "Chrome";
@@ -205,7 +198,7 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Chromium, an open source web browser";
     homepage = http://www.chromium.org/;
-    maintainers = with maintainers; [ goibhniu chaoflow ];
+    maintainers = with maintainers; [ goibhniu chaoflow aszlig ];
     license = licenses.bsd3;
     platforms = platforms.linux;
   };
diff --git a/pkgs/applications/networking/browsers/chromium/pulse_audio_fix.patch b/pkgs/applications/networking/browsers/chromium/pulse_audio_fix.patch
new file mode 100644
index 000000000000..01ff89a9a63b
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/pulse_audio_fix.patch
@@ -0,0 +1,11 @@
+--- chromium-build/media/audio/pulse/pulse_output.cc.orig	2012-10-26 09:44:38.509209905 -0700
++++ chromium-build/media/audio/pulse/pulse_output.cc	2012-10-26 09:45:32.178819603 -0700
+@@ -86,7 +86,7 @@
+ 
+   // All channel maps have the same size array of channel positions.
+   for (unsigned int channel = 0; channel != CHANNELS_MAX; ++channel) {
+-    int channel_position = kChannelOrderings[channel_layout][channel];
++    int channel_position = ChannelOrder(channel_layout, static_cast<Channels>(channel));
+     if (channel_position > -1) {
+       channel_map.map[channel_position] = ChromiumToPAChannelPosition(
+           static_cast<Channels>(channel));
diff --git a/pkgs/applications/networking/browsers/chromium/sources.nix b/pkgs/applications/networking/browsers/chromium/sources.nix
index 9b6616ec63c3..a7687e731f5c 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 = "25.0.1323.1";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1323.1.tar.bz2";
-    sha256 = "1i7ga1qhnjvnw2gynmpmsvvl5pxcb5z9sgldp87d9yalim5sra6s";
+    version = "25.0.1364.36";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1364.36.tar.bz2";
+    sha256 = "1pn7qv1s6lcx8k26h89x9zdy43rzdq12f92s2l6cfdhr9ls9wv0s";
   };
   beta = {
-    version = "24.0.1312.14";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-24.0.1312.14.tar.bz2";
-    sha256 = "03w8cg4kqmpj82976ax9x6y275y9gcri4vc11cvfjp6r1issxzk8";
+    version = "25.0.1364.36";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1364.36.tar.bz2";
+    sha256 = "1pn7qv1s6lcx8k26h89x9zdy43rzdq12f92s2l6cfdhr9ls9wv0s";
   };
   stable = {
-    version = "23.0.1271.64";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-23.0.1271.64.tar.bz2";
-    sha256 = "1rzz08sgw07nkmvhhgyrkrcxj3z24lxbx0di6ky6jz3lshibp578";
+    version = "24.0.1312.52";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-24.0.1312.52.tar.bz2";
+    sha256 = "04fp04591dszx07wwdsgxf0wb2sxm863z1qxn5dii6f9yjqgh3gk";
   };
 }
diff --git a/pkgs/applications/networking/browsers/firefox/17.0.nix b/pkgs/applications/networking/browsers/firefox/17.0.nix
deleted file mode 100644
index 30cd54b9d43d..000000000000
--- a/pkgs/applications/networking/browsers/firefox/17.0.nix
+++ /dev/null
@@ -1,185 +0,0 @@
-{ 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 = "17.0";
-
-  xulVersion = "17.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 = "4f5f175c1662d67f70e78403607d8eda600efd8b";
-  };
-
-  commonConfigureFlags =
-    [ "--enable-optimize"
-      #"--enable-profiling"
-      "--disable-debug"
-      "--enable-strip"
-      "--with-system-jpeg"
-      "--with-system-zlib"
-      "--with-system-bz2"
-      "--with-system-nspr"
-      "--with-system-nss"
-      # "--with-system-png" # <-- "--with-system-png won't work because the system's libpng doesn't have APNG support"
-      # "--enable-system-cairo" # disabled for the moment because our Cairo is too old
-      "--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\n"'"$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
-        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}\n${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
-        chmod a+x firefox
-      ''; # */
-
-    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/16.0.nix b/pkgs/applications/networking/browsers/firefox/18.0.nix
index a9a10fbc4ec4..66acae130847 100644
--- a/pkgs/applications/networking/browsers/firefox/16.0.nix
+++ b/pkgs/applications/networking/browsers/firefox/18.0.nix
@@ -15,9 +15,9 @@ assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
 
 rec {
 
-  firefoxVersion = "16.0.2";
+  firefoxVersion = "18.0.1";
 
-  xulVersion = "16.0.2"; # this attribute is used by other packages
+  xulVersion = "18.0.1"; # this attribute is used by other packages
 
 
   src = fetchurl {
@@ -27,7 +27,7 @@ rec {
         # Fall back to this url for versions not available at releases.mozilla.org.
         "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
     ];
-    sha1 = "0ffe96896583e92561b341330ab09ddc50140dd1";
+    sha1 = "26415396233450a4e66bb0e0a73a258e1cb174ef";
   };
 
   commonConfigureFlags =
@@ -35,11 +35,11 @@ rec {
       #"--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-nss" # Too old in nixpkgs
       # "--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-sqlite"
@@ -94,7 +94,7 @@ rec {
       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")";
+              echo -e '#! /bin/sh\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
               chmod a+x "$out/bin/$(basename "$i")";
           fi;
       done
@@ -156,18 +156,9 @@ 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}\n${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
+        echo -e '#!${stdenv.shell}\nexec ${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
         chmod a+x firefox
       ''; # */
 
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 2eb34f68b8b3..7e2bfb692a3e 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
@@ -13,6 +13,7 @@
 , libXrender
 , libXcursor
 , libXt
+, libvdpau
 , gtk
 , glib
 , pango
@@ -43,9 +44,9 @@ let
         throw "no x86_64 debugging version available"
       else rec {
         # -> http://labs.adobe.com/downloads/flashplayer10.html
-        version = "11.2.202.238";
-        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.x86_64.tar.gz";
-        sha256 = "07d09xjnn2hm877psmv9a6c4cfighxw24p0apq2ykawnrjpjc6zn";
+        version = "11.2.202.251";
+        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux_x86_64.tar.gz";
+        sha256 = "0nkwpqp8ilv21rlmr4jv8abdnfmz292y3w1qlx6r67qf926nfrz2";
       }
     else if stdenv.system == "i686-linux" then
       if debug then {
@@ -54,9 +55,9 @@ let
         url = http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_plugin_debug.i386.tar.gz;
         sha256 = "1z3649lv9sh7jnwl8d90a293nkaswagj2ynhsr4xmwiy7c0jz2lk";
       } else rec {
-        version = "11.2.202.238";
-        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.i386.tar.gz";
-        sha256 = "0p05pr4vmc4536axjyljhxhqizq4ihslar8g638dj24251byp7ca";
+        version = "11.2.202.251";
+        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux_i386.tar.gz";
+        sha256 = "0nph42s1bspf88m1qqrvc93kkxkrvq3lfs5iq4l5dflwzs32jdm3";
       }
     else throw "Flash Player is not supported on this platform";
 
@@ -78,6 +79,7 @@ stdenv.mkDerivation {
   rpath = stdenv.lib.makeLibraryPath
     [ zlib alsaLib curl nss nspr fontconfig freetype expat libX11
       libXext libXrender libXcursor libXt gtk glib pango atk cairo gdk_pixbuf
+      libvdpau
     ];
 
   buildPhase = ":";
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
index 0ff7c92d3d89..44f191e54f1d 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/netsurf/libnsgif.nix b/pkgs/applications/networking/browsers/netsurf/libnsgif.nix
index 2ef8e8ae4325..63ae2ef86d43 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 d7a8ac51a061..80b09bcd8a8e 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.11-1661";
+  name = "opera-12.12-1707";
 
   src =
     if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "${mirror}/linux/1211/${name}.i386.linux.tar.xz";
-        sha256 = "0ax2kcnl0hb7fz56c9gcjia3dnwabxl2mq2hvszmbky4i399jlkk";
+        url = "${mirror}/linux/1212/${name}.i386.linux.tar.xz";
+        sha256 = "1jkrhxjxa5kz4bhyma0zlnsszdn84sq4pks3x8bfcayn12m6yxkz";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
-        url = "${mirror}/linux/1211/${name}.x86_64.linux.tar.xz";
-        sha256 = "1pnad4kdasrmm27kg6frldipyzcfy1y610rasbqic9frzb9q8dbp";
+        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/vimprobable2/default.nix b/pkgs/applications/networking/browsers/vimprobable2/default.nix
index 2402d2a902bb..46081cac3a78 100644
--- a/pkgs/applications/networking/browsers/vimprobable2/default.nix
+++ b/pkgs/applications/networking/browsers/vimprobable2/default.nix
@@ -2,10 +2,10 @@
   pkgconfig, webkit }:
 
 stdenv.mkDerivation {
-  name = "vimprobable2-1.0.2";
+  name = "vimprobable2-1.2.0";
   src = fetchurl {
-    url = "mirror://sourceforge/vimprobable/vimprobable2_1.0.2.tar.bz2";
-    sha256 = "19gwlfv0lczbns73xg3637q7ixly62y3ijccnv0m1bqaqxjl4v8x";
+    url = "mirror://sourceforge/vimprobable/vimprobable2_1.2.0.tar.bz2";
+    sha256 = "0fjakrmz1syjwgx01j2icpdv69jgvfl2nlxbj8zxfr8mw0h2wg1f";
   };
   buildInputs = [ makeWrapper gtk libsoup libX11 perl pkgconfig webkit ];
   installPhase = ''
diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix
index f1a906f92508..b979598e17c4 100644
--- a/pkgs/applications/networking/dropbox/default.nix
+++ b/pkgs/applications/networking/dropbox/default.nix
@@ -21,8 +21,8 @@ assert stdenv.system == "x86_64-linux";
 
 let
 
-  version = "1.4.0";
-  sha256 = "93933d95cce5956ed99342fa342d01ce2bde8d2e4339afb97f23e0c0ec98875e";
+  version = "1.4.21";
+  sha256 = "94073842f4a81feee80bca590e1df73fc3cab47ba879407ceba2de48f30d84e2";
 
   # relative location where the dropbox libraries are stored
   appdir = "opt/dropbox";
@@ -42,7 +42,7 @@ let
     exec = "dropbox";
     comment = "Online directories";
     desktopName = "Dropbox";
-    genericName = "Online storage";    
+    genericName = "Online storage";
     categories = "Application;Internet;";
   };
 
@@ -65,7 +65,7 @@ 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"
 
@@ -78,13 +78,13 @@ in stdenv.mkDerivation {
       -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/ftp/filezilla/default.nix b/pkgs/applications/networking/ftp/filezilla/default.nix
new file mode 100644
index 000000000000..43ee98b55dcb
--- /dev/null
+++ b/pkgs/applications/networking/ftp/filezilla/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, dbus, gnutls2, wxGTK28, libidn, tinyxml, gettext, pkgconfig, xdg_utils, gtk2, sqlite36 }:
+
+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 sqlite36 ];
+  
+  meta = {
+    homepage = "http://filezilla-project.org/";
+    description = "FileZilla is a cross-platform graphical FTP, FTPS and SFTP client a lot of features, supporting Windows, Linux, Mac OS X and more.";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/kadu/default.nix b/pkgs/applications/networking/instant-messengers/kadu/default.nix
index 7dc66886af6e..03cbb1ce0737 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 0ee06c21382a..000000000000
--- 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/mcabber/default.nix b/pkgs/applications/networking/instant-messengers/mcabber/default.nix
index dd5a3dc8b9ee..cae0213c6be2 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/skype/default.nix b/pkgs/applications/networking/instant-messengers/skype/default.nix
index 7eee9f37ecca..66a18dbdfe97 100644
--- a/pkgs/applications/networking/instant-messengers/skype/default.nix
+++ b/pkgs/applications/networking/instant-messengers/skype/default.nix
@@ -5,11 +5,11 @@
 assert stdenv.system == "i686-linux";
 
 stdenv.mkDerivation rec {
-  name = "skype-4.0.0.8";
+  name = "skype-4.1.0.20";
 
   src = fetchurl {
     url = "http://download.skype.com/linux/${name}.tar.bz2";
-    sha256 = "0gq24rbmjd05ihraarn45rwr79gidnwgllvprzrh5zqx02xll17p";
+    sha256 = "1qhcxkfmlpblpy9rqimzdl79rm781swbldkzi6nyw56bbp6lf7n3";
   };
 
   buildInputs =
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 73eda93f7e84..000000000000
--- 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/tkabber/default.nix b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
index 03a98cb20597..fd989739c941 100644
--- a/pkgs/applications/networking/instant-messengers/tkabber/default.nix
+++ b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
@@ -36,6 +36,7 @@ in stdenv.mkDerivation rec {
 
   postInstall = ''
     wrapProgram $out/bin/tkabber \
+      --prefix PATH : "${tk}/bin" \
       --set TCLLIBPATH '"${tclLibPaths}"' \
       --set TKABBER_SITE_PLUGINS '$HOME/.nix-profile/share/tkabber-plugins'
   '';
diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix
index 8dcde90e538e..16aaf3d9f3b2 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 eb1a9c4474f4..e583551bcf10 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.9";
+  version = "0.4.0";
   name = "weechat-${version}";
 
   src = fetchurl {
     url = "http://weechat.org/files/src/${name}.tar.gz";
-    sha256 = "8666c788cbb212036197365df3ba3cf964a23e4f644d76ea51d66dbe3be593bb";
+    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/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index c518f0430ff3..9d7126452c9a 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://notmuchmail.org/releases/${name}.tar.gz";
-    sha256 = "0lx7kkrsg401zrgj8s4ziqds1jsha3szsh44v57mq4pkq0fijph9";
+    sha256 = "095e191dc0f3125c4fd98440fdf55050cba01b8e9f68245ffe0190a7f39ca753";
   };
 
   buildInputs = [ bash emacs gdb glib gmime gnupg1 pkgconfig talloc xapian ];
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index a1fc52337edc..c0d87ee5a034 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
     sha1 = "ccc5f2e155364948945abf6fd27bebeb4d797aa8";
   };
 
-  enableParallelBuilding = true;
+  enableParallelBuilding = false;
 
   buildInputs =
     [ pkgconfig perl python zip unzip bzip2 gtk dbus_glib alsaLib libIDL nspr
diff --git a/pkgs/applications/networking/p2p/gnunet/default.nix b/pkgs/applications/networking/p2p/gnunet/default.nix
index f2fbf7046492..02f782c75a10 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.5";
 
   src = fetchurl {
     url = "mirror://gnu/gnunet/${name}.tar.gz";
-    sha256 = "0ppirvwjb7w7270g0w83z6wyk984cnxv2ydxj7qr0j1cz2j6nn2h";
+    sha256 = "162bahbskhzc0b2pda7v36dckm3p5p9rnbv2w0fbl0xl2gln63aa";
   };
 
   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/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix
index 434d75bce585..d8634e31dada 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 2266f7237f61..ef8ddf8b0e3b 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/office/abiword/default.nix b/pkgs/applications/office/abiword/default.nix
index fdfd60e98370..a500bbaa240b 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/hledger-interest/default.nix b/pkgs/applications/office/hledger-interest/default.nix
index 5b9aefa182e8..e66166f47133 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.2";
+  sha256 = "1his6pxrvs5p28bmk77bd8vaq6rhjlilwq598mbkgfvlqg7q076v";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ Cabal hledgerLib mtl time ];
diff --git a/pkgs/applications/office/ledger/const.patch b/pkgs/applications/office/ledger/const.patch
deleted file mode 100644
index 8565fbfd0d45..000000000000
--- 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/science/astronomy/celestia/default.nix b/pkgs/applications/science/astronomy/celestia/default.nix
new file mode 100644
index 000000000000..22180e9a3f7d
--- /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/stellarium/default.nix b/pkgs/applications/science/astronomy/stellarium/default.nix
index e890ee58307c..541340df6299 100644
--- a/pkgs/applications/science/astronomy/stellarium/default.nix
+++ b/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchurl, cmake, freetype, libpng, mesa, gettext, openssl, qt4, perl, libiconv}:
 
 let
-  name = "stellarium-0.11.4";
+  name = "stellarium-0.11.4a";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "mirror://sourceforge/stellarium/${name}.tar.gz";
-    sha256 = "8ad5e9878eb36c2c27f4754dcfc69279123e0eae02cc388074e3cf9b23746535";
+    sha256 = "0gs3lf2061chgcyx22xbnn6b284nsnj8xal7jyjzj57s8yk4n619";
   };
 
   buildInputs = [ cmake freetype libpng mesa gettext openssl qt4 perl libiconv ];
diff --git a/pkgs/applications/science/biology/slr/default.nix b/pkgs/applications/science/biology/slr/default.nix
deleted file mode 100644
index 7111d1a854e5..000000000000
--- 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/electronics/xoscope/default.nix b/pkgs/applications/science/electronics/xoscope/default.nix
index 61fb615b84db..54aae9e7d3bf 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 000000000000..993df9cb5503
--- /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/eProver/default.nix b/pkgs/applications/science/logic/eprover/default.nix
index 327a5d3a6237..8cc1de6e8dad 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.6";
+    name="${baseName}-${version}";
+    hash="140cnw4qck1hancrqdh0f77yfba5ljhdnfxdxsl0a86a6y7ydbwi";
+    url="http://www4.in.tum.de/~schulz/WORK/E_DOWNLOAD/V_1.6/E.tgz";
+    sha256="140cnw4qck1hancrqdh0f77yfba5ljhdnfxdxsl0a86a6y7ydbwi";
+  };
+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 000000000000..fb2d80fafae8
--- /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 5d9866a650bc..e62751cde9d4 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -9,11 +9,11 @@ let
 in
 
 stdenv.mkDerivation {
-  name = "hol_light-20120529";
+  name = "hol_light-20121213";
   src = fetchsvn {
     url = http://hol-light.googlecode.com/svn/trunk;
-    rev = "141";
-    sha256 = "a11d7e5db7c6035a2debcf9e73f43c6322389aeac5bc4d123ebf58918052a57f";
+    rev = "153";
+    sha256 = "1n4da5k3jya8mf7dgif8cl5sr2dqf6vl21fw1fcdna215v2x1rc0";
   };
 
   buildInputs = [ ocaml findlib camlp5 ];
diff --git a/pkgs/applications/science/logic/iprover/default.nix b/pkgs/applications/science/logic/iprover/default.nix
index 91d8c122a8d4..2acc0ac8d89a 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
diff --git a/pkgs/applications/science/logic/logisim/default.nix b/pkgs/applications/science/logic/logisim/default.nix
new file mode 100644
index 000000000000..009bed3ffe2a
--- /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 165c8a2f1484..430537fd57ff 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/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index 18d145b6dde2..d644a1633cbb 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.28.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 = "d73e925f0116ba361bf4390c80e24d4fa763f647cc1fc4cc06bbf40ceb3facda";
+    sha256 = "1p94l28adcn0826nah460r9pz71h7wd5klsg885sl2gzds75bn74";
   };
 
   buildInputs = [sbcl texinfo perl makeWrapper];
diff --git a/pkgs/applications/science/misc/boinc/default.nix b/pkgs/applications/science/misc/boinc/default.nix
index 5cc79469b769..9d8bc705fa47 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 bf0d9ddada46..00038373d568 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/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
new file mode 100644
index 000000000000..c687fd5908c4
--- /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/version-management/bazaar/default.nix b/pkgs/applications/version-management/bazaar/default.nix
index 856320f01684..1eb114ecd8ce 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 8944ebeb9cbf..000000000000
--- 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/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index fe4f101e27c7..3120cc84e63f 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -76,6 +76,11 @@ rec {
     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;
   };
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 713cf0d62a61..aef86c06cfb7 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
@@ -12,14 +12,14 @@
 }:
 
 let
-  version = "3.20121112-161-gb27d9eb";
+  version = "3.20130107";
 in
 stdenv.mkDerivation {
   name = "git-annex-${version}";
 
   src = fetchurl {
-    url = "http://git.kitenet.net/?p=git-annex.git;a=snapshot;h=b27d9ebd0f63bdc449440f2529224d5b655ddbb3;sf=tgz";
-    sha256 = "507efc50e33566a51a6abf688920d30fc55ce984c9c35be085e6df0767686b3a";
+    url = "http://git.kitenet.net/?p=git-annex.git;a=snapshot;sf=tgz;h=${version}";
+    sha256 = "15x4rmpxv3mgp8r4gb6jana5262nvyl6rm5p8slc5z5ijl0qwbzq";
     name = "git-annex-${version}.tar.gz";
   };
 
@@ -36,7 +36,6 @@ stdenv.mkDerivation {
   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|' Build/mdwn2man
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 b32299092124..db3833f1855b 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -9,7 +9,7 @@
 
 let
 
-  version = "1.8.0";
+  version = "1.8.1";
 
   svn = subversionClient.override { perlBindings = true; };
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://git-core.googlecode.com/files/git-${version}.tar.gz";
-    sha1 = "a03afc33f8f0723ad12649d79f1e8968526b4bf7";
+    sha1 = "wfj2pbqf9l56014dm330wb13qgcwx3dc";
   };
 
   patches = [ ./docbook2texi.patch ];
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 25a76ea3dd23..000000000000
--- 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 7515ade57875..000000000000
--- 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/hub/default.nix b/pkgs/applications/version-management/git-and-tools/hub/default.nix
new file mode 100644
index 000000000000..e545d2bc6f43
--- /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/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix
index 486bebc2531c..865033ae2d26 100644
--- a/pkgs/applications/version-management/mercurial/default.nix
+++ b/pkgs/applications/version-management/mercurial/default.nix
@@ -17,8 +17,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
@@ -47,8 +45,6 @@ stdenv.mkDerivation {
       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/";
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 dc4816cee512..000000000000
--- 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 e1f9bfc5f7f1..000000000000
--- 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/rcs/no-root.patch b/pkgs/applications/version-management/rcs/no-root.patch
deleted file mode 100644
index 2fbfc86ff45a..000000000000
--- 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 8e454ad9f8f0..885e4310a593 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.7";
+  version = "1.7.8";
 
   name = "subversion-${version}";
 
   src = fetchurl {
     url = "mirror://apache/subversion//${name}.tar.bz2";
-    sha1 = "c9fc0c5992eda36ba9affd93a15929e25958a951";
+    sha1 = "12c7d8d5414bba74c9777c4d1dae74f152df63c2";
   };
 
   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 395dda240b8b..5a514e8728d4 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/RealPlayer/builder.sh b/pkgs/applications/video/RealPlayer/builder.sh
deleted file mode 100644
index 9929634921cb..000000000000
--- 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 968846f1dcb1..000000000000
--- a/pkgs/applications/video/RealPlayer/default.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{stdenv, fetchurl, libstdcpp5, glib, pango, atk, gtk, libX11, makeWrapper}:
-
-# Note that RealPlayer 10 need libstdc++.so.5, i.e., GCC 3.3, not 3.4.
-
-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";
-  };
-
-  inherit libstdcpp5 makeWrapper;
-  libPath = [libstdcpp5 glib pango atk gtk libX11];
-  
-}) // {mozillaPlugin = "/real/mozilla";}
diff --git a/pkgs/applications/video/gpac/default.nix b/pkgs/applications/video/gpac/default.nix
new file mode 100644
index 000000000000..292010a3717c
--- /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
+  buildNativeInputs = [ 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/mkvtoolnix/default.nix b/pkgs/applications/video/mkvtoolnix/default.nix
index 812826d7ec28..1dc58607de06 100644
--- a/pkgs/applications/video/mkvtoolnix/default.nix
+++ b/pkgs/applications/video/mkvtoolnix/default.nix
@@ -16,11 +16,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "mkvtoolnix-5.6.0";
+  name = "mkvtoolnix-5.9.0";
 
   src = fetchurl {
     url = "http://www.bunkus.org/videotools/mkvtoolnix/sources/${name}.tar.bz2";
-    sha256 = "1hzwf4zaamny3qzmd6hyhy4hy9l67s3fjvznbi0avw0ad7g05i89";
+    sha256 = "1qdxzi72w5p77brlpp7y7llsgzlvl4p8fk1kzg934cqw6cqza4yr";
   };
 
   buildInputs = [ libmatroska flac libvorbis file boost lzo xdg_utils expat wxGTK zlib ruby gettext pkgconfig curl ];
diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/mplayer/default.nix
index 944af1c26571..357c6eec6e7e 100644
--- a/pkgs/applications/video/MPlayer/default.nix
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -18,6 +18,7 @@
 , pulseSupport ? false, pulseaudio ? null
 # For screenshots
 , libpngSupport ? true, libpng ? null
+, useUnfreeCodecs ? false
 }:
 
 assert x11Support -> (libX11 != null && libXext != null && mesa != null);
@@ -66,9 +67,7 @@ let
       cp -prv * $out
     '';
 
-    meta = {
-      license = "unfree";
-    };
+    meta.license = "unfree";
   } else null;
 
 in
@@ -140,8 +139,7 @@ stdenv.mkDerivation rec {
       ${if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc"}
       ${if jackaudioSupport then "--enable-jack" else "--disable-jack"}
       ${if pulseSupport then "--enable-pulse" else "--disable-pulse"}
-
-      ${optionalString (codecs != null) "--codecsdir=${codecs}"}
+      ${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"}
       ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"}
       --enable-freetype
       --disable-xanim
@@ -154,6 +152,8 @@ stdenv.mkDerivation rec {
 
   NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
 
+  enableParallelBuilding = true;
+
   # Provide a reasonable standard font.  Maybe we should symlink here.
   postInstall =
     ''
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 b1cfd49f1ba9..000000000000
--- 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 3341a01101c0..7d04a02f27f5 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -10,11 +10,11 @@
 
 stdenv.mkDerivation rec {
   name = "vlc-${version}";
-  version = "2.0.4";
+  version = "2.0.5";
 
   src = fetchurl {
     url = "http://download.videolan.org/pub/videolan/vlc/${version}/${name}.tar.xz";
-    sha256 = "1dixankckfxf8xixfc32rc9mfsv6mx2lk5h13ym8bp4dsk86w1jf";
+    sha256 = "0vkbv477a7z0v55sigz6c3abxljz7jyysp7z8s29zk8vhq0fpyfz";
   };
 
   buildInputs =
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 bbcf18064525..000000000000
--- 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 e1b636749696..000000000000
--- 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/svn-6642.nix b/pkgs/applications/virtualization/qemu/svn-6642.nix
deleted file mode 100644
index 32d67234ba73..000000000000
--- 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/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index a8594c4ba169..f699119c5f04 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, kernel, 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.2.2";
+  version = "4.2.6";
+  extpackRevision = "82870";
 
   forEachModule = action: ''
     for mod in \
@@ -29,24 +31,30 @@ 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 = "f0113688a76efa0426c27c5541c78506b18637025c35aa682ecc6eeed5d56582";
+    url = "https://www.virtualbox.org/wiki/Downloads";
+  };
+
 in stdenv.mkDerivation {
   name = "virtualbox-${version}-${kernel.version}";
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
-    sha256 = "943daa13694605d5d0a23ffef27c398b5e72ada669de89bad4b98f000f029700";
+    sha256 = "54526091bc2aa66b88ca878dd9ecc4466f96d607db2f6678a9d673ecf6646ae3";
   };
 
   buildInputs =
     [ iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor qt4 libIDL SDL
-      libcap glib kernel python alsaLib curl pam xorriso makeself perl
+      libcap glib kernel lvm2 python alsaLib curl pam xorriso makeself perl
       pkgconfig which libXmu ]
     ++ optional javaBindings jdk
     ++ optional pythonBindings python;
 
-  patches = [ ./remove_fa_ir.patch ];
-
-  postPatch = ''
+  prePatch = ''
     set -x
     MODULES_BUILD_DIR=`echo ${kernel}/lib/modules/*/build`
     sed -e 's@/lib/modules/`uname -r`/build@'$MODULES_BUILD_DIR@ \
@@ -108,6 +116,15 @@ 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
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
index c4c7a9f27083..7a79a73c6b95 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -1,19 +1,20 @@
 { stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper
-, libX11, libXt, libXext, libXmu, libXcomposite, libXfixes, libXrandr, libXcursor}:
+, libX11, libXt, libXext, libXmu, libXcomposite, libXfixes, libXrandr, libXcursor
+, dbus }:
 
-let version = "4.2.2"; in
+let version = "4.2.6"; in
 
 stdenv.mkDerivation {
-  name = "VirtualBox-GuestAdditions-${version}";
+  name = "VirtualBox-GuestAdditions-${version}-${kernel.version}";
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
-    sha256 = "26f5390b36a3bb9855846d194dcd287b8e53613b599c6ffd7aff1b451cc7f1f1";
+    sha256 = "1lry4hjjk8p69km1bi3mpmyarlnxz9izs2c0s8pq5rjzv1bd7bxr";
   };
 
   KERN_DIR = "${kernel}/lib/modules/*/build";
 
-  buildInputs = [ patchelf cdrkit makeWrapper ];
+  buildInputs = [ patchelf cdrkit makeWrapper dbus ];
 
   installPhase = ''
     mkdir -p $out
@@ -56,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
@@ -66,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
@@ -82,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
diff --git a/pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch b/pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch
deleted file mode 100644
index 0d7a83421927..000000000000
--- a/pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-This patch is for VirtualBox-4.2.2, to temporarily remove references to the
-fa_IR language file from the source tree, as it somehow got lost during tarball
-creation. For more information on this subject please have a look at:
-
-https://www.virtualbox.org/pipermail/vbox-dev/2012-October/005408.html
-
-diff --git a/src/VBox/Frontends/VirtualBox/VBoxUI.pro b/src/VBox/Frontends/VirtualBox/VBoxUI.pro
-index ffeb410..37ac56a 100644
---- a/src/VBox/Frontends/VirtualBox/VBoxUI.pro
-+++ b/src/VBox/Frontends/VirtualBox/VBoxUI.pro
-@@ -63,7 +63,6 @@ TRANSLATIONS = \
- 	nls/VirtualBox_es.ts \
- 	nls/VirtualBox_eu.ts \
- 	nls/VirtualBox_fi.ts \
--	nls/VirtualBox_fa_IR.ts \
- 	nls/VirtualBox_fr.ts \
- 	nls/VirtualBox_gl_ES.ts \
- 	nls/VirtualBox_hu.ts \
-diff --git a/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk b/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
-index 66f0ec3..2fc19b9 100644
---- a/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
-+++ b/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
-@@ -23,7 +23,6 @@ VBOX_APPROVED_GUI_LANGUAGES := \
- 	de    \
- 	en    \
- 	es    \
--	fa_IR \
- 	hu    \
- 	it    \
- 	ja    \
diff --git a/pkgs/applications/window-managers/compiz/bcop.nix b/pkgs/applications/window-managers/compiz/bcop.nix
deleted file mode 100644
index 254393d4c7fc..000000000000
--- 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 0406a170d190..000000000000
--- 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 4de7fb41a488..000000000000
--- 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 d4a5b79b7fb3..000000000000
--- 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 000000000000..ba9d9574366a
--- /dev/null
+++ b/pkgs/applications/window-managers/compiz/default.nix
@@ -0,0 +1,58 @@
+{stdenv, fetchurl, cmake, pkgconfig
+, libXrender, renderproto, gtk, libwnck, pango, cairo
+, GConf, libXdamage, damageproto, libxml2, libxslt, glibmm
+, 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.8.6";
+    name="compiz-0.9.8.6";
+    hash="0agz5s11lwrkhk3svz3rwimlb6318ln3zcywlzczwks139svxnk6";
+    url="https://launchpad.net/compiz/0.9.8/0.9.8.6/+download/compiz-0.9.8.6.tar.bz2";
+    sha256="0agz5s11lwrkhk3svz3rwimlb6318ln3zcywlzczwks139svxnk6";
+  };
+  buildInputs = [cmake pkgconfig
+    libXrender renderproto gtk libwnck pango cairo
+    GConf libXdamage damageproto libxml2 libxslt glibmm 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 
+    ];
+  in
+stdenv.mkDerivation rec {
+  inherit (s) name version;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  inherit buildInputs;
+
+  NIX_CFLAGS_COMPILE=" -Wno-error ";
+  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 000000000000..b7fc98bd1263
--- /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 d80a5514ee9d..000000000000
--- 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 51d459e7a366..000000000000
--- 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 5a242e66088f..000000000000
--- 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 207816a3c518..000000000000
--- 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 8852ebd474ed..000000000000
--- 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 ea1c01e7414b..000000000000
--- 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 8130dff1dba4..000000000000
--- 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/i3/default.nix b/pkgs/applications/window-managers/i3/default.nix
index 042e1a323a6d..94ac84f838c2 100644
--- a/pkgs/applications/window-managers/i3/default.nix
+++ b/pkgs/applications/window-managers/i3/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "i3-${version}";
-  version = "4.3";
+  version = "4.4";
 
   src = fetchurl {
     url = "http://i3wm.org/downloads/${name}.tar.bz2";
-    sha256 = "895bf586092535efb2bc723ba599c71a027768115e56052f111fc8bb148db925";
+    sha256 = "06s8gzcxxh06zp1586kp4bxaj8yj5i9jacwg0nizbmmnx94mg1wr";
   };
 
   buildInputs = [ which pkgconfig libxcb xcbutilkeysyms xcbutil bison xcbutilwm
diff --git a/pkgs/applications/window-managers/ion-3/default.nix b/pkgs/applications/window-managers/ion-3/default.nix
index e6714536cadd..b4dabb300c19 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/wmii/builder.sh b/pkgs/applications/window-managers/wmii/builder.sh
deleted file mode 100644
index be21a9c9fad4..000000000000
--- 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 fd215986fa30..a15755205ee6 100644
--- a/pkgs/applications/window-managers/xmonad/default.nix
+++ b/pkgs/applications/window-managers/xmonad/default.nix
@@ -1,24 +1,19 @@
-{ 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
+  ];
   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
-    ];
+    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 11c8531ad174..6716591eabae 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";
+  sha256 = "188brys16b3wmxd22j4284wnpasm8bixdjfxl1jr2q2xi45nzks0";
   buildDepends = [
     extensibleExceptions mtl random utf8String X11 X11Xft xmonad
   ];
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
index 334c7f59d571..025bab67e968 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
@@ -4,13 +4,14 @@
 
 cabal.mkDerivation (self: {
   pname = "xmonad-extras";
-  version = "0.10.1.2";
-  sha256 = "1v0yhi3sw7qks8d13amps0qs5p90j3prjh5abm02wblcd0bm1xay";
+  version = "0.11";
+  sha256 = "09r64z09mfdz86k7v5c6zds9ng0fjcp44kd8f5qg1sz40yblrny5";
   buildDepends = [
     hint libmpd mtl network parsec random regexPosix split X11 xmonad
     xmonadContrib
   ];
   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";
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix
index 42392aff60c4..a5884786b001 100644
--- a/pkgs/build-support/cabal/default.nix
+++ b/pkgs/build-support/cabal/default.nix
@@ -44,7 +44,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;
             };
 
diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix
index dd81692b5f2d..98dd7d8fb8ea 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
@@ -248,8 +246,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/release/source-tarball.nix b/pkgs/build-support/release/source-tarball.nix
index 85d0b29f5b70..887bfb3125ca 100644
--- a/pkgs/build-support/release/source-tarball.nix
+++ b/pkgs/build-support/release/source-tarball.nix
@@ -9,7 +9,7 @@
 , 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
 , ... } @ args:
 
diff --git a/pkgs/build-support/replace-dependency.nix b/pkgs/build-support/replace-dependency.nix
new file mode 100644
index 000000000000..098637b4f9b9
--- /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/upstream-updater/update-walker-service-specific.sh b/pkgs/build-support/upstream-updater/update-walker-service-specific.sh
index 234f27ff1d10..4f3a7110346e 100644
--- a/pkgs/build-support/upstream-updater/update-walker-service-specific.sh
+++ b/pkgs/build-support/upstream-updater/update-walker-service-specific.sh
@@ -3,3 +3,7 @@ SF_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
index ce0e1403f2ed..c4dc7713f504 100755
--- a/pkgs/build-support/upstream-updater/update-walker.sh
+++ b/pkgs/build-support/upstream-updater/update-walker.sh
@@ -3,6 +3,7 @@
 own_dir="$(cd "$(dirname "$0")"; pwd)"
 
 CURRENT_URL=
+NEED_TO_CHOOSE_URL=1
 
 url () {
   CURRENT_URL="$1"
@@ -45,12 +46,14 @@ matching_links () {
 
 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
 }
@@ -79,23 +82,64 @@ version () {
 }
 
 ensure_version () {
+  echo "Ensuring version. CURRENT_VERSION: $CURRENT_VERSION" >&2
   [ -z "$CURRENT_VERSION" ] && version '.*-([0-9.]+)[-._].*' '\1'
 }
 
 ensure_target () {
-  [ -z "$CURRENT_TARGET" ] && target default.nix
+  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_NAME".meta.version | xargs)"
+  PACKAGED_VERSION="$(nix-instantiate --eval-only '<nixpkgs>' -A "$CURRENT_ATTRIBUTE_NAME".meta.version | xargs)"
 }
 
 directory_of () {
@@ -108,8 +152,7 @@ full_path () {
 
 target () {
   CURRENT_TARGET="$1"
-  test -e "$CURRENT_TARGET" || 
-    { [ "$CURRENT_TARGET" = "${CURRENT_TARGET#/}" ] && CURRENT_TARGET="$CONFIG_DIR/$CURRENT_TARGET"; }
+  { [ "$CURRENT_TARGET" = "${CURRENT_TARGET#/}" ] && CURRENT_TARGET="$CONFIG_DIR/$CURRENT_TARGET"; }
   echo "Target set to: $CURRENT_TARGET"
 }
 
@@ -126,7 +169,7 @@ do_write_expression () {
   echo "${1}rec {"
   echo "${1}  baseName=\"$CURRENT_NAME\";"
   echo "${1}  version=\"$CURRENT_VERSION\";"
-  echo "${1}  name=\"$CURRENT_NAME-$CURRENT_VERSION\";"
+  echo "${1}  name=\"\${baseName}-\${version}\";"
   echo "${1}  hash=\"$CURRENT_HASH\";"
   echo "${1}  url=\"$CURRENT_URL\";"
   echo "${1}  sha256=\"$CURRENT_HASH\";"
@@ -146,6 +189,12 @@ replace_once () {
   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"
 }
@@ -160,7 +209,7 @@ set_var_value () {
   quote='"'
   let "$no_quotes" && quote=""
 
-  replace_once "$file" "${var} *= *.*" "${var} = ${quote}${value}${quote};"
+  replace_once "$file" "${var} *= *.*" "${var} = ${quote}${value}${quote};" "$instance"
 }
 
 do_regenerate () {
@@ -176,16 +225,20 @@ do_regenerate () {
 }
 
 do_overwrite () {
-  hash
+  ensure_hash
   do_regenerate "$1" > "$1.new.tmp"
   mv "$1.new.tmp" "$1"
 }
 
 process_config () {
   CONFIG_DIR="$(directory_of "$1")"
-  source "$CONFIG_DIR/$(basename "$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"
diff --git a/pkgs/build-support/upstream-updater/urls-from-page.sh b/pkgs/build-support/upstream-updater/urls-from-page.sh
index 065e3faf309b..f1ddf0bfd88e 100755
--- a/pkgs/build-support/upstream-updater/urls-from-page.sh
+++ b/pkgs/build-support/upstream-updater/urls-from-page.sh
@@ -11,4 +11,4 @@ echo "URL: $url" >&2
 
 curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]="([^"]*)"/\n+\1\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 1d41f89218bd..887077037e28 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;
 }
 
@@ -50,7 +51,7 @@ my %provides;
 
 foreach my $cdata (values %packages) {
     next unless defined $cdata->{Provides};
-    my @provides = getDeps(Dpkg::Deps::parse($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";
@@ -83,7 +84,7 @@ sub closePackage {
     $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};
         }
     }
@@ -92,14 +93,14 @@ sub closePackage {
 
     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);
     }
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index e8de915e7889..9d9bdb2033e3 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -3,7 +3,7 @@
 , 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"
     ]
 }:
 
@@ -38,35 +38,19 @@ rec {
       # 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
     ''; # */
 
@@ -84,8 +68,7 @@ rec {
 
 
   stage1Init = writeScript "vm-run-stage1" ''
-    #! ${initrdUtils}/bin/bash -e
-    echo START
+    #! ${initrdUtils}/bin/ash -e
 
     export PATH=${initrdUtils}/bin
 
@@ -167,8 +150,7 @@ rec {
 
     mount -o remount,ro dummy /fs
 
-    echo DONE
-    halt -d -p -f
+    poweroff -f
   '';
 
 
@@ -761,7 +743,7 @@ rec {
   debClosureGenerator =
     {name, packagesLists, urlPrefix, packages}:
 
-    runCommand "${name}.nix" {} ''
+    runCommand "${name}.nix" { buildInputs = [ perl dpkg ]; } ''
       for i in ${toString packagesLists}; do
         echo "adding $i..."
         bunzip2 < $i >> ./Packages
@@ -770,7 +752,7 @@ rec {
       # 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
     '';
 
@@ -1306,6 +1288,40 @@ rec {
       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" ];
+    };
+
     debian40i386 = {
       name = "debian-4.0r9-etch-i386";
       fullName = "Debian 4.0r9 Etch (i386)";
@@ -1351,22 +1367,22 @@ rec {
     };
 
     debian60i386 = {
-      name = "debian-6.0.4-squeeze-i386";
-      fullName = "Debian 6.0.4 Squeeze (i386)";
+      name = "debian-6.0.6-squeeze-i386";
+      fullName = "Debian 6.0.6 Squeeze (i386)";
       packagesList = fetchurl {
         url = mirror://debian/dists/squeeze/main/binary-i386/Packages.bz2;
-        sha256 = "1aih4n1iz4gzzm5cy1j14mpx8i25jj1237994j33k7dm0gnqgr2w";
+        sha256 = "18c0473jacd877nkky1x21dkmp4992d8qra6wj07sq0yz5gdc9c4";
       };
       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.6-squeeze-amd64";
+      fullName = "Debian 6.0.6 Squeeze (amd64)";
       packagesList = fetchurl {
         url = mirror://debian/dists/squeeze/main/binary-amd64/Packages.bz2;
-        sha256 = "1gb3im7kl8dwd7z82xj4wb5g58r86fjj8cirvq0ssrvcm9bqaiz7";
+        sha256 = "1n1h3pz6axcaraxq8gfzq0jywlpdrqand1dnd4q79dy6cl788bi2";
       };
       urlPrefix = mirror://debian;
       packages = commonDebianPackages;
diff --git a/pkgs/data/documentation/man-pages/default.nix b/pkgs/data/documentation/man-pages/default.nix
index 465d83f8b4c6..d00ca6c869fb 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.43";
+  name = "man-pages-3.45";
 
   src = fetchurl {
     url = "mirror://kernel/linux/docs/man-pages/Archive/${name}.tar.xz";
-    sha256 = "05fjq8llfxm77mnf2jhly98780xbkakim7b7hbx6kafvvs5zisrf";
+    sha256 = "1lwqrp79xcyhnjlyg1n0imz5wc88lpgv909xxz8bdgbk7c1mky0h";
   };
 
   preBuild =
diff --git a/pkgs/data/fonts/libertine/default.nix b/pkgs/data/fonts/libertine/default.nix
index a0ed5f757974..b8c0db222d5f 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/themes/green.nix b/pkgs/data/misc/themes/green.nix
deleted file mode 100644
index 945bd3c9a3cf..000000000000
--- 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 32d1a9256ac4..000000000000
--- 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/desktops/kde-4.7/kde-workspace.nix b/pkgs/desktops/kde-4.7/kde-workspace.nix
index 8116f4bb6b59..1ece3f490761 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,7 +12,7 @@ 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 ];
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 13c145f32753..000000000000
--- 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/smokekde.nix b/pkgs/desktops/kde-4.7/kdebindings/smokekde.nix
deleted file mode 100644
index c49a77a48ed6..000000000000
--- a/pkgs/desktops/kde-4.7/kdebindings/smokekde.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ kde, kdelibs, smokeqt }:
-
-kde {
-  propagatedBuildInputs = [ kdelibs smokeqt ];
-
-  meta = {
-    description = "C++ parser used to generate language bindings for Qt/KDE";
-    license = "GPLv2";
-  };
-}
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 6770dd399e33..000000000000
--- 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/kdesdk/optional-docs.diff b/pkgs/desktops/kde-4.7/kdesdk/optional-docs.diff
deleted file mode 100644
index f67e1f4cdd8e..000000000000
--- 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 ea237a5d718e..000000000000
--- 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.8/kde-workspace.nix b/pkgs/desktops/kde-4.8/kde-workspace.nix
index 31937d4f1d56..1a86eacb3367 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,7 +12,7 @@ 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
     ];
 
diff --git a/pkgs/desktops/xfce-4.8/applications/terminal.nix b/pkgs/desktops/xfce-4.8/applications/terminal.nix
index 44aa72d9d8c8..f03a940679a6 100644
--- a/pkgs/desktops/xfce-4.8/applications/terminal.nix
+++ b/pkgs/desktops/xfce-4.8/applications/terminal.nix
@@ -7,9 +7,9 @@
 
 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;
+    url = http://archive.xfce.org/src/apps/xfce4-terminal/0.4/Terminal-0.4.8.tar.bz2;
     sha1 = "2f12c3a0fffad18976d47e531d404ee308cb2f05";
   };
 
diff --git a/pkgs/desktops/xfce-4.8/applications/xfce4-notifyd.nix b/pkgs/desktops/xfce-4.8/applications/xfce4-notifyd.nix
new file mode 100644
index 000000000000..598e6eb414d1
--- /dev/null
+++ b/pkgs/desktops/xfce-4.8/applications/xfce4-notifyd.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, intltool, pkgconfig, gtk, xfce }:
+
+stdenv.mkDerivation rec {
+  name = "xfce4-notifyd-0.2.2";
+  
+  src = fetchurl {
+    url = "http://archive.xfce.org/src/apps/xfce4-notifyd/0.2/${name}.tar.bz2";
+    sha256 = "0s4ilc36sl5k5mg5727rmqims1l3dy5pwg6dk93wyjqnqbgnhvmn";
+  };
+
+  buildInputs = [ intltool pkgconfig gtk xfce.libxfce4util xfce.libxfce4ui xfce.xfconf ];
+
+  meta = {
+    homepage = http://goodies.xfce.org/projects/applications/xfce4-notifyd;
+    description = "The Xfce Notify Daemon";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/xfce-4.8/default.nix b/pkgs/desktops/xfce-4.8/default.nix
index c20e42d20196..bfe7fddd7381 100644
--- a/pkgs/desktops/xfce-4.8/default.nix
+++ b/pkgs/desktops/xfce-4.8/default.nix
@@ -73,6 +73,8 @@ rec {
 
   ristretto = callPackage ./applications/ristretto.nix { };
 
+  xfce4_notifyd = callPackage ./applications/xfce4-notifyd.nix { };
+
   xfce4_power_manager = callPackage ./applications/xfce4-power-manager.nix { };
 
   xfce4mixer = callPackage ./applications/xfce4-mixer.nix { };
diff --git a/pkgs/development/arduino/arduino-core/default.nix b/pkgs/development/arduino/arduino-core/default.nix
new file mode 100644
index 000000000000..f1be290b190e
--- /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 000000000000..6b88a8deaea7
--- /dev/null
+++ b/pkgs/development/arduino/ino/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, buildPythonPackage, 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 = [ minicom avrdude arduino_core ];
+
+  patchPhase = ''
+    echo "Patching Arduino distribution path"
+    sed -i 's@/usr/local/share/arduino@${arduino_core}/share/arduino@g' ino/environment.py
+  '';
+ 
+  doCheck = false;
+
+  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/cmucl/binary.nix b/pkgs/development/compilers/cmucl/binary.nix
index 11d0b723ce45..55f64234a32e 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/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix
index fb801b6b8440..40690841965a 100644
--- a/pkgs/development/compilers/ecl/default.nix
+++ b/pkgs/development/compilers/ecl/default.nix
@@ -1,47 +1,45 @@
-{builderDefsPackage
-  , gmp, mpfr, libffi
-  , ...} @ x:
-builderDefsPackage (a :  
-let 
-  propagatedBuildInputs = with a; [
+{stdenv, fetchurl
+, gmp, mpfr, libffi
+, noUnicode ? false, 
+}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="ecl";
+    version="12.12.1";
+    name="${baseName}-${version}";
+    hash="15y2dgj95li6mxiz9pnllj9x88km0z8gfh46kysfllkp2pl7rrsl";
+    url="mirror://sourceforge/project/ecls/ecls/12.12/ecl-12.12.1.tgz";
+    sha256="15y2dgj95li6mxiz9pnllj9x88km0z8gfh46kysfllkp2pl7rrsl";
+  };
+  buildInputs = [
+    libffi
+  ];
+  propagatedBuildInputs = [
     gmp mpfr
   ];
-  buildInputs = [ gmp libffi mpfr ];
 in
-rec {
-  mainVersion = "12.7";
-  revision = "1";
-  version = "${mainVersion}.${revision}";
-
-  name = "ecl-${version}";
-
-  src = a.fetchurl {
-    url = "mirror://sourceforge/project/ecls/ecls/${mainVersion}/${name}.tar.gz";
-    sha256 = "0k8ww142g3bybvvnlijqsbidl8clbs1pb4ympk2ds07z5swvy2ap";
-  };
-
+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 000000000000..70dcb1b43442
--- /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/eql/default.nix b/pkgs/development/compilers/eql/default.nix
index 4e288824713d..5bb0a2e5f649 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 e2a9fd128e98..a2863663bea9 100644
--- a/pkgs/development/compilers/fpc/lazarus.nix
+++ b/pkgs/development/compilers/fpc/lazarus.nix
@@ -38,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/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 b9d558d5c175..000000000000
--- 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.2-apple32/builder.sh b/pkgs/development/compilers/gcc/4.2-apple32/builder.sh
deleted file mode 100644
index 1e4eccafbb2e..000000000000
--- 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 b26f15e6512f..000000000000
--- 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 3346a4e327a5..000000000000
--- 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 b7b93d6944cc..000000000000
--- 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 4f9a29ae51bb..000000000000
--- 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.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix
index 0267c1def5d0..5ab7166204e9 100644
--- a/pkgs/development/compilers/gcc/4.7/default.nix
+++ b/pkgs/development/compilers/gcc/4.7/default.nix
@@ -89,9 +89,11 @@ let version = "4.7.2";
     gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
     gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
     gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] 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 "";
+    withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
     crossMingw = (cross != null && cross.libc == "msvcrt");
 
     crossConfigureFlags =
@@ -99,6 +101,7 @@ let version = "4.7.2";
       withArch +
       withCpu +
       withAbi +
+      withMode +
       (if (crossMingw && crossStageStatic) then
         " --with-headers=${libcCross}/include" +
         " --with-gcc" +
@@ -181,7 +184,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
@@ -194,8 +196,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}'..."
@@ -289,7 +291,9 @@ stdenv.mkDerivation ({
         )
       )
     }
-    ${if (stdenv ? glibc) then " --with-native-system-header-dir=${stdenv.glibc}/include" else ""}
+    ${if (stdenv ? glibc && cross == null)
+      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 langAda then " --enable-libada" else ""}
diff --git a/pkgs/development/compilers/ghc/with-packages.nix b/pkgs/development/compilers/ghc/with-packages.nix
index f4f567f30b39..07071ef8414a 100644
--- a/pkgs/development/compilers/ghc/with-packages.nix
+++ b/pkgs/development/compilers/ghc/with-packages.nix
@@ -79,7 +79,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/idris/default.nix b/pkgs/development/compilers/idris/default.nix
index dbd35d9e9482..15b4aa009864 100644
--- a/pkgs/development/compilers/idris/default.nix
+++ b/pkgs/development/compilers/idris/default.nix
@@ -1,15 +1,15 @@
 { cabal, binary, Cabal, filepath, happy, haskeline, mtl, parsec
-, transformers
+, split, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "idris";
-  version = "0.9.5.1";
-  sha256 = "0cy27b2kq696lw354y55mpx1gv66jdax1xjph989kxp0rd1v1sw9";
+  version = "0.9.6";
+  sha256 = "1yml1k4bis210hgi898hgs4wj5p34ainlj7vwy5lh7bjkvrksgq1";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    binary Cabal filepath haskeline mtl parsec transformers
+    binary Cabal filepath haskeline mtl parsec split transformers
   ];
   buildTools = [ happy ];
   meta = {
diff --git a/pkgs/development/compilers/jdk/default.nix b/pkgs/development/compilers/jdk/default.nix
deleted file mode 100644
index 8940be7f34d5..000000000000
--- 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-cygwin.nix b/pkgs/development/compilers/jdk/jdk6-cygwin.nix
deleted file mode 100644
index 31c9c6140314..000000000000
--- 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/julia/default.nix b/pkgs/development/compilers/julia/default.nix
index b8a5a10ec97c..a4503911b92c 100644
--- a/pkgs/development/compilers/julia/default.nix
+++ b/pkgs/development/compilers/julia/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre, zlib
  , readline, fftwSinglePrec, fftw, libunwind, suitesparse, glpk, fetchurl
  , ncurses, libunistring, lighttpd, patchelf, openblas, liblapack
- , tcl, tk
+ , tcl, tk, xproto, libX11
  } :
 let
   realGcc = stdenv.gcc.gcc;
 in
 stdenv.mkDerivation rec {
   pname = "julia";
-  date = "20121122";
+  date = "20121209";
   name = "${pname}-git-${date}";
 
   grisu_ver = "1.1.1";
@@ -18,6 +18,7 @@ stdenv.mkDerivation rec {
   arpack_ver = "3.1.2";
   clp_ver = "1.14.5";
   lighttpd_ver = "1.4.29";
+  patchelf_ver = "0.6";
 
   grisu_src = fetchurl {
     url = "http://double-conversion.googlecode.com/files/double-conversion-${grisu_ver}.tar.gz";
@@ -52,38 +53,40 @@ 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";
+  };
 
   src = fetchgit {
     url = "git://github.com/JuliaLang/julia.git";
-    rev = "51076ef4c1b269de738b6185865b389601627eb7";
-    sha256 = "1hbhxdiymkv0pd4dhr9wbvh1566ivfffhmafsjh8jcwh2f9fz90b";
+    rev = "27b950f62aeb3664ab76e5d827b30b4885a9efb9";
+    sha256 = "0khx8ln2zq3vpj0g66hnsdhw04hxl79fq43rc06ggsmc1j4xrifb";
   };
 
   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 
     ];
 
   configurePhase = ''
     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}" ; 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 -lz "''}
-
-    sed -e 's@ cpp @ gcc -E @g' -i base/Makefile
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC "
 
     export LDFLAGS="-L${suitesparse}/lib -L$out/lib/julia -Wl,-rpath,$out/lib/julia"
 
@@ -101,17 +104,19 @@ stdenv.mkDerivation rec {
   '';
 
   preBuild = ''
-    make -C test/unicode all SHELL="${stdenv.shell}"
-    make -C extras glpk_h.jl GLPK_PREFIX="$GLPK_PREFIX" SHELL="${stdenv.shell}"
+    mkdir -p usr/lib
+    ln -s libuv.a usr/lib/uv.a
+  '';
+
+  preInstall = ''
+    make -C deps install-tk-wrapper
   '';
 
   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 btf cxsparse ldl rbio spqr suitesparseconfig; 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/"
+   (
+   cd $out/share/julia/test/ 
+   $out/bin/julia runtests.jl all
+   ) || true
   '';
 
   meta = {
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 5e7370718ab4..000000000000
--- a/pkgs/development/compilers/llvm/clang-include-paths.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -Naur clang-3.1.src-orig/lib/Driver/ToolChains.cpp clang-3.1.src/lib/Driver/ToolChains.cpp
---- clang-3.1.src-orig/lib/Driver/ToolChains.cpp	2012-05-11 20:16:02.000000000 -0400
-+++ clang-3.1.src/lib/Driver/ToolChains.cpp	2012-10-08 01:13:01.044083509 -0400
-@@ -2146,9 +2146,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");
-@@ -2264,6 +2261,7 @@
-     return;
- 
-   // Check if libc++ has been enabled and provide its include paths if so.
-+  // !!! Will need to modify this if/when nixpkgs uses libc++
-   if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
-     // libc++ is always installed at a fixed path on Linux currently.
-     addSystemInclude(DriverArgs, CC1Args,
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 ffa67b464eca..000000000000
--- a/pkgs/development/compilers/llvm/clang-ld-flags.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -Naur clang-3.1.src-orig/lib/Driver/ToolChains.cpp clang-3.1.src/lib/Driver/ToolChains.cpp
---- clang-3.1.src-orig/lib/Driver/ToolChains.cpp	2012-05-11 20:16:02.000000000 -0400
-+++ clang-3.1.src/lib/Driver/ToolChains.cpp	2012-10-08 01:22:53.458850737 -0400
-@@ -2077,16 +2077,6 @@
-       addPathIfExists(LibPath + "/../" + Multilib, 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()) {
-@@ -2100,8 +2090,6 @@
-       addPathIfExists(LibPath, Paths);
-     }
-   }
--  addPathIfExists(SysRoot + "/lib", Paths);
--  addPathIfExists(SysRoot + "/usr/lib", Paths);
- }
- 
- bool Linux::HasNativeLLVMSupport() const {
-diff -Naur clang-3.1.src-orig/lib/Driver/Tools.cpp clang-3.1.src/lib/Driver/Tools.cpp
---- clang-3.1.src-orig/lib/Driver/Tools.cpp	2012-04-18 17:32:25.000000000 -0400
-+++ clang-3.1.src/lib/Driver/Tools.cpp	2012-10-08 01:25:23.913501995 -0400
-@@ -5210,24 +5210,6 @@
-       ToolChain.getArch() == llvm::Triple::thumb ||
-       (!Args.hasArg(options::OPT_static) &&
-        !Args.hasArg(options::OPT_shared))) {
--    CmdArgs.push_back("-dynamic-linker");
--    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)
--      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)
--      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 --git a/pkgs/development/compilers/llvm/clang-purity.patch b/pkgs/development/compilers/llvm/clang-purity.patch
new file mode 100644
index 000000000000..18c70b56c540
--- /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 48e4c4946f30..0c5788288881 100644
--- a/pkgs/development/compilers/llvm/clang.nix
+++ b/pkgs/development/compilers/llvm/clang.nix
@@ -1,14 +1,13 @@
-{ stdenv, fetchurl, perl, groff, llvm, cmake }:
+{ stdenv, fetchurl, perl, groff, llvm, cmake, libxml2 }:
 
-let version = "3.1"; in
+let version = "3.2"; 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;
 
   cmakeFlags = [
     "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
@@ -22,7 +21,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
       url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
-      sha256 = "11m7sm9f8qcrayckfg3z91zb3fimilpm0f7azn7q7qnkvhay4qzz";
+      sha256 = "0n2nzw3pw2v7fk67f2k2qyzd9wibvi3i5j7cjzz1csqgghzz1aia";
   };
 
   passthru = { gcc = stdenv.gcc.gcc; };
@@ -35,4 +34,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 204c080b871a..4b5bbdc52584 100644
--- a/pkgs/development/compilers/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, perl, groff, cmake, python }:
 
-let version = "3.1"; in
+let version = "3.2"; in
 
 stdenv.mkDerivation {
   name = "llvm-${version}";
 
   src = fetchurl {
     url    = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
-    sha256 = "1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab";
+    sha256 = "0hv30v5l4fkgyijs56sr1pbrlzgd674pg143x7az2h37sb290l0j";
   };
 
   buildInputs = [ perl groff cmake python ];
@@ -24,4 +24,3 @@ stdenv.mkDerivation {
     platforms = with stdenv.lib.platforms; all;
   };
 }
-
diff --git a/pkgs/development/compilers/mit-scheme/default.nix b/pkgs/development/compilers/mit-scheme/default.nix
index ef11c5b3baf2..7572dda77118 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 ];
+  buildNativeInputs = [ makeWrapper gnum4 texinfo texLive automake ];
 
   # XXX: The `check' target doesn't exist.
   doCheck = false;
diff --git a/pkgs/development/compilers/ocaml/cvs.nix b/pkgs/development/compilers/ocaml/cvs.nix
deleted file mode 100644
index cc40ca9aac54..000000000000
--- 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 2a54b90dda98..68413e3e25d1 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/openjdk/cppflags-include-fix.patch b/pkgs/development/compilers/openjdk/cppflags-include-fix.patch
index 36fa9054bc62..8931c122538f 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 246696f81e2b..0be36379f33a 100644
--- a/pkgs/development/compilers/openjdk/default.nix
+++ b/pkgs/development/compilers/openjdk/default.nix
@@ -39,35 +39,18 @@ let
     else
       throw "openjdk requires i686-linux or x86_64 linux";
 
+  update = "6";
+
+  build = "24";
+
 in
 
 stdenv.mkDerivation rec {
-  name = "openj${if jreOnly then "re" else "dk"}-7b127";
+  name = "openj${if jreOnly then "re" else "dk"}-7u${update}b${build}";
 
   src = fetchurl {
-    url = http://www.java.net/download/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.zip;
-    sha256 = "1qhwlz9y5qmwmja4qnxg6sn3pgsg1i11fb9j41w8l26acyhk34rs";
-  };
-
-  jaxws_src_name = "jdk7-jaxws2_2_4-b03-2011_05_27.zip";
-
-  jaxws_src = fetchurl {
-    url = "http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7/${jaxws_src_name}";
-    sha256 = "1mpzgr9lnbf2p3x45npcniy47kbzi3hyqqbd4w3j63sxnxcp5bh5";
-  };
-
-  jaxp_src_name = "jaxp145_01.zip";
-
-  jaxp_src = fetchurl {
-    url = "http://download.java.net/jaxp/1.4.5/${jaxp_src_name}";
-    sha256 = "1js8m1a6lcn95byplmjjs1lja1maisyl6lgfjy1jx3lqi1hlr4n5";
-  };
-
-  jaf_src_name = "jdk7-jaf-2010_08_19.zip";
-
-  jaf_src = fetchurl {
-    url = "http://java.net/downloads/jax-ws/JDK7/${jaf_src_name}";
-    sha256 = "17n0i5cgvfsd6ric70h3n7hr8aqnzd216gaq3603wrxlvggzxbp6";
+    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" ];
@@ -96,12 +79,6 @@ stdenv.mkDerivation rec {
   NIX_LDFLAGS = "-lfontconfig -lXcursor -lXinerama";
 
   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
-
     sed -i -e "s@/usr/bin/test@${coreutils}/bin/test@" \
       -e "s@/bin/ls@${coreutils}/bin/ls@" \
       openjdk/hotspot/make/linux/makefiles/sa.make
@@ -115,8 +92,6 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./cppflags-include-fix.patch
-    ./printf-fix.patch
-    ./linux-version-check-fix.patch
     ./no-crypto-restrictions.patch
   ];
 
@@ -126,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 = ''
@@ -170,4 +144,3 @@ stdenv.mkDerivation rec {
 
   passthru = { inherit architecture; };
 }
-
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 9d749a198e3f..000000000000
--- 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/printf-fix.patch b/pkgs/development/compilers/openjdk/printf-fix.patch
deleted file mode 100644
index 3d66962a1197..000000000000
--- 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/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index adffb7c50742..794a97b205fa 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -4,10 +4,11 @@ let
   s= # Generated upstream information
   rec {
     baseName="sbcl";
-    version="1.1.1";
+    version="1.1.3";
     name="${baseName}-${version}";
-    hash="1gkwz0248zl2nhx79ck5wiyxj8407c10gcrpgg1c67102pgyiikv";
-    url="mirror://sourceforge/project/sbcl/sbcl/1.1.1/sbcl-1.1.1-source.tar.bz2";
+    hash="1qy64fy0nvjdgzlmasswgvzg1b2h2rygnnjvlf9vj7wg16i5383i";
+    url="mirror://sourceforge/project/sbcl/sbcl/1.1.3/sbcl-1.1.3-source.tar.bz2";
+    sha256="1qy64fy0nvjdgzlmasswgvzg1b2h2rygnnjvlf9vj7wg16i5383i";
   };
   buildInputs = with a; [
     clisp makeWrapper
@@ -90,5 +91,3 @@ rec {
     inherit(s) version;
   };
 }
-
-
diff --git a/pkgs/development/compilers/tiger/builder.sh b/pkgs/development/compilers/tiger/builder.sh
deleted file mode 100644
index c602b5280f60..000000000000
--- 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 2fd297b8848a..000000000000
--- 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/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix
index 6c20ca714069..dbbe4a9dcc31 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/guile/default.nix b/pkgs/development/interpreters/guile/default.nix
index cc49ab87af89..e5c8f2685480 100644
--- a/pkgs/development/interpreters/guile/default.nix
+++ b/pkgs/development/interpreters/guile/default.nix
@@ -7,11 +7,11 @@
  else stdenv.mkDerivation)
 
 (rec {
-  name = "guile-2.0.6";
+  name = "guile-2.0.7";
 
   src = fetchurl {
     url = "mirror://gnu/guile/${name}.tar.xz";
-    sha256 = "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l";
+    sha256 = "0f53pxkia4v17n0avwqlcjpy0n89hkazm2xsa6p84lv8k6k8y9vg";
   };
 
   buildNativeInputs = [ makeWrapper gawk pkgconfig ];
diff --git a/pkgs/development/interpreters/hiphopvm/default.nix b/pkgs/development/interpreters/hiphopvm/default.nix
new file mode 100644
index 000000000000..d2cdf06f1385
--- /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, google_perftools
+, 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 google_perftools 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 000000000000..0dee06d00fd7
--- /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/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix
index e3dfd4711a17..8b1e1529095e 100644
--- a/pkgs/development/interpreters/lua-5/5.1.nix
+++ b/pkgs/development/interpreters/lua-5/5.1.nix
@@ -1,5 +1,12 @@
 { 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";
 
@@ -10,7 +17,19 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ readline ];
 
-  configurePhase = "makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux )";
+  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";
@@ -25,6 +44,6 @@ stdenv.mkDerivation rec {
     '';
     license = "MIT";
     platforms = stdenv.lib.platforms.unix;
-    maintainers = [ ];
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix
index e073a51c92da..014ce9d3b971 100644
--- a/pkgs/development/interpreters/php/5.3.nix
+++ b/pkgs/development/interpreters/php/5.3.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
-, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql
-, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng }:
+, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
+, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype }:
 
 composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
 
@@ -84,8 +84,8 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
       };
 
       gd = {
-        configureFlags = ["--with-gd=${gd}"];
-        buildInputs = [gd libpng libjpeg ];
+        configureFlags = ["--with-gd=${gd} --with-freetype-dir=${freetype}"];
+        buildInputs = [gd libpng libjpeg freetype];
       };
 
       soap = {
@@ -105,6 +105,11 @@ composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed)
         configureFlags = ["--enable-mbstring"];
       };
 
+      gettext = {
+        configureFlags = ["--with-gettext=${gettext}"];
+        buildInputs = [gettext];
+      };
+
       /*
          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.
diff --git a/pkgs/development/interpreters/php/fix.patch b/pkgs/development/interpreters/php/fix.patch
index 1cec8fea0fe2..02f2c9c6c93f 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/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix
index f87e1e3810f0..f264e4179e70 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 098603105410..9fb2ab377dfc 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/python-linkme-wrapper.nix b/pkgs/development/interpreters/python/python-linkme-wrapper.nix
new file mode 100644
index 000000000000..8d783a8c11ea
--- /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 000000000000..e6307d81ed44
--- /dev/null
+++ b/pkgs/development/interpreters/python/python-linkme-wrapper.sh
@@ -0,0 +1,34 @@
+#!/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=$(dirname "$1")
+  BIN=$(realpath -s "$BIN")
+  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 c9cf6277b244..000000000000
--- 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 e8e343976bc3..0f2f46cd568d 100644
--- a/pkgs/development/interpreters/python/wrapper.nix
+++ b/pkgs/development/interpreters/python/wrapper.nix
@@ -1,17 +1,17 @@
 # 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"
diff --git a/pkgs/development/interpreters/spidermonkey/builder.sh b/pkgs/development/interpreters/spidermonkey/builder.sh
deleted file mode 100644
index 91110159665c..000000000000
--- 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/toolbus/default.nix b/pkgs/development/interpreters/toolbus/default.nix
deleted file mode 100644
index eda55b069633..000000000000
--- 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/SDL_image/default.nix b/pkgs/development/libraries/SDL_image/default.nix
index 1ecb2f830826..8f0d59bc2122 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 fd4cdf7f7a49..000000000000
--- 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/apr-util/default.nix b/pkgs/development/libraries/apr-util/default.nix
index ad02f9b84cce..5f6291127e93 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/boost/1.52-headers.nix b/pkgs/development/libraries/boost/1.52-headers.nix
index b89273fdd305..72a4b419f2d5 100644
--- a/pkgs/development/libraries/boost/1.52-headers.nix
+++ b/pkgs/development/libraries/boost/1.52-headers.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   installPhase = ''
     mkdir -p $out/include
-    tar xf $src -C $out/include --strip-components=1 ./boost_1_52_0/boost
+    tar xf $src -C $out/include --strip-components=1 boost_1_52_0/boost
   '';
 
   meta = {
diff --git a/pkgs/development/libraries/boost/1.52.nix b/pkgs/development/libraries/boost/1.52.nix
index 0de11aaed87b..367c2426b782 100644
--- a/pkgs/development/libraries/boost/1.52.nix
+++ b/pkgs/development/libraries/boost/1.52.nix
@@ -63,7 +63,12 @@ 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 ];
diff --git a/pkgs/development/libraries/cil-aterm/atermprinter.patch b/pkgs/development/libraries/cil-aterm/atermprinter.patch
deleted file mode 100644
index 16761898e193..000000000000
--- 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 9df14593019e..000000000000
--- 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 13fecc801711..000000000000
--- 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/clucene-core/default.nix b/pkgs/development/libraries/clucene-core/default.nix
index d180c4761e88..abd6712736f5 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/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 30f3ab4907b0..000000000000
--- 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 2af59ac8d1e5..000000000000
--- 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 48b0d5d8cf64..000000000000
--- 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 e9cedf188575..000000000000
--- 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 dbbcf4388c5a..2504f87a230a 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 3833cc1e6c15..000000000000
--- 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 9833d79a726c..32d1c478a497 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 8f39de41e55b..43d1011ec0a1 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -14,10 +14,7 @@ stdenv.mkDerivation rec {
   ] ++ 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 ];
 
   # Unpack the thing in a subdirectory.
   unpackPhase = ''
diff --git a/pkgs/development/libraries/despotify/default.nix b/pkgs/development/libraries/despotify/default.nix
new file mode 100644
index 000000000000..13732d34e093
--- /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";
+
+  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/src-for-default.nix b/pkgs/development/libraries/directfb/src-for-default.nix
index c154ac68e4a1..a9c8c16a9d33 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/eigen/2.0.nix b/pkgs/development/libraries/eigen/2.0.nix
new file mode 100644
index 000000000000..6884aca16fcb
--- /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";
+  };
+  
+  buildNativeInputs = [ 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 6884aca16fcb..56f66aba8f8d 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,7 +9,7 @@ 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 ];
diff --git a/pkgs/development/libraries/ffmpeg/1.0.nix b/pkgs/development/libraries/ffmpeg/1.0.nix
index 7ac77ffdcb7a..d703fd8e3697 100644
--- a/pkgs/development/libraries/ffmpeg/1.0.nix
+++ b/pkgs/development/libraries/ffmpeg/1.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2
+{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2, alsaLib
 , mp3Support ? true, lame ? null
 , speexSupport ? true, speex ? null
 , theoraSupport ? true, libtheora ? null
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional dc1394Support "--enable-libdc1394"
     ++ stdenv.lib.optional x11grabSupport "--enable-x11grab";
 
-  buildInputs = [ pkgconfig lame yasm zlib bzip2 ]
+  buildInputs = [ pkgconfig lame yasm zlib bzip2 alsaLib ]
     ++ stdenv.lib.optional mp3Support lame
     ++ stdenv.lib.optional speexSupport speex
     ++ stdenv.lib.optional theoraSupport libtheora
diff --git a/pkgs/development/libraries/ffmpeg/1.1.nix b/pkgs/development/libraries/ffmpeg/1.1.nix
new file mode 100644
index 000000000000..6651f1783f80
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/1.1.nix
@@ -0,0 +1,85 @@
+{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2, alsaLib
+, 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
+, vdpauSupport ? true, libvdpau ? null
+, faacSupport ? false, faac ? null
+, dc1394Support ? false, libdc1394 ? null
+, x11grabSupport ? false, libXext ? null, libXfixes ? 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 vdpauSupport -> libvdpau != null;
+assert faacSupport -> faac != null;
+assert x11grabSupport -> libXext != null && libXfixes != null;
+
+stdenv.mkDerivation rec {
+  name = "ffmpeg-1.1";
+  
+  src = fetchurl {
+    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
+    sha256 = "03s1zsprz5p6gjgwwqcf7b6cvzwwid6l8k7bamx9i0f1iwkgdm0j";
+  };
+  
+  # `--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"
+    "--disable-ffplay"
+    "--enable-shared"
+    "--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 vdpauSupport "--enable-vdpau"
+    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
+    ++ stdenv.lib.optional dc1394Support "--enable-libdc1394"
+    ++ stdenv.lib.optional x11grabSupport "--enable-x11grab";
+
+  buildInputs = [ pkgconfig lame yasm zlib bzip2 alsaLib ]
+    ++ 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 vdpauSupport libvdpau
+    ++ stdenv.lib.optional faacSupport faac
+    ++ stdenv.lib.optional dc1394Support libdc1394
+    ++ stdenv.lib.optionals x11grabSupport [ libXext libXfixes ];
+
+  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/freeglut/freeglut-gcc-4.2.patch b/pkgs/development/libraries/freeglut/freeglut-gcc-4.2.patch
deleted file mode 100644
index 1642affba912..000000000000
--- 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/ftgl/2.1.2.nix b/pkgs/development/libraries/ftgl/2.1.2.nix
index 121f99e3b03a..c83173450b19 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/gmp/4.3.1.nix b/pkgs/development/libraries/gmp/4.3.1.nix
deleted file mode 100644
index 5f83d9ae46dc..000000000000
--- 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/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix
index ee566d46b658..a1c1f3f357f4 100644
--- a/pkgs/development/libraries/gnutls/default.nix
+++ b/pkgs/development/libraries/gnutls/default.nix
@@ -26,7 +26,10 @@ stdenv.mkDerivation (rec {
         else ""}
   '';
 
-  enableParallelBuilding = true;
+  # 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 ]
     ++ stdenv.lib.optional guileBindings guile;
@@ -37,7 +40,7 @@ stdenv.mkDerivation (rec {
 
   # 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 = {
     description = "The GNU Transport Layer Security Library";
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 51f4524811dd..000000000000
--- 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/gts/default.nix b/pkgs/development/libraries/gts/default.nix
index b3038d5eaddb..7eb519a045c3 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/haskell/Boolean/default.nix b/pkgs/development/libraries/haskell/Boolean/default.nix
index 45661b815b1e..4503c0fec548 100644
--- a/pkgs/development/libraries/haskell/Boolean/default.nix
+++ b/pkgs/development/libraries/haskell/Boolean/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "Boolean";
-  version = "0.1.1";
-  sha256 = "1id075slxgz67gv382vpr7cr19i59bjajvb60iv2xrhh73gp08yv";
+  version = "0.1.2";
+  sha256 = "07mhg9zf98hlm7qq9gdbrq68a8rpvdby1jwmgrvf3nv2k47dimx6";
   meta = {
     description = "Generalized booleans";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/Crypto/default.nix b/pkgs/development/libraries/haskell/Crypto/default.nix
index f93fbdcb6796..c7d10d0160d8 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 ];
diff --git a/pkgs/development/libraries/haskell/DAV/default.nix b/pkgs/development/libraries/haskell/DAV/default.nix
index 2ab6e29e226a..c10e56d11460 100644
--- a/pkgs/development/libraries/haskell/DAV/default.nix
+++ b/pkgs/development/libraries/haskell/DAV/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "DAV";
-  version = "0.2";
-  sha256 = "0g9b72ia4h85ykbng6103wc8f218fj9fdvm1896yx999vr95kxw4";
+  version = "0.3";
+  sha256 = "16qbq59g79a0a1n6vblndj1fknj9fvd0anhrsz9czwl3k3lk5cx8";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/DSH/default.nix b/pkgs/development/libraries/haskell/DSH/default.nix
index 32cf21242de6..409afcd45b07 100644
--- a/pkgs/development/libraries/haskell/DSH/default.nix
+++ b/pkgs/development/libraries/haskell/DSH/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "DSH";
-  version = "0.8.2.2";
-  sha256 = "0hjy8c97avi4wwv3p9gyml66n34mbrfrhb19j5y6vcy0y8ysgf0c";
+  version = "0.8.2.3";
+  sha256 = "0d5jh1vxjx3874rgwvxjm00lj3vvp8ggz2c54x6ymhmgav3pd8vy";
   buildDepends = [ csv FerryCore HaXml HDBC mtl Pathfinder text ];
   meta = {
     description = "Database Supported Haskell";
diff --git a/pkgs/development/libraries/haskell/Diff/default.nix b/pkgs/development/libraries/haskell/Diff/default.nix
index c28bef5cbd7e..86e219ac91d2 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.2.0";
+  sha256 = "15hdkrzwajnfcx8bj4jdcy4jli115g9v20msw1xyc9wnwrmbz97k";
   meta = {
     description = "O(ND) diff algorithm in haskell";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/Graphalyze/default.nix b/pkgs/development/libraries/haskell/Graphalyze/default.nix
index 90bcb9f8605d..489e338cba54 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.1";
-  sha256 = "1yk7iglsspbj0kxh5rhjkc6q65vz07vpygiig07w86g2s6gad8am";
+  version = "0.14.0.0";
+  sha256 = "027nxvv38cza6y6rivmvc9wpglbazkjrkyriwv3mn03pp21y53fg";
   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 d5dca127ca15..50994384c966 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 03000b688112..a8275c31b858 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/JuicyPixels/default.nix b/pkgs/development/libraries/haskell/JuicyPixels/default.nix
index 1f7d9067e751..c289c0092567 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 = "2.0.2";
-  sha256 = "14nqifdsdhzlfq29waqlwspyy37gp174vw368ph772zp9b0ngyff";
+  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, bitmap and gif)";
+    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/MemoTrie/default.nix b/pkgs/development/libraries/haskell/MemoTrie/default.nix
index 115ad935ae11..f3bd183d1373 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/X11/1.5.0.1.nix b/pkgs/development/libraries/haskell/X11/1.5.0.1.nix
deleted file mode 100644
index e36b940e923c..000000000000
--- 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.2.nix b/pkgs/development/libraries/haskell/X11/default.nix
index dff5bca4400b..dff5bca4400b 100644
--- a/pkgs/development/libraries/haskell/X11/1.6.0.2.nix
+++ b/pkgs/development/libraries/haskell/X11/default.nix
diff --git a/pkgs/development/libraries/haskell/active/default.nix b/pkgs/development/libraries/haskell/active/default.nix
index 5c563ad9cd73..d3307d0a30d3 100644
--- a/pkgs/development/libraries/haskell/active/default.nix
+++ b/pkgs/development/libraries/haskell/active/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "active";
-  version = "0.1.0.2";
-  sha256 = "1iymh3sd21ba7ijwv5afphn5vhmwchk6725hbcsdwk2d2x2gd674";
+  version = "0.1.0.3";
+  sha256 = "0jarc270z6raak1vz30jy2gl0pkj9a2x3ib5hq7vsl2ljbvbgyqi";
   buildDepends = [ newtype semigroupoids semigroups vectorSpace ];
+  jailbreak = true;
   meta = {
     description = "Abstractions for animation";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/aeson/default.nix b/pkgs/development/libraries/haskell/aeson/default.nix
index c1cacb9eaa35..b0f89619b1c5 100644
--- a/pkgs/development/libraries/haskell/aeson/default.nix
+++ b/pkgs/development/libraries/haskell/aeson/default.nix
@@ -4,8 +4,8 @@
 
 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
diff --git a/pkgs/development/libraries/haskell/ansi-terminal/default.nix b/pkgs/development/libraries/haskell/ansi-terminal/default.nix
index 90a0a9b2b00e..6d598f29ec95 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 f34fcf6559d3..bfccdcffd746 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/attoparsec-binary/attoparsec-binary-ghc7.6.1.patch b/pkgs/development/libraries/haskell/attoparsec-binary/attoparsec-binary-ghc7.6.1.patch
deleted file mode 100644
index dae949b25708..000000000000
--- a/pkgs/development/libraries/haskell/attoparsec-binary/attoparsec-binary-ghc7.6.1.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/Data/Attoparsec/Binary.hs b/Data/Attoparsec/Binary.hs
-index fab76c6..01d6c8b 100644
---- a/Data/Attoparsec/Binary.hs
-+++ b/Data/Attoparsec/Binary.hs
-@@ -23,7 +23,7 @@ import Data.Word
- byteSize :: (Bits a) => a -> Int
- byteSize = (`div` 8) . bitSize
- 
--pack :: (Bits a) => B.ByteString -> a
-+pack :: (Bits a, Num a) => B.ByteString -> a
- pack = B.foldl' (\n h -> (n `shiftL` 8) .|. fromIntegral h) 0
- 
- anyWordN :: (Bits a) => (B.ByteString -> a) -> Parser a
-@@ -84,4 +84,4 @@ word64be = wordN unpack
- 
- -- |Match a specific 64-bit little-endian word.
- word64le :: Word64 -> Parser Word64
--word64le = wordN $ B.reverse . unpack
-\ No newline at end of file
-+word64le = wordN $ B.reverse . unpack
diff --git a/pkgs/development/libraries/haskell/attoparsec/default.nix b/pkgs/development/libraries/haskell/attoparsec/default.nix
index 6f923605b678..e7bb666e677e 100644
--- a/pkgs/development/libraries/haskell/attoparsec/default.nix
+++ b/pkgs/development/libraries/haskell/attoparsec/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "attoparsec";
-  version = "0.10.2.0";
-  sha256 = "0hvkx63knhxdc06lkv2avz2dblbvn0hhvckfqyr22ls1qrpgz71c";
+  version = "0.10.3.0";
+  sha256 = "1l4cnfgnynrprfvx0p3n6kca8arsmvb1yxb9ir782rrk537jci50";
   buildDepends = [ deepseq text ];
   meta = {
     homepage = "https://github.com/bos/attoparsec";
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 000000000000..851dda488dcd
--- /dev/null
+++ b/pkgs/development/libraries/haskell/base64-conduit/default.nix
@@ -0,0 +1,14 @@
+{ cabal, base64Bytestring, conduit }:
+
+cabal.mkDerivation (self: {
+  pname = "base64-conduit";
+  version = "0.5.1";
+  sha256 = "1zmp6iv55rac7x7w59az7zaarq79fr7zvgg2wcb5b627axlw909l";
+  buildDepends = [ base64Bytestring conduit ];
+  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
index c30f3f5c7e04..df00aff549f9 100644
--- a/pkgs/development/libraries/haskell/basic-prelude/default.nix
+++ b/pkgs/development/libraries/haskell/basic-prelude/default.nix
@@ -1,13 +1,13 @@
-{ cabal, hashable, ReadArgs, systemFilepath, text, transformers
-, unorderedContainers, vector
+{ cabal, hashable, liftedBase, ReadArgs, systemFilepath, text
+, transformers, unorderedContainers, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "basic-prelude";
-  version = "0.3.1.0";
-  sha256 = "15k89z78zjhga36wrvfn8b17hsmlwr1na6xq0gmimivfrdlnz5j0";
+  version = "0.3.2.0";
+  sha256 = "1sdwkh9xrsx8v96d06jll7cqc0p6ykv2y9gnjzpbfx0k3ns69kcj";
   buildDepends = [
-    hashable ReadArgs systemFilepath text transformers
+    hashable liftedBase ReadArgs systemFilepath text transformers
     unorderedContainers vector
   ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/bifunctors/default.nix b/pkgs/development/libraries/haskell/bifunctors/default.nix
new file mode 100644
index 000000000000..b4de19104659
--- /dev/null
+++ b/pkgs/development/libraries/haskell/bifunctors/default.nix
@@ -0,0 +1,14 @@
+{ cabal, semigroupoids, semigroups }:
+
+cabal.mkDerivation (self: {
+  pname = "bifunctors";
+  version = "3.0.3";
+  sha256 = "1nmrwc9n9qkj9w9c38ja0had32isr6v35j1v19fhqdwk5ddbpxp4";
+  buildDepends = [ semigroupoids semigroups ];
+  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/default.nix b/pkgs/development/libraries/haskell/binary/default.nix
index ed2414a500cc..ef95d13809f1 100644
--- a/pkgs/development/libraries/haskell/binary/default.nix
+++ b/pkgs/development/libraries/haskell/binary/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "binary";
-  version = "0.6.3.0";
-  sha256 = "0gynhyamhvffy2z88xzi56kf57pd5d6534n7w0m11qq4188w0zai";
+  version = "0.6.4.0";
+  sha256 = "0vq80fzhwil5bx4a2vbd3jvfh1awhg1pwxgvq3lvbi37yzl0ydgh";
   meta = {
     homepage = "https://github.com/kolmodin/binary";
     description = "Binary serialisation for Haskell values using lazy ByteStrings";
diff --git a/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix b/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix
index e6b8785b6a92..a9568dde4963 100644
--- a/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "blaze-builder-conduit";
-  version = "0.5.0.2";
-  sha256 = "0ynkz822zxp1m02fp9l572d8j8xi5r9j1bg6zs2671m81h22d4in";
+  version = "0.5.0.3";
+  sha256 = "0dbymh29zg0bvhlmai5s6qiqypx46hmlg375jpcq1597vzaanwnw";
   buildDepends = [ blazeBuilder conduit text transformers ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
diff --git a/pkgs/development/libraries/haskell/blaze-html/default.nix b/pkgs/development/libraries/haskell/blaze-html/default.nix
index c2505aeb72fa..63859d5e91f5 100644
--- a/pkgs/development/libraries/haskell/blaze-html/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-html/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "blaze-html";
-  version = "0.5.1.0";
-  sha256 = "1f256z68pbm1h6wsk33p94byxwfp01i4pbdrch32jdi1q35cmqxh";
+  version = "0.5.1.3";
+  sha256 = "0ia7pk346lc7664w859q09p163cxgxjjpkk7cbmbl1wj2shshh1w";
   buildDepends = [ blazeBuilder blazeMarkup text ];
   meta = {
     homepage = "http://jaspervdj.be/blaze";
diff --git a/pkgs/development/libraries/haskell/blaze-markup/default.nix b/pkgs/development/libraries/haskell/blaze-markup/default.nix
index 1f6a83894cc6..becd1a24ec60 100644
--- a/pkgs/development/libraries/haskell/blaze-markup/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-markup/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "blaze-markup";
-  version = "0.5.1.1";
-  sha256 = "14va7db8icf2xj7v4i5z0srgv74pf8z6w7046lxs3cyj5pcjl2r9";
+  version = "0.5.1.4";
+  sha256 = "0g316qhk7yv6y680w93613apfhm458a01g3jmq42yv4ndydkv4rr";
   buildDepends = [ blazeBuilder text ];
   meta = {
     homepage = "http://jaspervdj.be/blaze";
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 000000000000..7b3ec55dc577
--- /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/bloomfilter/default.nix b/pkgs/development/libraries/haskell/bloomfilter/default.nix
index 2545c3f4f407..7c8c2d348498 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 e018ac7a8d28..e018ac7a8d28 100644
--- a/pkgs/development/libraries/haskell/bmp/default.nix
+++ b/pkgs/development/libraries/haskell/bmp/1.2.2.1.nix
diff --git a/pkgs/development/libraries/haskell/bmp/1.2.3.4.nix b/pkgs/development/libraries/haskell/bmp/1.2.3.4.nix
new file mode 100644
index 000000000000..404229cf7636
--- /dev/null
+++ b/pkgs/development/libraries/haskell/bmp/1.2.3.4.nix
@@ -0,0 +1,15 @@
+{ cabal, binary }:
+
+cabal.mkDerivation (self: {
+  pname = "bmp";
+  version = "1.2.3.4";
+  sha256 = "134nfchsw4q1k3kr09i5w8jxbr659as4523gs5m2dch15wrmrhf6";
+  buildDepends = [ binary ];
+  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/bytestring-nums/default.nix b/pkgs/development/libraries/haskell/bytestring-nums/default.nix
index 9659bea3f776..e78a64781518 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/case-insensitive/default.nix b/pkgs/development/libraries/haskell/case-insensitive/default.nix
index 7f53773f1ab6..7f972dfd6551 100644
--- a/pkgs/development/libraries/haskell/case-insensitive/default.nix
+++ b/pkgs/development/libraries/haskell/case-insensitive/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "case-insensitive";
-  version = "0.4.0.3";
-  sha256 = "1lpfxfwfxiimvh5nxqrnjqj2687dp7rmv9wkrpmw2zm5wkxwcmzf";
+  version = "0.4.0.4";
+  sha256 = "1xzpri688vbd6fvvxczqx8bv53009ygzws7vbjmj2q97wcm8nmwd";
   buildDepends = [ hashable text ];
   meta = {
     homepage = "https://github.com/basvandijk/case-insensitive";
diff --git a/pkgs/development/libraries/haskell/cautious-file/default.nix b/pkgs/development/libraries/haskell/cautious-file/default.nix
index bbdb6d350c8b..aa6e87565aee 100644
--- a/pkgs/development/libraries/haskell/cautious-file/default.nix
+++ b/pkgs/development/libraries/haskell/cautious-file/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cautious-file";
-  version = "1.0.1";
-  sha256 = "0mlgchvdhw9lhml4pqmxxvx1zcqmkcyl3yx6w3zp0df200njzsws";
+  version = "1.0.2";
+  sha256 = "1sw5ngwrarq1lsd4c6v2wdmgbhkkq6kpybb62r8ccm11ddgn3yiq";
   buildDepends = [ filepath ];
   meta = {
     description = "Ways to write a file cautiously, to reduce the chances of problems such as data loss due to crashes or power failures";
diff --git a/pkgs/development/libraries/haskell/certificate/default.nix b/pkgs/development/libraries/haskell/certificate/default.nix
index eb40a4744f9c..036e7ddc124c 100644
--- a/pkgs/development/libraries/haskell/certificate/default.nix
+++ b/pkgs/development/libraries/haskell/certificate/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "certificate";
-  version = "1.3.3";
-  sha256 = "043xj3xd6cfnbg9hw2f8agckww3fasvraa72jw84zqc7l2gq0rq2";
+  version = "1.3.5";
+  sha256 = "17g2alyib89y2k8jjg4b6jskz0ndpr92yi8hzra7vw7ygfi5mi4j";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/cipher-aes/default.nix b/pkgs/development/libraries/haskell/cipher-aes/default.nix
index 42152bfb0d77..bae237375854 100644
--- a/pkgs/development/libraries/haskell/cipher-aes/default.nix
+++ b/pkgs/development/libraries/haskell/cipher-aes/default.nix
@@ -2,10 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cipher-aes";
-  version = "0.1.2";
-  sha256 = "1c8drabfmx5wc519kxsr64bdvakfvxwzhfh7ym01kk1dpja0nlnq";
-  isLibrary = true;
-  isExecutable = true;
+  version = "0.1.7";
+  sha256 = "1iai9c4rvxframylvc0xwx2nk6s0rsj4dc42wi334xyinilvfyng";
   meta = {
     homepage = "http://github.com/vincenthz/hs-cipher-aes";
     description = "Fast AES cipher implementation with advanced mode of operations";
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 000000000000..234491cde368
--- /dev/null
+++ b/pkgs/development/libraries/haskell/cipher-rc4/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "cipher-rc4";
+  version = "0.1.2";
+  sha256 = "0nyrqms7h3hq236h03sjjjqdcxn3iz3fg4ifqj43f4nb8gv0ifb1";
+  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/citeproc-hs/default.nix b/pkgs/development/libraries/haskell/citeproc-hs/default.nix
index 027fe75033a4..b62714749e3f 100644
--- a/pkgs/development/libraries/haskell/citeproc-hs/default.nix
+++ b/pkgs/development/libraries/haskell/citeproc-hs/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "citeproc-hs";
-  version = "0.3.6";
-  sha256 = "0zxwca3i7gg1vhdvrxd15c8zgx1gy3y7zjj746bcvf8pwavkq5q2";
+  version = "0.3.7";
+  sha256 = "0ix9y7z8m8x4l10h96fgv820grywvwcp3019wxjja4y4w6irid3b";
   buildDepends = [
     filepath hexpat hsBibutils HTTP json mtl network pandocTypes parsec
     syb time utf8String
diff --git a/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix b/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
index 31c7eecaa6ec..c167f191d4d3 100644
--- a/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
@@ -1,10 +1,15 @@
-{ cabal, classyPrelude, conduit, xmlConduit }:
+{ cabal, classyPrelude, conduit, monadControl, resourcet
+, transformers, void, xmlConduit
+}:
 
 cabal.mkDerivation (self: {
   pname = "classy-prelude-conduit";
-  version = "0.4.1";
-  sha256 = "0llir0xnnyhgxifay019x64jw7mnn9p1sqs1xwm14gjcqr2nqqg8";
-  buildDepends = [ classyPrelude conduit xmlConduit ];
+  version = "0.4.3";
+  sha256 = "0ny4si6z6i6g6khcg9d3m9wks42sqh8i8kpgghhdwd37v32l3f34";
+  buildDepends = [
+    classyPrelude conduit monadControl resourcet transformers void
+    xmlConduit
+  ];
   meta = {
     homepage = "https://github.com/snoyberg/classy-prelude";
     description = "conduit instances for classy-prelude";
diff --git a/pkgs/development/libraries/haskell/classy-prelude/default.nix b/pkgs/development/libraries/haskell/classy-prelude/default.nix
index 8c5a94d4d127..9f8893bf72fa 100644
--- a/pkgs/development/libraries/haskell/classy-prelude/default.nix
+++ b/pkgs/development/libraries/haskell/classy-prelude/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "classy-prelude";
-  version = "0.4.1";
-  sha256 = "14s1qirss8qbicdw4bc7smdnk1xrpp1xsii8kgmrb1z4ji0h9bf1";
+  version = "0.4.3";
+  sha256 = "1k2iszja03s8azypl8lpkdjvvqsgzg73cl1wp4jl2fqp1psqv36q";
   buildDepends = [
     basicPrelude hashable systemFilepath text transformers
     unorderedContainers vector
diff --git a/pkgs/development/libraries/haskell/clientsession/default.nix b/pkgs/development/libraries/haskell/clientsession/default.nix
index 03d3896e8531..81ae5ebddb09 100644
--- a/pkgs/development/libraries/haskell/clientsession/default.nix
+++ b/pkgs/development/libraries/haskell/clientsession/default.nix
@@ -1,14 +1,14 @@
-{ cabal, base64Bytestring, cereal, cprngAes, cryptoApi
-, cryptocipher, entropy, skein, tagged
+{ cabal, base64Bytestring, cereal, cipherAes, cprngAes, cryptoApi
+, entropy, skein, tagged
 }:
 
 cabal.mkDerivation (self: {
   pname = "clientsession";
-  version = "0.8.0.1";
-  sha256 = "0r6j15wkyp4akhaxvimjxlwdka7cbm3c3nfk5bvkqan1nrip5rxv";
+  version = "0.8.1";
+  sha256 = "1x4qfm4hkvm3xmn7hnvcx1j900g97qhks66xzik1wvsjy3piwpgd";
   buildDepends = [
-    base64Bytestring cereal cprngAes cryptoApi cryptocipher entropy
-    skein tagged
+    base64Bytestring cereal cipherAes cprngAes cryptoApi entropy skein
+    tagged
   ];
   meta = {
     homepage = "http://github.com/yesodweb/clientsession/tree/master";
diff --git a/pkgs/development/libraries/haskell/comonad-transformers/default.nix b/pkgs/development/libraries/haskell/comonad-transformers/default.nix
index bc378235b91a..3a56b37edf9b 100644
--- a/pkgs/development/libraries/haskell/comonad-transformers/default.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.1";
+  sha256 = "1lmcz01zsgy0lfzsznqbdq83vlk6h10zs7i41nav8qhzzhjn095j";
   buildDepends = [
     comonad contravariant distributive semigroupoids semigroups
     transformers
diff --git a/pkgs/development/libraries/haskell/comonad/default.nix b/pkgs/development/libraries/haskell/comonad/default.nix
index 3394de012060..b37ffdf596e1 100644
--- a/pkgs/development/libraries/haskell/comonad/default.nix
+++ b/pkgs/development/libraries/haskell/comonad/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "comonad";
-  version = "3.0.0.2";
-  sha256 = "01q71b446mdbdj81qjrxjl5bshbg4bjih5zpw9fd4y5431bclfhi";
+  version = "3.0.1.1";
+  sha256 = "01zqxrqxy6x6nf6rynzmncbhlgbbpshhw10pkimnw5isg3b8qhc2";
   buildDepends = [ semigroups transformers ];
   meta = {
     homepage = "http://github.com/ekmett/comonad/";
diff --git a/pkgs/development/libraries/haskell/comonads-fd/default.nix b/pkgs/development/libraries/haskell/comonads-fd/default.nix
index 26a18c667a2b..5921d8b07d39 100644
--- a/pkgs/development/libraries/haskell/comonads-fd/default.nix
+++ b/pkgs/development/libraries/haskell/comonads-fd/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "comonads-fd";
-  version = "3.0";
-  sha256 = "1j5ymj711c49fsk2ilxfpzqr0jr117z8kb5ggyh5nlwjy16m32in";
+  version = "3.0.1";
+  sha256 = "0ap9sw7h130bza43091mbl9a5bsin6342zawgycdcsag49wm3dyy";
   buildDepends = [
     comonad comonadTransformers mtl semigroups transformers
   ];
diff --git a/pkgs/development/libraries/haskell/conduit/default.nix b/pkgs/development/libraries/haskell/conduit/default.nix
index 9263bb0c893e..74827d407b74 100644
--- a/pkgs/development/libraries/haskell/conduit/default.nix
+++ b/pkgs/development/libraries/haskell/conduit/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "conduit";
-  version = "0.5.4.1";
-  sha256 = "00fx4v9phclyg8ybz22w8053pfvy92nibx5g3c6h37hhn7hnsxh4";
+  version = "0.5.6";
+  sha256 = "1a5apcds3jjksz7hzw4ag725796axqk9nm5fhn5i4l82zphq2cxs";
   buildDepends = [
     liftedBase monadControl resourcet text transformers
     transformersBase void
diff --git a/pkgs/development/libraries/haskell/configurator/default.nix b/pkgs/development/libraries/haskell/configurator/default.nix
index 3618f5980554..775c2e5027f8 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.1";
-  sha256 = "02w6f5q2xkpc3kgqz6a58g7yr0q4xd8ck1b6lr64ahvqwsjbxy6p";
+  version = "0.2.0.2";
+  sha256 = "011rgd48gv4idkh2dwg4mlyx3s6pgm1263xq5ixsa4sg3jqh9d8b";
   buildDepends = [
     attoparsec hashable text unixCompat unorderedContainers
   ];
diff --git a/pkgs/development/libraries/haskell/cprng-aes/default.nix b/pkgs/development/libraries/haskell/cprng-aes/default.nix
index 1feb21a8b638..4f2aa58b7d29 100644
--- a/pkgs/development/libraries/haskell/cprng-aes/default.nix
+++ b/pkgs/development/libraries/haskell/cprng-aes/default.nix
@@ -1,13 +1,11 @@
-{ cabal, cereal, cipherAes, cryptoApi, cryptocipher, entropy
-, random
-}:
+{ cabal, cipherAes, cryptoApi, cryptoRandomApi, entropy, random }:
 
 cabal.mkDerivation (self: {
   pname = "cprng-aes";
-  version = "0.2.4";
-  sha256 = "0rk14yj76p5a1h6jlz4q2fgijjid430lwcr57zkkda8mdibqqs5j";
+  version = "0.3.4";
+  sha256 = "0k1zh4nw30qgdrkgn6x6zfbpp129f9cparzyqsdqfbf44j0mf2rw";
   buildDepends = [
-    cereal cipherAes cryptoApi cryptocipher entropy random
+    cipherAes cryptoApi cryptoRandomApi entropy random
   ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-cprng-aes";
diff --git a/pkgs/development/libraries/haskell/crypto-conduit/default.nix b/pkgs/development/libraries/haskell/crypto-conduit/default.nix
index 539fa3b192f3..d22bfa840e78 100644
--- a/pkgs/development/libraries/haskell/crypto-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/crypto-conduit/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "crypto-conduit";
-  version = "0.4.0.1";
-  sha256 = "1afkn9kp5y1qsgd2l2q85d2bh0wbvn07x0ddi72sr8g7daw8zrs8";
+  version = "0.4.3";
+  sha256 = "0h9dmr88hqmz2876mlnzz8s5kmi368zs9pljvvmb9vn7m44gpyrk";
   buildDepends = [ cereal conduit cryptoApi transformers ];
   meta = {
     homepage = "https://github.com/meteficha/crypto-conduit";
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 000000000000..70cd3f44252a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/crypto-numbers/default.nix
@@ -0,0 +1,14 @@
+{ cabal, cryptoRandomApi, vector }:
+
+cabal.mkDerivation (self: {
+  pname = "crypto-numbers";
+  version = "0.1.3";
+  sha256 = "115lgnay3ly5r53flh3v5jygqks0rg1i8qmbvrqf9nkmnmw6a5x1";
+  buildDepends = [ cryptoRandomApi 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/default.nix b/pkgs/development/libraries/haskell/crypto-pubkey/default.nix
new file mode 100644
index 000000000000..dc6d83a765de
--- /dev/null
+++ b/pkgs/development/libraries/haskell/crypto-pubkey/default.nix
@@ -0,0 +1,18 @@
+{ cabal, cryptohash, cryptoNumbers, cryptoPubkeyTypes
+, cryptoRandomApi
+}:
+
+cabal.mkDerivation (self: {
+  pname = "crypto-pubkey";
+  version = "0.1.2";
+  sha256 = "1law5l7j0r0v89dnibmaipjp0yshffq10xs4rvg2j247v29lhns5";
+  buildDepends = [
+    cryptohash cryptoNumbers cryptoPubkeyTypes cryptoRandomApi
+  ];
+  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 000000000000..7c3b10a38386
--- /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 b464180ca550..275622d3cad8 100644
--- a/pkgs/development/libraries/haskell/cryptocipher/default.nix
+++ b/pkgs/development/libraries/haskell/cryptocipher/default.nix
@@ -1,19 +1,20 @@
-{ cabal, cereal, cpu, cryptoApi, cryptoPubkeyTypes, primitive
-, tagged, vector
+{ cabal, cereal, cipherAes, cipherRc4, cpu, cryptoApi
+, cryptoPubkeyTypes, primitive, tagged, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "cryptocipher";
-  version = "0.3.6";
-  sha256 = "0r2alw0in0ndaz7y9bzqigla74wbn8h1z43s2zx5rc3sq5p3rp6s";
+  version = "0.4.0";
+  sha256 = "1qbnhzbzypin7h62sn2sibij7clsgmaiq24q3xhgbjrirb6bhqf0";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    cereal cpu cryptoApi cryptoPubkeyTypes primitive tagged vector
+    cereal cipherAes cipherRc4 cpu cryptoApi cryptoPubkeyTypes
+    primitive tagged 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/default.nix b/pkgs/development/libraries/haskell/cryptohash/default.nix
index eed282624704..2dc0cad97729 100644
--- a/pkgs/development/libraries/haskell/cryptohash/default.nix
+++ b/pkgs/development/libraries/haskell/cryptohash/default.nix
@@ -2,10 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cryptohash";
-  version = "0.7.8";
-  sha256 = "0n9m5gl3hfkx0p0mg05k7317vjqqx5aynandg428pcgcjkpbfv9g";
-  isLibrary = true;
-  isExecutable = true;
+  version = "0.8.3";
+  sha256 = "1fcqbbclii2hmbhi7h64v0nnbc34zzs107m3lqq38iiyy5fvqqv2";
   buildDepends = [ cereal cryptoApi tagged ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-cryptohash";
diff --git a/pkgs/development/libraries/haskell/dataenc/default.nix b/pkgs/development/libraries/haskell/dataenc/default.nix
index 2ece14dcfdc3..9c4de4a1b84d 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.4";
-  sha256 = "0xnn90nyz4m0rbzykkr5p9270s8dq2bfiz5j7qyzyy5m8vbl15bw";
+  version = "0.14.0.5";
+  sha256 = "13gajqbayar7x8sq3rw93i277gqd0bx1i34spshlj4b41fraxc8w";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/diagrams/cairo.nix b/pkgs/development/libraries/haskell/diagrams/cairo.nix
index f23be1ebfb18..bc2abf5c16d5 100644
--- a/pkgs/development/libraries/haskell/diagrams/cairo.nix
+++ b/pkgs/development/libraries/haskell/diagrams/cairo.nix
@@ -1,15 +1,15 @@
-{ cabal, cairo, cmdargs, diagramsCore, diagramsLib, filepath, gtk
-, mtl, split
+{ cabal, cairo, cmdargs, colour, diagramsCore, diagramsLib
+, filepath, mtl, split, time
 }:
 
 cabal.mkDerivation (self: {
   pname = "diagrams-cairo";
-  version = "0.5.0.2";
-  sha256 = "1wwk65c2cx7rkhmai5spms791fjhl3snwhj0w9399q8pgj6g4lj8";
+  version = "0.6";
+  sha256 = "0fxqwkv2cpgpkr80q828rm91ybn7j0dwj1p5ysc3648w28jvhkil";
   buildDepends = [
-    cairo cmdargs diagramsCore diagramsLib filepath gtk mtl split
+    cairo cmdargs colour diagramsCore diagramsLib filepath mtl split
+    time
   ];
-  jailbreak = true;
   meta = {
     homepage = "http://projects.haskell.org/diagrams";
     description = "Cairo backend for diagrams drawing EDSL";
diff --git a/pkgs/development/libraries/haskell/diagrams/contrib.nix b/pkgs/development/libraries/haskell/diagrams/contrib.nix
new file mode 100644
index 000000000000..85b1360c3662
--- /dev/null
+++ b/pkgs/development/libraries/haskell/diagrams/contrib.nix
@@ -0,0 +1,18 @@
+{ cabal, colour, dataDefault, diagramsLib, forceLayout, lens, mtl
+, vectorSpace
+}:
+
+cabal.mkDerivation (self: {
+  pname = "diagrams-contrib";
+  version = "0.6.0.2";
+  sha256 = "1lj99a46r12zjwmpkn7vj04wapfgdlmw05jwb5lnhy9hxqgcsgng";
+  buildDepends = [
+    colour dataDefault diagramsLib forceLayout lens mtl vectorSpace
+  ];
+  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
index 365e27371319..c087e27d025d 100644
--- a/pkgs/development/libraries/haskell/diagrams/core.nix
+++ b/pkgs/development/libraries/haskell/diagrams/core.nix
@@ -1,14 +1,16 @@
-{ cabal, MemoTrie, newtype, semigroups, vectorSpace
-, vectorSpacePoints
+{ cabal, dualTree, MemoTrie, monoidExtras, newtype, semigroups
+, vectorSpace, vectorSpacePoints
 }:
 
 cabal.mkDerivation (self: {
   pname = "diagrams-core";
-  version = "0.5.0.1";
-  sha256 = "073fk9cxm1kh92alr51dgwps9wxc5w3470axc6q7w91sk5cskpxy";
+  version = "0.6.0.1";
+  sha256 = "0kw0rxk9a2zkpnbx4bfd0japm75y29ldvdn7i3c93kvz0p6jc2wa";
   buildDepends = [
-    MemoTrie newtype semigroups vectorSpace vectorSpacePoints
+    dualTree MemoTrie monoidExtras newtype semigroups vectorSpace
+    vectorSpacePoints
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://projects.haskell.org/diagrams";
     description = "Core libraries for diagrams EDSL";
diff --git a/pkgs/development/libraries/haskell/diagrams/diagrams.nix b/pkgs/development/libraries/haskell/diagrams/diagrams.nix
index 21c3a7a28f60..293cdab1f9ef 100644
--- a/pkgs/development/libraries/haskell/diagrams/diagrams.nix
+++ b/pkgs/development/libraries/haskell/diagrams/diagrams.nix
@@ -1,10 +1,12 @@
-{ cabal, diagramsCairo, diagramsCore, diagramsLib }:
+{ cabal, diagramsContrib, diagramsCore, diagramsLib, diagramsSvg }:
 
 cabal.mkDerivation (self: {
   pname = "diagrams";
-  version = "0.5";
-  sha256 = "163h2fg3gpmsfm57gjyja2rxh9pl6s3xnzlidfdy201zbk1mzdg5";
-  buildDepends = [ diagramsCairo diagramsCore diagramsLib ];
+  version = "0.6";
+  sha256 = "1i62jbixjzw82y622ymp6lrp4kzgn7iv55arivvh0y46bbmybqvh";
+  buildDepends = [
+    diagramsContrib diagramsCore diagramsLib diagramsSvg
+  ];
   noHaddock = true;
   meta = {
     homepage = "http://projects.haskell.org/diagrams";
diff --git a/pkgs/development/libraries/haskell/diagrams/lib.nix b/pkgs/development/libraries/haskell/diagrams/lib.nix
index d5c386c1e1f7..1bd77db85803 100644
--- a/pkgs/development/libraries/haskell/diagrams/lib.nix
+++ b/pkgs/development/libraries/haskell/diagrams/lib.nix
@@ -1,15 +1,16 @@
-{ cabal, active, colour, dataDefault, diagramsCore, newtype
-, NumInstances, semigroups, vectorSpace
+{ cabal, active, colour, dataDefault, diagramsCore, monoidExtras
+, newtype, NumInstances, semigroups, vectorSpace
 }:
 
 cabal.mkDerivation (self: {
   pname = "diagrams-lib";
-  version = "0.5.0.1";
-  sha256 = "0spfsllr2z064cxkdqcij02f0ikxxmll2dqj7rfikp4738wj21dy";
+  version = "0.6.0.1";
+  sha256 = "00ysdppl2jv0kspj0pjy8qj8shc9gg6g10lkq62vlvr39wnxx6yj";
   buildDepends = [
-    active colour dataDefault diagramsCore newtype NumInstances
-    semigroups vectorSpace
+    active colour dataDefault diagramsCore monoidExtras newtype
+    NumInstances semigroups vectorSpace
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://projects.haskell.org/diagrams";
     description = "Embedded domain-specific language for declarative graphics";
diff --git a/pkgs/development/libraries/haskell/diagrams/svg.nix b/pkgs/development/libraries/haskell/diagrams/svg.nix
new file mode 100644
index 000000000000..561f32118c22
--- /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/digestive-functors-heist/default.nix b/pkgs/development/libraries/haskell/digestive-functors-heist/default.nix
index acc75a3552a2..08a9f09be3ad 100644
--- a/pkgs/development/libraries/haskell/digestive-functors-heist/default.nix
+++ b/pkgs/development/libraries/haskell/digestive-functors-heist/default.nix
@@ -1,10 +1,10 @@
-{ cabal, digestiveFunctors, heist, text, xmlhtml }:
+{ cabal, 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.6.0.0";
+  sha256 = "17qndqsk09fvnvyhhw3xbbjjhfyyp4sivc898vqllyyky0wqmrdk";
+  buildDepends = [ 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 2d7fdada4285..f23ee6d06910 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.2";
-  sha256 = "0xx5i09l8n1srdmslq0sq1h366cdq3xqxwjd3kp2ck9s6x65zyjz";
+  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 cce033eaf29b..df474e632719 100644
--- a/pkgs/development/libraries/haskell/digestive-functors/default.nix
+++ b/pkgs/development/libraries/haskell/digestive-functors/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "digestive-functors";
-  version = "0.5.0.4";
-  sha256 = "0diaj1pmfmhwbyjmw49kna59f7dckwrp16cbar5xpcn9k2pf19nv";
+  version = "0.6.0.0";
+  sha256 = "1h56nl1rszm098gwrdhm5w63mrnfjp1brfrk5hlj238nmj0djgcd";
   buildDepends = [ mtl text ];
   meta = {
     homepage = "http://github.com/jaspervdj/digestive-functors";
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 000000000000..70995ecb3ce7
--- /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/distributive/default.nix b/pkgs/development/libraries/haskell/distributive/default.nix
index a8b07c608d8a..6709569b0540 100644
--- a/pkgs/development/libraries/haskell/distributive/default.nix
+++ b/pkgs/development/libraries/haskell/distributive/default.nix
@@ -1,10 +1,10 @@
-{ cabal, transformers }:
+{ cabal, transformers, transformersCompat }:
 
 cabal.mkDerivation (self: {
   pname = "distributive";
-  version = "0.2.2";
-  sha256 = "13wvr2wb3h2nr1qd3dwjqx0b6g4igjqm3q2cyi4mc41gwihkbhr2";
-  buildDepends = [ transformers ];
+  version = "0.3";
+  sha256 = "0z6vwak2n91vpx9ps9j1pbiw0zlh9jmds84yx1yqssbqx8npi32f";
+  buildDepends = [ transformers transformersCompat ];
   meta = {
     homepage = "http://github.com/ekmett/distributive/";
     description = "Haskell 98 Distributive functors -- Dual to Traversable";
diff --git a/pkgs/development/libraries/haskell/doctest/default.nix b/pkgs/development/libraries/haskell/doctest/default.nix
new file mode 100644
index 000000000000..df92c4a6cf50
--- /dev/null
+++ b/pkgs/development/libraries/haskell/doctest/default.nix
@@ -0,0 +1,16 @@
+{ cabal, deepseq, filepath, ghcPaths, syb, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "doctest";
+  version = "0.9.5";
+  sha256 = "073q56gyhkb7r4f94b9nx341dkmgapy8gig7f668jkghv2zci5ws";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ deepseq filepath ghcPaths syb transformers ];
+  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 5d92b8178c18..878eba660a06 100644
--- a/pkgs/development/libraries/haskell/double-conversion/default.nix
+++ b/pkgs/development/libraries/haskell/double-conversion/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "double-conversion";
-  version = "0.2.0.5";
-  sha256 = "1z23a8sfnq5lady8n2kcina9a7df8lmsliscf85x84dxkd3a1ahf";
+  version = "0.2.0.6";
+  sha256 = "1c6hy0ghdqf44fvhdpdxjbcr0ahimw283x5fnvjxja36i71qshjp";
   buildDepends = [ text ];
   meta = {
     homepage = "https://github.com/bos/double-conversion";
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 000000000000..ebca3b5a3be6
--- /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.1";
+  sha256 = "09bdid65frccpbh1bs01f7vprq0vfgqsb5bfa4j8yi3q773mycb2";
+  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/editline/default.nix b/pkgs/development/libraries/haskell/editline/default.nix
index aee315d01fc9..309847a28e4f 100644
--- a/pkgs/development/libraries/haskell/editline/default.nix
+++ b/pkgs/development/libraries/haskell/editline/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "editline";
-  version = "0.2.1.0";
-  sha256 = "83618e5f86074fdc11d7f5033aa2886284462941be38fa02966acc92712c46e1";
+  version = "0.2.1.1";
+  sha256 = "101zhzja14n8bhbrly7w2aywx3sxyzgyjdrmgpg4gn4alf4lzdlz";
   extraLibraries = [ libedit ];
   meta = {
     homepage = "http://code.haskell.org/editline";
diff --git a/pkgs/development/libraries/haskell/either/default.nix b/pkgs/development/libraries/haskell/either/default.nix
new file mode 100644
index 000000000000..cbfa53b6d001
--- /dev/null
+++ b/pkgs/development/libraries/haskell/either/default.nix
@@ -0,0 +1,14 @@
+{ cabal, semigroupoids, semigroups, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "either";
+  version = "3.0.3";
+  sha256 = "02kpb8xd19n00ll61haqr6k3hy8qmbdf73gr4zs59q9xh0739qxc";
+  buildDepends = [ semigroupoids semigroups transformers ];
+  meta = {
+    homepage = "http://github.com/ekmett/either/";
+    description = "Haskell 98 either monad transformer";
+    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 000000000000..d2e68670eb0e
--- /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.3.1";
+  sha256 = "0vfpnpkiz362bvjyaf35spfk3h6vw7xi1x3f8agzs7kmxrdvrfik";
+  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/file-embed/default.nix b/pkgs/development/libraries/haskell/file-embed/default.nix
index a36d333e9099..119d9d185e55 100644
--- a/pkgs/development/libraries/haskell/file-embed/default.nix
+++ b/pkgs/development/libraries/haskell/file-embed/default.nix
@@ -1,9 +1,10 @@
-{ cabal }:
+{ cabal, filepath }:
 
 cabal.mkDerivation (self: {
   pname = "file-embed";
-  version = "0.0.4.6";
-  sha256 = "0p2vs56s1jy5xaw3axzfsir925z2a46624n32x797lga9khm3qvp";
+  version = "0.0.4.7";
+  sha256 = "1hn08499kay0y6ik5z1s58s8r9h1nzf116avgi6ia4b565wpzkvi";
+  buildDepends = [ filepath ];
   meta = {
     homepage = "https://github.com/snoyberg/file-embed";
     description = "Use Template Haskell to embed file contents directly";
diff --git a/pkgs/development/libraries/haskell/filestore/default.nix b/pkgs/development/libraries/haskell/filestore/default.nix
index f56db649fc7a..43492d73fae5 100644
--- a/pkgs/development/libraries/haskell/filestore/default.nix
+++ b/pkgs/development/libraries/haskell/filestore/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "filestore";
-  version = "0.5.0.1";
-  sha256 = "1wbiw3skbbcqi9p97xnhg5lnakq3vyan9v4f68wd3g4swk09xp7l";
+  version = "0.6";
+  sha256 = "1bmsqxrkiqw791h0xwasry3jm56rjsyvl9l5r78209bhiv5v6xk0";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
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 000000000000..025ed14869f8
--- /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
index 2b8378803b9f..80b6760a3b7b 100644
--- a/pkgs/development/libraries/haskell/fsnotify/default.nix
+++ b/pkgs/development/libraries/haskell/fsnotify/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "fsnotify";
-  version = "0.0.4";
-  sha256 = "0s71zxj48jimzhl7wz9j22g9c09z64g61nfmpy4mlrhpkzn1f8sz";
+  version = "0.0.6";
+  sha256 = "0ib6ansj3vaq9hxxbsq5jw14w2b61wp4jfahzb3c3x46mdb1bqw5";
   buildDepends = [ hinotify systemFileio systemFilepath text time ];
   meta = {
     description = "Cross platform library for file creation, modification, and deletion notification";
diff --git a/pkgs/development/libraries/haskell/generic-deriving/default.nix b/pkgs/development/libraries/haskell/generic-deriving/default.nix
index 27eecd552a60..c071aba7decd 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.3.1";
-  sha256 = "1z02j86lgn57ws0rfq2m0zb0m866k9afh9346k8bbwb5c4914wm3";
+  version = "1.4.0";
+  sha256 = "15av3l4m4qn5by41rkpdvp1kyp3fi9ixvy76wmyj20c46kjbmra7";
   meta = {
     description = "Generic programming library for generalised deriving";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/ghc-mod/default.nix b/pkgs/development/libraries/haskell/ghc-mod/default.nix
index 6ef59a4451bc..266740cbaaca 100644
--- a/pkgs/development/libraries/haskell/ghc-mod/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-mod/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ghc-mod";
-  version = "1.11.2";
-  sha256 = "0df1g57mwgd9avd2smnc7j97n14553p3zdmnbjanhnzin2fqj0dc";
+  version = "1.11.3";
+  sha256 = "13r3cz25lf0ndsyfc5adqx5mdv7hcl3qp7n2syg2msrn133xpwb2";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/ghc-paths/default.nix b/pkgs/development/libraries/haskell/ghc-paths/default.nix
index 8f01db02f992..b930e993dcc4 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 000000000000..b3c75a26a035
--- /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/gitit/default.nix b/pkgs/development/libraries/haskell/gitit/default.nix
index a77c122985ee..aa06d0178bed 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.2";
-  sha256 = "0cnql35h4laqpaymg32dmszwzc74qmbmmjas44gcsd8v5n6f701i";
+  version = "0.10.1.2";
+  sha256 = "1dy1wdnld6cxx5xqfszywi4f7xv143ar2dq4nb0dnd1dgd5hgmak";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
@@ -18,7 +18,6 @@ cabal.mkDerivation (self: {
     safe SHA syb tagsoup text time url utf8String xhtml xml xssSanitize
     zlib
   ];
-  jailbreak = true;
   meta = {
     homepage = "http://gitit.net";
     description = "Wiki using happstack, git or darcs, and pandoc";
diff --git a/pkgs/development/libraries/haskell/gloss/default.nix b/pkgs/development/libraries/haskell/gloss/default.nix
index 7d2319df08a4..a0fb693acbba 100644
--- a/pkgs/development/libraries/haskell/gloss/default.nix
+++ b/pkgs/development/libraries/haskell/gloss/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "gloss";
-  version = "1.7.6.6";
-  sha256 = "1by8zr1194mjnnia0ackhd48yqxh79k752c5jwxx6nsk1diwrvl9";
+  version = "1.7.8.1";
+  sha256 = "0bi60zprgq1dd6prshvgqyyp13l6n5f171aryxg254kjagvrm3lf";
   buildDepends = [ bmp GLUT OpenGL ];
   jailbreak = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/glpk-hs/default.nix b/pkgs/development/libraries/haskell/glpk-hs/default.nix
index 006f227a8c20..fbbe7d31c2a5 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/graphviz/default.nix b/pkgs/development/libraries/haskell/graphviz/default.nix
index e48f92e5b818..637bb5ba45ac 100644
--- a/pkgs/development/libraries/haskell/graphviz/default.nix
+++ b/pkgs/development/libraries/haskell/graphviz/default.nix
@@ -4,12 +4,11 @@
 
 cabal.mkDerivation (self: {
   pname = "graphviz";
-  version = "2999.14.1.0";
-  sha256 = "13fni5sf6cdfvgyh7kqjjdhmjxkhbgl3gbi0cbq90n8blzg4q1ql";
+  version = "2999.15.0.1";
+  sha256 = "137d8n20fbpdz7az79gqharsfl293pl3xn444338i6blfi47ssdy";
   buildDepends = [
     colour dlist fgl filepath polyparse text transformers wlPprintText
   ];
-  patchPhase = "sed -i -e 's|bytestring.*,|bytestring,|' graphviz.cabal";
   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 000000000000..4c085c0ae23b
--- /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/hakyll/default.nix b/pkgs/development/libraries/haskell/hakyll/default.nix
index ef2cc128e04f..c8b2117c1286 100644
--- a/pkgs/development/libraries/haskell/hakyll/default.nix
+++ b/pkgs/development/libraries/haskell/hakyll/default.nix
@@ -1,16 +1,19 @@
-{ 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, deepseq, filepath, httpConduit, httpTypes, lrucache
+, mtl, pandoc, parsec, random, regexBase, regexTdfa, snapCore
+, snapServer, tagsoup, text, time
 }:
 
 cabal.mkDerivation (self: {
   pname = "hakyll";
-  version = "3.5.1.0";
-  sha256 = "16aaxnknxbpzdlm6dlmsq8pfssp63ywqim0zm3kvf7zic3hvq2xr";
+  version = "4.1.2.1";
+  sha256 = "1d9bbqy1dix60w72zc3g4y7454avngfyl2i8gj99bdqin2wwcgp8";
+  isLibrary = true;
+  isExecutable = true;
   buildDepends = [
-    binary blazeHtml blazeMarkup citeprocHs cryptohash filepath hamlet
-    lrucache mtl pandoc parsec regexBase regexTdfa snapCore snapServer
-    tagsoup text time
+    binary blazeHtml blazeMarkup citeprocHs cmdargs cryptohash deepseq
+    filepath httpConduit httpTypes lrucache mtl pandoc parsec random
+    regexBase regexTdfa snapCore snapServer tagsoup text time
   ];
   meta = {
     homepage = "http://jaspervdj.be/hakyll";
diff --git a/pkgs/development/libraries/haskell/hamlet/default.nix b/pkgs/development/libraries/haskell/hamlet/default.nix
index 0fc9d7b59f3f..906a8e2759aa 100644
--- a/pkgs/development/libraries/haskell/hamlet/default.nix
+++ b/pkgs/development/libraries/haskell/hamlet/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hamlet";
-  version = "1.1.1.1";
-  sha256 = "0vxnvh9npsf1jxh471fnr2d13bdi7p8sxn5b2w86bla3q273jxp8";
+  version = "1.1.3.1";
+  sha256 = "04qqsjrn0fh9y4z7gjf3g60w69gqxhzq7dqkraq97p3w45fijm1i";
   buildDepends = [
     blazeBuilder blazeHtml blazeMarkup failure parsec shakespeare text
   ];
diff --git a/pkgs/development/libraries/haskell/happstack/happstack-server.nix b/pkgs/development/libraries/haskell/happstack/happstack-server.nix
index e864075b42a5..b2311bde6ca9 100644
--- a/pkgs/development/libraries/haskell/happstack/happstack-server.nix
+++ b/pkgs/development/libraries/haskell/happstack/happstack-server.nix
@@ -1,18 +1,18 @@
 { cabal, base64Bytestring, blazeHtml, extensibleExceptions
 , filepath, hslogger, html, monadControl, mtl, network, parsec
-, sendfile, syb, systemFilepath, text, threads, time, transformers
-, transformersBase, utf8String, xhtml, zlib
+, sendfile, syb, systemFilepath, text, threads, time, timeCompat
+, transformers, transformersBase, utf8String, xhtml, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "happstack-server";
-  version = "7.0.7";
-  sha256 = "0r9bk82zjzlsi6j6dnz5b73qacpfdyhsn5ds98cn7gkqyf4yg7cj";
+  version = "7.1.1";
+  sha256 = "0q12l93kq5ixvam682ys3a6i3q59amz9cyr1bb06f2zf8qr57b7a";
   buildDepends = [
     base64Bytestring blazeHtml extensibleExceptions filepath hslogger
     html monadControl mtl network parsec sendfile syb systemFilepath
-    text threads time transformers transformersBase utf8String xhtml
-    zlib
+    text threads time timeCompat transformers transformersBase
+    utf8String xhtml zlib
   ];
   meta = {
     homepage = "http://happstack.com";
diff --git a/pkgs/development/libraries/haskell/hashable/default.nix b/pkgs/development/libraries/haskell/hashable/1.1.2.5.nix
index 96fe7ae0eb13..96fe7ae0eb13 100644
--- a/pkgs/development/libraries/haskell/hashable/default.nix
+++ b/pkgs/development/libraries/haskell/hashable/1.1.2.5.nix
diff --git a/pkgs/development/libraries/haskell/hashable/1.2.0.5.nix b/pkgs/development/libraries/haskell/hashable/1.2.0.5.nix
new file mode 100644
index 000000000000..0547fd67b1f7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hashable/1.2.0.5.nix
@@ -0,0 +1,15 @@
+{ cabal, text }:
+
+cabal.mkDerivation (self: {
+  pname = "hashable";
+  version = "1.2.0.5";
+  sha256 = "0frqr294bsx4i21xxd5pw59xpaf0nww0dh4bqn0ywblsm9c7nyqh";
+  buildDepends = [ text ];
+  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/heist/default.nix b/pkgs/development/libraries/haskell/heist/default.nix
index d87f4fe239e9..a2251f696731 100644
--- a/pkgs/development/libraries/haskell/heist/default.nix
+++ b/pkgs/development/libraries/haskell/heist/default.nix
@@ -1,20 +1,20 @@
 { cabal, aeson, attoparsec, blazeBuilder, blazeHtml, directoryTree
-, filepath, MonadCatchIOTransformers, mtl, random, text, time
-, unorderedContainers, vector, xmlhtml
+, dlist, errors, filepath, hashable, MonadCatchIOTransformers, mtl
+, random, text, time, unorderedContainers, vector, xmlhtml
 }:
 
 cabal.mkDerivation (self: {
   pname = "heist";
-  version = "0.8.2";
-  sha256 = "0zamggvfq9054vxznbnfq1fihk110ih8q0dza1rmsjb1h2s88rkj";
+  version = "0.10.2.1";
+  sha256 = "14lp27vlzv6qqv325x2vqqvphw5ads5ywjqpjramv3hhd275fn3d";
   buildDepends = [
-    aeson attoparsec blazeBuilder blazeHtml directoryTree filepath
-    MonadCatchIOTransformers mtl random text time unorderedContainers
-    vector xmlhtml
+    aeson attoparsec blazeBuilder blazeHtml directoryTree dlist errors
+    filepath hashable MonadCatchIOTransformers mtl random text time
+    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/highlighting-kate/default.nix b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
index 4b2e32d23520..afb6a4be662a 100644
--- a/pkgs/development/libraries/haskell/highlighting-kate/default.nix
+++ b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "highlighting-kate";
-  version = "0.5.3.3";
-  sha256 = "08jxl2ba0kb4vj1qbdf4sas8bwbxzayzwsxnjvq358x57i5l302n";
+  version = "0.5.3.5";
+  sha256 = "0m76h33igw77ndllgzkqgmygi7krc5vfjvizidsgris0zd1g2yv3";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ blazeHtml filepath mtl parsec regexPcre ];
diff --git a/pkgs/development/libraries/haskell/hjsmin/default.nix b/pkgs/development/libraries/haskell/hjsmin/default.nix
index 35eed1de3f0f..58720e33f7b9 100644
--- a/pkgs/development/libraries/haskell/hjsmin/default.nix
+++ b/pkgs/development/libraries/haskell/hjsmin/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hjsmin";
-  version = "0.1.3";
-  sha256 = "0lz7qsm74hbs8qa5d3khw43ipiimjbvxsrqqmxvp44605ib22y4d";
+  version = "0.1.4";
+  sha256 = "1w4w560p7xy3lci36xy01dpwl0hhf9iv8gy4ldqvh33931pkxhxn";
   buildDepends = [ blazeBuilder languageJavascript text ];
   meta = {
     homepage = "http://github.com/alanz/hjsmin";
diff --git a/pkgs/development/libraries/haskell/hledger-lib/default.nix b/pkgs/development/libraries/haskell/hledger-lib/default.nix
index 05a1c04fe599..b5d9d7abbaac 100644
--- a/pkgs/development/libraries/haskell/hledger-lib/default.nix
+++ b/pkgs/development/libraries/haskell/hledger-lib/default.nix
@@ -1,14 +1,14 @@
 { cabal, cmdargs, csv, filepath, HUnit, mtl, parsec, regexpr, safe
-, shakespeareText, split, time, transformers, utf8String
+, split, time, transformers, utf8String
 }:
 
 cabal.mkDerivation (self: {
   pname = "hledger-lib";
-  version = "0.19.1";
-  sha256 = "19ccbf9g1garwg56ig4qckz1zky89g1z71nwfbwi4v57bjw53ab4";
+  version = "0.19.3";
+  sha256 = "1wn72ycy1hvcn2ikaplq446hggpkbabyj1d8201vajwn862waxra";
   buildDepends = [
-    cmdargs csv filepath HUnit mtl parsec regexpr safe shakespeareText
-    split time transformers utf8String
+    cmdargs csv filepath HUnit mtl parsec regexpr safe split time
+    transformers utf8String
   ];
   meta = {
     homepage = "http://hledger.org";
diff --git a/pkgs/development/libraries/haskell/hledger-web/default.nix b/pkgs/development/libraries/haskell/hledger-web/default.nix
index 825b79ae1592..2e50b19f0116 100644
--- a/pkgs/development/libraries/haskell/hledger-web/default.nix
+++ b/pkgs/development/libraries/haskell/hledger-web/default.nix
@@ -8,8 +8,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hledger-web";
-  version = "0.19";
-  sha256 = "0p820pwx4javzfvzhz02930adx6w7246hdk802wz1g4937rlq8p3";
+  version = "0.19.3";
+  sha256 = "1kx5mn6drm90clz132vrd2lkssm73hlwvxb9cxg6z82i5qa9jqn9";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
@@ -19,6 +19,7 @@ cabal.mkDerivation (self: {
     shakespeareJs shakespeareText text time transformers wai waiExtra
     warp yaml yesod yesodCore yesodDefault yesodForm yesodStatic
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://hledger.org";
     description = "A web interface for the hledger accounting tool";
diff --git a/pkgs/development/libraries/haskell/hledger/default.nix b/pkgs/development/libraries/haskell/hledger/default.nix
index 30427f2cddde..4099b1896a58 100644
--- a/pkgs/development/libraries/haskell/hledger/default.nix
+++ b/pkgs/development/libraries/haskell/hledger/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hledger";
-  version = "0.19.1";
-  sha256 = "0ad7wmcpwi7a9nag4j27rhffhai6a5zgzaafss7sfr7yia00cpgg";
+  version = "0.19.3";
+  sha256 = "1kxkv2dwl5ir2vqvbi1ppbwns8mw1lkg5lkfdkdwwbjj7dq0ysr6";
   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 8acb621fe3f0..b9f3eb3cb8e5 100644
--- a/pkgs/development/libraries/haskell/hs-bibutils/default.nix
+++ b/pkgs/development/libraries/haskell/hs-bibutils/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hs-bibutils";
-  version = "4.15";
-  sha256 = "1h2vqi6ymhx9wpfv5qzvq4fhc4iand93shsncp8nszk64acmz9z9";
+  version = "4.16";
+  sha256 = "0501fqv0xlwdmpg65s3rr0fns6gqq15x2zq2a8915n3dvipfkixb";
   buildDepends = [ syb ];
   meta = {
     homepage = "http://gorgias.mine.nu/repos/hs-bibutils/";
diff --git a/pkgs/development/libraries/haskell/hsemail/default.nix b/pkgs/development/libraries/haskell/hsemail/default.nix
index f69789772ace..e8c0c9e4da86 100644
--- a/pkgs/development/libraries/haskell/hsemail/default.nix
+++ b/pkgs/development/libraries/haskell/hsemail/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hsemail";
-  version = "1.7.2";
-  sha256 = "1bl017gfyvjvxs9z1fns6sknk1l55905r82i31aqbz9qyaj70gzx";
+  version = "1.7.4";
+  sha256 = "0nigv0zbkm90m5jskfc5a4zx2d3gyqj1y472jplrgd76s15alsmw";
   buildDepends = [ mtl parsec ];
   meta = {
     homepage = "http://gitorious.org/hsemail";
diff --git a/pkgs/development/libraries/haskell/hslogger-template/default.nix b/pkgs/development/libraries/haskell/hslogger-template/default.nix
index a7b1a51b7057..be78bea938cf 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/default.nix b/pkgs/development/libraries/haskell/hspec/default.nix
index 4c43513e229e..bc194108d337 100644
--- a/pkgs/development/libraries/haskell/hspec/default.nix
+++ b/pkgs/development/libraries/haskell/hspec/default.nix
@@ -4,14 +4,15 @@
 
 cabal.mkDerivation (self: {
   pname = "hspec";
-  version = "1.4.2";
-  sha256 = "0qlm6p5i1fkgyca704bsjc1nm1ks19pfq6l3vmzsszjzbdl8p5cq";
+  version = "1.4.3";
+  sha256 = "0i963fxamyyi3afac67rkw4340i3xqs1q3lvcy69mq0czbdvgjmc";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
     ansiTerminal filepath hspecExpectations HUnit QuickCheck setenv
     silently time transformers
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://hspec.github.com/";
     description = "Behavior-Driven Development for Haskell";
diff --git a/pkgs/development/libraries/haskell/http-conduit/default.nix b/pkgs/development/libraries/haskell/http-conduit/default.nix
index 2240bb56b5a0..b9f47b440068 100644
--- a/pkgs/development/libraries/haskell/http-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/http-conduit/default.nix
@@ -1,21 +1,23 @@
 { cabal, 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
+, filepath, httpTypes, liftedBase, mimeTypes, monadControl, mtl
+, network, random, regexCompat, resourcet, socks, text, time, tls
+, tlsExtra, transformers, transformersBase, utf8String, void
+, zlibConduit
 }:
 
 cabal.mkDerivation (self: {
   pname = "http-conduit";
-  version = "1.8.4.1";
-  sha256 = "0jrsl8m0r3i1jyhi8qsadv4dhq069v67hlphzm78sfinrd083h8y";
+  version = "1.8.7";
+  sha256 = "12v5rxp4dx6glyijygpp7r7b5b6mscclgfp2cbii78m3hgld097i";
   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
+    cprngAes dataDefault deepseq failure filepath httpTypes liftedBase
+    mimeTypes monadControl mtl network random regexCompat resourcet
+    socks text time tls tlsExtra transformers transformersBase
+    utf8String void 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 a0168a519581..58d4dd7ecbfd 100644
--- a/pkgs/development/libraries/haskell/http-date/default.nix
+++ b/pkgs/development/libraries/haskell/http-date/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "http-date";
-  version = "0.0.3";
-  sha256 = "12iylfzz1d0v0gl4cf31dxcmlg0x7bq5f7acacy2pb0ilrxmzsnn";
+  version = "0.0.4";
+  sha256 = "1pbm066i1cpa3z2kfsqpva0qixnx87s76dpafz3wf6dkaqj8n8i5";
   buildDepends = [ attoparsec ];
   meta = {
     description = "HTTP Date parser/formatter";
diff --git a/pkgs/development/libraries/haskell/http-reverse-proxy/default.nix b/pkgs/development/libraries/haskell/http-reverse-proxy/default.nix
index 9c44971688dc..e30a30fc7aa3 100644
--- a/pkgs/development/libraries/haskell/http-reverse-proxy/default.nix
+++ b/pkgs/development/libraries/haskell/http-reverse-proxy/default.nix
@@ -1,15 +1,15 @@
 { cabal, blazeBuilder, caseInsensitive, classyPreludeConduit
-, conduit, httpConduit, httpTypes, liftedBase, monadControl
-, network, networkConduit, text, wai, warp, word8
+, conduit, dataDefault, httpConduit, httpTypes, liftedBase
+, monadControl, network, networkConduit, text, wai, warp, word8
 }:
 
 cabal.mkDerivation (self: {
   pname = "http-reverse-proxy";
-  version = "0.1.0.5";
-  sha256 = "1x1m9vklgg6x8niry8c5fxcjpmsmrpxv7j2i5h38hp1hbka3mpr0";
+  version = "0.1.1.1";
+  sha256 = "0xg6xw0j61db75smys2fgjn0nzv2dy8c1ha4m828ssnxlic98lk2";
   buildDepends = [
     blazeBuilder caseInsensitive classyPreludeConduit conduit
-    httpConduit httpTypes liftedBase monadControl network
+    dataDefault httpConduit httpTypes liftedBase monadControl network
     networkConduit text wai warp word8
   ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/iproute/default.nix b/pkgs/development/libraries/haskell/iproute/default.nix
index d323bece64c4..c342f80a6c25 100644
--- a/pkgs/development/libraries/haskell/iproute/default.nix
+++ b/pkgs/development/libraries/haskell/iproute/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "iproute";
-  version = "1.2.7";
-  sha256 = "07ixxq45w5wzvfrvsv2b206kygiqn1v3bcclkd98afjpc6mv3ld3";
+  version = "1.2.10";
+  sha256 = "1ni91llvq1mfdsjmw1laqhk964y4vlpyk5s25j8klsfn27mq6c68";
   buildDepends = [ appar byteorder network ];
   meta = {
     homepage = "http://www.mew.org/~kazu/proj/iproute/";
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 000000000000..6ae0447b1fe6
--- /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/language-c-quote/default.nix b/pkgs/development/libraries/haskell/language-c-quote/default.nix
index 77396e3cf555..fc569f996a89 100644
--- a/pkgs/development/libraries/haskell/language-c-quote/default.nix
+++ b/pkgs/development/libraries/haskell/language-c-quote/default.nix
@@ -4,13 +4,14 @@
 
 cabal.mkDerivation (self: {
   pname = "language-c-quote";
-  version = "0.4.3";
-  sha256 = "13xpmj3jrqkcgilkh4p8ycxhlk5yvfsisx4c1ax7n7aafg1n7phf";
+  version = "0.4.4";
+  sha256 = "1g233ja3qy64xcimy9irfb3n8zys00vg1d0s4g3hr48ilc95dl8l";
   buildDepends = [
     exceptionMtl exceptionTransformers filepath haskellSrcMeta
     mainlandPretty mtl srcloc syb symbol
   ];
   buildTools = [ alex happy ];
+  jailbreak = true;
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
     description = "C/CUDA/OpenCL quasiquoting library";
diff --git a/pkgs/development/libraries/haskell/largeword/default.nix b/pkgs/development/libraries/haskell/largeword/default.nix
index 67159c2bcbf7..991213067f65 100644
--- a/pkgs/development/libraries/haskell/largeword/default.nix
+++ b/pkgs/development/libraries/haskell/largeword/default.nix
@@ -2,10 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "largeword";
-  version = "1.0.3";
-  sha256 = "18b6nhq1cww4wdbrfq0cb828kncxzcsibgs5dbgxa66y6iw93vkg";
+  version = "1.0.4";
+  sha256 = "19nrzbbbmsvxdhfhh6wc53lbk0xyjvbcwvjw0snym666j1w2b2l5";
   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/lens/default.nix b/pkgs/development/libraries/haskell/lens/default.nix
index 8e853147a31a..e815d654b612 100644
--- a/pkgs/development/libraries/haskell/lens/default.nix
+++ b/pkgs/development/libraries/haskell/lens/default.nix
@@ -1,16 +1,21 @@
-{ cabal, comonad, comonadsFd, comonadTransformers, filepath
-, hashable, mtl, parallel, semigroups, split, text, transformers
-, unorderedContainers, vector
+{ cabal, bifunctors, comonad, comonadsFd, comonadTransformers
+, contravariant, distributive, filepath, genericDeriving, hashable
+, MonadCatchIOTransformers, mtl, parallel, profunctorExtras
+, profunctors, reflection, semigroupoids, semigroups, split, tagged
+, text, transformers, transformersCompat, unorderedContainers
+, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "lens";
-  version = "3.4";
-  sha256 = "19f5kmd6b1jnimvfm56dpgqzhnlpi0anar1ii9am38lg5yaqbgs4";
+  version = "3.8.2";
+  sha256 = "1spz4nyv1f7kf4bnw8qgqaks5kc4m0slzw0czj1wh1232w2sz15m";
   buildDepends = [
-    comonad comonadsFd comonadTransformers filepath hashable mtl
-    parallel semigroups split text transformers unorderedContainers
-    vector
+    bifunctors comonad comonadsFd comonadTransformers contravariant
+    distributive filepath genericDeriving hashable
+    MonadCatchIOTransformers mtl parallel profunctorExtras profunctors
+    reflection semigroupoids semigroups split tagged text transformers
+    transformersCompat unorderedContainers vector
   ];
   meta = {
     homepage = "http://github.com/ekmett/lens/";
diff --git a/pkgs/development/libraries/haskell/liblastfm/default.nix b/pkgs/development/libraries/haskell/liblastfm/default.nix
index 70ba29830c68..d9a04355e2e5 100644
--- a/pkgs/development/libraries/haskell/liblastfm/default.nix
+++ b/pkgs/development/libraries/haskell/liblastfm/default.nix
@@ -1,17 +1,16 @@
-{ cabal, aeson, curl, mtl, pureMD5, urlencoded, utf8String, xml }:
+{ cabal, aeson, cereal, cryptoApi, httpConduit, httpTypes, network
+, pureMD5, text
+}:
 
 cabal.mkDerivation (self: {
   pname = "liblastfm";
-  version = "0.0.3.6";
-  sha256 = "0xmrciv489dvksgpg9g83kna34x1amsx45wvpngcpnx4m44fcp4w";
+  version = "0.1.0.0";
+  sha256 = "1777p2zysha9z389dkzvc22wph5k2xa6f23xk1ckr8j1q5v9dg6x";
   buildDepends = [
-    aeson curl mtl pureMD5 urlencoded utf8String xml
+    aeson cereal cryptoApi httpConduit httpTypes network pureMD5 text
   ];
-  patchPhase = ''
-    sed -i -e 's|curl == .*,|curl,|' -e 's|urlencoded .*,|urlencoded,|' liblastfm.cabal
-  '';
   meta = {
-    description = "Wrapper to Lastfm API";
+    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 f6185597af17..fc77388727fd 100644
--- a/pkgs/development/libraries/haskell/libmpd/default.nix
+++ b/pkgs/development/libraries/haskell/libmpd/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "libmpd";
-  version = "0.8.0.1";
-  sha256 = "16j2c0dnwllsb979gqf1cl4ylvpldcj8k32ddpp4wf62lbb1mqxm";
+  version = "0.8.0.2";
+  sha256 = "1phlbb5lsapw2hb0db7906ddlmvnpyk1xbgxvl9zp9zfd0sn40aj";
   buildDepends = [ filepath mtl network text time utf8String ];
   meta = {
     homepage = "http://github.com/joachifm/libmpd-haskell";
diff --git a/pkgs/development/libraries/haskell/lifted-base/default.nix b/pkgs/development/libraries/haskell/lifted-base/default.nix
index e5c334e1b22b..fbb09db9bb87 100644
--- a/pkgs/development/libraries/haskell/lifted-base/default.nix
+++ b/pkgs/development/libraries/haskell/lifted-base/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "lifted-base";
-  version = "0.2";
-  sha256 = "12ai34wb1sd6fza50arlpvsdc6l2nwrrcik0xakf2q0ddzjmhjfb";
+  version = "0.2.0.2";
+  sha256 = "19xzparj0k5h4wx71gvbd7l653fak1p57za236sncmar8cps5pdx";
   buildDepends = [
     baseUnicodeSymbols monadControl transformersBase
   ];
diff --git a/pkgs/development/libraries/haskell/logict/default.nix b/pkgs/development/libraries/haskell/logict/default.nix
index a603b4fe6449..0a03ed45fee6 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.2";
-  sha256 = "0m0a55l061vbxdqw9h1780g893amdxs7glza4jd5jncjsv823s1z";
+  version = "0.6";
+  sha256 = "1np4wizvwlx458kq6mmdrh8qcp1794y1bs4mnnz951h6hay5z49f";
   buildDepends = [ mtl ];
   meta = {
     homepage = "http://code.haskell.org/~dolio/logict";
diff --git a/pkgs/development/libraries/haskell/mainland-pretty/default.nix b/pkgs/development/libraries/haskell/mainland-pretty/default.nix
index 5da3e47a333e..30681bd340bc 100644
--- a/pkgs/development/libraries/haskell/mainland-pretty/default.nix
+++ b/pkgs/development/libraries/haskell/mainland-pretty/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "mainland-pretty";
-  version = "0.2.4";
-  sha256 = "0x481k36rz4zvj1nwvrfw1d10vbmmx8gb5f2nc8alnxcbc2y7xwq";
+  version = "0.2.5";
+  sha256 = "0h3q7xw69dc0lcqwlacsnv36dlbj0sfgv5imjlqrixy6m5cniq9x";
   buildDepends = [ srcloc text ];
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
diff --git a/pkgs/development/libraries/haskell/mime-types/default.nix b/pkgs/development/libraries/haskell/mime-types/default.nix
index 8359d6dc181d..1bde4861b3ac 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.2";
+  sha256 = "1pkhr8k23386qwa1wmlrcilz75di2l8n5kc4n8pnia05p49akfcs";
   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 000000000000..54fc100b7dd8
--- /dev/null
+++ b/pkgs/development/libraries/haskell/minimorph/default.nix
@@ -0,0 +1,14 @@
+{ cabal, text }:
+
+cabal.mkDerivation (self: {
+  pname = "minimorph";
+  version = "0.1.4.0";
+  sha256 = "16ri9hfriszrgqcm111b1pp5x65s034hrc35kjz5qax32mnc9rn6";
+  buildDepends = [ 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 000000000000..b06ee1363c87
--- /dev/null
+++ b/pkgs/development/libraries/haskell/miniutter/default.nix
@@ -0,0 +1,14 @@
+{ cabal, minimorph, text }:
+
+cabal.mkDerivation (self: {
+  pname = "miniutter";
+  version = "0.4.0";
+  sha256 = "1l275aad8svrqp22jv9s0mmlam7wbdlf6m4m97658rm8ks4j2mbx";
+  buildDepends = [ minimorph 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/monad-logger/default.nix b/pkgs/development/libraries/haskell/monad-logger/default.nix
index 0a5f52512c69..97078f2fb84f 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.1";
-  sha256 = "00ssh60rxw7dg1dcfh8kr4mg9p7pvvvmjf9xd8kvxbrb9s3nkc4s";
-  buildDepends = [ fastLogger resourcet text transformers ];
+  version = "0.2.3.2";
+  sha256 = "0b5jfmzmsb7pdawcm5i74sy934q2d78pjs39invas502kx5bxzk5";
+  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/mongoDB/default.nix b/pkgs/development/libraries/haskell/mongoDB/default.nix
index 32187c39963d..83b04869e68c 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.1";
-  sha256 = "1qvsb993n5gmchym4zz2pv68mdyir439cfindqdqlvjwam0jf4l5";
+  version = "1.3.2";
+  sha256 = "0gv0i2z6f797ibjfp16ax2aiqa66sclxjy8sabrwydwcyr96xb4y";
   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 000000000000..a67017298a83
--- /dev/null
+++ b/pkgs/development/libraries/haskell/monoid-extras/default.nix
@@ -0,0 +1,14 @@
+{ cabal, semigroups }:
+
+cabal.mkDerivation (self: {
+  pname = "monoid-extras";
+  version = "0.2.2.2";
+  sha256 = "1fz93hm0sswisvwvbygxvbwmmnzqcxmz9h82i4361wzychf2si22";
+  buildDepends = [ semigroups ];
+  jailbreak = true;
+  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 fa19197871dd..543578211718 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 e231a3a1f3aa..000000000000
--- 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/multiarg/default.nix b/pkgs/development/libraries/haskell/multiarg/default.nix
index 8b2871c3ce4f..74254a4c591e 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.6.0.0";
-  sha256 = "1qrw1rajdvrvd297a7lpfkxm5qqhwmnnl5jiagjwzb9lckgpy87y";
+  version = "0.8.0.0";
+  sha256 = "17zfrm9zjf7c8g7q9vqj1srk0g766ifhwqp7gm4ql890541q5lv5";
   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/multiset/default.nix b/pkgs/development/libraries/haskell/multiset/0.2.1.nix
index 9f85317505c9..9f85317505c9 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/syb/default.nix b/pkgs/development/libraries/haskell/multiset/0.2.2.nix
index 65dd5e0e0182..16fcf155747d 100644
--- a/pkgs/development/libraries/haskell/syb/default.nix
+++ b/pkgs/development/libraries/haskell/multiset/0.2.2.nix
@@ -1,11 +1,11 @@
 { cabal }:
 
 cabal.mkDerivation (self: {
-  pname = "syb";
-  version = "0.1.0.1";
-  sha256 = "08nf4id26s5iasxzdy5jds6h87fy3a55zgw0zrig4dg6difmwjp3";
+  pname = "multiset";
+  version = "0.2.2";
+  sha256 = "1g14c1zm4rdc8nxvb69k98h542wi24q2lpba1gpqjqspk4d0sjmn";
   meta = {
-    description = "Scrap Your Boilerplate";
+    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/nat/default.nix b/pkgs/development/libraries/haskell/nat/default.nix
new file mode 100644
index 000000000000..3ad4240e2892
--- /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 000000000000..02f5c289836e
--- /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 000000000000..787ac70ffa96
--- /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 000000000000..ff9ed1ac0bfa
--- /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 000000000000..57550dcb3d86
--- /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/network-conduit/default.nix b/pkgs/development/libraries/haskell/network-conduit/default.nix
index 3b86b0699ca4..a56c35a214ba 100644
--- a/pkgs/development/libraries/haskell/network-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/network-conduit/default.nix
@@ -3,8 +3,8 @@
 
 cabal.mkDerivation (self: {
   pname = "network-conduit";
-  version = "0.6.1.1";
-  sha256 = "00x5ks1qcq5smmd2g4bm23lb3ngdxmdlz822qkkj9l9c27lkn67n";
+  version = "0.6.2.2";
+  sha256 = "1v8abhw977hr78hkshrbxy04abbbhafvvnhr4xxgqc0phwch02mc";
   buildDepends = [
     conduit liftedBase monadControl network transformers
   ];
diff --git a/pkgs/development/libraries/haskell/network/2.4.0.1.nix b/pkgs/development/libraries/haskell/network/2.4.1.0.nix
index e0aa44c38bde..9d5ac3abe781 100644
--- a/pkgs/development/libraries/haskell/network/2.4.0.1.nix
+++ b/pkgs/development/libraries/haskell/network/2.4.1.0.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "network";
-  version = "2.4.0.1";
-  sha256 = "00jj3pf2gchkx5wmipm2ijxcmhy37g86ggnp6pb92i5nmb93h1iw";
+  version = "2.4.1.0";
+  sha256 = "0m44iqlcnpsaa3iqxb4wbx2l1k2ycxzq8v07bwz7br7yyikv16y3";
   buildDepends = [ parsec ];
   meta = {
     homepage = "https://github.com/haskell/network";
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 000000000000..76f57daca385
--- /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
index 75f801eee18d..3e04a33990e3 100644
--- a/pkgs/development/libraries/haskell/optparse-applicative/default.nix
+++ b/pkgs/development/libraries/haskell/optparse-applicative/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "optparse-applicative";
-  version = "0.4.1";
-  sha256 = "00byv248662n6pr8gn5b777l0fjg6f0wcxfkbhw0qyhd1ciq8d38";
+  version = "0.5.2.1";
+  sha256 = "0w4mk851mx8dch8lnck0g82asmzrsc47xrf34jygh0f6v4kbj40i";
   buildDepends = [ transformers ];
   meta = {
     homepage = "https://github.com/pcapriotti/optparse-applicative";
diff --git a/pkgs/development/libraries/haskell/pandoc-types/default.nix b/pkgs/development/libraries/haskell/pandoc-types/default.nix
index 6dfbc1fc15ff..d4f49791d306 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 de6b29ff9cc0..ed6600626734 100644
--- a/pkgs/development/libraries/haskell/pandoc/default.nix
+++ b/pkgs/development/libraries/haskell/pandoc/default.nix
@@ -1,20 +1,20 @@
 { cabal, base64Bytestring, blazeHtml, blazeMarkup, citeprocHs
-, extensibleExceptions, filepath, highlightingKate, HTTP, json, mtl
-, network, pandocTypes, parsec, random, syb, tagsoup, temporary
-, texmath, time, utf8String, xml, zipArchive, zlib
+, dataDefault, extensibleExceptions, filepath, highlightingKate
+, HTTP, json, mtl, network, pandocTypes, parsec, random, syb
+, tagsoup, temporary, texmath, text, time, xml, zipArchive, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "pandoc";
-  version = "1.9.4.5";
-  sha256 = "05k8i537756m07xlb6kgshpfxa4sp2jxidb1c8m72ilpai13r6fb";
+  version = "1.10.0.5";
+  sha256 = "05mjgvxk3wxfssf4aviigdm6jb73a6bp8lwz86aabdgkgh2i6n54";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    base64Bytestring blazeHtml blazeMarkup citeprocHs
+    base64Bytestring blazeHtml blazeMarkup citeprocHs dataDefault
     extensibleExceptions filepath highlightingKate HTTP json mtl
     network pandocTypes parsec random syb tagsoup temporary texmath
-    time utf8String xml zipArchive zlib
+    text time xml zipArchive zlib
   ];
   configureFlags = "-fblaze_html_0_5";
   meta = {
@@ -22,6 +22,9 @@ cabal.mkDerivation (self: {
     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/parallel-io/default.nix b/pkgs/development/libraries/haskell/parallel-io/default.nix
index d16f42f52ff2..56c1a1306964 100644
--- a/pkgs/development/libraries/haskell/parallel-io/default.nix
+++ b/pkgs/development/libraries/haskell/parallel-io/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "parallel-io";
-  version = "0.3.2.1";
-  sha256 = "0wrmz0i5s8p87840pacdnpf2fi12nips4yc72vymifrc1wvlc42q";
+  version = "0.3.3";
+  sha256 = "0i86x3bf8pjlg6mdg1zg5lcrjpg75pbqs2mrgrbp4z4bkcmw051s";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ extensibleExceptions random ];
diff --git a/pkgs/development/libraries/haskell/parseargs/default.nix b/pkgs/development/libraries/haskell/parseargs/default.nix
index d51533a06532..4287015115c8 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.4";
+  sha256 = "1n55ay42qiwm72fa63xbz5m5fi0ld5dr3vypmyz5mc0zzhqwxz2j";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/pem/default.nix b/pkgs/development/libraries/haskell/pem/default.nix
index ff9b91fe0dac..b82dc4ed83df 100644
--- a/pkgs/development/libraries/haskell/pem/default.nix
+++ b/pkgs/development/libraries/haskell/pem/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "pem";
-  version = "0.1.1";
-  sha256 = "0klb39w6mihx35xgdw5wvi1q6r61xgrsqvcqi4c5r6psv5z94cil";
+  version = "0.1.2";
+  sha256 = "1p2sw36b9w6lf53jzj86ibyy9a48fjd786mx3x8mvc5lczx8v78m";
   buildDepends = [ attoparsec base64Bytestring cereal mtl ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-pem";
diff --git a/pkgs/development/libraries/haskell/persistent-postgresql/default.nix b/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
index 9b545ad15242..8fdc9f641aac 100644
--- a/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "persistent-postgresql";
-  version = "1.0.0";
-  sha256 = "149vv6wd0a85gphwrqcyd66ivdzyy7yc37c99ngq7377fdnszzhn";
+  version = "1.1.2.1";
+  sha256 = "1iz6w9isva1drbr37c8f42g3nnl78sp27ydaj0975yqyp7nh7and";
   buildDepends = [
     aeson conduit monadControl persistent postgresqlLibpq
     postgresqlSimple text time transformers
diff --git a/pkgs/development/libraries/haskell/persistent-sqlite/default.nix b/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
index 5b3ecd5ebc41..2da2c06a2439 100644
--- a/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "persistent-sqlite";
-  version = "1.0.0";
-  sha256 = "0ak9x6w9566mjc0ggsqxr69x4w5w7igdxkq6wwm6ysy5cvs8fwc8";
+  version = "1.1.2";
+  sha256 = "0pb52k7a7js71s4d2mynd62i8gk99az7y72rycs0xg9r9cr081p3";
   buildDepends = [
     aeson conduit monadControl persistent text transformers
   ];
diff --git a/pkgs/development/libraries/haskell/persistent-template/default.nix b/pkgs/development/libraries/haskell/persistent-template/default.nix
index 8d09c5931708..596b0789445f 100644
--- a/pkgs/development/libraries/haskell/persistent-template/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-template/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "persistent-template";
-  version = "1.0.0.2";
-  sha256 = "0skd1gfrxq8mpa2g56b2wn83zw4zca5q2dxyjf6d7k6sh9sc9iz8";
+  version = "1.1.2.1";
+  sha256 = "02sqrq847cxywj9hwixvi0bqq09kxr9w6lhn6kqg4ww0mw2add6s";
   buildDepends = [ aeson monadControl persistent text transformers ];
   meta = {
     homepage = "http://www.yesodweb.com/book/persistent";
diff --git a/pkgs/development/libraries/haskell/persistent/default.nix b/pkgs/development/libraries/haskell/persistent/default.nix
index 449debe0405e..83bc9f53951d 100644
--- a/pkgs/development/libraries/haskell/persistent/default.nix
+++ b/pkgs/development/libraries/haskell/persistent/default.nix
@@ -1,17 +1,17 @@
 { cabal, aeson, attoparsec, base64Bytestring, blazeHtml
 , blazeMarkup, conduit, liftedBase, monadControl, monadLogger
-, pathPieces, poolConduit, resourcet, sqlite, text, time
+, pathPieces, poolConduit, resourcet, silently, sqlite, text, time
 , transformers, transformersBase, unorderedContainers, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "persistent";
-  version = "1.0.1.3";
-  sha256 = "156iv1iv807wm39sr98z0f10sbw4q0ac3lafgai0mq3ph5xysi80";
+  version = "1.1.4";
+  sha256 = "1frxhyyp8l5xvq5h9zf730c7kpnrryw2mw8mpnav2bs5g6rmmrgj";
   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
   ];
   extraLibraries = [ sqlite ];
diff --git a/pkgs/development/libraries/haskell/pool-conduit/default.nix b/pkgs/development/libraries/haskell/pool-conduit/default.nix
index b951b0d435f0..08c035f18268 100644
--- a/pkgs/development/libraries/haskell/pool-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/pool-conduit/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "pool-conduit";
-  version = "0.1.0.3";
-  sha256 = "0q95b4770xfd9ancbzbisslqax3pcvg1yf3kkplnvp335ffxbax9";
+  version = "0.1.1";
+  sha256 = "1gaj0gwwbr950jkxhpl326py758j2mvh557xz737js9qcs9g3cg1";
   buildDepends = [ resourcePool resourcet transformers ];
   meta = {
     homepage = "http://www.yesodweb.com/book/persistent";
diff --git a/pkgs/development/libraries/haskell/pretty-show/default.nix b/pkgs/development/libraries/haskell/pretty-show/default.nix
index 577848ab459d..5fedd0aca292 100644
--- a/pkgs/development/libraries/haskell/pretty-show/default.nix
+++ b/pkgs/development/libraries/haskell/pretty-show/default.nix
@@ -1,15 +1,15 @@
-{ cabal, haskellLexer }:
+{ cabal, filepath, haskellLexer }:
 
 cabal.mkDerivation (self: {
   pname = "pretty-show";
-  version = "1.2";
-  sha256 = "0lbalmyrqisgd2spbvzifsy25lr6cl9sgz78hav8q8r406k7nf2l";
+  version = "1.5";
+  sha256 = "1n04f9aypgbhkq0lbji9czv1mjfwv4f80w1c6hqs55gmzwif63m4";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [ haskellLexer ];
+  buildDepends = [ filepath haskellLexer ];
   meta = {
     homepage = "http://wiki.github.com/yav/pretty-show";
-    description = "Tools for working with derived Show instances";
+    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/profunctor-extras/default.nix b/pkgs/development/libraries/haskell/profunctor-extras/default.nix
new file mode 100644
index 000000000000..df16898ddd3e
--- /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 000000000000..7146359eda40
--- /dev/null
+++ b/pkgs/development/libraries/haskell/profunctors/default.nix
@@ -0,0 +1,14 @@
+{ cabal, comonad, tagged }:
+
+cabal.mkDerivation (self: {
+  pname = "profunctors";
+  version = "3.2";
+  sha256 = "0c7242pk5hfz67cwjy0l7skqyz20akw9j2w7cb8iggcbbb27bgyc";
+  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
index 62058e8737b2..04b0de35465c 100644
--- a/pkgs/development/libraries/haskell/project-template/default.nix
+++ b/pkgs/development/libraries/haskell/project-template/default.nix
@@ -1,14 +1,15 @@
-{ cabal, base64Bytestring, classyPreludeConduit, conduit, mtl
-, systemFileio, systemFilepath, text, transformers
+{ cabal, base64Bytestring, base64Conduit, classyPreludeConduit
+, conduit, mtl, resourcet, systemFileio, systemFilepath, text
+, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "project-template";
-  version = "0.1.0.1";
-  sha256 = "0ahmdlfn48yz8fj7199w0qsa1dbbxr21bs9hq1lnm3s2p4qiki23";
+  version = "0.1.1";
+  sha256 = "186hqfhhl77yq9gqiw59jbnkk7xmpljqfwwilzjkjknf3ifhs5na";
   buildDepends = [
-    base64Bytestring classyPreludeConduit conduit mtl systemFileio
-    systemFilepath text transformers
+    base64Bytestring base64Conduit classyPreludeConduit conduit mtl
+    resourcet systemFileio systemFilepath text transformers
   ];
   meta = {
     homepage = "https://github.com/fpco/haskell-ide";
diff --git a/pkgs/development/libraries/haskell/random-fu/default.nix b/pkgs/development/libraries/haskell/random-fu/default.nix
index 520f232d81fe..8dd228ad3db3 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.1";
-  sha256 = "06b4v7012fj1kmnz6i63vbwl9gkhzgk556gmcc62k14299ks8pci";
+  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 e4dab92dcb76..acc0285a59a4 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/reactive-banana/default.nix b/pkgs/development/libraries/haskell/reactive-banana/default.nix
index 467addefeebd..ef4016d003d5 100644
--- a/pkgs/development/libraries/haskell/reactive-banana/default.nix
+++ b/pkgs/development/libraries/haskell/reactive-banana/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "reactive-banana";
-  version = "0.7.1.0";
-  sha256 = "0diklfkc4fq05g5fhgcdkx8y0vmq26zfnmfkj95yvmwks8p9k22r";
+  version = "0.7.1.1";
+  sha256 = "0d4dqpzglzkygy2hhn1j1c7vk2782mk66f8aqaadkyhijn7kc6i5";
   buildDepends = [ hashable transformers unorderedContainers vault ];
   meta = {
     homepage = "http://haskell.org/haskellwiki/Reactive-banana";
diff --git a/pkgs/development/libraries/haskell/reflection/default.nix b/pkgs/development/libraries/haskell/reflection/default.nix
new file mode 100644
index 000000000000..fbcaa58d777e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/reflection/default.nix
@@ -0,0 +1,14 @@
+{ cabal, tagged }:
+
+cabal.mkDerivation (self: {
+  pname = "reflection";
+  version = "1.1.6";
+  sha256 = "1ihyx1a8pk1czam0qm1znl851dn4y6jip6s30girgghrvvxmblkw";
+  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/repa-algorithms/default.nix b/pkgs/development/libraries/haskell/repa-algorithms/default.nix
index 39f0682e4ba8..acf9dc712f35 100644
--- a/pkgs/development/libraries/haskell/repa-algorithms/default.nix
+++ b/pkgs/development/libraries/haskell/repa-algorithms/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "repa-algorithms";
-  version = "3.2.2.3";
-  sha256 = "1maxkl7plxzdkmbak4c7qj68chbpkbarjmw454kjx544pbkn9xhb";
+  version = "3.2.3.1";
+  sha256 = "12w76npa52g7zxa0j9w8q9njacm2dn0hcd8a8386p9r6iy6lpjwc";
   buildDepends = [ repa vector ];
   extraLibraries = [ llvm ];
   jailbreak = true;
diff --git a/pkgs/development/libraries/haskell/repa-examples/default.nix b/pkgs/development/libraries/haskell/repa-examples/default.nix
index 0320eea7c629..bea9d9f7f043 100644
--- a/pkgs/development/libraries/haskell/repa-examples/default.nix
+++ b/pkgs/development/libraries/haskell/repa-examples/default.nix
@@ -1,12 +1,16 @@
-{ cabal, llvm, random, repa, repaAlgorithms, repaIo, vector }:
+{ cabal, llvm, QuickCheck, random, repa, repaAlgorithms, repaIo
+, vector
+}:
 
 cabal.mkDerivation (self: {
   pname = "repa-examples";
-  version = "3.2.2.3";
-  sha256 = "0v21f8zzn05j3pjwvnb7x08q0sd375kbf450zjgsv8fzsypclr51";
+  version = "3.2.3.1";
+  sha256 = "1lflgpnig2ks2mwp7bywyjqr2v426gbk1675mkkvjncgr5ahf11g";
   isLibrary = false;
   isExecutable = true;
-  buildDepends = [ random repa repaAlgorithms repaIo vector ];
+  buildDepends = [
+    QuickCheck random repa repaAlgorithms repaIo vector
+  ];
   extraLibraries = [ llvm ];
   jailbreak = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/repa-io/default.nix b/pkgs/development/libraries/haskell/repa-io/default.nix
index f410595d8959..7b15b2bbb929 100644
--- a/pkgs/development/libraries/haskell/repa-io/default.nix
+++ b/pkgs/development/libraries/haskell/repa-io/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "repa-io";
-  version = "3.2.2.3";
-  sha256 = "1rzis7gp9dq06czqmnj9p7hpyfkdbirx2bldhg5mz3glmqf4xvw5";
+  version = "3.2.3.1";
+  sha256 = "19dnz8xa18yydprnwzgdcbrndi6akwc53rs1104z0awffh83iynm";
   buildDepends = [ binary bmp repa vector ];
   jailbreak = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/repa/default.nix b/pkgs/development/libraries/haskell/repa/default.nix
index de8f9cd4f956..4eb21c5661a5 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.2.3";
-  sha256 = "04y8yrfh0khk7w9wv61fh2rfygw8r6g9c3spzki6kw63byr01m5c";
+  version = "3.2.3.1";
+  sha256 = "0r5z781h9v6ri2m3ih7jbymvc3i2m26qaf29pxwmaks0sdlp4qmr";
   buildDepends = [ QuickCheck vector ];
   jailbreak = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/resourcet/default.nix b/pkgs/development/libraries/haskell/resourcet/default.nix
index e5df582bad0d..f657f4e0ca52 100644
--- a/pkgs/development/libraries/haskell/resourcet/default.nix
+++ b/pkgs/development/libraries/haskell/resourcet/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "resourcet";
-  version = "0.4.3";
-  sha256 = "0j3sr4xl30nszy79akzzn8aws40bmhd2dyw8ispirnx004i6ay3b";
+  version = "0.4.4";
+  sha256 = "0ad1hl7bl9qid4brchb95gvnylfchmxncgdvgljb5lci7gy9r31z";
   buildDepends = [
     liftedBase monadControl mtl transformers transformersBase
   ];
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 000000000000..263adb42f253
--- /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/default.nix b/pkgs/development/libraries/haskell/semigroupoids/default.nix
index c2e8deefbad5..7e25fa5913e2 100644
--- a/pkgs/development/libraries/haskell/semigroupoids/default.nix
+++ b/pkgs/development/libraries/haskell/semigroupoids/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "semigroupoids";
-  version = "3.0.0.1";
-  sha256 = "0ilqmpywiwp9m1k8lrw0mxb0pzc9l8bs2hgzrp8k5iln1yq1fh6i";
+  version = "3.0.1";
+  sha256 = "12k2yryr31lxhwq42cx05kswljmbli8p8c2wknigzkkam63d8k5h";
   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 240062493e30..ea0f2813b55f 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.1";
-  sha256 = "05wv5amgg3nqr1if936zl330sv1k4i9p8xzdmgxsmchp4lshyr6n";
+  version = "0.9";
+  sha256 = "0cwyjjlr9zgpxryzdf26pb58dmad0cp8d0493rarhh5zmgighh90";
+  buildDepends = [ nats ];
   meta = {
     homepage = "http://github.com/ekmett/semigroups/";
     description = "Haskell 98 semigroups";
diff --git a/pkgs/development/libraries/haskell/shakespeare-js/default.nix b/pkgs/development/libraries/haskell/shakespeare-js/default.nix
index 228e35bab467..a7238ba52eb3 100644
--- a/pkgs/development/libraries/haskell/shakespeare-js/default.nix
+++ b/pkgs/development/libraries/haskell/shakespeare-js/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "shakespeare-js";
-  version = "1.1.0";
-  sha256 = "0rb1fim6xvpgc2in71drxgimh1z75p72zj0k6hwh2hyfwkj2yh9p";
+  version = "1.1.1";
+  sha256 = "1xzhb3ipax2489311hmiaxp9i44099bsbclcj3ds0rhdfa62xarg";
   buildDepends = [ aeson shakespeare text ];
   meta = {
     homepage = "http://www.yesodweb.com/book/shakespearean-templates";
diff --git a/pkgs/development/libraries/haskell/shelly/default.nix b/pkgs/development/libraries/haskell/shelly/default.nix
index 9ac5b3555836..15245bfe0bcd 100644
--- a/pkgs/development/libraries/haskell/shelly/default.nix
+++ b/pkgs/development/libraries/haskell/shelly/default.nix
@@ -3,8 +3,8 @@
 
 cabal.mkDerivation (self: {
   pname = "shelly";
-  version = "0.14.3";
-  sha256 = "0nlspgk5svc9zr2gry96sykhd8i7vdmqxpsvfsz22khw8climqzj";
+  version = "0.15.4";
+  sha256 = "1b8fn5fa350hhlswn97g6zn9454nzn9sz60x55j959phwys0fcdk";
   buildDepends = [
     mtl systemFileio systemFilepath text time unixCompat
   ];
diff --git a/pkgs/development/libraries/haskell/silently/default.nix b/pkgs/development/libraries/haskell/silently/default.nix
index 658fe4fc6939..c8223cecac4f 100644
--- a/pkgs/development/libraries/haskell/silently/default.nix
+++ b/pkgs/development/libraries/haskell/silently/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "silently";
-  version = "1.2.4";
-  sha256 = "0ac75b4n9566vpvv6jfcqafnyplv8dd7bgak89b16wy032z1xl5j";
+  version = "1.2.4.1";
+  sha256 = "035dw3zg680ykyz5rqkkrjn51wkznbc4jb45a8l2gh3vgqzgbf52";
   buildDepends = [ deepseq ];
   meta = {
     homepage = "https://github.com/trystan/silently";
diff --git a/pkgs/development/libraries/haskell/simple-sendfile/default.nix b/pkgs/development/libraries/haskell/simple-sendfile/default.nix
index 2a55427a6aae..6f858398bc9a 100644
--- a/pkgs/development/libraries/haskell/simple-sendfile/default.nix
+++ b/pkgs/development/libraries/haskell/simple-sendfile/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "simple-sendfile";
-  version = "0.2.8";
-  sha256 = "11lw8m21cy40hd9nzp80d9jawgv9hd3sfvizjcfbvdc2lpq6m17j";
+  version = "0.2.10";
+  sha256 = "07js189yyya2vs3wsc49b7c2zbh63f48kywmz88g7s394bp3n9am";
   buildDepends = [ network ];
   meta = {
     description = "Cross platform library for the sendfile system call";
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 000000000000..672b2c090ef2
--- /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 d6719c7a4517..1ccedad6d114 100644
--- a/pkgs/development/libraries/haskell/skein/default.nix
+++ b/pkgs/development/libraries/haskell/skein/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "skein";
-  version = "0.1.0.9";
-  sha256 = "06hx064cpfcd397rmrmfbm7ph38pnxcsn6wij8fcfsx9wq5yq1k1";
+  version = "0.1.0.11";
+  sha256 = "16iy3frzxzkiybl5cglvnmvxzziwr8361s00m7130dh82r3vc21q";
   buildDepends = [ cereal cryptoApi tagged ];
   meta = {
     homepage = "https://github.com/meteficha/skein";
diff --git a/pkgs/development/libraries/haskell/smallcheck/default.nix b/pkgs/development/libraries/haskell/smallcheck/default.nix
index 1086a1929a80..a11eb501a861 100644
--- a/pkgs/development/libraries/haskell/smallcheck/default.nix
+++ b/pkgs/development/libraries/haskell/smallcheck/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "smallcheck";
-  version = "0.6.1";
-  sha256 = "1p2bsc08lcyzmqdjc5qsr60dr03kvc8xw7kk4lbi9cnn9s9w90vb";
+  version = "0.6.2";
+  sha256 = "0yz7an3k71ia7sgs8xpkh37xz9ipsnbf13680185cij8llq8zbyr";
   buildDepends = [ dlist ];
   meta = {
     homepage = "https://github.com/feuerbach/smallcheck";
diff --git a/pkgs/development/libraries/haskell/snap/loader-dynamic.nix b/pkgs/development/libraries/haskell/snap/loader-dynamic.nix
index 3f6c5db004b7..abe4d4cc074b 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.1";
-  sha256 = "1pzn8lfqngn8cqm1dpxn5wsx70xcd7r90rd2948n4p5309qgh9mq";
+  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 a9dcbf10810e..e75ae50d6c87 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/snap.nix b/pkgs/development/libraries/haskell/snap/snap.nix
index 1676de1e8404..30a2d34a99ef 100644
--- a/pkgs/development/libraries/haskell/snap/snap.nix
+++ b/pkgs/development/libraries/haskell/snap/snap.nix
@@ -1,24 +1,25 @@
-{ 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, vector, vectorAlgorithms
+{ 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.2.2";
-  sha256 = "1ql9c8b9arcd8zwlwsiipl4diah87sp339ljc5bc7yls1g4d9zsw";
+  version = "0.10.0.1";
+  sha256 = "14j9lgcdyxh7n4yidfvn1r94nziljiqz6nsqgq114v34bnn6l2yn";
   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
-    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
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://snapframework.com/";
     description = "Top-level package for the Snap Web Framework";
diff --git a/pkgs/development/libraries/haskell/srcloc/default.nix b/pkgs/development/libraries/haskell/srcloc/default.nix
index c867a353cd6f..f652ed001e40 100644
--- a/pkgs/development/libraries/haskell/srcloc/default.nix
+++ b/pkgs/development/libraries/haskell/srcloc/default.nix
@@ -1,10 +1,9 @@
-{ cabal, syb }:
+{ cabal }:
 
 cabal.mkDerivation (self: {
   pname = "srcloc";
-  version = "0.3.0";
-  sha256 = "1ymk8k0r9ckk7dalz3virvvpyrf4nw8xvb23cs6ibdjjbzsphpiz";
-  buildDepends = [ syb ];
+  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/strptime/default.nix b/pkgs/development/libraries/haskell/strptime/default.nix
index bb30fe71cc37..c092f0c0d15b 100644
--- a/pkgs/development/libraries/haskell/strptime/default.nix
+++ b/pkgs/development/libraries/haskell/strptime/default.nix
@@ -1,10 +1,10 @@
-{ cabal, time }:
+{ cabal, text, time }:
 
 cabal.mkDerivation (self: {
   pname = "strptime";
-  version = "1.0.8";
-  sha256 = "0cd4wzrg9zpnwrfpp6lxs1ib06h0fcsdqd3idsw663wr5lllfgdq";
-  buildDepends = [ time ];
+  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;
diff --git a/pkgs/development/libraries/haskell/stylish-haskell/default.nix b/pkgs/development/libraries/haskell/stylish-haskell/default.nix
index fc875d75bd0b..03ab9a2b84de 100644
--- a/pkgs/development/libraries/haskell/stylish-haskell/default.nix
+++ b/pkgs/development/libraries/haskell/stylish-haskell/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "stylish-haskell";
-  version = "0.5.4.0";
-  sha256 = "1bnsjs5s760xnk3s1l7kjqr2svxp4a881p9z2slaywi5kn0v5mwf";
+  version = "0.5.5.2";
+  sha256 = "1whl8qdqyw2saic70kav8srg4f6bcn77mc86m0vk8i8n5mb3q4ny";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/syb/0.3.5.nix b/pkgs/development/libraries/haskell/syb/0.3.5.nix
deleted file mode 100644
index b1264ecb4370..000000000000
--- a/pkgs/development/libraries/haskell/syb/0.3.5.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal }:
-
-cabal.mkDerivation (self: {
-  pname = "syb";
-  version = "0.3.5";
-  sha256 = "17gwhn0rqjf9zkx1dsmsaj41qdjlk4mq5lzpqkgy3slq30nwwwbr";
-  meta = {
-    homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/SYB";
-    description = "Scrap Your Boilerplate";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/system-fileio/default.nix b/pkgs/development/libraries/haskell/system-fileio/default.nix
index 7b1f7d7bcfd5..f61dedb7b8c5 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.10";
-  sha256 = "1f8si6m62nxzj71jgyhxl38szmw8wr3frvgih596vfjxwdhqpkq4";
+  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/tabular/default.nix b/pkgs/development/libraries/haskell/tabular/default.nix
index ddfc4aac7d6f..32ede2f660b3 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/test-framework-hunit/default.nix b/pkgs/development/libraries/haskell/test-framework-hunit/default.nix
index 42e2e4485296..011d791643cc 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 d71e2a034d05..cabc0fe1d0a4 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 e0615469ab75..77e201ca63d4 100644
--- a/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
+++ b/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "test-framework-quickcheck2";
-  version = "0.2.12.3";
-  sha256 = "17pj6b1cclihy203zpb75rkx2djldc9kcj10wqkf5fjmf9vvi0ks";
+  version = "0.3.0.1";
+  sha256 = "1177cvlb4qsa5x2k12dd60y7b14dyd3jr1ygb49aackhjx52c41s";
   buildDepends = [
     extensibleExceptions QuickCheck random testFramework
   ];
diff --git a/pkgs/development/libraries/haskell/test-framework-th/default.nix b/pkgs/development/libraries/haskell/test-framework-th/default.nix
index 57b4302938be..f70e522a2ce4 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.3";
-  sha256 = "1xls8034zkfnvkv2p6jd6kc1x3xrr0sm5c6hl0mp7ym2w2ww9f1w";
+  version = "0.2.4";
+  sha256 = "12lw7yj02jb9s0i7rb98jjam43j2h0gzmnbj9zi933fx7sg0sy4b";
   buildDepends = [
     haskellSrcExts languageHaskellExtract regexPosix testFramework
   ];
diff --git a/pkgs/development/libraries/haskell/test-framework/default.nix b/pkgs/development/libraries/haskell/test-framework/default.nix
index 14fb53a5a09e..b9f335e1a5af 100644
--- a/pkgs/development/libraries/haskell/test-framework/default.nix
+++ b/pkgs/development/libraries/haskell/test-framework/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "test-framework";
-  version = "0.6.1";
-  sha256 = "1rx2c3yckw50vrydswb61ngvp27yxcimm5q6jcyqpn16fpkvxijw";
+  version = "0.8";
+  sha256 = "1w895nq357zpc4v6vr5nbszyrw7cpsjq5bj38vdd10bfpjjmijcl";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/texmath/default.nix b/pkgs/development/libraries/haskell/texmath/default.nix
index 65d9da1548fd..78ec99da8db5 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.1.1";
-  sha256 = "06yk19jvpj7di1njybk1hdc7hp6c9h3yb4gvi7ljna6wqrh6zqaz";
+  version = "0.6.1.2";
+  sha256 = "1izsjy30saz2il16dwx8sh2s30b1pfgcpq6023v135w1bdrzrnmq";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ parsec syb xml ];
diff --git a/pkgs/development/libraries/haskell/text/0.11.1.12.nix b/pkgs/development/libraries/haskell/text/0.11.1.12.nix
deleted file mode 100644
index e860e1c61a1d..000000000000
--- a/pkgs/development/libraries/haskell/text/0.11.1.12.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ cabal, deepseq }:
-
-cabal.mkDerivation (self: {
-  pname = "text";
-  version = "0.11.1.12";
-  sha256 = "0j2044whj3xckmxqmgdjbc2mpwdan481qzjslwplqbqwml2jvkml";
-  buildDepends = [ deepseq ];
-  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/time-compat/default.nix b/pkgs/development/libraries/haskell/time-compat/default.nix
new file mode 100644
index 000000000000..e42224ace0d7
--- /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.2";
+  sha256 = "0687bxkvqs22p7skqb8n289k9nv7cafg8jyx32sswn2h11m7dihb";
+  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 55c52e8a73c0..000000000000
--- 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 23c07f9dd235..000000000000
--- 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.2.0.5.nix b/pkgs/development/libraries/haskell/time/1.2.0.5.nix
deleted file mode 100644
index 9d059245d7b5..000000000000
--- a/pkgs/development/libraries/haskell/time/1.2.0.5.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal }:
-
-cabal.mkDerivation (self: {
-  pname = "time";
-  version = "1.2.0.5";
-  sha256 = "0y4plv9qvpmzzzb5855zngm6lmd38m0vr2mzwm94xhz2xsqhdh2z";
-  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 107c7cee0372..ce429c8d602b 100644
--- a/pkgs/development/libraries/haskell/time/1.4.0.1.nix
+++ b/pkgs/development/libraries/haskell/time/1.4.0.2.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "time";
-  version = "1.4.0.1";
-  sha256 = "046jyz2xnbg2s94d9xhpphgq93mqlky7bc50vss40wdk6l7w8aws";
+  version = "1.4.0.2";
+  sha256 = "0p4ncankr9968lp4fnbq6pc5xwv2198gxhbds656da9jbv74w7j8";
   buildDepends = [ deepseq ];
   meta = {
     homepage = "http://semantic.org/TimeLib/";
diff --git a/pkgs/development/libraries/haskell/tls-extra/default.nix b/pkgs/development/libraries/haskell/tls-extra/default.nix
index 6a7b24f1fe2c..c9ab989ed76d 100644
--- a/pkgs/development/libraries/haskell/tls-extra/default.nix
+++ b/pkgs/development/libraries/haskell/tls-extra/default.nix
@@ -1,16 +1,17 @@
-{ cabal, certificate, cipherAes, 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.5.0";
-  sha256 = "1r645qljn3ql7jcphsqf4cm259cl8fsva64q4p2x37mafi01bkr8";
+  version = "0.6.1";
+  sha256 = "0gc3dz3s188jk6q2lai56y4ckxh62s9gm04d7jznr6jzpx2i4fan";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    certificate cipherAes 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";
diff --git a/pkgs/development/libraries/haskell/tls/default.nix b/pkgs/development/libraries/haskell/tls/default.nix
index 082a4b75cc6e..29b6b11d7913 100644
--- a/pkgs/development/libraries/haskell/tls/default.nix
+++ b/pkgs/development/libraries/haskell/tls/default.nix
@@ -1,15 +1,14 @@
-{ cabal, cereal, certificate, cryptoApi, cryptocipher, cryptohash
-, mtl, network
+{ cabal, cereal, certificate, cryptohash, cryptoPubkey
+, cryptoRandomApi, mtl, network
 }:
 
 cabal.mkDerivation (self: {
   pname = "tls";
-  version = "1.0.2";
-  sha256 = "0fkbh89j4gpwq45hv88axcdy7hxhvj1wj14nf7ma8wzaga2p4m75";
-  isLibrary = true;
-  isExecutable = true;
+  version = "1.1.1";
+  sha256 = "0ji83b5z3v6f6a6rgyj5xkjh9vvsqckr7ymzjnhb4zqf0mgymypq";
   buildDepends = [
-    cereal certificate cryptoApi cryptocipher cryptohash mtl network
+    cereal certificate cryptohash cryptoPubkey cryptoRandomApi mtl
+    network
   ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-tls";
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 000000000000..d36ace0eb299
--- /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";
+  sha256 = "100xw00h2l6iipg6lq5bbncpil3bl6w3frak99klpi8gn6ihd8ah";
+  buildDepends = [ transformers ];
+  noHaddock = true;
+  meta = {
+    homepage = "http://github.com/ekmett/transformers-compat/";
+    description = "Lenses, Folds and Traversals";
+    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 66b8b1974ff4..2cc98f00bb56 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.1";
+  sha256 = "0sgb7aki0ns3547y3abv1xh9rlmwhjm1c370pf3jjssysayh2wzv";
   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 000000000000..8dff0ffd58fc
--- /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/uniplate/default.nix b/pkgs/development/libraries/haskell/uniplate/default.nix
index 909b7f7659eb..8519ff451b2e 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 7c5cb6c63c4f..582764204818 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.4.0.0";
-  sha256 = "0xhhvqdjcmcyavf0g2q2sjghj2h4si1ijg4nc4s8kidbd957z9r8";
+  version = "0.4.1.0";
+  sha256 = "155m3zg692zbfyck4njx1vzvb5vgs0dkzyzlqf2x78ds6j9bzjzi";
   meta = {
     homepage = "http://github.com/jystic/unix-compat";
     description = "Portable POSIX-compatibility layer";
diff --git a/pkgs/development/libraries/haskell/unix-time/default.nix b/pkgs/development/libraries/haskell/unix-time/default.nix
index 61d8f86189d9..a17ed203941d 100644
--- a/pkgs/development/libraries/haskell/unix-time/default.nix
+++ b/pkgs/development/libraries/haskell/unix-time/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "unix-time";
-  version = "0.1.2";
-  sha256 = "146m4b93bla0pbf76bmff6f3aq9zx60cwy58mkqa0a4dyndd3pid";
+  version = "0.1.4";
+  sha256 = "1a8z9r75jk4z4diyigk0qzljkjqirxm30vf3jp75plnc9irysnw5";
   meta = {
     description = "Unix time parser/formatter and utilities";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/unordered-containers/default.nix b/pkgs/development/libraries/haskell/unordered-containers/default.nix
index 8ac2372d1c0d..786eb59ec104 100644
--- a/pkgs/development/libraries/haskell/unordered-containers/default.nix
+++ b/pkgs/development/libraries/haskell/unordered-containers/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "unordered-containers";
-  version = "0.2.2.1";
-  sha256 = "0ny8w7xw0ch3yp0fnskzygz61b72ln5s5ccsdlcqpp29cvfar6zy";
+  version = "0.2.3.0";
+  sha256 = "1vzgjr9jxdkmgq970ng9zi2j60awvx8iv1v6kzjlrkwzxx1a9dpd";
   buildDepends = [ deepseq hashable ];
   meta = {
     homepage = "https://github.com/tibbe/unordered-containers";
diff --git a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
index 02356789bc30..d28eb827dabf 100644
--- a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
+++ b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "uu-parsinglib";
-  version = "2.7.4";
-  sha256 = "1cznyn09a3glfkvvzqma3bhjinddkp6v2xwiy5x403v0wy8y565j";
+  version = "2.7.4.1";
+  sha256 = "1aya95j7dd0yal0ygy6d4w4wmlhgn5ddy3c5f6ncl4k3kg7hjxd1";
   buildDepends = [ ListLike time ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/bin/view/HUT/ParserCombinators";
diff --git a/pkgs/development/libraries/haskell/vault/default.nix b/pkgs/development/libraries/haskell/vault/default.nix
index 4d74884a1a7f..6039e7424772 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/vector-space/default.nix b/pkgs/development/libraries/haskell/vector-space/default.nix
index 60762ce3f9b9..c6d440a5d471 100644
--- a/pkgs/development/libraries/haskell/vector-space/default.nix
+++ b/pkgs/development/libraries/haskell/vector-space/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "vector-space";
-  version = "0.8.4";
-  sha256 = "1hrilbv44lrqm9p3z97xw8nlgxam98abll4iqik8a4d6ky225bwq";
+  version = "0.8.6";
+  sha256 = "03kz2qhnynbgs4vk7348zjkkakzzwvxhbasl0lcazj1cx1ay7c4l";
   buildDepends = [ Boolean MemoTrie NumInstances ];
   meta = {
     description = "Vector & affine spaces, linear maps, and derivatives";
diff --git a/pkgs/development/libraries/haskell/void/default.nix b/pkgs/development/libraries/haskell/void/default.nix
index e19a0450c027..cdf21c782334 100644
--- a/pkgs/development/libraries/haskell/void/default.nix
+++ b/pkgs/development/libraries/haskell/void/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "void";
-  version = "0.5.8";
-  sha256 = "1iqwndpc77i4i1977z7lxj20viplr2f5pwxwa2kibyhy556bs27z";
+  version = "0.5.11";
+  sha256 = "0fi8ccnhg0ckz5v3cgxhdd67p0v3g9yawin917ik4vxfbwz5j3v6";
   buildDepends = [ semigroups ];
   meta = {
     homepage = "http://github.com/ekmett/void";
diff --git a/pkgs/development/libraries/haskell/wai-app-static/default.nix b/pkgs/development/libraries/haskell/wai-app-static/default.nix
index 427efd4d9bf3..2ff182470009 100644
--- a/pkgs/development/libraries/haskell/wai-app-static/default.nix
+++ b/pkgs/development/libraries/haskell/wai-app-static/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "wai-app-static";
-  version = "1.3.0.4";
-  sha256 = "1dcgw6b10j5y2xa1jpqfsgcq8w6c7cdbp4pfc8nb6n54bys4linn";
+  version = "1.3.1";
+  sha256 = "0r2ghx3nqh7nms8yxa874h5pyagj993r077f8riybjyjp078s2lk";
   buildDepends = [
     base64Bytestring blazeBuilder blazeHtml blazeMarkup cereal
     cryptoConduit cryptohash fileEmbed httpDate httpTypes mimeTypes
diff --git a/pkgs/development/libraries/haskell/wai-extra/default.nix b/pkgs/development/libraries/haskell/wai-extra/default.nix
index 1c681a39ef50..1f08f3f1fd4f 100644
--- a/pkgs/development/libraries/haskell/wai-extra/default.nix
+++ b/pkgs/development/libraries/haskell/wai-extra/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "wai-extra";
-  version = "1.3.0.4";
-  sha256 = "1i909qipmnwx161c0xlqzrwcpbv6si2rrbhfs524dicgr1jdijcc";
+  version = "1.3.2";
+  sha256 = "1089sfb4jyi17rw6nivpy96gbc90nyawr35jzwlzl41gzxxmv503";
   buildDepends = [
     ansiTerminal blazeBuilder blazeBuilderConduit caseInsensitive
     conduit dataDefault dateCache fastLogger httpTypes network
diff --git a/pkgs/development/libraries/haskell/warp/default.nix b/pkgs/development/libraries/haskell/warp/default.nix
index 56cdbd9adc10..6a36e873ca69 100644
--- a/pkgs/development/libraries/haskell/warp/default.nix
+++ b/pkgs/development/libraries/haskell/warp/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "warp";
-  version = "1.3.4.4";
-  sha256 = "0i6mjadw87f9c949wg9lcbld0yfvnrxn7bhapf71gk36sh7llxaj";
+  version = "1.3.7.1";
+  sha256 = "0kabcxzjc686iayhxln2cmnxm3vk3h0685n4d4ybprv5h1nc6ghl";
   buildDepends = [
     blazeBuilder blazeBuilderConduit caseInsensitive conduit hashable
     httpTypes liftedBase network networkConduit simpleSendfile
diff --git a/pkgs/development/libraries/haskell/word8/default.nix b/pkgs/development/libraries/haskell/word8/default.nix
index d86ef72d2cbf..4b05c0b70d01 100644
--- a/pkgs/development/libraries/haskell/word8/default.nix
+++ b/pkgs/development/libraries/haskell/word8/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "word8";
-  version = "0.0.2";
-  sha256 = "0ij8l5h9kj93srsizwxiss4jcgj0hy2gsskw88l58lgd2v4c9dnb";
+  version = "0.0.3";
+  sha256 = "1k5sq91pidgw7w8fc62k9gl8iynb65pcza6mjx8pa3n2lslp7125";
   meta = {
     description = "Word8 library";
     license = self.stdenv.lib.licenses.bsd3;
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 000000000000..38551d24d43f
--- /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 f439b9e1594a..74ca4f91d70f 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/xss-sanitize/default.nix b/pkgs/development/libraries/haskell/xss-sanitize/default.nix
index 0fac2ad63727..f592568cb324 100644
--- a/pkgs/development/libraries/haskell/xss-sanitize/default.nix
+++ b/pkgs/development/libraries/haskell/xss-sanitize/default.nix
@@ -2,8 +2,8 @@
 
 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
   ];
diff --git a/pkgs/development/libraries/haskell/yaml/default.nix b/pkgs/development/libraries/haskell/yaml/default.nix
index 0271f6874f34..eb90b847fc8c 100644
--- a/pkgs/development/libraries/haskell/yaml/default.nix
+++ b/pkgs/development/libraries/haskell/yaml/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yaml";
-  version = "0.8.1.1";
-  sha256 = "0n2m205f0jq8v4g84bw642vdqqr68m3jklv98rr21s8r2fyy7937";
+  version = "0.8.2";
+  sha256 = "1c83vxgry1425z4wk2mnijy183pnlhamcra7fvh55rvhq4bql1m8";
   buildDepends = [
     aeson attoparsec conduit resourcet text transformers
     unorderedContainers vector
diff --git a/pkgs/development/libraries/haskell/yesod-auth/default.nix b/pkgs/development/libraries/haskell/yesod-auth/default.nix
index 712fd44fbf08..dfa96bf2b13e 100644
--- a/pkgs/development/libraries/haskell/yesod-auth/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-auth/default.nix
@@ -1,19 +1,20 @@
 { cabal, aeson, authenticate, blazeHtml, blazeMarkup, hamlet
-, httpConduit, liftedBase, mimeMail, persistent, persistentTemplate
-, pureMD5, pwstoreFast, random, SHA, shakespeareCss, text
-, transformers, unorderedContainers, wai, yesodCore, yesodForm
-, yesodJson, yesodPersistent
+, httpConduit, liftedBase, mimeMail, network, persistent
+, persistentTemplate, pureMD5, pwstoreFast, random, SHA
+, shakespeareCss, shakespeareJs, text, transformers
+, unorderedContainers, wai, yesodCore, yesodForm, yesodJson
+, yesodPersistent
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-auth";
-  version = "1.1.1.6";
-  sha256 = "0xbr8q7rv73hsh90pdb5cl00pd4mx3q74q0dqampha0y2lpq6124";
+  version = "1.1.3";
+  sha256 = "0rlp56jsb0cwm1z303b7l9iy5hbip18vlm7fisna4agbf4rj2k0z";
   buildDepends = [
     aeson authenticate blazeHtml blazeMarkup hamlet httpConduit
-    liftedBase mimeMail persistent persistentTemplate pureMD5
-    pwstoreFast random SHA shakespeareCss text transformers
-    unorderedContainers wai yesodCore yesodForm yesodJson
+    liftedBase mimeMail network persistent persistentTemplate pureMD5
+    pwstoreFast random SHA shakespeareCss shakespeareJs text
+    transformers unorderedContainers wai yesodCore yesodForm yesodJson
     yesodPersistent
   ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/yesod-core/default.nix b/pkgs/development/libraries/haskell/yesod-core/default.nix
index c7cd1466072f..65b24a4534ca 100644
--- a/pkgs/development/libraries/haskell/yesod-core/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-core/default.nix
@@ -9,8 +9,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod-core";
-  version = "1.1.5";
-  sha256 = "1mnmszka6fy5gps1y4bwpn0aq5vzxdxqyh2vrl7vii1lfl51yly7";
+  version = "1.1.7.1";
+  sha256 = "07rh6yy8hz660hxz60gvminm166cb5was8qb1l24lrmzchigbf3r";
   buildDepends = [
     aeson blazeBuilder blazeHtml blazeMarkup caseInsensitive cereal
     clientsession conduit cookie failure fastLogger hamlet httpTypes
diff --git a/pkgs/development/libraries/haskell/yesod-default/default.nix b/pkgs/development/libraries/haskell/yesod-default/default.nix
index 0ff1c2028267..d2bbf413c835 100644
--- a/pkgs/development/libraries/haskell/yesod-default/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-default/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod-default";
-  version = "1.1.2";
-  sha256 = "0asz9daf7by0d8sx8zqjsbxbzbyy59bvrdkq4f533fbn0nm1bn38";
+  version = "1.1.3";
+  sha256 = "1g0hb6jl0bp2q50pw2cy3hkbww1l230al08s7vfpqir68n9infiy";
   buildDepends = [
     dataDefault hamlet networkConduit safe shakespeareCss shakespeareJs
     text transformers unorderedContainers wai waiExtra warp yaml
diff --git a/pkgs/development/libraries/haskell/yesod-form/default.nix b/pkgs/development/libraries/haskell/yesod-form/default.nix
index 4f9e17371657..2d0a099002cb 100644
--- a/pkgs/development/libraries/haskell/yesod-form/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-form/default.nix
@@ -6,15 +6,14 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod-form";
-  version = "1.2.0.1";
-  sha256 = "13zfai1r8wvs2gxh6adp5pcnrk0480fx7kp8gwarv68x4hmf0jph";
+  version = "1.2.0.2";
+  sha256 = "0a3172rgvma420l98hkgvl17ks2a2jkys3rh4qd2bbm9p7qknv3y";
   buildDepends = [
     aeson attoparsec blazeBuilder blazeHtml blazeMarkup cryptoApi
     dataDefault emailValidate hamlet network persistent shakespeareCss
     shakespeareJs text time transformers wai xssSanitize yesodCore
     yesodPersistent
   ];
-  noHaddock = true;
   meta = {
     homepage = "http://www.yesodweb.com/";
     description = "Form handling support for Yesod Web Framework";
diff --git a/pkgs/development/libraries/haskell/yesod-persistent/default.nix b/pkgs/development/libraries/haskell/yesod-persistent/default.nix
index a094f4722336..e69bc2a51275 100644
--- a/pkgs/development/libraries/haskell/yesod-persistent/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-persistent/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod-persistent";
-  version = "1.1.0";
-  sha256 = "0c8cvc2gy9ixa0h79ycnyi86indny2i86g5xcg30a2rvc4mjbaaj";
+  version = "1.1.0.1";
+  sha256 = "0kgd1b7kaif644hjbvkc53yxr7qk310zdndypd9h0j31paw52k1p";
   buildDepends = [
     persistent persistentTemplate transformers yesodCore
   ];
diff --git a/pkgs/development/libraries/haskell/yesod-static/default.nix b/pkgs/development/libraries/haskell/yesod-static/default.nix
index ada24ea3193e..7923b6e9e8e3 100644
--- a/pkgs/development/libraries/haskell/yesod-static/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-static/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod-static";
-  version = "1.1.1.1";
-  sha256 = "1wp3ijiwsai9npf6zl0bq3fi4rbh0qjy8bii3d178sariv7588js";
+  version = "1.1.1.2";
+  sha256 = "0x3vrzqqddi4fmbivmy5pi66jmnc5fh68j5fjfxn5nyhp4n6z0sw";
   buildDepends = [
     base64Bytestring cereal conduit cryptoConduit cryptohash fileEmbed
     httpTypes systemFilepath text transformers unixCompat wai
diff --git a/pkgs/development/libraries/haskell/yesod-test/default.nix b/pkgs/development/libraries/haskell/yesod-test/default.nix
index bd0e3c17c862..b03274902e67 100644
--- a/pkgs/development/libraries/haskell/yesod-test/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-test/default.nix
@@ -1,17 +1,18 @@
-{ cabal, attoparsec, blazeHtml, blazeMarkup, caseInsensitive, hspec
-, htmlConduit, httpTypes, HUnit, monadControl, network, persistent
-, poolConduit, text, transformers, wai, waiTest, xmlConduit
-, xmlTypes
+{ cabal, attoparsec, blazeBuilder, blazeHtml, blazeMarkup
+, caseInsensitive, cookie, hspec, htmlConduit, httpTypes, HUnit
+, monadControl, network, persistent, poolConduit, text, time
+, transformers, wai, waiTest, xmlConduit, xmlTypes
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-test";
-  version = "0.3.1.1";
-  sha256 = "0p3490yw0xcc62vzjk2vq32vv2ij7mcs6h28szp7y04gn6xc5nbg";
+  version = "0.3.3";
+  sha256 = "1jb410r905wd26swh2rk59nbyy389gcfz261adhb69awmsyql5x3";
   buildDepends = [
-    attoparsec blazeHtml blazeMarkup caseInsensitive hspec htmlConduit
-    httpTypes HUnit monadControl network persistent poolConduit text
-    transformers wai waiTest xmlConduit xmlTypes
+    attoparsec blazeBuilder blazeHtml blazeMarkup caseInsensitive
+    cookie hspec htmlConduit httpTypes HUnit monadControl network
+    persistent poolConduit text time transformers wai waiTest
+    xmlConduit xmlTypes
   ];
   meta = {
     homepage = "http://www.yesodweb.com";
diff --git a/pkgs/development/libraries/haskell/yesod/default.nix b/pkgs/development/libraries/haskell/yesod/default.nix
index 7c592cb7efe4..50365296270d 100644
--- a/pkgs/development/libraries/haskell/yesod/default.nix
+++ b/pkgs/development/libraries/haskell/yesod/default.nix
@@ -1,30 +1,31 @@
-{ cabal, attoparsec, base64Bytestring, blazeBuilder, blazeHtml
-, blazeMarkup, Cabal, conduit, fileEmbed, filepath, fsnotify
-, ghcPaths, hamlet, httpConduit, httpReverseProxy, httpTypes
-, liftedBase, monadControl, network, optparseApplicative, parsec
-, projectTemplate, resourcet, shakespeare, shakespeareCss
-, shakespeareJs, shakespeareText, split, systemFileio
-, systemFilepath, tar, text, time, transformers, unixCompat
-, unorderedContainers, wai, waiExtra, warp, yaml, yesodAuth
-, yesodCore, yesodDefault, yesodForm, yesodJson, yesodPersistent
-, zlib
+{ cabal, aeson, attoparsec, base64Bytestring, blazeBuilder
+, blazeHtml, blazeMarkup, Cabal, conduit, fileEmbed, filepath
+, fsnotify, ghcPaths, hamlet, httpConduit, httpReverseProxy
+, httpTypes, liftedBase, monadControl, network, networkConduit
+, optparseApplicative, parsec, projectTemplate, resourcet
+, shakespeare, shakespeareCss, shakespeareJs, shakespeareText
+, split, systemFileio, systemFilepath, tar, text, time
+, transformers, unixCompat, unorderedContainers, wai, waiExtra
+, warp, yaml, yesodAuth, yesodCore, yesodDefault, yesodForm
+, yesodJson, yesodPersistent, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod";
-  version = "1.1.4";
-  sha256 = "1na50j7cd89mxk7ss67xlj703spvkpzcwgp7qs1pn2x3xsm7vrm2";
+  version = "1.1.7.2";
+  sha256 = "0mxxzcmp63sdn7g30ilp40dsj2iccajc9gpxycnqxqabdzhqkbm0";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    attoparsec base64Bytestring blazeBuilder blazeHtml blazeMarkup
-    Cabal conduit fileEmbed filepath fsnotify ghcPaths hamlet
-    httpConduit httpReverseProxy httpTypes liftedBase monadControl
-    network optparseApplicative parsec projectTemplate resourcet
-    shakespeare shakespeareCss shakespeareJs shakespeareText split
-    systemFileio systemFilepath tar text time transformers unixCompat
-    unorderedContainers wai waiExtra warp yaml yesodAuth yesodCore
-    yesodDefault yesodForm yesodJson yesodPersistent zlib
+    aeson attoparsec base64Bytestring blazeBuilder blazeHtml
+    blazeMarkup Cabal conduit fileEmbed filepath fsnotify ghcPaths
+    hamlet httpConduit httpReverseProxy httpTypes liftedBase
+    monadControl network networkConduit optparseApplicative parsec
+    projectTemplate resourcet shakespeare shakespeareCss shakespeareJs
+    shakespeareText split systemFileio systemFilepath tar text time
+    transformers unixCompat unorderedContainers wai waiExtra warp yaml
+    yesodAuth yesodCore yesodDefault yesodForm yesodJson
+    yesodPersistent zlib
   ];
   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 5cb5fb6a2099..5087bfce12cf 100644
--- a/pkgs/development/libraries/haskell/yst/default.nix
+++ b/pkgs/development/libraries/haskell/yst/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yst";
-  version = "0.3.0.1";
-  sha256 = "17jp9vdbpp82wzsj8rhp5nh6fbmgm2xrclfnb7jl4gjwls7xggrv";
+  version = "0.3.1";
+  sha256 = "1ax3j21b4ac9x4vvvfgnhz0sczd7l7ia6mcxnqhbc3166sn91vig";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix b/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
index 44b04397c3f4..4db350f93b52 100644
--- a/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
+++ b/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zeromq3-haskell";
-  version = "0.1.4";
-  sha256 = "026b18ligbrfbg4x7vivk6r2gj9rj3vy6pm3h0s81571h6lk3dhx";
+  version = "0.2";
+  sha256 = "12qljfkcd4l9h3l80jibxgw2an6v782w0sxwvzxqmma29jv6hvky";
   extraLibraries = [ zeromq ];
   meta = {
     homepage = "http://github.com/twittner/zeromq-haskell/";
diff --git a/pkgs/development/libraries/haskell/zip-archive/default.nix b/pkgs/development/libraries/haskell/zip-archive/default.nix
index 5ee2377147ed..300de9df4c96 100644
--- a/pkgs/development/libraries/haskell/zip-archive/default.nix
+++ b/pkgs/development/libraries/haskell/zip-archive/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zip-archive";
-  version = "0.1.2.1";
-  sha256 = "1c0pjbrkfv44nbpz60b1c4xdbkdk8qaxlkfxl51rb2183gj1gkph";
+  version = "0.1.3.3";
+  sha256 = "0zzps6s6lsv35qv1xx1fwipk2nwv255wpa956mvzbwdr47pgqjwi";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ binary digest filepath mtl time utf8String zlib ];
diff --git a/pkgs/development/libraries/haskell/zlib-bindings/default.nix b/pkgs/development/libraries/haskell/zlib-bindings/default.nix
index d0ffcecaaebe..d2c3a838adfb 100644
--- a/pkgs/development/libraries/haskell/zlib-bindings/default.nix
+++ b/pkgs/development/libraries/haskell/zlib-bindings/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zlib-bindings";
-  version = "0.1.1.2";
-  sha256 = "0p4713craq59vbyf3rr6kzv53rrfycbnlfs57i78fjrgwv6bd1ln";
+  version = "0.1.1.3";
+  sha256 = "18jhav7chbapakm9mwn7bn9lgvip7qaz61dw5gwv2nyalvm96qfr";
   buildDepends = [ zlib ];
   meta = {
     homepage = "http://github.com/snoyberg/zlib-bindings";
diff --git a/pkgs/development/libraries/haskell/zlib-conduit/default.nix b/pkgs/development/libraries/haskell/zlib-conduit/default.nix
index 89a22b6b8896..e902cce44e5f 100644
--- a/pkgs/development/libraries/haskell/zlib-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/zlib-conduit/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zlib-conduit";
-  version = "0.5.0.2";
-  sha256 = "1jgj3x4z1901bm1618753hqyrjragzrpyhy9h02qj9kplqswh878";
+  version = "0.5.0.3";
+  sha256 = "05rlbyxcwq952psbfp94irmygabqxyf1kkm80pwdanlaaky03nsb";
   buildDepends = [ conduit transformers void zlibBindings ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
diff --git a/pkgs/development/libraries/hunspell/default.nix b/pkgs/development/libraries/hunspell/default.nix
index c5243bc63930..04be58eb50a6 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 4f2bd4f679a0..de4270008f37 100644
--- a/pkgs/development/libraries/hwloc/default.nix
+++ b/pkgs/development/libraries/hwloc/default.nix
@@ -2,11 +2,11 @@
 , 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.
@@ -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/indilib/default.nix b/pkgs/development/libraries/indilib/default.nix
index 9fc5ac665e8b..31cbe772916d 100644
--- a/pkgs/development/libraries/indilib/default.nix
+++ b/pkgs/development/libraries/indilib/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation {
   name = "indilib-0.8";
 
   src = fetchurl {
-    url = mirror://sf/indi/libindi_0.8.tar.gz;
+    url = mirror://sourceforge/indi/libindi_0.8.tar.gz;
     sha256 = "d5ed14a5de6fd6e5db15463ada96c2b15b53e84a1ffe199b76f70128493f2a65";
   };
 
diff --git a/pkgs/development/libraries/intel-tbb/default.nix b/pkgs/development/libraries/intel-tbb/default.nix
new file mode 100644
index 000000000000..ad2c317a9efa
--- /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 a0119866df0c..4e6614345c17 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/levmar/use-atlas.patch b/pkgs/development/libraries/levmar/use-atlas.patch
deleted file mode 100644
index 2be9999b40ff..000000000000
--- 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/libdwarf/default.nix b/pkgs/development/libraries/libdwarf/default.nix
new file mode 100644
index 000000000000..44eec24cb41d
--- /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/libev/src-for-default.nix b/pkgs/development/libraries/libev/src-for-default.nix
index 52c8e65bc4f6..49624fc6bd27 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 000000000000..ed190bf60615
--- /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/libgadu/default.nix b/pkgs/development/libraries/libgadu/default.nix
index 98324c184c66..430560107702 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/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix
index f2958e4668de..bffc72e005cb 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,12 @@ 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" ];
+
   meta = {
     description = "GNU libiconv, an iconv(3) implementation";
 
@@ -27,16 +33,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/libixp/builder.sh b/pkgs/development/libraries/libixp/builder.sh
deleted file mode 100644
index 58513600fa09..000000000000
--- 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/liblrdf/default.nix b/pkgs/development/libraries/liblrdf/default.nix
deleted file mode 100644
index 515c81483b08..000000000000
--- a/pkgs/development/libraries/liblrdf/default.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-x@{builderDefsPackage
-  , libtool, autoconf, automake, ladspaH, librdf_raptor, pkgconfig, zlib
-  , ...}:
-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";
-    name="${baseName}-${version}";
-    url="mirror://sourceforge/project/${project}/${baseName}/${version}/${name}.tar.gz";
-    hash="015jv7pp0a0qxgljgdvf7d01nj4fx0zgzg0wayjp7v86pa38xscm";
-  };
-in
-rec {
-  src = a.fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.hash;
-  };
-
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
-  meta = {
-    description = "Lightweight RDF library with special support for LADSPA";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = a.lib.licenses.gpl2;
-  };
-  passthru = {
-  };
-}) x
-
diff --git a/pkgs/development/libraries/libmcrypt/default.nix b/pkgs/development/libraries/libmcrypt/default.nix
new file mode 100644
index 000000000000..eac577869e29
--- /dev/null
+++ b/pkgs/development/libraries/libmcrypt/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl }:
+
+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 = [];
+
+  meta = {
+    homepage = http://mcrypt.sourceforge.net;
+  };
+}
diff --git a/pkgs/development/libraries/libmemcached/default.nix b/pkgs/development/libraries/libmemcached/default.nix
new file mode 100644
index 000000000000..487b4de6cb76
--- /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 90888ce09616..42f7c60610ec 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/libmsn/libmsn-4.1-openssl-1.patch b/pkgs/development/libraries/libmsn/libmsn-4.1-openssl-1.patch
deleted file mode 100644
index cdaecf7dc54d..000000000000
--- 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/libnatspec/default.nix b/pkgs/development/libraries/libnatspec/default.nix
index fbab569e38cc..985745c38986 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/libnova/default.nix b/pkgs/development/libraries/libnova/default.nix
index e24a93c10439..28decb9cfca0 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/libqalculate/default.nix b/pkgs/development/libraries/libqalculate/default.nix
index 9c75bd51db14..bf1a1e232bb6 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/libspotify/default.nix b/pkgs/development/libraries/libspotify/default.nix
new file mode 100644
index 000000000000..9c28a99fee8d
--- /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.proprietary;
+  };
+}
diff --git a/pkgs/development/libraries/libssh/default.nix b/pkgs/development/libraries/libssh/default.nix
index 1ac93db0f4df..f8621f3b78b2 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 ];
+
   cmakeFlags = "-DWITH_GCRYPT=ON";
+
   meta = {
     description = "SSH client library";
     license = "LGPL";
diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix
index bf9927c93072..92ab8d67c91e 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/libxklavier/default.nix b/pkgs/development/libraries/libxklavier/default.nix
index 419f9a497c08..b50399d4f108 100644
--- a/pkgs/development/libraries/libxklavier/default.nix
+++ b/pkgs/development/libraries/libxklavier/default.nix
@@ -5,7 +5,7 @@ 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";
   };
 
diff --git a/pkgs/development/libraries/libxtc_dxtn/default.nix b/pkgs/development/libraries/libxtc_dxtn/default.nix
new file mode 100644
index 000000000000..0e7442633d77
--- /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/mesa/swrast-settexbuffer.patch b/pkgs/development/libraries/mesa/swrast-settexbuffer.patch
deleted file mode 100644
index c74daa3aef12..000000000000
--- 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/muparser/default.nix b/pkgs/development/libraries/muparser/default.nix
index 009b6c9ddfe4..3cc1c6ce43c5 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 f692c14a6df1..0a2df0003847 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/ncbi/default.nix b/pkgs/development/libraries/ncbi/default.nix
index 0b795e78ad50..a74cd81854e1 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/nettle/default.nix b/pkgs/development/libraries/nettle/default.nix
index 2a4d89bb4f0c..2e444c321773 100644
--- a/pkgs/development/libraries/nettle/default.nix
+++ b/pkgs/development/libraries/nettle/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation (rec {
   buildInputs = [ gnum4 ];
   propagatedBuildInputs = [ gmp ];
 
-  doCheck = (stdenv.system != "i686-cygwin");
+  doCheck = (stdenv.system != "i686-cygwin" && !stdenv.isDarwin);
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index e0bd1d2a53ed..8e4edcad8850 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -13,8 +13,9 @@ let
   secLoadPatch = fetchurl {
     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://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";
   };
diff --git a/pkgs/development/libraries/ogre/default.nix b/pkgs/development/libraries/ogre/default.nix
index 3a8e1c4ae556..6bb1916ed0fb 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/oniguruma/default.nix b/pkgs/development/libraries/oniguruma/default.nix
new file mode 100644
index 000000000000..984b84085fe4
--- /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/opencascade/default.nix b/pkgs/development/libraries/opencascade/default.nix
index 375aa4f2d58f..7cc47a30eb70 100644
--- a/pkgs/development/libraries/opencascade/default.nix
+++ b/pkgs/development/libraries/opencascade/default.nix
@@ -2,10 +2,10 @@
 ftgl, freetype}:
 
 stdenv.mkDerivation rec {
-  name = "opencascade-6.5.2";
+  name = "opencascade-6.5.4";
   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.5.4_release/OpenCASCADE654.tar.gz;
+    sha256 = "1di08mc0wly4cdi3rh9kj52bk0bfpyk6dy03c9yfnv04i7z03kmy";
   };
 
   buildInputs = [ mesa tcl tk file libXmu automake autoconf libtool qt4 ftgl freetype ];
@@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
 
   # -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";
+  NIX_CFLAGS_COMPILE = "-fpermissive";
 
-  configureFlags = [ "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" ];
+  configureFlags = [ "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" "--with-qt=${qt4}" "--with-ftgl=${ftgl}" "--with-freetype=${freetype}" ];
 
   postInstall = ''
     mv $out/inc $out/include
diff --git a/pkgs/development/libraries/opencv/changeset_r3190.diff b/pkgs/development/libraries/opencv/changeset_r3190.diff
deleted file mode 100644
index 4a614659e723..000000000000
--- 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 d40b253df2f4..207c14bdce05 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg
 , pkgconfig, gstreamer, xineLib, glib }:
 
-let v = "2.4.2"; in
+let v = "2.4.3"; in
 
 stdenv.mkDerivation rec {
   name = "opencv-${v}";
 
   src = fetchurl {
     url = "mirror://sourceforge/opencvlibrary/OpenCV-${v}.tar.bz2";
-    sha256 = "0a1c4ys78k670dsk1fapylpf8hwfyzy944r9jvwivqh33s0j6039";
+    sha256 = "16zmyr383x9ka81mp6h2s9hlfzd383njddf3x1rswkldjy2ykyzq";
   };
 
   buildInputs = [ gtk glib libjpeg libpng libtiff jasper ffmpeg xineLib gstreamer ];
diff --git a/pkgs/development/libraries/opencv/default.nix.edited b/pkgs/development/libraries/opencv/default.nix.edited
deleted file mode 100644
index 05db48095c3c..000000000000
--- 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/openmotif/default.nix b/pkgs/development/libraries/openmotif/default.nix
deleted file mode 100644
index cf9b059bd163..000000000000
--- 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/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index 88daab5ff92f..788b6d6d32b8 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/qimageblitz/default.nix b/pkgs/development/libraries/qimageblitz/default.nix
index 4aac06a51014..5800b562e6b0 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 a4b146ff424f..af960c1b9933 100644
--- a/pkgs/development/libraries/qjson/default.nix
+++ b/pkgs/development/libraries/qjson/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "qjson-0.7.1";
 
   src = fetchurl {
-    url = "mirror://sf/qjson/${name}.tar.bz2";
+    url = "mirror://sourceforge/qjson/${name}.tar.bz2";
     sha256 = "155r7nypgnsvjc6w3q51zmjchpqxi4c3azad9cf1fip8bws993iv";
   };
 
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 87cec5bb3d9a..0acf5c07bbde 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -9,6 +9,7 @@
 , buildWebkit ? true
 , flashplayerFix ? false, gdk_pixbuf
 , gtkStyle ? false, libgnomeui, gtk, GConf, gnome_vfs
+, developerBuild ? false
 }:
 
 with stdenv.lib;
@@ -74,6 +75,7 @@ stdenv.mkDerivation rec {
       -nomake demos -nomake examples -nomake docs
 
       -no-phonon ${if buildWebkit then "" else "-no"}-webkit ${if buildMultimedia then "" else "-no"}-multimedia -audio-backend
+      ${if developerBuild then "-developer-build" else ""}
     '';
 
   propagatedBuildInputs =
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 d48511cead39..000000000000
--- 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/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix
index 2cca8d7d9c44..75f9de5e96a2 100644
--- a/pkgs/development/libraries/science/math/atlas/default.nix
+++ b/pkgs/development/libraries/science/math/atlas/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
   name = "atlas-3.9.67";
 
   src = fetchurl {
-    url = mirror://sf/math-atlas/atlas3.9.67.tar.bz2;
+    url = mirror://sourceforge/math-atlas/atlas3.9.67.tar.bz2;
     sha256 = "06xxlv440z8a3qmfrh17p28girv71c6awvpw5vhpspr0pcsgk1pa";
   };
 
diff --git a/pkgs/development/libraries/spice-protocol/default.nix b/pkgs/development/libraries/spice-protocol/default.nix
index c1b6d0e67e7f..25f422756449 100644
--- a/pkgs/development/libraries/spice-protocol/default.nix
+++ b/pkgs/development/libraries/spice-protocol/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "spice-protocol-0.10.1";
+  name = "spice-protocol-0.12.2";
 
   src = fetchurl {
     url = "http://www.spice-space.org/download/releases/${name}.tar.bz2";
-    sha256 = "0drmy2ws7qwmvjxfynhssbvh1y954rfik99hnl789g7yg6vcpxp5";
+    sha256 = "0v6msf6gbl8g69qamp97dggz148zpc3ncbfgbq3b472wszjdkclb";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix
index 52726f017abf..fc2e5bb72c5f 100644
--- a/pkgs/development/libraries/spice/default.nix
+++ b/pkgs/development/libraries/spice/default.nix
@@ -1,27 +1,28 @@
 { stdenv, fetchurl, pkgconfig, pixman, celt, alsaLib, openssl
 , libXrandr, libXfixes, libXext, libXrender, libXinerama, libjpeg, zlib
-, spice_protocol }:
+, spice_protocol, python, pyparsing }:
 
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "spice-0.10.1";
+  name = "spice-0.12.0";
 
   src = fetchurl {
     url = "http://www.spice-space.org/download/releases/${name}.tar.bz2";
-    sha256 = "105p5fh6hhhzvz0fh1x52lzi41rpvajf390xbbw3da4417lf5pqk";
+    sha256 = "15mp6nz467h4l5jg3vk51si6r5w7g329jvsy61f2gl3yabwcxmva";
   };
 
   buildInputs = [ pixman celt alsaLib openssl libjpeg zlib
                   libXrandr libXfixes libXrender libXext libXinerama
-                ];
+                  python pyparsing ];
 
   buildNativeInputs = [ pkgconfig spice_protocol ];
 
-  # NIX_CFLAGS_COMPILE = "-fno-stack-protector";
+  NIX_CFLAGS_COMPILE = "-fno-stack-protector";
 
   configureFlags = [
     "--with-sasl=no"
+    "--disable-smartcard"
   ];
 
   postInstall = ''
diff --git a/pkgs/development/libraries/taglib/live.nix b/pkgs/development/libraries/taglib/live.nix
deleted file mode 100644
index 35af2ff51958..000000000000
--- 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/tcp-wrappers/default.nix b/pkgs/development/libraries/tcp-wrappers/default.nix
deleted file mode 100644
index 14335e6a3adb..000000000000
--- 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 626fce1a88ab..000000000000
--- 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 1e55819f8dec..000000000000
--- 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/tinyxml/2.6.2-add-pkgconfig.patch b/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch
new file mode 100644
index 000000000000..ca89685a458f
--- /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 000000000000..3164261291ba
--- /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 000000000000..8770859817ca
--- /dev/null
+++ b/pkgs/development/libraries/tinyxml/2.6.2.nix
@@ -0,0 +1,61 @@
+{ 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 = ''
+    # 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/tsocks/default.nix b/pkgs/development/libraries/tsocks/default.nix
new file mode 100644
index 000000000000..a0d607517ac3
--- /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/v8/default.nix b/pkgs/development/libraries/v8/default.nix
index 5cd083a7e330..1fd6179183fd 100644
--- a/pkgs/development/libraries/v8/default.nix
+++ b/pkgs/development/libraries/v8/default.nix
@@ -37,7 +37,11 @@ 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/
     '';
 }
diff --git a/pkgs/development/libraries/wxGTK-2.9/default.nix b/pkgs/development/libraries/wxGTK-2.9/default.nix
index a0e69bff0fea..21a80d8951fb 100644
--- a/pkgs/development/libraries/wxGTK-2.9/default.nix
+++ b/pkgs/development/libraries/wxGTK-2.9/default.nix
@@ -7,12 +7,15 @@ 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 ]
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 83e800faa2c3..3c28ed04dba2 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/androidenv/addon.xml b/pkgs/development/mobile/androidenv/addon.xml
index 7b0f69128a63..fb5d324d7789 100644
--- a/pkgs/development/androidenv/addon.xml
+++ b/pkgs/development/mobile/androidenv/addon.xml
@@ -16,69 +16,85 @@
 -->
 <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">This is the Android Software Development Kit License Agreement.
+    <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 "SDK" 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 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+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 You can accept this License Agreement by:
+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.
 
-(A) clicking to accept or agree to this License Agreement, where this option is made available to you; or
+2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
 
-(B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards.
+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.3 You may not use the SDK and may not accept the Licensing 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.
 
-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 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. "Intellectual Property Rights" 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.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.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 SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not 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.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.4 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.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.5 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.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.6 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.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.
 
-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 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, 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 permission to do so.
+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 the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+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 for the Android Platform
+
+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.
 
@@ -86,55 +102,65 @@
 
 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 providing 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.
+(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 "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+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.
+
+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 constitute the whole legal agreement between you and Google and govern your use of the SDK (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 SDK.
+
+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.
 
@@ -148,7 +174,7 @@
 
 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.
 
-April 10, 2009
+November 13, 2012
     </sdk:license>
 
     <sdk:license id="android-googletv-license" type="text">Terms and Conditions
@@ -157,9 +183,9 @@ This is the Google TV Add-on for the Android Software Development Kit License Ag
 
 1. Introduction
 
-1.1 The Google TV Add-on for the Android Software Development Kit (referred to in this License Agreement as the "Google TV Add-on" 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.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 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+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
 
@@ -179,7 +205,7 @@ This is the Google TV Add-on for the Android Software Development Kit License Ag
 
 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. "Intellectual Property Rights" 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.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.
 
@@ -257,7 +283,7 @@ This is the Google TV Add-on for the Android Software Development Kit License Ag
 
 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 "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+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.
 
@@ -704,11 +730,41 @@ August 15, 2011
         <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 Thu Aug  9 13:20:52 2012 from git_jb-dev @ 416700 -->
-        <sdk:revision>10</sdk:revision>
+        <!-- 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>
@@ -716,11 +772,12 @@ August 15, 2011
         <sdk:old-paths>compatibility</sdk:old-paths>
         <sdk:archives>
             <sdk:archive arch="any" os="any">
-                <sdk:size>1161015</sdk:size>
-                <sdk:checksum type="sha1">7c62e542d46ac3bdb89e1b90503d6afae557cf7d</sdk:checksum>
-                <sdk:url>support_r10.zip</sdk:url>
+                <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 ....................... -->
@@ -768,15 +825,15 @@ August 15, 2011
         <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>1</sdk:revision>
+        <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>363692</sdk:size>
-                <sdk:checksum type="sha1">b1808a7d5f91a3ed42839b950fd254c60e9328f1</sdk:checksum>
-                <sdk:url>google_play_services_1013.zip</sdk:url>
+                <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>
@@ -806,14 +863,14 @@ August 15, 2011
         <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>2</sdk:revision>
-        <sdk:description>Google Play Billing sample code</sdk:description>
-        <sdk:desc-url>http://developer.android.com/guide/market/billing/index.html</sdk:desc-url>
+        <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>55191</sdk:size>
-                <sdk:checksum type="sha1">3c84c05c60a9cabb578cebce0515860be7ad23d2</sdk:checksum>
-                <sdk:url>market_billing_r02.zip</sdk:url>
+                <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"/>
@@ -890,4 +947,4 @@ August 15, 2011
         </sdk:archives>
         <sdk:uses-license ref="android-sdk-license"/>
     </sdk:extra>
-</sdk:sdk-addon>
\ No newline at end of file
+</sdk:sdk-addon>
diff --git a/pkgs/development/androidenv/addons.nix b/pkgs/development/mobile/androidenv/addons.nix
index b995b4301e9c..f26db5c2cb73 100644
--- a/pkgs/development/androidenv/addons.nix
+++ b/pkgs/development/mobile/androidenv/addons.nix
@@ -182,5 +182,17 @@ in
       };
     };
     
+  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/androidenv/androidsdk.nix b/pkgs/development/mobile/androidenv/androidsdk.nix
index b175266ebf7b..e8e1f919fe4e 100644
--- a/pkgs/development/androidenv/androidsdk.nix
+++ b/pkgs/development/mobile/androidenv/androidsdk.nix
@@ -2,22 +2,22 @@
 , platformTools, support, platforms, sysimages, addons
 , zlib_32bit
 , libX11_32bit, libxcb_32bit, libXau_32bit, libXdmcp_32bit, libXext_32bit
-, libX11, libXext, libXrender
+, libX11, libXext, libXrender, libxcb, libXau, libXdmcp
 , freetype, fontconfig, gtk, atk
 }:
 {platformVersions, useGoogleAPIs}:
 
 stdenv.mkDerivation {
-  name = "android-sdk-20.0.3";
+  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_r20.0.3-linux.tgz;
-      sha256 = "0xfb41xsjaf7n6b9gsrxm24jwg2fi1hzn73y69rlqm55bw1vxhc1";
+      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_r20.0.3-macosx.zip;
-      sha256 = "0eecaa04950d5c540f36ab4183a4cbaef3ae6a7434467bfc32febaeb796a8ff2";
+      url = http://dl.google.com/android/android-sdk_r21-macosx.zip;
+      md5 = "67e46adca90dd18d7291443f6c15d6af";
     }
     else throw "platform not ${stdenv.system} supported!";
   
@@ -32,12 +32,22 @@ stdenv.mkDerivation {
     ''
       # 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-x86 hprof-conv mksdcard sqlite3
+      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
@@ -48,11 +58,19 @@ stdenv.mkDerivation {
     
       # The emulators need additional libraries, which are not in the RPATH => let's wrap them
     
-      for i in emulator emulator-arm emulator-x86
+      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 .
diff --git a/pkgs/development/androidenv/build-app.nix b/pkgs/development/mobile/androidenv/build-app.nix
index 571cd2be6232..571cd2be6232 100644
--- a/pkgs/development/androidenv/build-app.nix
+++ b/pkgs/development/mobile/androidenv/build-app.nix
diff --git a/pkgs/development/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix
index d2769799df13..a76deb98b6ee 100644
--- a/pkgs/development/androidenv/default.nix
+++ b/pkgs/development/mobile/androidenv/default.nix
@@ -32,7 +32,7 @@ rec {
   androidsdk = import ./androidsdk.nix {
     inherit (pkgs) stdenv fetchurl unzip makeWrapper;
     inherit (pkgs) freetype fontconfig gtk atk;
-    inherit (pkgs.xorg) libX11 libXext libXrender;
+    inherit (pkgs.xorg) libX11 libXext libXrender libxcb libXau libXdmcp;
     
     inherit platformTools support platforms sysimages addons;
     
diff --git a/pkgs/development/androidenv/emulate-app.nix b/pkgs/development/mobile/androidenv/emulate-app.nix
index 3cbe57238066..3cbe57238066 100644
--- a/pkgs/development/androidenv/emulate-app.nix
+++ b/pkgs/development/mobile/androidenv/emulate-app.nix
diff --git a/pkgs/development/androidenv/generate-addons.sh b/pkgs/development/mobile/androidenv/generate-addons.sh
index 9b2cf34eabcc..9b2cf34eabcc 100755
--- a/pkgs/development/androidenv/generate-addons.sh
+++ b/pkgs/development/mobile/androidenv/generate-addons.sh
diff --git a/pkgs/development/androidenv/generate-addons.xsl b/pkgs/development/mobile/androidenv/generate-addons.xsl
index 0100b980a4ef..0100b980a4ef 100644
--- a/pkgs/development/androidenv/generate-addons.xsl
+++ b/pkgs/development/mobile/androidenv/generate-addons.xsl
diff --git a/pkgs/development/androidenv/generate-platforms.sh b/pkgs/development/mobile/androidenv/generate-platforms.sh
index 983d8bde87b9..983d8bde87b9 100755
--- a/pkgs/development/androidenv/generate-platforms.sh
+++ b/pkgs/development/mobile/androidenv/generate-platforms.sh
diff --git a/pkgs/development/androidenv/generate-platforms.xsl b/pkgs/development/mobile/androidenv/generate-platforms.xsl
index 1802ae63efe1..1802ae63efe1 100644
--- a/pkgs/development/androidenv/generate-platforms.xsl
+++ b/pkgs/development/mobile/androidenv/generate-platforms.xsl
diff --git a/pkgs/development/androidenv/generate-sysimages.sh b/pkgs/development/mobile/androidenv/generate-sysimages.sh
index dc28c27f45f0..dc28c27f45f0 100755
--- a/pkgs/development/androidenv/generate-sysimages.sh
+++ b/pkgs/development/mobile/androidenv/generate-sysimages.sh
diff --git a/pkgs/development/androidenv/generate-sysimages.xsl b/pkgs/development/mobile/androidenv/generate-sysimages.xsl
index 1224ebbd4e8d..1224ebbd4e8d 100644
--- a/pkgs/development/androidenv/generate-sysimages.xsl
+++ b/pkgs/development/mobile/androidenv/generate-sysimages.xsl
diff --git a/pkgs/development/androidenv/platform-tools.nix b/pkgs/development/mobile/androidenv/platform-tools.nix
index bc4ceb4e39da..554996082909 100644
--- a/pkgs/development/androidenv/platform-tools.nix
+++ b/pkgs/development/mobile/androidenv/platform-tools.nix
@@ -1,15 +1,15 @@
 {stdenv, stdenv_32bit, fetchurl, unzip, zlib, ncurses}:
 
 stdenv.mkDerivation {
-  name = "android-platform-tools-r15_rc7";
+  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_r15_rc7-linux.zip;
-      sha1 = "444e12ba413341282cd810d2e4bdb49975c95758";
+      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_r15_rc7-macosx.zip;
-      sha1 = "974eac4afbe404278fcda8f8cd39b55c82be012d";
+      url = https://dl-ssl.google.com/android/repository/platform-tools_r16-macosx.zip;
+      sha1 = "fbb0f8d2786a83b8c3eb6df402e706e136db8fed";
     }
     else throw "System ${stdenv.system} not supported!";
   
diff --git a/pkgs/development/androidenv/platforms-linux.nix b/pkgs/development/mobile/androidenv/platforms-linux.nix
index c2cff1b62a2c..f544fcc08bed 100644
--- a/pkgs/development/androidenv/platforms-linux.nix
+++ b/pkgs/development/mobile/androidenv/platforms-linux.nix
@@ -194,5 +194,17 @@ in
     };
   };
     
+  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/androidenv/platforms-macosx.nix b/pkgs/development/mobile/androidenv/platforms-macosx.nix
index 355740c4200c..a1434bbe56c1 100644
--- a/pkgs/development/androidenv/platforms-macosx.nix
+++ b/pkgs/development/mobile/androidenv/platforms-macosx.nix
@@ -194,5 +194,17 @@ in
     };
   };
     
+  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/androidenv/repository-7.xml b/pkgs/development/mobile/androidenv/repository-7.xml
index 695be1d90a74..7bbbaf1e3620 100644
--- a/pkgs/development/androidenv/repository-7.xml
+++ b/pkgs/development/mobile/androidenv/repository-7.xml
@@ -16,69 +16,85 @@
 -->
 <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">This is the Android Software Development Kit License Agreement.
+    <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 "SDK" 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 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+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 You can accept this License Agreement by:
+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.
 
-(A) clicking to accept or agree to this License Agreement, where this option is made available to you; or
+2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
 
-(B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards.
+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.3 You may not use the SDK and may not accept the Licensing 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.
 
-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 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. "Intellectual Property Rights" 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.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.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 SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not 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.4 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.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.5 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.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.6 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.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.
 
-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 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, 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 permission to do so.
+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 the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+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 for the Android Platform
+
+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.
 
@@ -86,55 +102,65 @@
 
 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 providing 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.
+(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 "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+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.
+
+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 constitute the whole legal agreement between you and Google and govern your use of the SDK (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 SDK.
+
+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.
 
@@ -148,7 +174,7 @@
 
 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.
 
-April 10, 2009
+November 13, 2012
     </sdk:license>
 
     <!-- PLATFORMS ........................ -->
@@ -180,6 +206,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated manually from earlier versions -->
@@ -213,6 +240,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -245,6 +273,7 @@ April 10, 2009
         <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. -->
@@ -280,6 +309,7 @@ April 10, 2009
         <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. -->
@@ -315,6 +345,7 @@ April 10, 2009
         <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. -->
@@ -339,6 +370,7 @@ April 10, 2009
         <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. -->
@@ -363,6 +395,7 @@ April 10, 2009
         <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. -->
@@ -388,6 +421,7 @@ April 10, 2009
         <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. -->
@@ -412,6 +446,7 @@ April 10, 2009
         <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. -->
@@ -436,6 +471,7 @@ April 10, 2009
         <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.
@@ -462,6 +498,7 @@ April 10, 2009
         <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. -->
@@ -486,6 +523,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -505,6 +543,7 @@ April 10, 2009
                 <sdk:url>android-14_r03.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -527,6 +566,7 @@ April 10, 2009
                 <sdk:url>android-15_r03.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -549,6 +589,30 @@ April 10, 2009
                 <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 ........................ -->
@@ -566,6 +630,7 @@ April 10, 2009
                 <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>
@@ -581,6 +646,7 @@ April 10, 2009
                 <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>
@@ -596,6 +662,23 @@ April 10, 2009
                 <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 ........................ -->
@@ -615,6 +698,7 @@ April 10, 2009
                 <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. -->
@@ -632,6 +716,7 @@ April 10, 2009
                 <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. -->
@@ -650,6 +735,7 @@ April 10, 2009
                 <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. -->
@@ -667,6 +753,7 @@ April 10, 2009
                 <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. -->
@@ -684,6 +771,7 @@ April 10, 2009
                 <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. -->
@@ -701,6 +789,7 @@ April 10, 2009
                 <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. -->
@@ -718,6 +807,7 @@ April 10, 2009
                 <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>
@@ -731,6 +821,7 @@ April 10, 2009
                 <sdk:url>samples-14_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <sdk:sample>
@@ -744,6 +835,7 @@ April 10, 2009
                 <sdk:url>samples-15_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <sdk:sample>
@@ -757,132 +849,125 @@ April 10, 2009
                 <sdk:url>samples-16_r01.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
-    <!-- PLATFORM-TOOLS ........................ -->
-
-    <sdk:platform-tool>
-        <!-- Generated at Thu Jul 19 18:38:34 2012 from git_jb-dev @ 407773 -->
-        <sdk:revision>
-            <sdk:major>14</sdk:major>
-        </sdk:revision>
+    <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="windows">
-                <sdk:size>11159472</sdk:size>
-                <sdk:checksum type="sha1">6028258d8f2fba14d8b40c3cf507afa0289aaa13</sdk:checksum>
-                <sdk:url>platform-tools_r14-windows.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive arch="any" os="linux">
-                <sdk:size>10985068</sdk:size>
-                <sdk:checksum type="sha1">6e2bc329c9485eb383172cbc2cde8b0c0cd1843f</sdk:checksum>
-                <sdk:url>platform-tools_r14-linux.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive arch="any" os="macosx">
-                <sdk:size>11342461</sdk:size>
-                <sdk:checksum type="sha1">4a015090c6a209fc33972acdbc65745e0b3c08b9</sdk:checksum>
-                <sdk:url>platform-tools_r14-macosx.zip</sdk:url>
+            <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:platform-tool>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- PLATFORM-TOOLS ........................ -->
 
     <sdk:platform-tool>
-        <!-- Generated at Wed Oct 17 15:42:13 2012 from git_jb-dev @ 505673 -->
+        <!-- Generated at Mon Nov 12 17:13:48 2012 from git_jb-mr1-dev @ 527242 -->
         <sdk:revision>
-            <sdk:major>15</sdk:major>
-            <sdk:preview>9</sdk:preview>
+            <sdk:major>16</sdk:major>
         </sdk:revision>
         <sdk:archives>
             <sdk:archive arch="any" os="windows">
-                <sdk:size>11170483</sdk:size>
-                <sdk:checksum type="sha1">853afdf5f63aaac61dcfd016a7acb930b6dac377</sdk:checksum>
-                <sdk:url>platform-tools_r15_rc9-windows.zip</sdk:url>
+                <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>10996592</sdk:size>
-                <sdk:checksum type="sha1">c1aa2bc0d6f7dac7e292151ee77752bbfb10d1c5</sdk:checksum>
-                <sdk:url>platform-tools_r15_rc9-linux.zip</sdk:url>
+                <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>11345162</sdk:size>
-                <sdk:checksum type="sha1">22ac626ec3526b606d358193a16df10179f1d4f5</sdk:checksum>
-                <sdk:url>platform-tools_r15_rc9-macosx.zip</sdk:url>
+                <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 Thu Aug  9 13:16:38 2012 from git_tools_r20 @ 427395 -->
+        <!-- Generated at Mon Nov 12 17:07:47 2012 from git_tools_r21 @ 519525 -->
         <sdk:revision>
-            <sdk:major>20</sdk:major>
-            <sdk:minor>0</sdk:minor>
-            <sdk:micro>3</sdk:micro>
+            <sdk:major>21</sdk:major>
         </sdk:revision>
         <sdk:min-platform-tools-rev>
-            <sdk:major>12</sdk:major>
+            <sdk:major>16</sdk:major>
         </sdk:min-platform-tools-rev>
         <sdk:archives>
             <sdk:archive arch="any" os="windows">
-                <sdk:size>90272048</sdk:size>
-                <sdk:checksum type="sha1">54fb94168e631e211910f88aa40c532205730dd4</sdk:checksum>
-                <sdk:url>tools_r20.0.3-windows.zip</sdk:url>
+                <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>82723559</sdk:size>
-                <sdk:checksum type="sha1">09bc633b406ae81981e3a0db19426acbb01ef219</sdk:checksum>
-                <sdk:url>tools_r20.0.3-linux.zip</sdk:url>
+                <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>58197071</sdk:size>
-                <sdk:checksum type="sha1">09cee5ff3226277a6f0c07dcd29cba4ffc2e1da4</sdk:checksum>
-                <sdk:url>tools_r20.0.3-macosx.zip</sdk:url>
+                <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 Wed Oct 17 15:40:42 2012 from git_mirror-aosp-master @ 506320 -->
+        <!-- Generated at Fri Nov 30 13:45:55 2012 from git_tools_r21 @ 539280 -->
         <sdk:revision>
             <sdk:major>21</sdk:major>
-            <sdk:preview>9</sdk:preview>
+            <sdk:minor>0</sdk:minor>
+            <sdk:micro>1</sdk:micro>
+            <sdk:preview>1</sdk:preview>
         </sdk:revision>
         <sdk:min-platform-tools-rev>
-            <sdk:major>15</sdk:major>
-            <sdk:preview>9</sdk:preview>
+            <sdk:major>16</sdk:major>
         </sdk:min-platform-tools-rev>
         <sdk:archives>
             <sdk:archive arch="any" os="windows">
-                <sdk:size>98865433</sdk:size>
-                <sdk:checksum type="sha1">a1379cef10f33e74061f6935fd74922b0351addb</sdk:checksum>
-                <sdk:url>tools_r21_rc9-windows.zip</sdk:url>
+                <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>91377922</sdk:size>
-                <sdk:checksum type="sha1">dde958cb26276b632a02ca6d530506c09ce4e086</sdk:checksum>
-                <sdk:url>tools_r21_rc9-linux.zip</sdk:url>
+                <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>65655657</sdk:size>
-                <sdk:checksum type="sha1">43803f6179707ca6bd4a37e129bcf022ebda0043</sdk:checksum>
-                <sdk:url>tools_r21_rc9-macosx.zip</sdk:url>
+                <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 Tue Oct  9 14:08:23 2012 from git_jb-dev @ 495790 -->
-        <sdk:revision>3</sdk:revision>
-        <sdk:api-level>16</sdk:api-level>
+        <!-- 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>164244602</sdk:size>
-                <sdk:checksum type="sha1">3168152f52f5edc0c85523c875c96e7431ab4545</sdk:checksum>
-                <sdk:url>docs-16_r03.zip</sdk:url>
+                <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 ........................ -->
@@ -898,6 +983,7 @@ April 10, 2009
                 <sdk:url>sources-14_r01.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:source>
 
     <sdk:source>
@@ -911,6 +997,7 @@ April 10, 2009
                 <sdk:url>sources-15_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:source>
 
     <sdk:source>
@@ -924,5 +1011,20 @@ April 10, 2009
                 <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>
\ No newline at end of file
+</sdk:sdk-repository>
diff --git a/pkgs/development/androidenv/support.nix b/pkgs/development/mobile/androidenv/support.nix
index 0c69bf37107e..2e9690de7a26 100644
--- a/pkgs/development/androidenv/support.nix
+++ b/pkgs/development/mobile/androidenv/support.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation {
-  name = "android-support";
+  name = "android-support-r11";
   src = fetchurl {
-    url = https://dl-ssl.google.com/android/repository/support_r10.zip;
-    sha1 = "7c62e542d46ac3bdb89e1b90503d6afae557cf7d";
+    url = https://dl-ssl.google.com/android/repository/support_r11.zip;
+    sha1 = "d30d182d8e4c86bb4464c03a83ccffce7bc84ecd";
   };
   
   buildCommand = ''
diff --git a/pkgs/development/androidenv/sysimages.nix b/pkgs/development/mobile/androidenv/sysimages.nix
index 3add0c41444b..b35b42989838 100644
--- a/pkgs/development/androidenv/sysimages.nix
+++ b/pkgs/development/mobile/androidenv/sysimages.nix
@@ -38,5 +38,13 @@ in
     };
   };
     
+  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 000000000000..aa46517f5718
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/build-app.nix
@@ -0,0 +1,119 @@
+{stdenv, androidsdk, titaniumsdk, xcodewrapper}:
+{ appId, name, 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";
+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 "${name}" ${androidsdkComposition}/libexec/android-sdk-* $(pwd) ${appId} ${androidKeyStore} ${androidKeyStorePassword} ${androidKeyAlias} $out''
+        else
+          ''${titaniumsdk}/mobilesdk/*/*/android/builder.py build "${name}" ${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} "${name}" "$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} "${name}" "$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} "${name}"
+          ''
+
+      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"
+        else if target == "iphone" then ""
+        else throw "Target: ${target} is not supported!"}
+  '';
+  
+  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 000000000000..8117b452d70b
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/default.nix
@@ -0,0 +1,18 @@
+{pkgs, pkgs_i686}:
+
+rec {
+  androidenv = pkgs.androidenv;
+
+  xcodeenv = if pkgs.stdenv.system == "x86_64-darwin" then pkgs.xcodeenv else null;
+
+  titaniumsdk = import ./titaniumsdk.nix {
+    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 000000000000..1526d4c43590
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/default.nix
@@ -0,0 +1,38 @@
+let
+  pkgs = import <nixpkgs> {};
+  pkgs_i686 = import <nixpkgs> { system = "i686-linux"; };
+in
+rec {
+  titaniumenv = import ./.. {
+    inherit pkgs pkgs_i686;
+  };
+  
+  kitchensink_android = import ./kitchensink {
+    inherit titaniumenv;
+    inherit (pkgs) fetchgit;
+    target = "android";
+  };
+  
+  kitchensink_iphone = import ./kitchensink {
+    inherit titaniumenv;
+    inherit (pkgs) fetchgit;
+    target = "iphone";
+  };
+  
+  emulate_kitchensink = import ./emulate-kitchensink {
+    inherit (titaniumenv) androidenv;
+    kitchensink = kitchensink_android;
+  };
+  
+  simulate_kitchensink_iphone = import ./simulate-kitchensink {
+    inherit (titaniumenv) xcodeenv;
+    kitchensink = kitchensink_iphone;
+    device = "iPhone";
+  };
+  
+  simulate_kitchensink_ipad = import ./simulate-kitchensink {
+    inherit (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 000000000000..817aa5ab37f5
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix
@@ -0,0 +1,10 @@
+{androidenv, kitchensink}:
+
+androidenv.emulateApp {
+  name = "kitchensink";
+  app = kitchensink;
+  platformVersion = "8";
+  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 000000000000..8e2b1df264a6
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
@@ -0,0 +1,24 @@
+{titaniumenv, fetchgit, target, androidPlatformVersions ? [ "8" ]}:
+
+titaniumenv.buildApp {
+  name = "KitchenSink";
+  appId = "com.appcelerator.kitchensink";
+  src = fetchgit {
+    url = https://github.com/appcelerator/KitchenSink.git;
+    rev = "0f2c0b818034cc4e6867f0aa2afc98bf77dbff02";
+    sha256 = "de31496cfb5625d7a193bbbc32a8021e4094ffab20ae13ef2e1583b0394d7c60";
+  };
+  
+  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 000000000000..70ec534f6ae2
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix
@@ -0,0 +1,8 @@
+{xcodeenv, kitchensink, device}:
+
+xcodeenv.simulateApp {
+  name = "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 000000000000..76b330136b66
--- /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 000000000000..c849aaa611c6
--- /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/fixtiverify.sed b/pkgs/development/mobile/titaniumenv/fixtiverify.sed
new file mode 100644
index 000000000000..8e1114769c89
--- /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.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk.nix
new file mode 100644
index 000000000000..d3831a9c2bea
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/titaniumsdk.nix
@@ -0,0 +1,60 @@
+{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
+
+stdenv.mkDerivation {
+  name = "titanium-mobilesdk-2.1.5.v20121112144658";
+  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.5.v20121112144658-linux.zip;
+    sha1 = "79f073d11ee893c508c5aa675a3126501dd385fd";
+  }
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
+    url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/2_1_X/mobilesdk-2.1.5.v20121112144658-osx.zip;
+    sha1 = "6a9a726882222d1615de332aa1ca608c15564e1c";
+  }
+  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/xcodeenv/build-app.nix b/pkgs/development/mobile/xcodeenv/build-app.nix
new file mode 100644
index 000000000000..3ac9e4bb9581
--- /dev/null
+++ b/pkgs/development/mobile/xcodeenv/build-app.nix
@@ -0,0 +1,92 @@
+{stdenv, xcodewrapper}:
+{ name
+, src
+, 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 "iphoneos6.0" else "iphonesimulator6.0"
+    else sdk;
+
+  # The following is to prevent repetition
+  deleteKeychain = "security delete-keychain $keychainName";
+in
+stdenv.mkDerivation {
+  inherit name 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
+      ''}
+      
+      # 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 000000000000..7f834688e636
--- /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 000000000000..456732abe1f4
--- /dev/null
+++ b/pkgs/development/mobile/xcodeenv/simulate-app.nix
@@ -0,0 +1,17 @@
+{stdenv, xcodewrapper}:
+{name, app, device ? "iPhone", baseDir ? ""}:
+
+stdenv.mkDerivation {
+  inherit name;
+  buildCommand = ''
+    ensureDir $out/bin
+    cat > $out/bin/run-test-simulator << "EOF"
+    #! ${stdenv.shell} -e
+
+    cd ${app}/${baseDir}/${name}.app
+    "$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication ./${name} -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 000000000000..39804b1a248b
--- /dev/null
+++ b/pkgs/development/mobile/xcodeenv/xcodewrapper.nix
@@ -0,0 +1,24 @@
+{stdenv}:
+
+let
+  version = "4.5.2";
+in
+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/lablgtkmathview/configure.patch b/pkgs/development/ocaml-modules/lablgtkmathview/configure.patch
deleted file mode 100644
index b841e8f43822..000000000000
--- 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/perl-modules/Compress-Raw-Bzip2/default.nix b/pkgs/development/perl-modules/Compress-Raw-Bzip2/default.nix
deleted file mode 100644
index 6515efada6f0..000000000000
--- 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 c2c7b5f83631..9385981e2c37 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,9 @@ buildPerlPackage rec {
   '';
 
   doCheck = !stdenv.isDarwin;
+
+  meta = {
+    homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+    license = "perl5";
+  };
 }
diff --git a/pkgs/development/perl-modules/DBD-Pg/default.nix b/pkgs/development/perl-modules/DBD-Pg/default.nix
index 0d0cb1accc5b..be5faa330aea 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/Google-ProtocolBuffers-multiline-comments.patch b/pkgs/development/perl-modules/Google-ProtocolBuffers-multiline-comments.patch
new file mode 100644
index 000000000000..6b634d0d2424
--- /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/starman-dont-change-name.patch b/pkgs/development/perl-modules/starman-dont-change-name.patch
deleted file mode 100644
index 82454cfdd165..000000000000
--- 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 402f1cb41bef..000000000000
--- 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/generic/default.nix b/pkgs/development/python-modules/generic/default.nix
index 4e0b61002316..70bf92f0ae90 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,32 +50,60 @@ 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
-      # dependencies is to have them in the PYTHONPATH variable).
-      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
+
+      for inputsfile in propagated-build-inputs propagated-build-native-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 65f3229ca7c4..d42be1469552 100644
--- a/pkgs/development/python-modules/generic/wrap.sh
+++ b/pkgs/development/python-modules/generic/wrap.sh
@@ -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/offline-distutils/default.nix b/pkgs/development/python-modules/offline-distutils/default.nix
new file mode 100644
index 000000000000..269f67bf5cd0
--- /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 4cf4576c0ce4..1dfdfee08fb6 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 8aebf1d78290..1e8ceed6878f 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/default.nix b/pkgs/development/python-modules/pycrypto/default.nix
index 9c756c9ed64c..0ad1663da65a 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/default.nix b/pkgs/development/python-modules/pygobject/default.nix
index 4ef851f5b3ed..5575243bd9f3 100644
--- a/pkgs/development/python-modules/pygobject/default.nix
+++ b/pkgs/development/python-modules/pygobject/default.nix
@@ -12,16 +12,12 @@ stdenv.mkDerivation rec {
 
   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 81147fff17dc..07d57591f1ac 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/python-gudev/default.nix b/pkgs/development/python-modules/python-gudev/default.nix
deleted file mode 100644
index c9105555f9d0..000000000000
--- 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/recursive-pth-loader/default.nix b/pkgs/development/python-modules/recursive-pth-loader/default.nix
new file mode 100644
index 000000000000..959882be9380
--- /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 000000000000..057e779803cb
--- /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 50b73aaf8f60..468ea50c9243 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -1,7 +1,9 @@
 { stdenv, fetchurl, python, wrapPython }:
 
 stdenv.mkDerivation rec {
-  name = "setuptools-0.6c11";
+  name = "python-setuptools-" + version;
+
+  version = "0.6c11";
 
   src = fetchurl {
     url = "http://pypi.python.org/packages/source/s/setuptools/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/setuptools/site.nix b/pkgs/development/python-modules/setuptools/site.nix
new file mode 100644
index 000000000000..34e7b478595e
--- /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 5093fdbead94..d3e588bd1cd2 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 c01945bf472b..000000000000
--- 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 223604129641..000000000000
--- 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 4775cfba49b9..000000000000
--- 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
index b57b9884e613..60ff5ede75a0 100644
--- a/pkgs/development/qtcreator/default.nix
+++ b/pkgs/development/qtcreator/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, qt4 }:
+{ stdenv, fetchurl, qt4_for_qtcreator }:
 
 let
-  version = "2.5.2";
+  version = "2.6.0";
 in
 
 stdenv.mkDerivation rec {
@@ -9,16 +9,19 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://origin.releases.qt-project.org/qtcreator/${version}/qt-creator-${version}-src.tar.gz";
-    md5 = "4a9c09cdf4609753283c31451c84ceb8";
+    md5 = "9bf01098f84a0fe930b2718d11124204";
   };
 
-  buildInputs = [ qt4 ];
+  buildInputs = [ qt4_for_qtcreator ];
 
   doCheck = false;
 
   enableParallelBuilding = true;
 
-  preConfigure = "qmake";
+  preConfigure = ''
+    qmake -spec linux-g++ "QT_PRIVATE_HEADERS=${qt4_for_qtcreator}/include" qtcreator.pro
+  '';
+
   installFlags = "INSTALL_ROOT=$(out)";
 
   meta = {
diff --git a/pkgs/development/tools/analysis/radare/lua.patch b/pkgs/development/tools/analysis/radare/lua.patch
deleted file mode 100644
index 3a2ca0d505d4..000000000000
--- 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/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 668a6c4d6b56..000000000000
--- 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 fad5e047f94c..000000000000
--- 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/leiningen/builder.sh b/pkgs/development/tools/build-managers/leiningen/builder.sh
index df7ace8e4f33..c4b7002a7186 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 e5a20b46046c..35c340ae0f95 100644
--- a/pkgs/development/tools/build-managers/leiningen/default.nix
+++ b/pkgs/development/tools/build-managers/leiningen/default.nix
@@ -1,34 +1,29 @@
-{stdenv, fetchurl, makeWrapper, openjdk, rlwrap}:
+{stdenv, fetchurl, makeWrapper, openjdk, rlwrap, clojure }:
 
 stdenv.mkDerivation rec {
   pname = "leiningen";
-  version = "1.7.1";
+  version = "2.0.0";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
-    sha256 = "7684b899edd6004abafd8e26d2b43d5691217f1aaca535fb94bde1594c8129a5";
+    sha256 = "0malymlswxwgh8amkw37qjb8n34ylw3chgbdxgxkq34rkvhv60hb";
   };
 
   jarsrc = fetchurl {
-    url = "https://github.com/downloads/technomancy/leiningen/leiningen-${version}-standalone.jar";
-    sha256 = "5d167b7572b9652d44c2b58a13829704842d976fd2236530ef552194e6c12150";
+    url = "https://leiningen.s3.amazonaws.com/downloads/leiningen-2.0.0-standalone.jar";
+    sha256 = "10jvk19mr5dcl5a9kzna9zslh77v3ixi8awhrhxi30dn1yj3r7ck";
   };
 
-  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.0.0.patch;
 
-  inherit rlwrap;
+  inherit rlwrap clojure;
 
   builder = ./builder.sh;
 
   buildInputs = [ makeWrapper ];
 
-  propagatedBuildInputs = [ openjdk ];
+  propagatedBuildInputs = [ openjdk clojure ];
 
   meta = {
     homepage = https://github.com/technomancy/leiningen;
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 208199f355df..000000000000
--- 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 b62701e25191..000000000000
--- 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.0.0.patch b/pkgs/development/tools/build-managers/leiningen/lein_2.0.0.patch
new file mode 100644
index 000000000000..23f6b6247764
--- /dev/null
+++ b/pkgs/development/tools/build-managers/leiningen/lein_2.0.0.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/casperjs/default.nix b/pkgs/development/tools/casperjs/default.nix
new file mode 100644
index 000000000000..f140f0d7862d
--- /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/xdoc/builder.sh b/pkgs/development/tools/documentation/xdoc/builder.sh
deleted file mode 100644
index 4bc414ff7bfe..000000000000
--- 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 cc56d7e133e4..000000000000
--- 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/haskell/BNFC/default.nix b/pkgs/development/tools/haskell/BNFC/default.nix
index e737a02a4acb..c6cbc4a53587 100644
--- a/pkgs/development/tools/haskell/BNFC/default.nix
+++ b/pkgs/development/tools/haskell/BNFC/default.nix
@@ -2,13 +2,13 @@
 
 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 ];
   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 382a940408f4..f5d43a7ab50f 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.3";
-  sha256 = "04bx7przxha38n9vckcxz3mbcxcws5ifbc1xfm0rg6bn8rym78yb";
+  version = "0.7.0.4";
+  sha256 = "1rxbanvw1dpdnpmrf5gpl12gn9796yq89dnmdxy56mb9qzsm7nm6";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/cabal2nix/default.nix b/pkgs/development/tools/haskell/cabal2nix/default.nix
index 8ce6b62a521f..e3b6378e3d91 100644
--- a/pkgs/development/tools/haskell/cabal2nix/default.nix
+++ b/pkgs/development/tools/haskell/cabal2nix/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cabal2nix";
-  version = "1.42";
-  sha256 = "02yg4lj2y272fvn79kgqccizs71xg5ifnjhpw4vhw5wya657a20w";
+  version = "1.43";
+  sha256 = "00blyn8hxj7d0ib7gg0a2gk36scm1isr5m4xsi9nvqay3261b068";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ Cabal filepath hackageDb HTTP mtl regexPosix ];
diff --git a/pkgs/development/tools/haskell/hlint/default.nix b/pkgs/development/tools/haskell/hlint/default.nix
index 739e48ba247a..8f8e16dd2609 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.35";
-  sha256 = "1w6scnbpy6vl46r0srpkxr0qjr0lpld046d9gb4s9c7if3ajibjv";
+  version = "1.8.42";
+  sha256 = "03myq4wagx5d9g6v8znw4l67f1irami0fnlw48rxlqhfn33y5mgc";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/splot/default.nix b/pkgs/development/tools/haskell/splot/default.nix
index 9f35054b4c01..4bd47b8decd4 100644
--- a/pkgs/development/tools/haskell/splot/default.nix
+++ b/pkgs/development/tools/haskell/splot/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "splot";
-  version = "0.3.6";
-  sha256 = "0fxjji6b0v3hf4pn1cbh88nvp4n4bfgfkiga6l149flk5nmlapqx";
+  version = "0.3.8";
+  sha256 = "188v9c070wn6gr47k5q55gsiph0lj96d96bss76gz7znknfj9rm3";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/timeplot/default.nix b/pkgs/development/tools/haskell/timeplot/default.nix
index ffdfa7869e04..d95c8cea03f3 100644
--- a/pkgs/development/tools/haskell/timeplot/default.nix
+++ b/pkgs/development/tools/haskell/timeplot/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "timeplot";
-  version = "1.0.18";
-  sha256 = "1q4kzzqmr7bx97wfaasrkzii6b9zpxcxggshpsjv02bwb1hazxmc";
+  version = "1.0.19";
+  sha256 = "1mwhrcjavx56z3msdf5zqvqlx5m3hbcw85f22h8p9wvfgn79aydx";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/uuagc/cabal.nix b/pkgs/development/tools/haskell/uuagc/cabal.nix
index 3c2f0351672a..ea981ad423b0 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.3.0";
-  sha256 = "0kr0k8pgz52n4g7x998djwncfr9byyxg5slqq80qijh06v01bm79";
+  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 6289abd71205..4e3214ee1df0 100644
--- a/pkgs/development/tools/haskell/uuagc/default.nix
+++ b/pkgs/development/tools/haskell/uuagc/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "uuagc";
-  version = "0.9.42.1";
-  sha256 = "1xyzvv9rqzqdc7kd2rncafnglfg699sn3f4987kbsxzhilvmhw78";
+  version = "0.9.42.2";
+  sha256 = "1l7w3gimcx079giw5ri4qfr1xfi1wfj93v29r8hvs8q8a6ffjifn";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ filepath haskellSrcExts mtl uuagcCabal uulib ];
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 000000000000..3556b4f47aad
--- /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 c37a829e3bcc..000000000000
--- 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/cflow/default.nix b/pkgs/development/tools/misc/cflow/default.nix
index 041191640bd4..d9be5802fa95 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/cpphs/default.nix b/pkgs/development/tools/misc/cpphs/default.nix
index 4fbce76474c8..2e419f67eb05 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/distcc/default.nix b/pkgs/development/tools/misc/distcc/default.nix
index a46c7a695f21..565d7835f05d 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 000000000000..117480670c39
--- /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/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 08fde14eb53a..43ec8dec9f58 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -8,7 +8,7 @@
 
 let
 
-  basename = "gdb-7.5";
+  basename = "gdb-7.5.1";
 
   # Whether (cross-)building for GNU/Hurd.  This is an approximation since
   # having `stdenv ? cross' doesn't tell us if we're building `hostDrv' and
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnu/gdb/${basename}.tar.bz2";
-    md5 = "24a6779a9fe0260667710de1b082ef61";
+    sha256 = "084xs90545an51biyy4qd53hsw6p1k6arviq2wlz1a4z526q02q7";
   };
 
   # I think python is not a native input, but I leave it
diff --git a/pkgs/development/tools/misc/intltool/default.nix b/pkgs/development/tools/misc/intltool/default.nix
new file mode 100644
index 000000000000..0ca8b6eb0714
--- /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 000000000000..4a2965b036af
--- /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/neoload/default.nix b/pkgs/development/tools/neoload/default.nix
index 1c0265503875..d7a203ad3f41 100644
--- a/pkgs/development/tools/neoload/default.nix
+++ b/pkgs/development/tools/neoload/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, writeTextFile, oraclejre, makeWrapper, licenseAccepted ? false }:
+{ 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.
@@ -12,10 +12,10 @@ if !licenseAccepted then throw ''
   ''
 else assert licenseAccepted;
 
-# the installer is very picky and demands 1.6.0.29
+# the installer is very picky and demands 1.7.0.07
 let dotInstall4j = writeTextFile { name = "dot-install4j"; text = ''
-      JRE_VERSION	${oraclejre}	1	6	0	29
-      JRE_INFO	${oraclejre}	0
+      JRE_VERSION	${jre}	1	7	0	7
+      JRE_INFO	${jre}	94
     ''; };
 
     responseVarfile = writeTextFile { name = "response.varfile"; text = ''
@@ -31,15 +31,15 @@ let dotInstall4j = writeTextFile { name = "dot-install4j"; text = ''
     ''; };
 
 in stdenv.mkDerivation rec {
-  name = "neoload-4.0.4";
+  name = "neoload-4.1.1";
 
   src = fetchurl (
     if stdenv.system == "x86_64-linux" then
-      { url = http://www.neotys.com/documents/download/neoload/v4.0/neoload_4_0_4_linux_x64.sh;
-        sha256 = "1w5pqik1998irpamx6y4rf2v5v34nm8xm6cwa1a8j0agawv992w2"; }
+      { url = http://www.neotys.com/documents/download/neoload/v4.1/neoload_4_1_1_linux_x64.sh;
+        sha256 = "1gik80pvrj95jcpvqk16alvldf2zc604zn3xz3nszgmpv9dgmjk6"; }
     else
-      { url = http://www.neotys.com/documents/download/neoload/v4.0/neoload_4_0_4_linux_x86.sh;
-        sha256 = "0k49kcwnimax9q7d2kychcbhh4zlixlx4ak9jgrm901zpkhw2f3b"; } );
+      { url = http://www.neotys.com/documents/download/neoload/v4.1/neoload_4_1_1_linux_x86.sh;
+        sha256 = "1m42xqy2gsk4khcaps287b4bsamn14grcy8wdz07hk8wvcfncd3d"; } );
 
   buildInputs = [ makeWrapper ];
   phases = [ "installPhase" ];
@@ -47,6 +47,9 @@ in stdenv.mkDerivation rec {
   # 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
@@ -59,8 +62,8 @@ in stdenv.mkDerivation rec {
     sed -e "s|INSTALLDIR|$out|" ${responseVarfile} > response.varfile
 
     export HOME=`pwd`
-    export INSTALL4J_JAVA_HOME=${oraclejre}
-    ./installer -q -varfile response.varfile
+    export INSTALL4J_JAVA_HOME=${jre}
+    bash -ic './installer -q -varfile response.varfile'
 
     for i in $out/bin/*; do
       wrapProgram $i --run 'cp ${dotInstall4j} ~/.install4j' \
@@ -74,7 +77,6 @@ in stdenv.mkDerivation rec {
     done
     rm $out/lib/neoload/*.desktop $out/lib/neoload/uninstall
 
-    ln -s ${oraclejre}/bin $out/lib/neoload/jre
   '';
 
   meta = {
diff --git a/pkgs/development/tools/parsing/re2c/default.nix b/pkgs/development/tools/parsing/re2c/default.nix
new file mode 100644
index 000000000000..b7ed4fb8934a
--- /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 4b93aa24bafc..000000000000
--- 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 c49ac9f0663a..000000000000
--- 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 000000000000..33b99e12de55
--- /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";
+          };
+
+  buildNativeInputs = 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/sysprof/default.nix b/pkgs/development/tools/profiling/sysprof/default.nix
index 154561e27e1e..b6750f889373 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/web/nodejs/default.nix b/pkgs/development/web/nodejs/default.nix
index 6a654b3b78da..533411b92de3 100644
--- a/pkgs/development/web/nodejs/default.nix
+++ b/pkgs/development/web/nodejs/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, openssl, python, zlib, v8, utillinux }:
 
 stdenv.mkDerivation rec {
-  version = "0.8.12";
+  version = "0.8.15";
   name = "nodejs-${version}";
 
   src = fetchurl {
     url = "http://nodejs.org/dist/v${version}/node-v${version}.tar.gz";
-    sha256 = "0igsz9g3hmxcnn685v4k8p6d2vv6cmh9sdz5pl8rlhglp0m7yjnn";
+    sha256 = "1ccjaw0lqspnrmzcb9jbnh1mf74ny7874m2q4vz83q7kdnf66n0p";
   };
 
   configureFlags = [
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     "--shared-v8-libpath=${v8}/lib"
   ];
 
-  patches = stdenv.lib.optional stdenv.isDarwin ./no-arch-flag.patch;
+  #patches = stdenv.lib.optional stdenv.isDarwin ./no-arch-flag.patch;
 
   prePatch = ''
     sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i tools/{*.py,waf-light,node-waf} configure
diff --git a/pkgs/games/LambdaHack/default.nix b/pkgs/games/LambdaHack/default.nix
index f7375172f06f..48c4809e5cd9 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/anki/default.nix b/pkgs/games/anki/default.nix
new file mode 100644
index 000000000000..d2e438dfa7b1
--- /dev/null
+++ b/pkgs/games/anki/default.nix
@@ -0,0 +1,67 @@
+{ 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";
+    };
+}
diff --git a/pkgs/games/bsdgames/default.nix b/pkgs/games/bsdgames/default.nix
index 38a32da9537d..59423d7a5a66 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/exult/snapshot.nix b/pkgs/games/exult/snapshot.nix
deleted file mode 100644
index 95643af6a62b..000000000000
--- 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/gnuchess/default.nix b/pkgs/games/gnuchess/default.nix
index 24556d83148e..8a706896ba5c 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.2";
+    name="${baseName}-${version}";
+    hash="1xd3g28glz2xyjnca0zfw3k0jl5vhgd7wvy4n9km5wnn9z7287l2";
+    url="http://ftp.gnu.org/gnu/chess/gnuchess-6.0.2.tar.gz";
+    sha256="1xd3g28glz2xyjnca0zfw3k0jl5vhgd7wvy4n9km5wnn9z7287l2";
+  };
+  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 000000000000..e1d1d5f2eeb8
--- /dev/null
+++ b/pkgs/games/gnuchess/default.upstream
@@ -0,0 +1 @@
+url http://ftp.gnu.org/gnu/chess/
diff --git a/pkgs/games/lincity/ng.nix b/pkgs/games/lincity/ng.nix
new file mode 100644
index 000000000000..4e886466777e
--- /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 000000000000..d73d1a2c4190
--- /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 3281f07335b0..1f80998da92d 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/naev/default.nix b/pkgs/games/naev/default.nix
index 36ccbf98274f..2e25cf4afb6b 100644
--- a/pkgs/games/naev/default.nix
+++ b/pkgs/games/naev/default.nix
@@ -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/pingus/default.nix b/pkgs/games/pingus/default.nix
new file mode 100644
index 000000000000..43cdc2031bf5
--- /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 000000000000..6b4eb31aa5f6
--- /dev/null
+++ b/pkgs/games/pingus/default.upstream
@@ -0,0 +1 @@
+url http://pingus.seul.org/download.html
diff --git a/pkgs/games/scid/default.nix b/pkgs/games/scid/default.nix
new file mode 100644
index 000000000000..91ceb74b0c56
--- /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/stuntrally/default.nix b/pkgs/games/stuntrally/default.nix
index 69609b1bbfb4..31fd25a5150f 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 0c92ffbcdbb1..46f22d332ccb 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/torcs/default.nix b/pkgs/games/torcs/default.nix
index cf740def5116..da4fd01d3a97 100644
--- a/pkgs/games/torcs/default.nix
+++ b/pkgs/games/torcs/default.nix
@@ -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 85440f88901e..80f3d72c579a 100644
--- a/pkgs/games/ufoai/default.nix
+++ b/pkgs/games/ufoai/default.nix
@@ -1,51 +1,33 @@
-{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;
diff --git a/pkgs/games/uqm/default.nix b/pkgs/games/uqm/default.nix
index 6e67ce660f14..a9fe9d596c78 100644
--- a/pkgs/games/uqm/default.nix
+++ b/pkgs/games/uqm/default.nix
@@ -8,22 +8,22 @@ stdenv.mkDerivation rec {
   version = "0.7.0";
 
   src = fetchurl {
-    url = "mirror://sf/sc2/uqm-${version}-source.tgz";
+    url = "mirror://sourceforge/sc2/uqm-${version}-source.tgz";
     sha256 = "a3695c5f7f0be7ec9c0f80ec569907b382023a1fee6e635532bd53b7b53bb221";
   };
 
   content = fetchurl {
-    url = "mirror://sf/sc2/uqm-${version}-content.uqm";
+    url = "mirror://sourceforge/sc2/uqm-${version}-content.uqm";
     sha256 = "b8f6db8ba29f0628fb1d5c233830896b19f441aee3744bda671ea264b44da3bf";
   };
 
   voice = fetchurl {
-    url = "mirror://sf/sc2/uqm-${version}-voice.uqm";
+    url = "mirror://sourceforge/sc2/uqm-${version}-voice.uqm";
     sha256 = "bcccf801b4ba37594ff6217b292744ea586ee2d447e927804842ccae8b73c979";
   };
 
   music = fetchurl {
-    url = "mirror://sf/sc2/uqm-${version}-3domusic.uqm";
+    url = "mirror://sourceforge/sc2/uqm-${version}-3domusic.uqm";
     sha256 = "c57085e64dad4bddf8a679a9aa2adf63f2156d5f6cbabe63af80519033dbcb82";
   };
 
diff --git a/pkgs/games/urbanterror/default.nix b/pkgs/games/urbanterror/default.nix
index 875dfc93bb10..bffc5ad90d18 100644
--- a/pkgs/games/urbanterror/default.nix
+++ b/pkgs/games/urbanterror/default.nix
@@ -82,6 +82,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/vessel/default.nix b/pkgs/games/vessel/default.nix
new file mode 100644
index 000000000000..e6f3523fa246
--- /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 000000000000..38ee2b6ce2e8
--- /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 66c33842b89e..fc9beb239876 100644
--- a/pkgs/games/warsow/default.nix
+++ b/pkgs/games/warsow/default.nix
@@ -3,17 +3,15 @@
 }:
 stdenv.mkDerivation rec {
   name = "warsow-${version}";
-  version = "1.0";
-  mversion = "1.0";  # sometimes only engine is updated
+  version = "1.02";
+  mversion = "1.02";  # sometimes only engine is updated
   src1 = fetchurl {
-    url = "http://www.warsow.net/download?dl=sdk";
-    name = "warsow_${version}_sdk.tar.gz";
-    sha256 = "08hfhx3ggb8v8lsb62ki5rhdhscg8j9sndlnllinf85da1f4nf9f";
+    url = "http://www.warsow.net:1337/~warsow/1.02/warsow_1.02_sdk.tar.gz";
+    sha256 = "0b5vra4qihkkcw4jn54r8l2lyl2mp67b4y1m76nyz7f34vng1hdy";
   };
   src2 = fetchurl {
-    url = "http://www.warsow.net/download?dl=linux";
-    name = "warsow_${mversion}_unified.tar.gz";
-    sha256 = "1v455v4lpqda7lf2yviasdrlibvb6bsyxcadgl8bd4jcvr8x4czr";
+    url = "http://www.warsow.net:1337/~warsow/1.02/warsow_1.02.tar.gz";
+    sha256 = "0ai5v1h5g9nq21ixz23v0qsj9dr7dbiz7l8r34mq4c3z6ili8zpy";
   };
   unpackPhase = ''
     tar xf "$src1"
diff --git a/pkgs/games/widelands/default.nix b/pkgs/games/widelands/default.nix
index 45538acdca3e..e20adc8faa73 100644
--- a/pkgs/games/widelands/default.nix
+++ b/pkgs/games/widelands/default.nix
@@ -64,8 +64,7 @@ rec {
       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 000000000000..216ec0d8041a
--- /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 a1a65165326b..ab74d56dbcc7 100644
--- a/pkgs/games/xboard/default.nix
+++ b/pkgs/games/xboard/default.nix
@@ -1,33 +1,32 @@
-a:  
-let 
-  fetchurl = a.fetchurl;
-
-  buildInputs = with a; [
+{stdenv, fetchurl, libX11, xproto, libXt, libXaw, libSM, libICE, libXmu
+, libXext, gnuchess, texinfo, libXpm
+}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="xboard";
+    version="4.6.2";
+    name="${baseName}-${version}";
+    hash="1pw90fh1crf0nkqyql54z728vn2093hwdh2v5i5703z9qv9g4mrf";
+    url="http://ftp.gnu.org/gnu/xboard/xboard-4.6.2.tar.gz";
+    sha256="1pw90fh1crf0nkqyql54z728vn2093hwdh2v5i5703z9qv9g4mrf";
+  };
+  buildInputs = [
     libX11 xproto libXt libXaw libSM libICE libXmu 
     libXext gnuchess texinfo libXpm
   ];
-
-  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 000000000000..1e649bba5056
--- /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 d648dfe5abbc..000000000000
--- 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 8d0386671a10..000000000000
--- 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 229d58029dea..ed37227bb039 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 787e5625b5fe..000000000000
--- 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 7d85cdbe528d..60de24e16c73 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/xsokoban/default.nix b/pkgs/games/xsokoban/default.nix
index b8917b4d41c9..b8c6096b756f 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 4bf8c526f586..59a88191d2e4 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 1ca39ebc73b2..fdf3aa91e2b0 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/maintainers.nix b/pkgs/lib/maintainers.nix
index 4de3ff4237b3..bff4ffa3b196 100644
--- a/pkgs/lib/maintainers.nix
+++ b/pkgs/lib/maintainers.nix
@@ -10,12 +10,13 @@
   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>";
   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>";
@@ -37,6 +38,7 @@
   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>";
   urkud = "Yury G. Kudryashov <urkud+nix@ya.ru>";
   viric = "Lluís Batlle i Rossell <viric@viric.name>";
diff --git a/pkgs/lib/modules.nix b/pkgs/lib/modules.nix
index 25cb956a0ea4..286178a0fa70 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/platforms.nix b/pkgs/lib/platforms.nix
index 45e863458d46..9a0fb8e17ff7 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"];
 }
diff --git a/pkgs/lib/properties.nix b/pkgs/lib/properties.nix
index 0d864b0c553c..eeac27ae70c7 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/types.nix b/pkgs/lib/types.nix
index 38ae7b43630a..1cb1185b8bb8 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;
@@ -176,6 +176,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/drivers/samsung/builder.sh b/pkgs/misc/cups/drivers/samsung/builder.sh
new file mode 100644
index 000000000000..58e1c0cd781d
--- /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 000000000000..ab0c0dc25e48
--- /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/gutenprint/bin.nix b/pkgs/misc/drivers/gutenprint/bin.nix
index d78e1674d871..1def4b7d1c92 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/emulators/dlx/default.nix b/pkgs/misc/emulators/dlx/default.nix
new file mode 100644
index 000000000000..c23b60c29b30
--- /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/wine/default.nix b/pkgs/misc/emulators/wine/default.nix
index c24bbaad1a57..f4968158dd28 100644
--- a/pkgs/misc/emulators/wine/default.nix
+++ b/pkgs/misc/emulators/wine/default.nix
@@ -1,6 +1,6 @@
 { 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;
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://sourceforge/wine/${name}.tar.bz2";
-    sha256 = "05ac8qlpbiacn3gmwlafpppyl7r2grsym20gz163szsbmfzlqnxi";
+    sha256 = "0l5kr3iq1lkv3gcw8ljzfjcfnsh9b5crdd4i0dzwdk1i3bfw2xxc";
   };
 
   gecko = fetchurl {
@@ -24,7 +24,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 +34,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
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = {
-    version = "1.5.17";
+    version = "1.5.21";
     homepage = "http://www.winehq.org/";
     license = "LGPL";
     description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
diff --git a/pkgs/misc/emulators/wine/default.upstream b/pkgs/misc/emulators/wine/default.upstream
index a1e9fe05f408..e23f341c28a2 100644
--- a/pkgs/misc/emulators/wine/default.upstream
+++ b/pkgs/misc/emulators/wine/default.upstream
@@ -1,13 +1,8 @@
-name wine
 url http://sourceforge.net/projects/wine/files/Source/
-version_link 'wine-[0-9.]+[.]tar[.][0-9a-z]+/download$'
+version_link '[.]tar[.][^./]+/download$'
 SF_redirect
-
-do_regenerate () {
-  set_var_value name "$CURRENT_NAME-"'${meta.version}'
+do_overwrite () {
+  ensure_hash
   set_var_value version "$CURRENT_VERSION"
-  set_var_value url 'mirror://sourceforge/wine/${name}.tar.bz2' 1
   set_var_value sha256 "$CURRENT_HASH"
-  cat "$CURRENT_TARGET"
 }
-
diff --git a/pkgs/misc/emulators/wine/wine-warcraft.nix b/pkgs/misc/emulators/wine/wine-warcraft.nix
deleted file mode 100644
index 3573c0ba4fe1..000000000000
--- 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/ghostscript/libpng-1.5.patch b/pkgs/misc/ghostscript/libpng-1.5.patch
deleted file mode 100644
index b00305804a09..000000000000
--- 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/rosegarden/default.nix b/pkgs/misc/rosegarden/default.nix
deleted file mode 100644
index dd4e351a0204..000000000000
--- 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/snapshot.nix b/pkgs/misc/sane-backends/snapshot.nix
deleted file mode 100644
index 636ae37ec05b..000000000000
--- 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 9427d17ac648..000000000000
--- 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 a0c138d5e047..000000000000
--- 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 fb7cf569fdf5..bc1504ab2e9b 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/uboot/default.nix b/pkgs/misc/uboot/default.nix
index 7525c28e740e..629537212bd4 100644
--- a/pkgs/misc/uboot/default.nix
+++ b/pkgs/misc/uboot/default.nix
@@ -20,11 +20,11 @@ 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 ];
@@ -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/sheevaplug-config.patch b/pkgs/misc/uboot/sheevaplug-config.patch
new file mode 100644
index 000000000000..487756217bfb
--- /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 000000000000..3a4ea2933a34
--- /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/os-specific/linux/acpi/default.nix b/pkgs/os-specific/linux/acpi/default.nix
index 84ee44868079..6bb44d7db449 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/alsa-oss/default.nix b/pkgs/os-specific/linux/alsa-oss/default.nix
new file mode 100644
index 000000000000..c76ee8d9298c
--- /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 ];
+  buildNativeInputs = [ 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 180f9153043c..fb17b47b5060 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 ebaef323491e..4f848e5a87de 100644
--- a/pkgs/os-specific/linux/alsa-utils/default.nix
+++ b/pkgs/os-specific/linux/alsa-utils/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, alsaLib, gettext, ncurses}:
+{stdenv, fetchurl, alsaLib, gettext, ncurses, libsamplerate}:
 
 stdenv.mkDerivation rec {
   name = "alsa-utils-1.0.26";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1rw1n3w8syqky9i7kwy5xd2rzfdbihxas32vwfxpb177lqx2lpzq";
   };
 
-  buildInputs = [ alsaLib ncurses ];
+  buildInputs = [ alsaLib ncurses libsamplerate ];
   buildNativeInputs = [ gettext ];
 
   configureFlags = "--disable-xmlto --with-udev-rules-dir=$(out)/lib/udev/rules.d";
diff --git a/pkgs/os-specific/linux/atheros/inj.patch b/pkgs/os-specific/linux/atheros/inj.patch
deleted file mode 100644
index baae9b88aa4a..000000000000
--- 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 95a834dd67aa..000000000000
--- 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/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index 49efcc1e76ee..c30d18fe75b6 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -45,9 +45,9 @@ stdenv.mkDerivation rec {
       patchelf
       unzip
     ];
-    
+
   inherit kernel glibc /* glibc only used for setting interpreter */;
-  
+
   LD_LIBRARY_PATH = stdenv.lib.concatStringsSep ":"
     [ "${xorg.libXrandr}/lib"
       "${xorg.libXrender}/lib"
@@ -58,11 +58,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
index 0e2df1e25fb0..39ba5dc3973e 100644
--- a/pkgs/os-specific/linux/atop/default.nix
+++ b/pkgs/os-specific/linux/atop/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, zlib, ncurses}:
 
 stdenv.mkDerivation rec {
-  version = "1.27-3";
+  version = "2.0.2";
   name = "atop-${version}";
 
   src = fetchurl {
     url = "http://www.atoptool.nl/download/atop-${version}.tar.gz";
-    sha256 = "bce36e0b50f0e03995d86d25dbc9ab4a289f6755ce3558844f96d41b0bba563f";
+    sha256 = "029lfa2capz1lg3m3rnyrgb8v6jm4znin84vjh2f0zkwvvhdn856";
   };
 
   buildInputs = [zlib ncurses];
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 87541def9ad9..000000000000
--- 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/3.nix b/pkgs/os-specific/linux/aufs-util/3.nix
index 8eefc1b0f4ae..d75f51d38c94 100644
--- a/pkgs/os-specific/linux/aufs-util/3.nix
+++ b/pkgs/os-specific/linux/aufs-util/3.nix
@@ -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 1539775a2a17..000000000000
--- 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/3.nix b/pkgs/os-specific/linux/aufs/3.nix
index 83de1faa8fe5..255804a31de9 100644
--- a/pkgs/os-specific/linux/aufs/3.nix
+++ b/pkgs/os-specific/linux/aufs/3.nix
@@ -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/blcr/default.nix b/pkgs/os-specific/linux/blcr/default.nix
index 8c77cffe1779..169b020befd3 100644
--- a/pkgs/os-specific/linux/blcr/default.nix
+++ b/pkgs/os-specific/linux/blcr/default.nix
@@ -1,15 +1,18 @@
 { stdenv, fetchurl, kernel, perl, makeWrapper }:
 
 # BLCR 0.8.4 works for kernel version up to 2.6.38 (including 2.6.38.x)
+# BLCR 0.8.5_beta3 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 "2.6.39" kernel.version == 1;
+assert builtins.compareVersions "3.7.2" kernel.version == 1;
 
 stdenv.mkDerivation {
-  name = "blcr-0.8.4-${kernel.version}";
+  name = "blcr_${kernel.version}-0.8.5pre3";
 
   src = fetchurl {
-    url = https://ftg.lbl.gov/assets/projects/CheckpointRestart/downloads/blcr-0.8.4.tar.gz;
-    sha256 = "d851da66627d9212ac37bc9ea2aba40008ff2dc51d45dbd395ca2e403c3d78cf";
+    url = https://upc-bugs.lbl.gov/blcr-dist/blcr-0.8.5_b3.tar.gz;
+    sha256 = "1xp2k140w79zqbnfnb2q7z91hv15d5a6p39zdc97f9pfxmyyc8fn";
   };
 
   buildInputs = [ perl makeWrapper ];
diff --git a/pkgs/os-specific/linux/cpufrequtils/default.nix b/pkgs/os-specific/linux/cpufrequtils/default.nix
index 35bf57c269ea..e9e0a36f1565 100644
--- a/pkgs/os-specific/linux/cpufrequtils/default.nix
+++ b/pkgs/os-specific/linux/cpufrequtils/default.nix
@@ -6,7 +6,7 @@ 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
index c64d47d0d4d6..cb797f07aa33 100644
--- a/pkgs/os-specific/linux/cryptodev/default.nix
+++ b/pkgs/os-specific/linux/cryptodev/default.nix
@@ -1,10 +1,11 @@
 { fetchurl, stdenv, kernel, onlyHeaders ? false }:
 
 stdenv.mkDerivation rec {
-  name = "cryptodev-linux-1.5";
+  pname = "cryptodev-linux-1.5";
+  name = "${pname}-${kernel.version}";
 
   src = fetchurl {
-    url = "http://download.gna.org/cryptodev-linux/${name}.tar.gz";
+    url = "http://download.gna.org/cryptodev-linux/${pname}.tar.gz";
     sha256 = "13hybl5p0ck0vgi2gxmiwa2810gcfk78kdy17ai8nczj8il15mn0";
   };
 
diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix
index 9e762f649041..6d612f8cdbdc 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/fbterm/default.nix b/pkgs/os-specific/linux/fbterm/default.nix
index 0201422cdf9f..59f93e836c41 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 000000000000..387ef8862fbf
--- /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 6705404ac9f5..000000000000
--- 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 b0c439714fb6..000000000000
--- 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 e257a7d46eba..000000000000
--- 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/firmware/iwlwifi-1000-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-1000-ucode/default.nix
index 2660c0b2493d..8acb75c3ed6f 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-5150-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-5150-ucode/default.nix
index 0d409bd8427c..dca427cbff53 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 e5f3effa4b73..2e88f1bba744 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 4aea802244f0..ef259b709754 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-6000g2a-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-6000g2a-ucode/default.nix
@@ -4,7 +4,8 @@ stdenv.mkDerivation rec {
   name = "iwlwifi-6000g2a-ucode-18.168.6.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 = "a7f2615756addafbf3e6912cb0265f9650b2807d1ccdf54b620735772725bbe9";
   };
 
@@ -17,7 +18,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    homepage = "http://intellinuxwireless.org/";
+    homepage = http://wireless.kernel.org/en/users/Drivers/iwlwifi;
     description = "Firmware for the Intel 6000 Series Gen2 wireless card";
 
     longDescription = ''
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 b3a2a810bf7d..0fee3acd0a3c 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/fuse/default.nix b/pkgs/os-specific/linux/fuse/default.nix
index 2a0dfb220ecf..bd2507ec1bc1 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/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index 48f050f98cc2..a58430401c59 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -134,6 +134,7 @@ stdenv.mkDerivation {
     homepage = http://www.kernel.org/;
     maintainers = [
       lib.maintainers.eelco
+      lib.maintainers.shlevy
       lib.maintainers.chaoflow
     ];
     platforms = lib.platforms.linux;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.0.nix b/pkgs/os-specific/linux/kernel/linux-3.0.nix
index 346ecf5660e4..557ee6b52c6f 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.0.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.0.nix
@@ -230,7 +230,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.0.52";
+    version = "3.0.59";
 
     preConfigure = ''
       substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
@@ -238,7 +238,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-      sha256 = "09iszqkxnwkcmm4cwh7320jrwbpwgzx0v05l8mq36p8ix3s926k6";
+      sha256 = "0w0l0vsky921j6wvhydl8ggzwkwkhr0lk2lkd7lshhmv9c6bdg86";
     };
 
     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 77fb9bd1e45f..b44caef147f3 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.2.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.2.nix
@@ -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
@@ -237,7 +239,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.2.34";
+    version = "3.2.37";
     testing = false;
 
     modDirVersion = version;
@@ -248,7 +250,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.0/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "0j99pg1kdrj200wda7w2v4d272y4x0hyrp3w540a6rj00gkxsmn4";
+      sha256 = "1h8lx0gvb1q962lghjpixa6q89k4yrgvpiw8hplb3w2jicqs4948";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.3.nix b/pkgs/os-specific/linux/kernel/linux-3.3.nix
index 0db9a5c375d5..b3660afaabbb 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.3.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.3.nix
@@ -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
diff --git a/pkgs/os-specific/linux/kernel/linux-3.4.nix b/pkgs/os-specific/linux/kernel/linux-3.4.nix
index df38aec881b8..6046e3b65fc2 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.4.nix
@@ -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
@@ -239,7 +241,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.4.19";
+    version = "3.4.28";
     testing = false;
 
     preConfigure = ''
@@ -248,7 +250,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "0zf5da2yfy10ml0f7rpzdbfj9avayw2i9mpm07xhjamw717b82bh";
+      sha256 = "11b8nip1szm2c4wnpz2plv9icny33i377wd8jk9qbib08wwcf87i";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.5.nix b/pkgs/os-specific/linux/kernel/linux-3.5.nix
index 78f60c9906a4..c5d694cfc5af 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.5.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.5.nix
@@ -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
diff --git a/pkgs/os-specific/linux/kernel/linux-3.6.nix b/pkgs/os-specific/linux/kernel/linux-3.6.nix
index 5334712865be..3447c9968e3c 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.6.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.6.nix
@@ -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
@@ -244,7 +246,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.6.7";
+    version = "3.6.11";
     testing = false;
 
     preConfigure = ''
@@ -253,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 = "08ivh0md8lcq4xqq98y2ripfb02pykh6qla4zspj76qvl0awvp3x";
+      sha256 = "0cnbdhsgxxdl44gqfqlh8nyf6yzmdz7xkfa0xh2rzdscwqh8085h";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.7.nix b/pkgs/os-specific/linux/kernel/linux-3.7.nix
new file mode 100644
index 000000000000..86c2223b77cc
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux-3.7.nix
@@ -0,0 +1,273 @@
+args @ { stdenv, fetchurl, extraConfig ? ""
+, perl, mktemp, module_init_tools
+, ... }:
+
+let
+  configWithPlatform = kernelPlatform :
+    ''
+      # Power management and debugging for powertop.
+      DEBUG_KERNEL y
+      PM_ADVANCED_DEBUG y
+      PM_RUNTIME y
+      TIMER_STATS y
+      USB_SUSPEND y
+      BACKTRACE_SELF_TEST n
+      CPU_NOTIFIER_ERROR_INJECT? n
+      DEBUG_DEVRES n
+      DEBUG_NX_TEST n
+      DEBUG_STACK_USAGE n
+      DEBUG_STACKOVERFLOW n
+      RCU_TORTURE_TEST n
+      SCHEDSTATS 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
+
+      # Enable NUMA.
+      NUMA? y
+
+      # Disable some expensive (?) features.
+      FTRACE n
+      KPROBES 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
+      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
+      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
+
+      # 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
+      # Enable KMS for devices whose X.org driver supports it.
+      DRM_I915_KMS y
+      DRM_RADEON_KMS y
+      # Hybrid graphics support
+      VGA_SWITCHEROO 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
+      NFS_FSCACHE y
+      CIFS_XATTR y
+      CIFS_POSIX y
+      CIFS_FSCACHE 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_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 m
+      BT_RFCOMM_TTY y # RFCOMM TTY support
+      CRASH_DUMP n
+      DMAR? n # experimental
+      DVB_DYNAMIC_MINORS? y # we use udev
+      EFI_STUB y # EFI bootloader in the bzImage itself
+      FUSION y # Fusion MPT device support
+      IDE_GD_ATAPI y # ATAPI floppy support
+      IRDA_ULTRA y # Ultra (connectionless) protocol
+      JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels
+      JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels
+      JOYSTICK_XPAD_FF y # X-Box gamepad rumble support
+      JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED
+      LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
+      LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
+      LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
+      LOGO n # not needed
+      MEDIA_ATTACH? y
+      MEGARAID_NEWGEN y
+      MICROCODE_AMD y
+      MODVERSIONS y
+      MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
+      MTRR_SANITIZER y
+      NET_FC y # Fibre Channel driver support
+      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
+      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
+      DEVPTS_MULTIPLE_INSTANCES? y
+
+      # Enable staging drivers.  These are somewhat experimental, but
+      # they generally don't hurt.
+      STAGING y
+
+      # 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
+
+      # 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
+
+      ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
+      ${extraConfig}
+    '';
+in
+
+import ./generic.nix (
+
+  rec {
+    version = "3.7.5";
+    testing = false;
+
+    preConfigure = ''
+      substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
+    '';
+
+    src = fetchurl {
+      url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
+      sha256 = "1x8wpc33h3xib3c98icpw8b652lqdqcw0sal0fky4wrb7v22kshd";
+    };
+
+    config = configWithPlatform stdenv.platform;
+    configCross = configWithPlatform stdenv.cross.platform;
+
+    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/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 52e284827d02..44c31d824aef 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -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 {
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index d42581e457ed..f886c2c49f42 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -107,13 +107,13 @@ rec {
 
   aufs3_0 = rec {
     name = "aufs3.0";
-    version = "3.0.20120827";
+    version = "3.0.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "4bd8efe495832ec43c26cb31ddcab3bae56485da";
-      sha256 = "496113f0eae1a24ae0c1998d1c73fc7c13961579c8e694b3651a8080eae7b74e";
+      rev = "0627c706d69778f5c74be982f28c746153b8cdf7";
+      sha256 = "7008ff64f5adc2b3a30fcbb090bcbfaac61b778af38493b6144fc7d768a6514d";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -121,13 +121,13 @@ rec {
 
   aufs3_1 = rec {
     name = "aufs3.1";
-    version = "3.1.20120827";
+    version = "3.1.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "9be47f1ff7c86976b0baa7847f22d75983e53922";
-      sha256 = "0cd239b9aad396750a26a5cd7b0d54146f21db63fb13d3fa03c4f73b7ebce77e";
+      rev = "82c9fe43d197072a82cab6f02a5fd5cc4f50306a";
+      sha256 = "f03d00964c9fc9975144d315fb79a1cd56d99f8c11853ed81d34afca35cd560a";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -135,13 +135,13 @@ rec {
 
   aufs3_2 = rec {
     name = "aufs3.2";
-    version = "3.2.20120827";
+    version = "3.2.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "267cb1138b4724ee028ec64ace556abdf993c9f4";
-      sha256 = "61f69264806cf06a05548166e2bc8fd121de9a3e524385f725d76abab22b8a0d";
+      rev = "0bf50c3b82f98e2ddc4c9ba0657f28ebfa8d15cb";
+      sha256 = "bc4b65cb77c62744db251da98488fdf4962f14a144c045cea6cbbbd42718ff89";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -149,13 +149,13 @@ rec {
 
   aufs3_3 = rec {
     name = "aufs3.3";
-    version = "3.3.20120827";
+    version = "3.3.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "ef302b8a8a2862b622cf4826d08b1e076ee6acb7";
-      sha256 = "7f78783685cc3e4eb825cd5dd8dabc82bb16c275493a850e8b7955ac69048d98";
+      rev = "65ab607cfb2c411d86da8fcee25c0f6dada1c4d5";
+      sha256 = "55c887932f1c12aed4ee20d9e749a80e9e0412951bd0a40fa3949ba972764a0a";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -163,13 +163,13 @@ rec {
 
   aufs3_4 = rec {
     name = "aufs3.4";
-    version = "3.4.20120827";
+    version = "3.4.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "79d8207b22c38420757adf7eec86ee2dcec7443c";
-      sha256 = "bc148aa251c6e63edca70c516c0548dc9b3e48653039df4cf693aa2bcc1b9bb0";
+      rev = "2faacd9baffb37df3b9062cc554353eebe68df1e";
+      sha256 = "3ecf97468f5e85970d9fd2bfc61e38c7f5ae2c6dde0045d5a17de085c411d452";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -177,28 +177,42 @@ rec {
 
   aufs3_5 = rec {
     name = "aufs3.5";
-    version = "3.5.20120827";
+    version = "3.5.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "18e455787597579fe144cdb2f18aa6a0a32c46a4";
-      sha256 = "9649a4cb00e41e2b2e3aa57c3869c33faf90ecbd845a3ac0119922655e80a030";
+      rev = "1658e9080c0e49f38feee5027cf0d32940a661ca";
+      sha256 = "4577fe1dd34299520155767a7c42697d41aabc0055ae8b1e448449b8c24a1044";
     };
     features.aufsBase = true;
     features.aufs3 = true;
   };
 
-  # not officially released yet, but 3.x seems to work fine
   aufs3_6 = rec {
     name = "aufs3.6";
-    version = "3.x.20120827";
+    version = "3.6.20121210";
+    utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
+    utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
+    patch = makeAufs3StandalonePatch {
+      inherit version;
+      rev = "f541ebfd88df0f4e6f9daf55053282e4f52cc4d9";
+      sha256 = "4d615a5f3c14a6a7c49bc6d65e78a2cdb89321cbd8a53f87cc8fe9edda382c3a";
+    };
+    features.aufsBase = true;
+    features.aufs3 = true;
+  };
+
+  # 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 = "46660ad144289fa1f0aca59bd00d592b560d0dbb";
-      sha256 = "823b7b4c011c103d63711900b3213008de3c9e408b909e0cc2b8697c1e82b67d";
+      rev = "8d24d728c7eb54dd624bccd8e87afa826670142c";
+      sha256 = "02dcb46e02b2a6b90c1601b5747614276074488c9308625c3a52ab74cad997a5";
     };
     features.aufsBase = true;
     features.aufs3 = true;
diff --git a/pkgs/os-specific/linux/kudzu/builder.sh b/pkgs/os-specific/linux/kudzu/builder.sh
deleted file mode 100644
index 002bac8a1db8..000000000000
--- 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 5cc8161bd94e..000000000000
--- 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 553d998f5176..000000000000
--- 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/libnl/libnl-1.1-flags.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch
deleted file mode 100644
index bb09b362660f..000000000000
--- 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 79dd039a3388..000000000000
--- 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 855a6ab3912e..000000000000
--- 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 c4c2fc6382de..000000000000
--- 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 f3f7f3fa732c..000000000000
--- 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 cb5c022c3d4c..000000000000
--- 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/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix
index be943f5df9e0..8f60ff2554bf 100644
--- a/pkgs/os-specific/linux/lxc/default.nix
+++ b/pkgs/os-specific/linux/lxc/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, libcap, perl, docbook2x, docbook_xml_dtd_45 }:
+{ stdenv, fetchurl, libcap, apparmor, perl, docbook2x, docbook_xml_dtd_45 }:
 
 stdenv.mkDerivation rec {
-  name = "lxc-0.8.0-rc2";
+  name = "lxc-0.8.0";
 
   src = fetchurl {
     url = "http://lxc.sf.net/download/lxc/${name}.tar.gz";
-    sha256 = "1f0ee0464507d26e494784e841b68c765ecd3abc5976012e226f69d1aa361bef";
+    sha256 = "0b3912mal1n56i1v5f3aplm7shqnlz24p0znpva27r4l1drk7j7a";
   };
 
-  buildInputs = [ libcap perl docbook2x ];
+  buildInputs = [ libcap apparmor perl docbook2x ];
 
   patches = [
    ./dont-run-ldconfig.patch
diff --git a/pkgs/os-specific/linux/mcelog/default.nix b/pkgs/os-specific/linux/mcelog/default.nix
index 82c502ede72f..b60b6134fdde 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/module-init-tools/default.nix b/pkgs/os-specific/linux/module-init-tools/default.nix
index 077d08f899da..240150b09ddb 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/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix
index 4060204d5052..42bacd41be03 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
     ];
 
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 c94641c69192..000000000000
--- 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 000000000000..bb8beab29c58
--- /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 124c8955e26d..98a03002fc2a 100755
--- a/pkgs/os-specific/linux/nvidia-x11/builder.sh
+++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh
@@ -27,19 +27,23 @@ buildPhase() {
 installPhase() {
 
     # Install libGL and friends.
-    mkdir -p $out/lib
-    cp -prd libcuda.* libGL.* libnvidia-cfg.* libnvidia-compiler.* libnvidia-tls.* libnvidia-glcore.* libOpenCL.* 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 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/libvdpau_nvidia.so.*.*
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 6cf7a93c6445..000000000000
--- 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/legacy304.nix b/pkgs/os-specific/linux/nvidia-x11/legacy304.nix
new file mode 100644
index 000000000000..c88eb77c12f9
--- /dev/null
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy304.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, kernel ? 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.64"; in
+
+stdenv.mkDerivation {
+  name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.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 = "0li27nlhx9bbln9424xpxw46sarjdch2fxpn4kvh0npaywll2ii3";
+      }
+    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 = "1x33f6b9zcsnpjcxlv38l1w0blimsv1y3bbrrzg48wwwb5wvynxl";
+      }
+    else throw "nvidia-x11 does not support platform ${stdenv.system}";
+
+  inherit versionNumber libsOnly;
+
+  kernel = if libsOnly then null else kernel;
+
+  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 fd27a989c079..8e1fb784ae34 100644
--- a/pkgs/os-specific/linux/nvidia-x11/legacy96.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy96.nix
@@ -2,7 +2,7 @@
 
 let 
 
-  versionNumber = "96.43.20";
+  versionNumber = "96.43.23";
 
 in
 
@@ -15,27 +15,17 @@ 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
-    ];
-
   dontStrip = true;
 
   glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
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 256922ca966d..000000000000
--- 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 51ffa7f83f15..000000000000
--- 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/ov511/ov511-2.30-default.nix b/pkgs/os-specific/linux/ov511/ov511-2.30-default.nix
index 4b2cd1ed5b22..ec9cda0e4d1e 100644
--- a/pkgs/os-specific/linux/ov511/ov511-2.30-default.nix
+++ b/pkgs/os-specific/linux/ov511/ov511-2.30-default.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchurl, kernel}:
 
 stdenv.mkDerivation {
-  name = "ov511-2.30";
+  name = "ov511-2.30-${kernel.version}";
   builder = ./ov511-2.30-builder.sh;
   src = fetchurl {
     url = http://nixos.org/tarballs/ov511-2.30.tar.bz2;
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 636b19a95af2..000000000000
--- 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 6af69d882dba..000000000000
--- 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.patch b/pkgs/os-specific/linux/ov511/ov511-2.32.patch
deleted file mode 100644
index 55e78afaeaa2..000000000000
--- 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/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix
index c18ea2b1f2b4..7da03cf9cad9 100644
--- a/pkgs/os-specific/linux/pam/default.nix
+++ b/pkgs/os-specific/linux/pam/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "linux-pam-1.1.1";
 
   src = fetchurl {
-    url = mirror://kernel/linux/libs/pam/library/Linux-PAM-1.1.1.tar.bz2;
+    url = http://www.linux-pam.org/library/Linux-PAM-1.1.1.tar.bz2;
     sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
   };
 
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 346008706718..eae62c9e1973 100644
--- a/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
+++ b/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
@@ -1,15 +1,23 @@
 { stdenv, fetchurl, pam, openssl, perl }:
 
 stdenv.mkDerivation rec {
-  name = "pam_ssh_agent_auth-0.9.3";
+  name = "pam_ssh_agent_auth-0.9.4";
 
   src = fetchurl {
     url = "mirror://sourceforge/pamsshagentauth/${name}.tar.bz2";
-    sha256 = "19p5mzplnr9g9vlp16nipf5rjw4v8zncvimarwgix958yml7j08h";
+    sha256 = "1a8cv223f30mvkxnyh9hk6kya0ynkwwkc5nhlz3rcqhxfw0fcva9";
   };
 
+  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";
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 000000000000..dc97b7d54f7c
--- /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/pm-utils/default.nix b/pkgs/os-specific/linux/pm-utils/default.nix
index f20cadabc533..e3b6168be9b5 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
index 1cb2220a3bdc..13a6e87319ed 100644
--- a/pkgs/os-specific/linux/pmtools/default.nix
+++ b/pkgs/os-specific/linux/pmtools/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "pmtools-20071116";
 
   src = fetchurl {
-    url = "www.lesswatts.org/patches/linux_acpi/${name}.tar.gz";
+    url = "http://www.lesswatts.org/patches/linux_acpi/${name}.tar.gz";
     sha256 = "91751774976e39f6237efd0326eb35196a9346220b92ad35894a33283e872748";
   };
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    homepage = "http://www.lesswatts.org/projects/acpi/utilities.php";
+    homepage = http://www.lesswatts.org/projects/acpi/utilities.php;
     description = "Linux ACPI utilities";
     license = "GPLv2";
 
diff --git a/pkgs/os-specific/linux/powertop/default.nix b/pkgs/os-specific/linux/powertop/default.nix
index 68075d115a48..2fb852acc31a 100644
--- a/pkgs/os-specific/linux/powertop/default.nix
+++ b/pkgs/os-specific/linux/powertop/default.nix
@@ -2,6 +2,7 @@
 
 stdenv.mkDerivation rec {
   name = "powertop-2.1";
+
   src = fetchurl {
     url = "https://01.org/powertop/sites/default/files/downloads/${name}.tar.gz";
     sha256 = "16161nlah4i4hq8vyx7ds1vq7icdzwm7gmyjg0xhcrs1r9n83m1x";
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 000000000000..6099505f1d65
--- /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/sepolgen/default.nix b/pkgs/os-specific/linux/sepolgen/default.nix
deleted file mode 100644
index a17a4153c47a..000000000000
--- a/pkgs/os-specific/linux/sepolgen/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ stdenv, fetchurl, python }:
-stdenv.mkDerivation rec {
-
-  name = "sepolgen-${version}";
-  version = "1.0.23";
-
-  src = fetchurl {
-    url = http://userspace.selinuxproject.org/releases/20101221/devel/sepolgen-1.0.23.tar.gz;
-    sha256 = "04d11l091iclp8lnay9as7y473ydrjz7171h95ddsbn0ihj5if2p";
-  };
-
-  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";
-    license = licenses.gpl2;
-    maintainers = [ maintainers.phreedom ];
-    platforms = platforms.linux;
-  };
-}
\ No newline at end of file
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index 29d56a60e95c..94e3573b70e6 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, kernel, perl, autoconf, automake, libtool, coreutils, gawk }:
 
 stdenv.mkDerivation {
-  name = "spl-0.6.0-rc12";
+  name = "spl-0.6.0-rc13-${kernel.version}";
   src = fetchurl {
-    url = http://github.com/downloads/zfsonlinux/spl/spl-0.6.0-rc12.tar.gz;
-    sha256 = "166853pqa294f78mn4j4x9pri79lyv3j2h8m9fzhfy7d7gxfqljk";
+    url = http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-0.6.0-rc13.tar.gz;
+    sha256 = "1frbifj1yd7pznlhsqsiksip5amx4ljvasg8h80haaxk0yvvkr9b";
   };
 
   patches = [ ./install_prefix.patch ./install_prefix_2.patch ./module_prefix.patch ];
diff --git a/pkgs/os-specific/linux/systemd/reexec.patch b/pkgs/os-specific/linux/systemd/0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch
index ff13a44ca0b2..9afa7543e571 100644
--- a/pkgs/os-specific/linux/systemd/reexec.patch
+++ b/pkgs/os-specific/linux/systemd/0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch
@@ -1,10 +1,18 @@
-Make "systemctl daemon-reexec" do the right thing on NixOS.
+From 0085f49cd0ba889e3db9102f328f6044ae3a2c18 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/6] 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 04fc0b3..0f5b0e9 100644
+index 1ee3c9c..1686f60 100644
 --- a/src/core/main.c
 +++ b/src/core/main.c
-@@ -1819,7 +1819,7 @@ finish:
+@@ -1858,7 +1858,7 @@ finish:
                          char_array_0(sfd);
  
                          i = 0;
@@ -13,3 +21,6 @@ index 04fc0b3..0f5b0e9 100644
                          if (switch_root_dir)
                                  args[i++] = "--switched-root";
                          args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user";
+-- 
+1.8.0.1
+
diff --git a/pkgs/os-specific/linux/systemd/ignore-duplicates.patch b/pkgs/os-specific/linux/systemd/0002-Ignore-duplicate-paths-in-systemctl-start.patch
index 764eead54eac..76160a1f7cc1 100644
--- a/pkgs/os-specific/linux/systemd/ignore-duplicates.patch
+++ b/pkgs/os-specific/linux/systemd/0002-Ignore-duplicate-paths-in-systemctl-start.patch
@@ -1,10 +1,17 @@
-Ignore duplicate paths in "systemctl start".
+From 2b0a9106d3aabb365af0cc34b595a1e697120f37 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/6] Ignore duplicate paths in "systemctl start"
+
+---
+ src/systemctl/systemctl.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
-index a4290c4..d3ac3ad 100644
+index 2ebfff8..9f99df5 100644
 --- a/src/systemctl/systemctl.c
 +++ b/src/systemctl/systemctl.c
-@@ -1596,8 +1596,11 @@ static int start_unit_one(
+@@ -1591,8 +1591,11 @@ static int start_unit_one(
  
                  r = set_put(s, p);
                  if (r < 0) {
@@ -18,3 +25,6 @@ index a4290c4..d3ac3ad 100644
                  }
  
                  p = NULL;
+-- 
+1.8.0.1
+
diff --git a/pkgs/os-specific/linux/systemd/crypt-devices-are-ready.patch b/pkgs/os-specific/linux/systemd/0003-Start-device-units-for-uninitialised-encrypted-devic.patch
index 4646ed0e44ca..a16a2672feb5 100644
--- a/pkgs/os-specific/linux/systemd/crypt-devices-are-ready.patch
+++ b/pkgs/os-specific/linux/systemd/0003-Start-device-units-for-uninitialised-encrypted-devic.patch
@@ -1,9 +1,16 @@
-Do start device units for uninitialised encrypted devices, because the
-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...)
+From a013beb84f135cebf1c8c9363d5676c1c0a6be7a 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/6] 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
@@ -20,3 +27,6 @@ index d17bdd9..040b10e 100644
  # 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.0.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 000000000000..beab35d63a06
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0004-Set-switch-to-configuration-hints-for-some-units.patch
@@ -0,0 +1,74 @@
+From b40d8783f94666035baae567882c0d4be82cda01 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/6] 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 dd92b17..dfcbc7b 100644
+--- a/units/local-fs.target
++++ b/units/local-fs.target
+@@ -10,3 +10,5 @@ Description=Local File Systems
+ Documentation=man:systemd.special(7)
+ OnFailure=emergency.target
+ OnFailureIsolate=yes
++
++X-StopOnReconfiguration=yes
+diff --git a/units/remote-fs.target b/units/remote-fs.target
+index 9e68878..85a53d7 100644
+--- a/units/remote-fs.target
++++ b/units/remote-fs.target
+@@ -9,5 +9,7 @@
+ Description=Remote File Systems
+ Documentation=man:systemd.special(7)
+ 
++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.0.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 000000000000..4403e6f56aaf
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch
@@ -0,0 +1,33 @@
+From c5c8ac3a0420fb42ba2f629368fd5bd6ea1e753b 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/6] 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.0.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 000000000000..250a751fe0c0
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0006-Don-t-call-plymouth-quit.patch
@@ -0,0 +1,38 @@
+From d3caa154098e215145679f38fa92a8bd482107be 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/6] 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.0.1
+
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index bab8dfa4a89b..e331b86872eb 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -1,34 +1,35 @@
 { stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
-, xz, pam, acl, cryptsetup, libuuid, m4, utillinux, usbutils, pciutils
-, glib, kbd, libxslt, coreutils, libgcrypt
+, xz, pam, acl, cryptsetup, libuuid, m4, utillinux
+, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools
 }:
 
 assert stdenv.gcc.libc or null != null;
 
 stdenv.mkDerivation rec {
-  name = "systemd-195";
+  name = "systemd-197";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz";
-    sha256 = "00v3haymdxhjk71pqp17irw9pm5ivfvz35ibvw41v5zdhj5il179";
+    sha256 = "1dbljyyc3w4a1af99f15f3sqnfx7mfmc5x5hwxb70kg23ai7x1g6";
   };
 
   patches =
-    [ ./reexec.patch
-      ./ignore-duplicates.patch
-      ./crypt-devices-are-ready.patch
-      ./listunitfiles-abort.patch
-    ];
+    [ ./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
+    ] ++ 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 libxslt libgcrypt
+      /* cryptsetup */ libuuid m4 glib libxslt libgcrypt
     ];
 
   configureFlags =
     [ "--localstatedir=/var"
       "--sysconfdir=/etc"
-      "--with-distro=other"
       "--with-rootprefix=$(out)"
       "--with-rootprefix=$(out)"
       "--with-dbusinterfacedir=$(out)/share/dbus-1/interfaces"
@@ -36,24 +37,31 @@ stdenv.mkDerivation rec {
       "--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-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; 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 /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\""
@@ -66,7 +74,12 @@ stdenv.mkDerivation rec {
       "-DFS_NOCOW_FL=0x00800000"
     ];
 
-  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 = "CPPFLAGS=-I${stdenv.gcc.libc}/include hwdb_bin=/var/lib/udev/hwdb.bin";
 
   installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc sysvinitdir=$(TMPDIR)/etc/init.d";
 
@@ -88,6 +101,8 @@ stdenv.mkDerivation rec {
       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;
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 000000000000..7cde2260189a
--- /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/systemd/listunitfiles-abort.patch b/pkgs/os-specific/linux/systemd/listunitfiles-abort.patch
deleted file mode 100644
index 4bbb0a9b1bea..000000000000
--- a/pkgs/os-specific/linux/systemd/listunitfiles-abort.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
-index ed9784b..6d045cc 100644
---- a/src/core/dbus-manager.c
-+++ b/src/core/dbus-manager.c
-@@ -491,7 +491,6 @@ static DBusMessage *message_from_file_changes(
-         return reply;
- 
- oom:
--        dbus_message_unref(reply);
-         return NULL;
- }
- 
-@@ -1432,7 +1431,6 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
-                 r = unit_file_get_list(m->running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER, NULL, h);
-                 if (r < 0) {
-                         unit_file_list_free(h);
--                        dbus_message_unref(reply);
-                         return bus_send_error_reply(connection, message, NULL, r);
-                 }
- 
diff --git a/pkgs/os-specific/linux/sysvinit/default.nix b/pkgs/os-specific/linux/sysvinit/default.nix
index 7b3ea62ea2df..99aebd11667c 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
@@ -27,16 +27,17 @@ stdenv.mkDerivation {
     '';
 
   postInstall = stdenv.lib.optionalString withoutInitTools
-    ''  
+    ''
       mv $out/sbin/killall5 $out/bin
       ln -sf killall5 $out/bin/pidof
-      rm -rf $out/sbin
+      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 7ea574fcf232..7ea574fcf232 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 a3f79cd05a85..a3f79cd05a85 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/udev/173.nix b/pkgs/os-specific/linux/udev/173.nix
deleted file mode 100644
index 795826cf6bf3..000000000000
--- 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 647691acfb16..000000000000
--- 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 2cf549d99a76..000000000000
--- 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/default.nix
index 4987e90429ce..b46efd468745 100644
--- a/pkgs/os-specific/linux/udisks/default.nix
+++ b/pkgs/os-specific/linux/udisks/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1xgqifddwaavmjc8c30i0mdffyirsld7c6qhfyjw7f9khwv8jjw5";
   };
 
-  patches = [ ./purity.patch ];
+  patches = [ ./purity.patch ./no-pci-db.patch ];
 
   postPatch =
     ''
@@ -30,11 +30,6 @@ stdenv.mkDerivation rec {
 
   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/no-pci-db.patch b/pkgs/os-specific/linux/udisks/no-pci-db.patch
new file mode 100644
index 000000000000..b323b515c40e
--- /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/upower/default.nix b/pkgs/os-specific/linux/upower/default.nix
index 2f870e5d9994..e406681060f6 100644
--- a/pkgs/os-specific/linux/upower/default.nix
+++ b/pkgs/os-specific/linux/upower/default.nix
@@ -1,16 +1,16 @@
 { 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 =
diff --git a/pkgs/os-specific/linux/upstart/cfgdir.patch b/pkgs/os-specific/linux/upstart/cfgdir.patch
deleted file mode 100644
index 2a29b36412c0..000000000000
--- 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/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index ae5727568f2d..35d01739a2a4 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -21,10 +21,13 @@ 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-fs-paths-default=/var/setuid-wrappers:/var/run/current-system/sw/sbin:/sbin
+    --enable-libmount-mount
     ${if ncurses == null then "--without-ncurses" else ""}
   '';
 
diff --git a/pkgs/os-specific/linux/v4l-utils/default.nix b/pkgs/os-specific/linux/v4l-utils/default.nix
index ea63dadc8bd2..8e6584465d07 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 aedfe9ac6861..f0f7fcbb9cee 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.mkDerivation rec {
-  name = "v86d-0.1.10-${kernel.version}";
+  name = "v86d-${version}-${kernel.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";
   };
 
diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix
index f947bc9a1e73..b1bc15ff0836 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/default.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, openssl, dbus_libs, pkgconfig, libnl }:
 
 stdenv.mkDerivation rec {
-  version = "1.0";
+  version = "1.1";
 
   name = "wpa_supplicant-${version}";
 
   src = fetchurl {
     url = "http://hostap.epitest.fi/releases/${name}.tar.gz";
-    sha256 = "171b9027rbzy64zaal4832ix9i3mm6ypwmynbpia5bss793ivm4i";
+    sha256 = "00lyifj8cz7qyal6dy1dxbpk3g3bywvdarik8gbj9ds7zmfbwkd5";
   };
 
   preBuild = ''
@@ -38,10 +38,11 @@ stdenv.mkDerivation rec {
     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/x86info/default.nix b/pkgs/os-specific/linux/x86info/default.nix
new file mode 100644
index 000000000000..d8840d08460d
--- /dev/null
+++ b/pkgs/os-specific/linux/x86info/default.nix
@@ -0,0 +1,33 @@
+{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";
+  };
+
+  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-video-nouveau/default.nix b/pkgs/os-specific/linux/xf86-video-nouveau/default.nix
index e92b7f8003d8..876daa7a1ecb 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
index 1768581d8f96..17c7d3824d7a 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -1,26 +1,31 @@
 { stdenv, fetchurl, kernel, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
 
 stdenv.mkDerivation {
-  name = "zfs-0.6.0-rc12";
+  name = "zfs-0.6.0-rc13-${kernel.version}";
+
   src = fetchurl {
-    url = http://github.com/downloads/zfsonlinux/zfs/zfs-0.6.0-rc12.tar.gz;
-    sha256 = "1mipy6v63y8z3c5chn813x8c2r8mwyja1v19dvars3j85105xf1y";
+    url = http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.0-rc13.tar.gz;
+    sha256 = "1kpx7sa49ir93kmlrjwjzd6v4kzmda4j9cf6bv2p4s3yrmiz3cjv";
   };
 
   patches = [ ./module_perm_prefix.patch ./mount_zfs_prefix.patch ./kerneldir_path.patch ./no_absolute_paths_to_coreutils.patch ];
 
   buildInputs = [ kernel 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";
   NIX_CFLAGS_COMPILE = "-I${kernel}/lib/modules/${kernel.modDirVersion}/build/include/generated";
 
   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 ./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 = ''
diff --git a/pkgs/servers/ftp/vsftpd/default.nix b/pkgs/servers/ftp/vsftpd/default.nix
index 0fc1531056bc..39b78958b031 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 3874e4adfbdc..000000000000
--- 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/http/4store/default.nix b/pkgs/servers/http/4store/default.nix
index 08d671d960e3..4854f9e18dda 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 a8624ab40ab5..7076b921911e 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/couchdb/src-for-default.nix b/pkgs/servers/http/couchdb/src-for-default.nix
index 0c174feed8db..6e07077d3332 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/myserver/installable-binary.patch b/pkgs/servers/http/myserver/installable-binary.patch
deleted file mode 100644
index 346e76afd5ec..000000000000
--- 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/mail/freepops/default.nix b/pkgs/servers/mail/freepops/default.nix
index d58660297623..c80d0f04bda9 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/memcached/default.nix b/pkgs/servers/memcached/default.nix
index 36ce54b53ef9..17c674b4d066 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/zabbix/2.0.nix b/pkgs/servers/monitoring/zabbix/2.0.nix
new file mode 100644
index 000000000000..6b0a22962a32
--- /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/mpd/default.nix b/pkgs/servers/mpd/default.nix
index a5cc810ada8a..54c9d1605655 100644
--- a/pkgs/servers/mpd/default.nix
+++ b/pkgs/servers/mpd/default.nix
@@ -1,39 +1,85 @@
-{ 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.8";
+
+  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 = "35183ae4a706391f5d739e4378b74f516952adda09a260fecfd531a58b0fff17";
+    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
-    ++ opt shoutSupport libshout;
-
-  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"}
-    ${if shoutSupport then "--enable-shout" else "--disable-shout"}
-  '';
+    ++ 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 ""}
diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix
index e2e111a81fb6..1992164b3d1c 100644
--- a/pkgs/servers/nosql/redis/default.nix
+++ b/pkgs/servers/nosql/redis/default.nix
@@ -1,17 +1,17 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  pname = "redis";
-  version = "2.4.7";
-  name = "${pname}-${version}";
+  name = "redis-2.6.9";
 
   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 = "12bl3inq7xr2lqlqbxjxa3v9s5v7xn2pxlbm72ivxbiq43zpx5jd";
   };
 
   makeFlags = "PREFIX=$(out)";
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://redis.io;
     description = "An open source, advanced key-value store";
diff --git a/pkgs/servers/portmap/default.nix b/pkgs/servers/portmap/default.nix
index d7a05261ff22..f2152b65df3c 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/samba/default.nix b/pkgs/servers/samba/default.nix
index 08c53182dd5d..059b1c1a217d 100644
--- a/pkgs/servers/samba/default.nix
+++ b/pkgs/servers/samba/default.nix
@@ -75,4 +75,10 @@ stdenv.mkDerivation rec {
       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/sql/mysql55/default.nix b/pkgs/servers/sql/mysql55/default.nix
index a5f588f747da..81514494c078 100644
--- a/pkgs/servers/sql/mysql55/default.nix
+++ b/pkgs/servers/sql/mysql55/default.nix
@@ -15,7 +15,9 @@ stdenv.mkDerivation rec {
     sha256 = "13y7bhjmx4daidvyqjz88yffbswb6rc1khkmiqm896fx3lglkcpr";
   };
 
-  buildInputs = [ cmake bison ncurses openssl readline zlib ];
+  buildInputs = [ cmake bison ncurses openssl readline zlib ]
+     ++ stdenv.lib.optional stdenv.isDarwin perl;
+
 
   enableParallelBuilding = true;
 
@@ -23,6 +25,9 @@ stdenv.mkDerivation rec {
   
   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/postgresql/8.3.x.nix b/pkgs/servers/sql/postgresql/8.3.x.nix
index 7a153187cd5c..713d85377380 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.21"; in
+let version = "8.3.22"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "1y1lw83jr3v91920xdhd4ypaa5iazmdh4snl5qzq0yq6z3lnsjx6";
+    sha256 = "1iphzr8mpfz050f95vhcji4k22mih3wl65z4559y4hh4kiqg7f0p";
   };
 
   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 3500299b50d8..eef39aa40d61 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.14"; in
+let version = "8.4.15"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "0fhk3mmk95p5gwmg2skqv1rfi7ylk8gw195hx8rska7fbdryfwhi";
+    sha256 = "0kdwg598c7ws2bvi5q5qgn2pbvznzpxs63chvp0xj6nzpcdpg0va";
   };
 
   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 9993732ebcd6..4f87cbd55ae7 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.10"; in
+let version = "9.0.11"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "0af7in1fp4qxkvzbipz74gxm06x31a9n4z9g91mcis4r015ii523";
+    sha256 = "0b3vw1a1x658famvgsfi1dladrbkc5j3h1ibaasgx9ffqn6xrp56";
   };
 
   buildInputs = [ zlib readline ];
diff --git a/pkgs/servers/sql/postgresql/9.1.x.nix b/pkgs/servers/sql/postgresql/9.1.x.nix
index c8fa9327cf36..83097f52124a 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.6"; in
+let version = "9.1.7"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "1rridkybr55xw4a1h0ppqwv2x2ffwvmpjai9yzsvk58scb56lfbf";
+    sha256 = "10iw6c6v1s7a00s0dr8agvb2fg2dmdvg84mk05206rb0islyl6fz";
   };
 
   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 000000000000..6341fa952f5b
--- /dev/null
+++ b/pkgs/servers/sql/postgresql/9.2.x.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, zlib, readline }:
+
+let version = "9.2.2"; in
+
+stdenv.mkDerivation rec {
+  name = "postgresql-${version}";
+
+  src = fetchurl {
+    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
+    sha256 = "1wzphj8vdqpzaihqmrkm9p4wlfvgr9psg5hnrmzwp5l8m5aai9z1";
+  };
+
+  buildInputs = [ zlib readline ];
+
+  enableParallelBuilding = true;
+
+  LC_ALL = "C";
+
+  postInstall =
+    ''
+      mkdir -p $out/share/man
+      cp -rvd doc/src/sgml/man1 $out/share/man
+    '';
+
+  passthru = {
+    inherit readline;
+    psqlSchema = "9.1";
+  };
+
+  meta = {
+    homepage = http://www.postgresql.org/;
+    description = "A powerful, open source object-relational database system";
+    license = "bsd";
+  };
+}
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 057142a8707b..6d231e2083e2 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -251,10 +251,7 @@ in
   };
 
   libSM = attrs: attrs
-    // { propagatedBuildInputs = [ xorg.libICE ]; }
-    // args.stdenv.lib.optionalAttrs (args.stdenv.system == "i686-darwin") {
-      configureFlags = "LIBUUID_CFLAGS='' LIBUUID_LIBS=''";
-    };
+    // { propagatedBuildInputs = [ xorg.libICE ]; };
 
   lndir = attrs: attrs // {
     preConfigure = ''
@@ -275,6 +272,14 @@ in
     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/xorgserver.sh b/pkgs/servers/x11/xorg/xorgserver.sh
deleted file mode 100644
index 0beb09d61a7f..000000000000
--- 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/stdenv/default.nix b/pkgs/stdenv/default.nix
index c454204f8977..67000670cd1b 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,21 +35,22 @@ 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
@@ -59,7 +60,6 @@ rec {
     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 9197ff8314b4..3106beed1c5b 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -1,5 +1,5 @@
 { 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).
@@ -10,7 +10,7 @@ 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 {
 
@@ -41,7 +41,7 @@ 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" || l == lib.licenses.proprietary) then
             throw "package ‘${attrs.name}’ has an unfree license, refusing to evaluate"
           else
           (derivation (
@@ -82,9 +82,7 @@ let
           // (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"
@@ -108,7 +106,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";
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 3105e76f8177..777b2cf6a328 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 {
 
@@ -81,7 +81,7 @@ rec {
     {gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? [], fetchurl}:
 
     import ../generic {
-      inherit system;
+      inherit system config;
       name = "stdenv-linux-boot";
       preHook =
         ''
@@ -261,7 +261,7 @@ rec {
   #     dependency (`nix-store -qR') on bootstrapTools or the
   #     first binutils built.
   stdenvLinux = import ../generic rec {
-    inherit system;
+    inherit system config;
     
     preHook = commonPreHook;
     
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index c0da8f2b0c19..524b2a53337b 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 5e242b6e3a1c..668bac5f0ae8 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
diff --git a/pkgs/tools/X11/xcalib/default.nix b/pkgs/tools/X11/xcalib/default.nix
new file mode 100644
index 000000000000..65868a3b6b0d
--- /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/xkb-switch/default.nix b/pkgs/tools/X11/xkb-switch/default.nix
new file mode 100644
index 000000000000..0fc49038efee
--- /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/archivers/cpio/latest.nix b/pkgs/tools/archivers/cpio/latest.nix
deleted file mode 100644
index 8e14ff178660..000000000000
--- 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/backup/bup/default.nix b/pkgs/tools/backup/bup/default.nix
index 586fc514ba65..7ba5175d550b 100644
--- a/pkgs/tools/backup/bup/default.nix
+++ b/pkgs/tools/backup/bup/default.nix
@@ -1,14 +1,17 @@
-{ 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.25git20121224";
 
   src = fetchgit {
-    url = "https://github.com/apenwarr/bup.git";
-    sha256 = "3ad232d7f23071ed34f920bd4c3137583f1adffbe23c022896289bc0a03fe7aa";
-    rev = "02bd2b566ea5eec2fd656e0ae572b4c7b6b9550a";
+    url = "https://github.com/bup/bup.git";
+    sha256 = "f0e0c835ab83f00b28920d493e4150d2247113aad3a74385865c2a8c6f1ba7b8";
+    rev = "458e92da32ddd3c18fc1c3e52a76e9f0b48b832f";
   };
 
   buildNativeInputs = [ pandoc perl makeWrapper ];
@@ -26,8 +29,8 @@ stdenv.mkDerivation {
       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'"
   '';
 
   makeFlags = [
@@ -42,6 +45,6 @@ stdenv.mkDerivation {
       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";
+    homepage = "https://github.com/bup/bup";
   };
 }
diff --git a/pkgs/tools/backup/duplicity/default.nix b/pkgs/tools/backup/duplicity/default.nix
index bb5ae55b904f..0b0c1dbb9438 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 07b86c2e41ed..dcac235c6703 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.2";
+pythonPackages.buildPythonPackage rec {
+  name = "obnam-${version}";
+  version = "1.3";
+
   namePrefix = "";
 
   src = fetchurl rec {
-    url = "http://code.liw.fi/debian/pool/main/o/obnam/obnam_1.2.orig.tar.gz";
-    sha256 = "33457452726d5c393d98c565b8e1ab3ac11276cc42bf67c4eee6c4e4ac9976d6";
+    url = "http://code.liw.fi/debian/pool/main/o/obnam/obnam_${version}.orig.tar.gz";
+    sha256 = "1hmi58knv7qjw6jr5m28sip5gwzavk87i3s77xk72anaxhvf4g8w";
   };
 
   buildInputs = [ pythonPackages.sphinx attr ];
diff --git a/pkgs/tools/filesystems/btrfsprogs/btrfs-progs-Fix-the-receive-code-pathing.patch b/pkgs/tools/filesystems/btrfsprogs/btrfs-progs-Fix-the-receive-code-pathing.patch
new file mode 100644
index 000000000000..6dd0639c607e
--- /dev/null
+++ b/pkgs/tools/filesystems/btrfsprogs/btrfs-progs-Fix-the-receive-code-pathing.patch
@@ -0,0 +1,146 @@
+diff --git a/cmds-receive.c b/cmds-receive.c
+index a8be6fa..6b7cf12 100644
+--- a/cmds-receive.c
++++ b/cmds-receive.c
+@@ -52,11 +52,13 @@ static int g_verbose = 0;
+ struct btrfs_receive
+ {
+ 	int mnt_fd;
++	int dest_dir_fd;
+
+ 	int write_fd;
+ 	char *write_path;
+
+ 	char *root_path;
++	char *dest_dir_path; /* relative to root_path */
+ 	char *full_subvol_path;
+
+ 	struct subvol_info *cur_subvol;
+@@ -150,8 +152,11 @@ static int process_subvol(const char *path, const u8 *uuid, u64 ctransid,
+ 	r->cur_subvol = calloc(1, sizeof(*r->cur_subvol));
+ 	r->parent_subvol = NULL;
+
+-	r->cur_subvol->path = strdup(path);
+-	r->full_subvol_path = path_cat(r->root_path, path);
++	if (strlen(r->dest_dir_path) == 0)
++		r->cur_subvol->path = strdup(path);
++	else
++		r->cur_subvol->path = path_cat(r->dest_dir_path, path);
++	r->full_subvol_path = path_cat3(r->root_path, r->dest_dir_path, path);
+
+ 	fprintf(stderr, "At subvol %s\n", path);
+
+@@ -167,7 +172,7 @@ static int process_subvol(const char *path, const u8 *uuid, u64 ctransid,
+
+ 	memset(&args_v1, 0, sizeof(args_v1));
+ 	strcpy(args_v1.name, path);
+-	ret = ioctl(r->mnt_fd, BTRFS_IOC_SUBVOL_CREATE, &args_v1);
++	ret = ioctl(r->dest_dir_fd, BTRFS_IOC_SUBVOL_CREATE, &args_v1);
+ 	if (ret < 0) {
+ 		ret = -errno;
+ 		fprintf(stderr, "ERROR: creating subvolume %s failed. "
+@@ -195,8 +200,11 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
+ 	r->cur_subvol = calloc(1, sizeof(*r->cur_subvol));
+ 	r->parent_subvol = NULL;
+
+-	r->cur_subvol->path = strdup(path);
+-	r->full_subvol_path = path_cat(r->root_path, path);
++	if (strlen(r->dest_dir_path) == 0)
++		r->cur_subvol->path = strdup(path);
++	else
++		r->cur_subvol->path = path_cat(r->dest_dir_path, path);
++	r->full_subvol_path = path_cat3(r->root_path, r->dest_dir_path, path);
+
+ 	fprintf(stderr, "At snapshot %s\n", path);
+
+@@ -243,7 +251,7 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
+ 		goto out;
+ 	}
+
+-	ret = ioctl(r->mnt_fd, BTRFS_IOC_SNAP_CREATE_V2, &args_v2);
++	ret = ioctl(r->dest_dir_fd, BTRFS_IOC_SNAP_CREATE_V2, &args_v2);
+ 	close(args_v2.fd);
+ 	if (ret < 0) {
+ 		ret = -errno;
+@@ -790,17 +798,48 @@ struct btrfs_send_ops send_ops = {
+ int do_receive(struct btrfs_receive *r, const char *tomnt, int r_fd)
+ {
+ 	int ret;
++	char *dest_dir_full_path;
+ 	int end = 0;
+
+-	r->root_path = strdup(tomnt);
+-	r->mnt_fd = open(tomnt, O_RDONLY | O_NOATIME);
++	dest_dir_full_path = realpath(tomnt, NULL);
++	if (!dest_dir_full_path) {
++		ret = -errno;
++		fprintf(stderr, "ERROR: realpath(%s) failed. %s\n", tomnt,
++				strerror(-ret));
++		goto out;
++	}
++	r->dest_dir_fd = open(dest_dir_full_path, O_RDONLY | O_NOATIME);
++	if (r->dest_dir_fd < 0) {
++		ret = -errno;
++		fprintf(stderr, "ERROR: failed to open destination directory %s. %s\n",
++			    dest_dir_full_path, strerror(-ret));
++		goto out;
++	}
++
++	ret = find_mount_root(dest_dir_full_path, &r->root_path);
++	if (ret < 0) {
++		ret = -EINVAL;
++		fprintf(stderr, "ERROR: failed to determine mount point "
++				"for %s\n", dest_dir_full_path);
++		goto out;
++	}
++	r->mnt_fd = open(r->root_path, O_RDONLY | O_NOATIME);
+ 	if (r->mnt_fd < 0) {
+ 		ret = -errno;
+-		fprintf(stderr, "ERROR: failed to open %s. %s\n", tomnt,
++		fprintf(stderr, "ERROR: failed to open %s. %s\n", r->root_path,
+ 				strerror(-ret));
+ 		goto out;
+ 	}
+
++	/*
++	 * find_mount_root returns a root_path that is a subpath of
++	 * dest_dir_full_path. Now get the other part of root_path,
++	 * which is the destination dir relative to root_path.
++	 */
++	r->dest_dir_path = dest_dir_full_path + strlen(r->root_path);
++	if (r->dest_dir_path[0] == '/')
++		r->dest_dir_path++;
++
+ 	ret = subvol_uuid_search_init(r->mnt_fd, &r->sus);
+ 	if (ret < 0)
+ 		return ret;
+diff --git a/cmds-send.c b/cmds-send.c
+index 9b47e70..c408bc7 100644
+--- a/cmds-send.c
++++ b/cmds-send.c
+@@ -81,6 +81,14 @@ int find_mount_root(const char *path, char **mount_root)
+ 		}
+ 	}
+
++	if (!longest_match) {
++		fprintf(stderr, "ERROR: Failed to find mount root for path %s.\n",
++			    path);
++		fprintf(stderr, "Please make sure that you have a valid \
++			/etc/mtab file.\n");
++		return -ENOENT;
++	}
++
+ 	*mount_root = realpath(longest_match, NULL);
+ 	free(longest_match);
+
+diff --git a/send-utils.h b/send-utils.h
+index da407eb..a3e038b 100644
+--- a/send-utils.h
++++ b/send-utils.h
+@@ -65,5 +65,6 @@ void subvol_uuid_search_add(struct subvol_uuid_search *s,
+ char *path_cat(const char *p1, const char *p2);
+ char *path_cat3(const char *p1, const char *p2, const char *p3);
+
++int find_mount_root(const char *path, char **mount_root);
+
+ #endif /* SEND_UTILS_H_ */
diff --git a/pkgs/tools/filesystems/btrfsprogs/btrfs-receive-help-text.patch b/pkgs/tools/filesystems/btrfsprogs/btrfs-receive-help-text.patch
new file mode 100644
index 000000000000..a9892cc780ed
--- /dev/null
+++ b/pkgs/tools/filesystems/btrfsprogs/btrfs-receive-help-text.patch
@@ -0,0 +1,13 @@
+diff --git a/cmds-receive.c b/cmds-receive.c
+index a8be6fa..c182175 100644
+--- a/cmds-receive.c
++++ b/cmds-receive.c
+@@ -880,7 +880,7 @@ static const char * const receive_cmd_group_usage[] = {
+ };
+
+ static const char * const cmd_receive_usage[] = {
+-	"btrfs receive [-v] [-i <infile>] <mount>",
++	"btrfs receive [-v] [-f <infile>] <mount>",
+ 	"Receive subvolumes from stdin.",
+ 	"Receives one or more subvolumes that were previously ",
+ 	"sent with btrfs send. The received subvolumes are stored",
diff --git a/pkgs/tools/filesystems/btrfsprogs/btrfs-receive-lchown.patch b/pkgs/tools/filesystems/btrfsprogs/btrfs-receive-lchown.patch
new file mode 100644
index 000000000000..3abb1ba25d32
--- /dev/null
+++ b/pkgs/tools/filesystems/btrfsprogs/btrfs-receive-lchown.patch
@@ -0,0 +1,12 @@
+diff --git a/cmds-receive.c b/cmds-receive.c
+index 6b7cf12..a6a6a5b 100644
+--- a/cmds-receive.c
++++ b/cmds-receive.c
+@@ -731,7 +731,7 @@  static int process_chown(const char *path, u64 uid, u64 gid, void *user)
+ 		fprintf(stderr, "chown %s - uid=%llu, gid=%llu\n", path,
+ 				uid, gid);
+
+-	ret = chown(full_path, uid, gid);
++	ret = lchown(full_path, uid, gid);
+ 	if (ret < 0) {
+ 		ret = -errno;
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 000000000000..483ec5f84155
--- /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 4c1963f46332..a42c6aa7a7ec 100644
--- a/pkgs/tools/filesystems/btrfsprogs/default.nix
+++ b/pkgs/tools/filesystems/btrfsprogs/default.nix
@@ -11,8 +11,27 @@ stdenv.mkDerivation {
     sha256 = "72d4cd4fb23d876a17146d6231ad40a2151fa47c648485c54cf7478239b43764";
   };
 
+  patches = [
+    ./subvol-listing.patch
+    ./btrfs-receive-help-text.patch
+    ./btrfs-progs-Fix-the-receive-code-pathing.patch
+    ./btrfs-receive-lchown.patch
+  ];
+
   buildInputs = [ zlib libuuid acl attr e2fsprogs ];
 
+  postPatch = ''
+    cp ${./btrfs-set-received-uuid.c} btrfs-set-received-uuid.c
+  '';
+
+  postBuild = ''
+    gcc -O2 -luuid -o btrfs-set-received-uuid send-utils.o rbtree.o btrfs-list.o btrfs-set-received-uuid.c
+  '';
+
+  postInstall = ''
+    cp btrfs-set-received-uuid $out/bin
+  '';
+
   makeFlags = "prefix=$(out)";
 
   meta = {
diff --git a/pkgs/tools/filesystems/btrfsprogs/subvol-listing.patch b/pkgs/tools/filesystems/btrfsprogs/subvol-listing.patch
new file mode 100644
index 000000000000..1c113ddefbe3
--- /dev/null
+++ b/pkgs/tools/filesystems/btrfsprogs/subvol-listing.patch
@@ -0,0 +1,34 @@
+--- a/btrfs-list.c	2012-12-30 12:20:01.394137593 +0100
++++ b/btrfs-list.c	2012-12-30 12:22:47.242452906 +0100
+@@ -1004,6 +1004,23 @@
+ 	return 0;
+ }
+ 
++static void __drop_deleting_roots(struct root_lookup *root_lookup)
++{
++	struct rb_node *n;
++
++again:
++	n = rb_first(&root_lookup->root);
++	while (n) {
++		struct root_info *entry = rb_entry(n, struct root_info, rb_node);
++		if (!entry->ref_tree) {
++			rb_erase(n, &root_lookup->root);
++			free(entry);
++			goto again;
++		}
++		n = rb_next(n);
++	}
++}
++
+ static int __list_subvol_search(int fd, struct root_lookup *root_lookup)
+ {
+ 	int ret;
+@@ -1123,6 +1140,8 @@
+ 			break;
+ 	}
+ 
++	__drop_deleting_roots(root_lookup);
++
+ 	return 0;
+ }
diff --git a/pkgs/tools/filesystems/glusterfs/default.nix b/pkgs/tools/filesystems/glusterfs/default.nix
index 3995faa588bc..7cae84a19c71 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 000000000000..7c86455b4409
--- /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 eeda32796f5b..000000000000
--- 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 273ee4512e1f..000000000000
--- 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/jfsutils/default.nix b/pkgs/tools/filesystems/jfsutils/default.nix
index 79a9fad0e79b..dc07734b9603 100644
--- a/pkgs/tools/filesystems/jfsutils/default.nix
+++ b/pkgs/tools/filesystems/jfsutils/default.nix
@@ -1,11 +1,11 @@
 { 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";
   };
 
   buildInputs = [ libuuid ];
diff --git a/pkgs/tools/filesystems/reiserfsprogs/default.nix b/pkgs/tools/filesystems/reiserfsprogs/default.nix
index 2283a0c17460..2c14bc624ae3 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/unionfs-fuse/default.nix b/pkgs/tools/filesystems/unionfs-fuse/default.nix
new file mode 100644
index 000000000000..43d7a5a8d180
--- /dev/null
+++ b/pkgs/tools/filesystems/unionfs-fuse/default.nix
@@ -0,0 +1,20 @@
+{ 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 ];
+
+  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 98657891f2d6..6d1f863fdeaa 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 000000000000..08cd012e0797
--- /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 ;
+  '';
+
+  buildNativeInputs = [ 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 e9baac43cbdd..e32a3901a92b 100644
--- a/pkgs/tools/graphics/asymptote/default.nix
+++ b/pkgs/tools/graphics/asymptote/default.nix
@@ -8,7 +8,15 @@ a @ {
 
   ...}:
 let
-  s = import ./src-for-default.nix;
+  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,6 +59,7 @@ rec {
   '' ["minInit" "addInputs" "doUnpack"];
 
   meta = {
+    inherit (s) version;
     description = "A tool for programming graphics intended to replace Metapost";
     maintainers = [
       a.lib.maintainers.raskin
diff --git a/pkgs/tools/graphics/asymptote/default.upstream b/pkgs/tools/graphics/asymptote/default.upstream
new file mode 100644
index 000000000000..3739390fd1d3
--- /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 277393283abb..000000000000
--- a/pkgs/tools/graphics/asymptote/src-for-default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-rec {
-   version="2.20";
-   name="asymptote-2.20";
-   hash="0ji45v0d9jps8clsl86pvmr22acci3f0ciicmyzak6dbczqyrj80";
-   url="http://downloads.sourceforge.net/project/asymptote/${version}/asymptote-${version}.src.tgz";
-   advertisedUrl="http://downloads.sourceforge.net/project/asymptote/2.20/asymptote-2.20.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 dbfd064f51a1..000000000000
--- 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 26df8818b2b6..9376ad6a709c 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 6ad1394650e9..179f0432dd10 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 13f7d4b7f6fc..3c75af4bcf38 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 000000000000..4fb85a2a1e89
--- /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/graphviz/default.nix b/pkgs/tools/graphics/graphviz/default.nix
index db4d766b7605..96ae324b01f0 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,8 @@ 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 ];
 
diff --git a/pkgs/tools/graphics/jbig2enc/default.nix b/pkgs/tools/graphics/jbig2enc/default.nix
new file mode 100644
index 000000000000..60704d6300c3
--- /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/mscgen/default.nix b/pkgs/tools/graphics/mscgen/default.nix
index 63e6afaa8039..ed69327b752a 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/inputmethods/fcitx/default.nix b/pkgs/tools/inputmethods/fcitx/default.nix
new file mode 100644
index 000000000000..ac60cd6134f9
--- /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/coreutils-5/default.nix b/pkgs/tools/misc/coreutils-5/default.nix
deleted file mode 100644
index de1ff1c4a907..000000000000
--- 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 232737c2f354..000000000000
--- 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/findutils/4.2.27.nix b/pkgs/tools/misc/findutils/4.2.27.nix
deleted file mode 100644
index 591134d692d1..000000000000
--- 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 11ed1cf07b56..eeb6b852e61f 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -10,10 +10,7 @@ stdenv.mkDerivation rec {
 
   buildNativeInputs = [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 957c32d3d4ea..000000000000
--- 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/gnokii/src-for-default.nix b/pkgs/tools/misc/gnokii/src-for-default.nix
index 3ea6f1a3b667..af2768ddfa3b 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";
-   url="http://www.gnokii.org/download/gnokii/0.6.x/gnokii-${version}.tar.gz";
-   advertisedUrl="http://www.gnokii.org/download/gnokii/gnokii-0.6.30.tar.gz";
+   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.31.tar.gz";
   
   
 }
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 0a21a51de799..000000000000
--- 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/ised/default.nix b/pkgs/tools/misc/ised/default.nix
index f5f9112639c5..0a04886f64c6 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/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 d6d55a027074..000000000000
--- 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 931b10b7b651..000000000000
--- 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/plowshare/default.nix b/pkgs/tools/misc/plowshare/default.nix
index 4634585cbd26..199e709f16ae 100644
--- a/pkgs/tools/misc/plowshare/default.nix
+++ b/pkgs/tools/misc/plowshare/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
 
-  name = "plowshare-${version}";
+  name = "plowshare4-${version}";
 
-  version = "20120916";
+  version = "20121126.47e4480";
 
   src = fetchurl {
-    url = "http://plowshare.googlecode.com/files/plowshare-snapshot-git${version}.tar.gz";
-    sha256 = "eccdb28d49ac47782abc8614202b3a88426cd587371641ecf2ec008880dc6067";
+    url = "http://plowshare.googlecode.com/files/plowshare4-snapshot-git${version}.tar.gz";
+    sha256 = "1p7bqqfbgcy41hiickgr8cilspyvrrql12rdmfasz0dmgf7nx1x6";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/tools/misc/screen/default.nix b/pkgs/tools/misc/screen/default.nix
index 930cd67bb135..2a5256761926 100644
--- a/pkgs/tools/misc/screen/default.nix
+++ b/pkgs/tools/misc/screen/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   preConfigure = ''
-    configureFlags="--enable-telnet --enable-pam --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
   '';
 
diff --git a/pkgs/tools/misc/system-config-printer/default.nix b/pkgs/tools/misc/system-config-printer/default.nix
index 8923637bbdbf..b0da497c322e 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/ttf2pt1/ttf2pt1-cl-pdf.nix b/pkgs/tools/misc/ttf2pt1/ttf2pt1-cl-pdf.nix
deleted file mode 100644
index 97a052db20db..000000000000
--- 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/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix
index 1fc5c08042cb..16d844d10d5d 100644
--- a/pkgs/tools/misc/youtube-dl/default.nix
+++ b/pkgs/tools/misc/youtube-dl/default.nix
@@ -1,31 +1,33 @@
-{stdenv, fetchgit, python}:
+{ stdenv, fetchurl, python, pandoc, zip }:
 
-let pkgname = "youtube-dl";
-    pkgver  = "2012.09.27";
-    
+let
+  version = "2012.12.11";
 in
 stdenv.mkDerivation {
-  name = "${pkgname}-${pkgver}";
+  name = "youtube-dl-${version}";
 
-  src = fetchgit {
-    url = "git://github.com/rg3/${pkgname}";
-    rev = "refs/tags/${pkgver}";
-    sha256 = "a98f3339301324ddd6620f7b1353abed807cd8dea5586d6901d7fe69bc6a397c";
+  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 ];
+  buildNativeInputs = [ pandoc zip ];
 
-  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/aircrack-ng/default.nix b/pkgs/tools/networking/aircrack-ng/default.nix
index ea4f517000a2..c616ba9ee160 100644
--- a/pkgs/tools/networking/aircrack-ng/default.nix
+++ b/pkgs/tools/networking/aircrack-ng/default.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchsvn, libpcap, openssl, zlib, wirelesstools}:
 
 let
-  rev = "2178";
+  rev = "2212";
 in
 stdenv.mkDerivation rec {
   name = "aircrack-ng-1.1-${rev}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   src = fetchsvn {
     url = "http://trac.aircrack-ng.org/svn/trunk";
     inherit rev;
-    sha256 = "d16fd3a4e918fd6a855c0d0ae0c863247a45189e6ec35c0c7082d3d07b6438db";
+    sha256 = "80e567b4e4bc501721cd58f7efadcd13fc3b235a41486174826694a6e701ce09";
   };
 
   buildInputs = [libpcap openssl zlib];
diff --git a/pkgs/tools/networking/connect/default.nix b/pkgs/tools/networking/connect/default.nix
new file mode 100644
index 000000000000..67f2b63c2928
--- /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/dd-agent/default.nix b/pkgs/tools/networking/dd-agent/default.nix
new file mode 100644
index 000000000000..e83ad7933f10
--- /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/gvpe/src-for-default.nix b/pkgs/tools/networking/gvpe/src-for-default.nix
index 10094c7b1292..097f275feffd 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 000000000000..aa2574fbc1d0
--- /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 000000000000..200bac53086a
--- /dev/null
+++ b/pkgs/tools/networking/httpie/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, buildPythonPackage }:
+
+buildPythonPackage {
+  name = "httpie-0.3.1";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://pypi.python.org/packages/source/h/httpie/httpie-0.3.1.tar.gz";
+    sha256 = "0abjkwcirmp6qa190qgbgj5fmmkmk5aa3fdiyayl2indh6304x7a";
+  };
+
+  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/maildrop/default.nix b/pkgs/tools/networking/maildrop/default.nix
new file mode 100644
index 000000000000..b91282c9a2b4
--- /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 000000000000..08988f6cde50
--- /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/mtr/default.nix b/pkgs/tools/networking/mtr/default.nix
index d4cfaa4ce9bd..7470c07d9377 100644
--- a/pkgs/tools/networking/mtr/default.nix
+++ b/pkgs/tools/networking/mtr/default.nix
@@ -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 000000000000..7495c3bcd7f0
--- /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 a772f2375004..000000000000
--- 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/network-manager-applet/default.nix b/pkgs/tools/networking/network-manager-applet/default.nix
index 1a9b94857495..042fd58c8f10 100644
--- a/pkgs/tools/networking/network-manager-applet/default.nix
+++ b/pkgs/tools/networking/network-manager-applet/default.nix
@@ -5,7 +5,7 @@
 let
   pn = "network-manager-applet";
   major = "0.9";
-  version = "${major}.4.1";
+  version = "${major}.6.4";
 in
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pn}/${major}/${name}.tar.xz";
-    sha256 = "b6b6de75e28d1fbcdfdbb51c0e40fcd6bc0ec0385bfecd16c457260491cd2ff7";
+    sha256 = "0ha16wvp2jcl96849qahaagidhiyalbjzi3nxi235y7hcnqnfmmf";
   };
 
   buildInputs = [
diff --git a/pkgs/tools/networking/network-manager/default.nix b/pkgs/tools/networking/network-manager/default.nix
index eec7361f6a29..0e3eaecf4cb0 100644
--- a/pkgs/tools/networking/network-manager/default.nix
+++ b/pkgs/tools/networking/network-manager/default.nix
@@ -4,11 +4,11 @@
 
 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,7 +29,10 @@ 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 libnl libuuid polkit ppp xz ];
 
@@ -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/nzbget/default.nix b/pkgs/tools/networking/nzbget/default.nix
index 7ff1ab4a5d32..c5386553f4f1 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/p2p/tahoe-lafs/default.nix b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix
index 5ef4a640d2a0..0c04d76e23f0 100644
--- a/pkgs/tools/networking/p2p/tahoe-lafs/default.nix
+++ b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix
@@ -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 f9867e64bf87..000000000000
--- 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/samplicator/default.nix b/pkgs/tools/networking/samplicator/default.nix
new file mode 100644
index 000000000000..a8733a7305a4
--- /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/tcng/default.nix b/pkgs/tools/networking/tcng/default.nix
deleted file mode 100644
index 062977b455c3..000000000000
--- 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/tinc/default.nix b/pkgs/tools/networking/tinc/default.nix
new file mode 100644
index 000000000000..bcfb584da1b7
--- /dev/null
+++ b/pkgs/tools/networking/tinc/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, lzo, openssl, zlib}:
+
+stdenv.mkDerivation rec {
+  version = "1.0.19";
+  name = "tinc-${version}";
+
+  src = fetchurl {
+    url = "http://www.tinc-vpn.org/packages/tinc-${version}.tar.gz";
+    sha256 = "183nxj23d05vc3pxwbb692lr048wr81wnv0avzlkdm4r6c3bp7jh";
+  };
+
+  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/wbox/default.nix b/pkgs/tools/networking/wbox/default.nix
new file mode 100644
index 000000000000..aa29b8be34f9
--- /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/package-management/dpkg/cache-arch.patch b/pkgs/tools/package-management/dpkg/cache-arch.patch
new file mode 100644
index 000000000000..9677c8fdee35
--- /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 849780ad047d..e801bcfb2c29 100644
--- a/pkgs/tools/package-management/dpkg/default.nix
+++ b/pkgs/tools/package-management/dpkg/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation {
     sha256 = "0ykby9x4x2zb7rfj30lfjcsrq2q32z2lnsrl8pbdvb2l9sx7zkbk";
   };
 
+  patches = [ ./cache-arch.patch ];
+
   configureFlags = "--disable-dselect --with-admindir=/var/lib/dpkg PERL_LIBDIR=$(out)/${perl.libPrefix}";
 
   preConfigure = ''
diff --git a/pkgs/tools/package-management/nix/custom.nix b/pkgs/tools/package-management/nix/custom.nix
deleted file mode 100644
index b760e4b7f4de..000000000000
--- 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 e433aa605799..5448c9f5ba38 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -5,11 +5,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "nix-1.1";
+  name = "nix-1.3";
 
   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 = "32cba96df0e02d6627f5625a441fdd4ea0db718dd5bfd50044cdfd3c606d4852";
   };
 
   buildNativeInputs = [ perl pkgconfig ];
@@ -26,14 +26,19 @@ 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 = {
@@ -45,15 +50,16 @@ 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-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 30e52da86389..61fe8295a903 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -5,11 +5,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "nix-1.2pre2980_9de6bc5";
+  name = "nix-1.4pre3048_99ed558";
 
   src = fetchurl {
-    url = "http://hydra.nixos.org/build/3338447/download/4/${name}.tar.bz2";
-    sha256 = "b767c2b75a0036edfc6be209dcaab23643887b192e3788640380ac27298b08d0";
+    url = "http://hydra.nixos.org/build/3851906/download/5/${name}.tar.xz";
+    sha256 = "4b2a75200d8b7ac21887f061b68b4e34d1edd69616916f86072d6f5bc7260d90";
   };
 
   buildNativeInputs = [ perl pkgconfig ];
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     ''
-      --with-store-dir=${storeDir} --localstatedir=${stateDir}
+      --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}
@@ -35,6 +35,10 @@ stdenv.mkDerivation rec {
       CFLAGS=-O3 CXXFLAGS=-O3
     '';
 
+  makeFlags = "profiledir=$(out)/etc/profile.d";
+
+  installFlags = "sysconfdir=$(out)/etc";
+
   doInstallCheck = true;
 
   crossAttrs = {
diff --git a/pkgs/tools/security/gnupg1/default.nix b/pkgs/tools/security/gnupg1/default.nix
index b3bf309b48e1..c779b979d9db 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.12";
+  name = "gnupg-1.4.13";
 
   src = fetchurl {
     url = "mirror://gnupg/gnupg/${name}.tar.bz2";
-    sha1 = "9b78e20328d35525af7b8a9c1cf081396910e937";
+    sha1 = "17a75c54d292bd0923f0a1817a1b02ded37d1de1";
   };
 
   buildInputs = [ readline bzip2 ];
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 78796ee2f53a..000000000000
--- 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/tor/default.nix b/pkgs/tools/security/tor/default.nix
index 3d2360196a66..c56f9454fcdb 100644
--- a/pkgs/tools/security/tor/default.nix
+++ b/pkgs/tools/security/tor/default.nix
@@ -1,11 +1,11 @@
 { 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 =
diff --git a/pkgs/tools/security/tor/torsocks.nix b/pkgs/tools/security/tor/torsocks.nix
index 83cfee07e66e..ac60ccb16a1f 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 243604c2c79e..6f34d61908e1 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/hardlink/default.nix b/pkgs/tools/system/hardlink/default.nix
index 192f7d871a1f..982aac3c9900 100644
--- a/pkgs/tools/system/hardlink/default.nix
+++ b/pkgs/tools/system/hardlink/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
   name = "hardlink-2012.9.${rev}";
 
   src = fetchurl {
-    url = "pkgs.fedoraproject.org/cgit/hardlink.git/snapshot/hardlink-${rev}.zip";
+    url = "http://pkgs.fedoraproject.org/cgit/hardlink.git/snapshot/hardlink-${rev}.zip";
     sha256 = "fea1803170b538d5fecf6a8d312ded1d25d516e9386a3797441a247487551647";
     name = "hardlink-${rev}.zip";
   };
diff --git a/pkgs/tools/system/logrotate/default.nix b/pkgs/tools/system/logrotate/default.nix
index a9994f14b57a..784c8e75e768 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 f024801515fb..b74958ae19a0 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/smartmontools/default.nix b/pkgs/tools/system/smartmontools/default.nix
index 89f8d3f5e77f..7a37e1200b48 100644
--- a/pkgs/tools/system/smartmontools/default.nix
+++ b/pkgs/tools/system/smartmontools/default.nix
@@ -2,8 +2,8 @@
 
 let
   driverdb = fetchurl {
-    url = "http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/trunk/smartmontools/drivedb.h?revision=3685";
-    sha256 = "11zczy03asfpj4wwip5bf3fpingdc7biz1cs3cykg4vnlxiwjxkx";
+    url = "http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/trunk/smartmontools/drivedb.h?revision=3742";
+    sha256 = "04xsgxzc1mqn9szazyr6v3xcpw0pszi8vz7xcsb661rww5482rw0";
     name = "smartmontools-drivedb.h";
   };
 in
diff --git a/pkgs/tools/text/ascii/default.nix b/pkgs/tools/text/ascii/default.nix
new file mode 100644
index 000000000000..769cf389426c
--- /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/typesetting/hevea/builder.sh b/pkgs/tools/typesetting/hevea/builder.sh
index 7598da5d0a57..05c93fe7da7a 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/tex/dblatex/default.nix b/pkgs/tools/typesetting/tex/dblatex/default.nix
index 05f4bd7a9fa1..fa4746a562ea 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/virtualization/ec2-ami-tools/default.nix b/pkgs/tools/virtualization/ec2-ami-tools/default.nix
index 1420ab5eeeb0..1905166c38e5 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/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index eb6876ff61f0..f78b3d8669ee 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -24,7 +24,7 @@
 , # 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 != "i686-darwin"
+  noSysDirs ? (system != "x86_64-darwin"
                && system != "x86_64-freebsd" && system != "i686-freebsd"
                && system != "x86_64-kfreebsd-gnu")
 
@@ -165,7 +165,7 @@ let
   x11 = 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;};
@@ -196,7 +196,7 @@ let
 
 
   allStdenvs = import ../stdenv {
-    inherit system stdenvType platform;
+    inherit system stdenvType platform config;
     allPackages = args: import ./all-packages.nix ({ inherit config system; } // args);
   };
 
@@ -237,7 +237,7 @@ let
 
   ### 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;
   };
@@ -344,6 +344,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 {
@@ -373,6 +377,15 @@ let
 
   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
@@ -402,7 +415,14 @@ let
     client = true;
   });
 
-  androidenv = import ../development/androidenv {
+  androidenv = import ../development/mobile/androidenv {
+    inherit pkgs;
+    pkgs_i686 = pkgsi686Linux;
+  };
+
+  xcodeenv = callPackage ../development/mobile/xcodeenv { };
+
+  titaniumenv = import ../development/mobile/titaniumenv {
     inherit pkgs;
     pkgs_i686 = pkgsi686Linux;
   };
@@ -455,6 +475,8 @@ let
 
   catdoc = callPackage ../tools/text/catdoc { };
 
+  dlx = callPackage ../misc/emulators/dlx { };
+
   eggdrop = callPackage ../tools/networking/eggdrop { };
 
   enca = callPackage ../tools/text/enca { };
@@ -502,6 +524,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 { };
@@ -522,6 +545,7 @@ let
 
   cfdg = builderDefsPackage ../tools/graphics/cfdg {
     inherit libpng bison flex;
+    ffmpeg = ffmpeg_1_1;
   };
 
   checkinstall = callPackage ../tools/package-management/checkinstall { };
@@ -538,12 +562,16 @@ let
 
   colordiff = callPackage ../tools/text/colordiff { };
 
+  connect = callPackage ../tools/networking/connect { };
+
   convertlit = callPackage ../tools/text/convertlit { };
 
   cowsay = callPackage ../tools/misc/cowsay { };
 
   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 { };
@@ -554,29 +582,24 @@ let
 
   convmv = callPackage ../tools/misc/convmv { };
 
-  coreutils = callPackage (if stdenv ? isDietLibC
-      then ../tools/misc/coreutils-5
-      else ../tools/misc/coreutils)
-    {
-      # TODO: Add ACL support for cross-Linux.
-      aclSupport = crossSystem == null && stdenv.isLinux;
-    };
+  coreutils = callPackage ../tools/misc/coreutils {
+    # TODO: Add ACL support for cross-Linux.
+    aclSupport = crossSystem == null && stdenv.isLinux;
+  };
 
   cpio = callPackage ../tools/archivers/cpio { };
 
   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;
   };
@@ -585,8 +608,7 @@ let
 
   curlftpfs = callPackage ../tools/filesystems/curlftpfs { };
 
-  dadadodo = builderDefsPackage (import ../tools/text/dadadodo) {
-  };
+  dadadodo = builderDefsPackage (import ../tools/text/dadadodo) { };
 
   dar = callPackage ../tools/archivers/dar { };
 
@@ -614,6 +636,8 @@ let
 
   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)'
@@ -674,8 +698,7 @@ let
 
   ecryptfs = callPackage ../tools/security/ecryptfs { };
 
-  edk2 = callPackage ../development/compilers/edk2 {
-  };
+  edk2 = callPackage ../development/compilers/edk2 { };
 
   efibootmgr = callPackage ../tools/system/efibootmgr { };
 
@@ -701,6 +724,8 @@ let
 
   fakeroot = callPackage ../tools/system/fakeroot { };
 
+  fcitx = callPackage ../tools/inputmethods/fcitx { };
+
   fcron = callPackage ../tools/system/fcron { };
 
   fdisk = callPackage ../tools/system/fdisk { };
@@ -714,12 +739,7 @@ let
 
   fileschanged = callPackage ../tools/misc/fileschanged { };
 
-  findutils =
-    if stdenv.isDarwin
-    then findutils4227
-    else callPackage ../tools/misc/findutils { };
-
-  findutils4227 = callPackage ../tools/misc/findutils/4.2.27.nix { };
+  findutils = callPackage ../tools/misc/findutils { };
 
   finger_bsd = callPackage ../tools/networking/bsd-finger { };
 
@@ -731,7 +751,7 @@ let
 
   flvtool2 = callPackage ../tools/video/flvtool2 { };
 
-  fontforge = callPackage ../tools/misc/fontforge { };
+  fontforge = lowPrio (callPackage ../tools/misc/fontforge { });
 
   fontforgeX = callPackage ../tools/misc/fontforge {
     withX11 = true;
@@ -784,9 +804,7 @@ 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 { };
 
@@ -910,6 +928,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',
@@ -1046,7 +1068,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;
@@ -1298,6 +1320,8 @@ let
 
   pdfjam = callPackage ../tools/typesetting/pdfjam { };
 
+  jbig2enc = callPackage ../tools/graphics/jbig2enc { };
+
   pdfread = callPackage ../tools/graphics/pdfread { };
 
   briss = callPackage ../tools/graphics/briss { };
@@ -1461,6 +1485,8 @@ let
 
   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 { };
@@ -1505,9 +1531,9 @@ let
 
   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 { };
 
@@ -1555,12 +1581,6 @@ let
 
   tcpdump = callPackage ../tools/networking/tcpdump { };
 
-  /*
-  tcng = callPackage ../tools/networking/tcng {
-    kernel = linux_2_6_27;
-  };
-  */
-
   telnet = callPackage ../tools/networking/telnet { };
 
   texmacs = callPackage ../applications/editors/texmacs {
@@ -1569,6 +1589,8 @@ let
     guile = guile_1_8;
   };
 
+  tinc = callPackage ../tools/networking/tinc { };
+
   tmux = callPackage ../tools/misc/tmux { };
 
   tor = callPackage ../tools/security/tor { };
@@ -1578,7 +1600,6 @@ let
   trickle = callPackage ../tools/networking/trickle {};
 
   ttf2pt1 = callPackage ../tools/misc/ttf2pt1 { };
-  ttf2pt1_cl_pdf = callPackage ../tools/misc/ttf2pt1 { };
 
   ucl = callPackage ../development/libraries/ucl { };
 
@@ -1628,6 +1649,8 @@ let
 
   vtun = callPackage ../tools/networking/vtun { };
 
+  wbox = callPackage ../tools/networking/wbox {};
+
   welkin = callPackage ../tools/graphics/welkin {};
 
   testdisk = callPackage ../tools/misc/testdisk { };
@@ -1697,7 +1720,7 @@ let
 
   unzip = callPackage ../tools/archivers/unzip { };
 
-  unzipNLS = unzip.override { enableNLS = true; };
+  unzipNLS = lowPrio (unzip.override { enableNLS = true; });
 
   uptimed = callPackage ../tools/system/uptimed { };
 
@@ -1736,6 +1759,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 {
@@ -1803,7 +1828,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 {};
 
@@ -1831,8 +1856,6 @@ let
 
   dash = callPackage ../shells/dash { };
 
-  ipython = callPackage ../shells/ipython { };
-
   tcsh = callPackage ../shells/tcsh { };
 
   rush = callPackage ../shells/rush { };
@@ -1858,7 +1881,11 @@ let
 
   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;
 
@@ -2131,17 +2158,14 @@ 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;
-       });
+    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;
+    });
 
   gccupc40 = wrapGCCUPC (import ../development/compilers/gcc-upc-4.0 {
     inherit fetchurl stdenv bison autoconf gnum4 noSysDirs;
@@ -2389,6 +2413,11 @@ let
 
   haxe = callPackage ../development/compilers/haxe { };
 
+  hiphopvm = callPackage ../development/interpreters/hiphopvm {
+    libevent = libevent14;
+    boost = boost149;
+  };
+
   falcon = builderDefsPackage (import ../development/interpreters/falcon) {
     inherit cmake;
   };
@@ -2406,26 +2435,23 @@ let
 
   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 { };
 
-  openjdkBootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix {};
-
-  openjdkStage1 = callPackage ../development/compilers/openjdk {
-    jdk = pkgs.openjdkBootstrap;
-    ant = pkgs.ant.override { jdk = pkgs.openjdkBootstrap; };
-  };
-
   openjdk =
     if stdenv.isDarwin then
       callPackage ../development/compilers/openjdk-darwin { }
     else
-      callPackage ../development/compilers/openjdk {
-        jdk = pkgs.openjdkStage1;
-        ant = pkgs.ant.override { jdk = pkgs.openjdkStage1; };
+      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 = pkgs.openjdk.override {
@@ -2441,20 +2467,18 @@ let
 
   oraclejdk = pkgs.jdkdistro true false;
 
-  oraclejre = pkgs.jdkdistro false false;
+  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 { };
 
@@ -2471,7 +2495,11 @@ let
     fpc = fpc;
   };
 
-  llvm = callPackage ../development/compilers/llvm { };
+  llvm = callPackage ../development/compilers/llvm {
+    stdenv = if stdenv.isDarwin
+      then stdenvAdapters.overrideGCC stdenv gccApple
+      else stdenv;
+  };
 
   mitscheme = callPackage ../development/compilers/mit-scheme { };
 
@@ -2736,6 +2764,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 {
@@ -2820,28 +2850,26 @@ let
 
   pure = callPackage ../development/interpreters/pure {};
 
-  python = python27;
   python3 = python32;
+  python32 = callPackage ../development/interpreters/python/3.2 { };
 
+  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 { };
+  pythonLinkmeWrapper = callPackage ../development/interpreters/python/python-linkme-wrapper.nix { };
 
   pyrex = pyrex095;
 
@@ -2894,16 +2922,13 @@ 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 config;
   };
@@ -2977,6 +3002,8 @@ let
       && stdenv.system != "i686-solaris";
   };
 
+  automake113x = callPackage ../development/tools/misc/automake/automake-1.13.x.nix { };
+
   automoc4 = callPackage ../development/tools/misc/automoc4 { };
 
   avrdude = callPackage ../development/tools/misc/avrdude { };
@@ -2987,10 +3014,10 @@ let
     inherit noSysDirs;
   };
 
-  binutils_gold = callPackage ../development/tools/misc/binutils {
+  binutils_gold = lowPrio (callPackage ../development/tools/misc/binutils {
     inherit noSysDirs;
     gold = true;
-  };
+  });
 
   binutilsCross = lowPrio (forceBuildDrv (import ../development/tools/misc/binutils {
     inherit stdenv fetchurl zlib;
@@ -3016,6 +3043,8 @@ let
 
   byacc = callPackage ../development/tools/parsing/byacc { };
 
+  casperjs = callPackage ../development/tools/casperjs { };
+
   cbrowser = callPackage ../development/tools/misc/cbrowser { };
 
   ccache = callPackage ../development/tools/misc/ccache { };
@@ -3080,6 +3109,28 @@ let
 
   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;
   };
@@ -3163,6 +3214,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 { };
@@ -3209,6 +3262,8 @@ 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,
@@ -3218,7 +3273,7 @@ let
      buildNativeInput after the renaming.
      */
   pkgconfig = forceBuildDrv (callPackage ../development/tools/misc/pkgconfig { });
-  pkgconfigUpstream = pkgconfig.override { vanilla = true; };
+  pkgconfigUpstream = lowPrio (pkgconfig.override { vanilla = true; });
 
   premake = callPackage ../development/tools/misc/premake { };
 
@@ -3235,6 +3290,8 @@ let
 
   ragel = callPackage ../development/tools/parsing/ragel { };
 
+  re2c = callPackage ../development/tools/parsing/re2c { };
+
   remake = callPackage ../development/tools/build-managers/remake { };
 
   # couldn't find the source yet
@@ -3461,8 +3518,6 @@ let
 
   confuse = callPackage ../development/libraries/confuse { };
 
-  consolekit = callPackage ../development/libraries/consolekit { };
-
   coredumper = callPackage ../development/libraries/coredumper { };
 
   ctl = callPackage ../development/libraries/ctl { };
@@ -3521,6 +3576,8 @@ let
 
   eigen = callPackage ../development/libraries/eigen {};
 
+  eigen2 = callPackage ../development/libraries/eigen/2.0.nix {};
+
   enchant = callPackage ../development/libraries/enchant { };
 
   enet = callPackage ../development/libraries/enet { };
@@ -3567,6 +3624,10 @@ let
     vpxSupport = !stdenv.isMips;
   };
 
+  ffmpeg_1_1 = callPackage ../development/libraries/ffmpeg/1.1.nix {
+    vpxSupport = !stdenv.isMips;
+  };
+
   fftw = callPackage ../development/libraries/fftw {
     singlePrecision = false;
   };
@@ -3744,26 +3805,26 @@ let
   glibcInfo = callPackage ../development/libraries/glibc/2.13/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 { };
 
@@ -3771,22 +3832,14 @@ 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 { };
 
   gobjectIntrospection = callPackage ../development/libraries/gobject-introspection { };
 
@@ -3854,6 +3907,8 @@ let
   gnutls_without_guile = gnutls.override { guileBindings = false; };
   gnutls2_without_guile = gnutls2.override { guileBindings = false; };
 
+  gpac = callPackage ../applications/video/gpac { };
+
   gpgme = callPackage ../development/libraries/gpgme {
     gnupg1 = gnupg1orig;
   };
@@ -3986,7 +4041,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 { };
 
@@ -4136,6 +4194,8 @@ let
 
   libdvdread = callPackage ../development/libraries/libdvdread { };
 
+  libdwarf = callPackage ../development/libraries/libdwarf { };
+
   libebml = callPackage ../development/libraries/libebml { };
 
   libedit = callPackage ../development/libraries/libedit { };
@@ -4158,13 +4218,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 { };
@@ -4223,6 +4283,8 @@ let
 
   liblockfile = callPackage ../development/libraries/liblockfile { };
 
+  libmcrypt = callPackage ../development/libraries/libmcrypt {};
+
   libmhash = callPackage ../development/libraries/libmhash {};
 
   libmtp = callPackage ../development/libraries/libmtp { };
@@ -4293,6 +4355,8 @@ let
 
   libmcs = callPackage ../development/libraries/libmcs { };
 
+  libmemcached = callPackage ../development/libraries/libmemcached { };
+
   libmicrohttpd = callPackage ../development/libraries/libmicrohttpd { };
 
   libmikmod = callPackage ../development/libraries/libmikmod { };
@@ -4422,9 +4486,9 @@ let
 
   libunwind = callPackage ../development/libraries/libunwind { };
 
-  libv4l = v4l_utils.override {
+  libv4l = lowPrio (v4l_utils.override {
     withQt4 = false;
-  };
+  });
 
   libva = callPackage ../development/libraries/libva { };
 
@@ -4476,14 +4540,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;
   });
@@ -4525,11 +4591,7 @@ let
   # 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;
 
   mesa = callPackage ../development/libraries/mesa { };
 
@@ -4570,6 +4632,8 @@ let
 
   mtdev = callPackage ../development/libraries/mtdev { };
 
+  mu = callPackage ../tools/networking/mu { };
+
   muparser = callPackage ../development/libraries/muparser { };
 
   mygui = callPackage ../development/libraries/mygui {};
@@ -4619,7 +4683,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;
@@ -4627,13 +4691,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)
@@ -4700,12 +4765,10 @@ let
 
   pcre = callPackage ../development/libraries/pcre {
     unicodeSupport = config.pcre.unicode or true;
-    cplusplusSupport = !stdenv ? isDietLibC;
   };
 
   pcre_8_30 = callPackage ../development/libraries/pcre/8.30.nix {
     unicodeSupport = config.pcre.unicode or true;
-    cplusplusSupport = !stdenv ? isDietLibC;
   };
 
   pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
@@ -4782,15 +4845,8 @@ let
     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;
+  qt4_for_qtcreator = qt48.override {
+    developerBuild = true;
   };
 
   qtscriptgenerator = callPackage ../development/libraries/qtscriptgenerator { };
@@ -4909,6 +4965,7 @@ let
   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 { };
@@ -4963,8 +5020,6 @@ let
 
   tcltls = callPackage ../development/libraries/tcltls { };
 
-  tcp_wrappers = callPackage ../development/libraries/tcp-wrappers {};
-
   tdb = callPackage ../development/libraries/tdb { };
 
   tecla = callPackage ../development/libraries/tecla { };
@@ -4975,6 +5030,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 { };
@@ -4986,6 +5045,8 @@ let
 
   unicap = callPackage ../development/libraries/unicap {};
 
+  tsocks = callPackage ../development/libraries/tsocks { };
+
   unixODBC = callPackage ../development/libraries/unixODBC { };
 
   unixODBCDrivers = recurseIntoAttrs (import ../development/libraries/unixODBCDrivers {
@@ -5135,20 +5196,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;
   }));
 
   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 { };
@@ -5217,6 +5276,7 @@ let
 
   jquery_ui = callPackage ../development/libraries/javascript/jquery-ui { };
 
+
   ### DEVELOPMENT / PERL MODULES
 
   buildPerlPackage = import ../development/perl-modules/generic perl;
@@ -5245,6 +5305,10 @@ 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;
     python = python26;
@@ -5261,13 +5325,13 @@ let
 
   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 { };
 
@@ -5275,13 +5339,11 @@ let
 
   pygame = callPackage ../development/python-modules/pygame { };
 
-  pygobject = callPackage ../development/python-modules/pygobject { };
+  pygobject = pythonPackages.pygobject;
 
-  pygtk = callPackage ../development/python-modules/pygtk { };
+  pygtk = pythonPackages.pygtk;
 
-  pyGtkGlade = callPackage ../development/python-modules/pygtk {
-    inherit (gnome) libglade;
-  };
+  pyGtkGlade = pythonPackages.pyGtkGlade;
 
   pyopenssl = builderDefsPackage (import ../development/python-modules/pyopenssl) {
     inherit python openssl;
@@ -5314,13 +5376,7 @@ let
 
   twisted = pythonPackages.twisted;
 
-  ZopeInterface = pythonPackages.zopeInterface;
-
-  /*
-  zope = callPackage ../development/python-modules/zope {
-    python = python24;
-  };
-  */
+  ZopeInterface = pythonPackages.zope_interface;
 
 
   ### SERVERS
@@ -5490,6 +5546,8 @@ 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 {
@@ -5508,7 +5566,12 @@ 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 { };
 
@@ -5522,16 +5585,15 @@ let
   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 { };
 
@@ -5574,6 +5636,10 @@ let
     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
 
@@ -5602,6 +5668,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 { };
 
@@ -5647,10 +5714,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;
@@ -5690,11 +5754,7 @@ let
 
   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 { };
 
@@ -5812,7 +5872,7 @@ let
     kernelPatches =
       [ kernelPatches.fbcondecor_2_6_31
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs2_2_6_32
+        # kernelPatches.aufs2_2_6_32
         kernelPatches.cifs_timeout_2_6_29
         kernelPatches.no_xsave
         kernelPatches.dell_rfkill
@@ -5824,7 +5884,7 @@ let
     kernelPatches =
       [ kernelPatches.fbcondecor_2_6_31
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs2_2_6_32
+        # kernelPatches.aufs2_2_6_32
         kernelPatches.cifs_timeout_2_6_29
         kernelPatches.no_xsave
         kernelPatches.dell_rfkill
@@ -5836,7 +5896,7 @@ let
     kernelPatches =
       [ kernelPatches.fbcondecor_2_6_35
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs2_2_6_35
+        # kernelPatches.aufs2_2_6_35
         kernelPatches.cifs_timeout_2_6_35
       ] ++ lib.optional (platform.kernelArch == "arm")
         kernelPatches.sheevaplug_modules_2_6_35;
@@ -5858,8 +5918,7 @@ let
     kernelPatches =
       [ #kernelPatches.fbcondecor_2_6_38
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_0
-        #kernelPatches.aufs2_1_3_0
+        # kernelPatches.aufs3_0
       ];
   };
 
@@ -5868,7 +5927,7 @@ let
     kernelPatches =
       [ #kernelPatches.fbcondecor_2_6_38
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_1
+        # kernelPatches.aufs3_1
       ];
   };
 
@@ -5877,7 +5936,7 @@ let
     kernelPatches =
       [ #kernelPatches.fbcondecor_2_6_38
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_2
+        # kernelPatches.aufs3_2
         kernelPatches.cifs_timeout_2_6_38
       ];
   };
@@ -5893,7 +5952,7 @@ let
     kernelPatches =
       [ #kernelPatches.fbcondecor_2_6_38
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_3
+        # kernelPatches.aufs3_3
       ];
   };
 
@@ -5902,7 +5961,7 @@ let
     kernelPatches =
       [ #kernelPatches.fbcondecor_2_6_38
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_4
+        # kernelPatches.aufs3_4
       ] ++ lib.optionals (platform.kernelArch == "mips")
       [ kernelPatches.mips_fpureg_emu
         kernelPatches.mips_fpu_sigill
@@ -5914,7 +5973,7 @@ let
     kernelPatches =
       [
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_5
+        # kernelPatches.aufs3_5
         kernelPatches.perf3_5
         kernelPatches.cifs_timeout_3_5_7
       ] ++ lib.optionals (platform.kernelArch == "mips")
@@ -5929,7 +5988,20 @@ let
     kernelPatches =
       [
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_6
+        # kernelPatches.aufs3_6
+      ] ++ lib.optionals (platform.kernelArch == "mips")
+      [ kernelPatches.mips_fpureg_emu
+        kernelPatches.mips_fpu_sigill
+        kernelPatches.mips_ext3_n32
+      ];
+  };
+
+  linux_3_7 = makeOverridable (import ../os-specific/linux/kernel/linux-3.7.nix) {
+    inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
+    kernelPatches =
+      [
+        kernelPatches.sec_perm_2_6_24
+        # kernelPatches.aufs3_7
       ] ++ lib.optionals (platform.kernelArch == "mips")
       [ kernelPatches.mips_fpureg_emu
         kernelPatches.mips_fpu_sigill
@@ -5956,8 +6028,6 @@ let
     aufs =
       if 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
         callPackage ../os-specific/linux/aufs/3.nix { }
       else null;
@@ -5965,8 +6035,6 @@ let
     aufs_util =
       if 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
         callPackage ../os-specific/linux/aufs-util/3.nix { }
       else null;
@@ -6001,6 +6069,7 @@ let
 
     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 { };
 
@@ -6067,6 +6136,7 @@ let
   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_6 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_6 pkgs.linuxPackages_3_6);
+  linuxPackages_3_7 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_7 pkgs.linuxPackages_3_7);
 
   # The current default kernel / kernel modules.
   linux = linuxPackages.kernel;
@@ -6197,6 +6267,8 @@ let
 
   procps = callPackage ../os-specific/linux/procps { };
 
+  "procps-ng" = callPackage ../os-specific/linux/procps-ng { };
+
   pwdutils = callPackage ../os-specific/linux/pwdutils { };
 
   qemu_kvm = callPackage ../os-specific/linux/qemu-kvm { };
@@ -6256,7 +6328,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;
@@ -6289,8 +6361,7 @@ let
   });
 
   udev145 = callPackage ../os-specific/linux/udev/145.nix { };
-  udev173 = callPackage ../os-specific/linux/udev/173.nix { };
-  udev = pkgs.udev173;
+  udev = pkgs.systemd;
 
   udisks = callPackage ../os-specific/linux/udisks { };
 
@@ -6412,8 +6483,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 { };
 
@@ -6477,7 +6547,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 {};
@@ -6563,7 +6633,7 @@ let
 
   aangifte2011 = callPackage_i686 ../applications/taxes/aangifte-2011 { };
 
-  abcde = callPackage ../applications/audio/abcde { 
+  abcde = callPackage ../applications/audio/abcde {
     inherit (perlPackages) DigestSHA MusicBrainz MusicBrainzDiscID;
   };
 
@@ -6600,10 +6670,11 @@ let
 
   autopanosiftc = callPackage ../applications/graphics/autopanosiftc { };
 
-  avidemux = callPackage ../applications/video/avidemux {
-  };
+  avidemux = callPackage ../applications/video/avidemux { };
 
-  avogadro = callPackage ../applications/science/chemistry/avogadro { };
+  avogadro = callPackage ../applications/science/chemistry/avogadro {
+    eigen = eigen2;
+  };
 
   awesome = callPackage ../applications/window-managers/awesome {
     lua = lua5;
@@ -6678,23 +6749,27 @@ let
   };
 
   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;
+    intltool = intltool_standalone;
+  };
 
   coriander = callPackage ../applications/video/coriander {
     inherit (gnome) libgnomeui GConf;
@@ -6702,14 +6777,6 @@ let
 
   csound = callPackage ../applications/audio/csound { };
 
-  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 { };
-
   cinepaint = callPackage ../applications/graphics/cinepaint {
     fltk = fltk13;
     libpng = libpng12;
@@ -6726,7 +6793,7 @@ let
 
   cuneiform = builderDefsPackage (import ../tools/graphics/cuneiform) {
     inherit cmake patchelf;
-    imagemagick=imagemagick;
+    imagemagick = imagemagick;
   };
 
   cvs = callPackage ../applications/version-management/cvs { };
@@ -6737,12 +6804,14 @@ let
 
   d4x = callPackage ../applications/misc/d4x { };
 
-  darcs = haskellPackages.darcs;
+  darcs = lib.setName "darcs-${haskellPackages.darcs.version}" haskellPackages.darcs;
 
   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;
   };
@@ -7011,11 +7080,13 @@ let
 
   feh = callPackage ../applications/graphics/feh { };
 
+  filezilla = callPackage ../applications/networking/ftp/filezilla { };
+
   firefox = pkgs.firefoxPkgs.firefox;
 
   firefoxWrapper = wrapFirefox { browser = pkgs.firefox; };
 
-  firefoxPkgs = pkgs.firefox16Pkgs;
+  firefoxPkgs = pkgs.firefox18Pkgs;
 
   firefox36Pkgs = callPackage ../applications/networking/browsers/firefox/3.6.nix {
     inherit (gnome) libIDL;
@@ -7029,19 +7100,12 @@ let
 
   firefox13Wrapper = lowPrio (wrapFirefox { browser = firefox13Pkgs.firefox; });
 
-  firefox16Pkgs = callPackage ../applications/networking/browsers/firefox/16.0.nix {
-    inherit (gnome) libIDL;
-    inherit (pythonPackages) pysqlite;
-  };
-
-  firefox16Wrapper = lowPrio (wrapFirefox { browser = firefox16Pkgs.firefox; });
-
-  firefox17Pkgs = callPackage ../applications/networking/browsers/firefox/17.0.nix {
+  firefox18Pkgs = callPackage ../applications/networking/browsers/firefox/18.0.nix {
     inherit (gnome) libIDL;
     inherit (pythonPackages) pysqlite;
   };
 
-  firefox17Wrapper = lowPrio (wrapFirefox { browser = firefox17Pkgs.firefox; });
+  firefox18Wrapper = lowPrio (wrapFirefox { browser = firefox18Pkgs.firefox; });
 
   flac = callPackage ../applications/audio/flac { };
 
@@ -7051,7 +7115,6 @@ let
   };
 
   freecad = callPackage ../applications/graphics/freecad {
-    boost = boost146;
   };
 
   freemind = callPackage ../applications/misc/freemind {
@@ -7068,6 +7131,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;
@@ -7109,8 +7176,6 @@ 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 { };
@@ -7277,7 +7342,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 {
@@ -7293,6 +7358,8 @@ let
     lua = lua5;
   };
 
+  ipe = callPackage ../applications/graphics/ipe { };
+
   iptraf = callPackage ../applications/networking/iptraf { };
 
   irssi = callPackage ../applications/networking/irc/irssi { };
@@ -7353,6 +7420,8 @@ let
 
   librecad = callPackage ../applications/misc/librecad { };
 
+  librecad2 = callPackage ../applications/misc/librecad/2.0.nix { };
+
   libreoffice = callPackage ../applications/office/openoffice/libreoffice.nix {
     inherit (perlPackages) ArchiveZip CompressZlib;
     inherit (gnome) GConf ORBit2 gnome_vfs;
@@ -7406,7 +7475,7 @@ 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; }));
@@ -7485,7 +7554,9 @@ let
 
   ncmpcpp = callPackage ../applications/audio/ncmpcpp { };
 
-  MPlayer = callPackage ../applications/video/MPlayer { };
+  mplayer = callPackage ../applications/video/mplayer {
+    pulseSupport = config.pulseaudio or false;
+  };
 
   MPlayerPlugin = browser:
     import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in {
@@ -7512,8 +7583,7 @@ let
 
   msmtp = callPackage ../applications/networking/msmtp { };
 
-  mupdf = callPackage ../applications/misc/mupdf {
-  };
+  mupdf = callPackage ../applications/misc/mupdf { };
 
   mythtv = callPackage ../applications/video/mythtv { };
 
@@ -7523,8 +7593,7 @@ let
 
   nano = callPackage ../applications/editors/nano { };
 
-  navipowm = callPackage ../applications/misc/navipowm {
-  };
+  navipowm = callPackage ../applications/misc/navipowm { };
 
   navit = callPackage ../applications/misc/navit { };
 
@@ -7533,15 +7602,15 @@ let
   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 { };
@@ -7639,6 +7708,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 { };
@@ -7653,10 +7724,6 @@ let
 
   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 { };
-
   qemuImage = callPackage ../applications/virtualization/qemu/linux-img { };
 
   qsampler = callPackage ../applications/audio/qsampler { };
@@ -7686,10 +7753,6 @@ let
 
   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 {
@@ -7731,7 +7794,7 @@ let
   siproxd = callPackage ../applications/networking/siproxd { };
 
   skype = callPackage_i686 ../applications/networking/instant-messengers/skype {
-    usePulseAudio = config.pulseaudio or false; # disabled by default (the 100% cpu bug)
+    usePulseAudio = config.pulseaudio or true;
   };
 
   st = callPackage ../applications/misc/st { };
@@ -7762,6 +7825,10 @@ let
 
   spotify = callPackage ../applications/audio/spotify { };
 
+  libspotify = callPackage ../development/libraries/libspotify {
+    apiKey = config.libspotify.apiKey or null;
+  };
+
   stalonetray = callPackage ../applications/window-managers/stalonetray {};
 
   stumpwm = builderDefsPackage (import ../applications/window-managers/stumpwm) {
@@ -7903,6 +7970,8 @@ let
     gtk = gtk3;
   };
 
+  vbindiff = callPackage ../applications/editors/vbindiff { };
+
   vdpauinfo = callPackage ../tools/X11/vdpauinfo { };
 
   veracity = callPackage ../applications/version-management/veracity {};
@@ -7929,7 +7998,7 @@ let
     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 {};
@@ -7948,7 +8017,7 @@ let
   };
 
   vlc = callPackage ../applications/video/vlc {
-    ffmpeg = ffmpeg_1_0;
+    ffmpeg = ffmpeg_1_1;
   };
 
   vnstat = callPackage ../applications/networking/vnstat { };
@@ -7985,6 +8054,13 @@ let
 
   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" }:
@@ -8000,8 +8076,6 @@ let
          ([ ]
           ++ lib.optional enableGnash gnash
           ++ lib.optional enableAdobeFlash flashplayer
-          # RealPlayer is disabled by default for legal reasons.
-          ++ lib.optional (system != "i686-linux" && cfg.enableRealPlayer or false) RealPlayer
           ++ lib.optional (cfg.enableDjvu or false) (djview4)
           ++ lib.optional (cfg.enableMPlayer or false) (MPlayerPlugin browser)
           ++ lib.optional (cfg.enableGeckoMediaPlayer or false) gecko_mediaplayer
@@ -8030,6 +8104,8 @@ let
 
   xbindkeys = callPackage ../tools/X11/xbindkeys { };
 
+  xcalib = callPackage ../tools/X11/xcalib { };
+
   xchat = callPackage ../applications/networking/irc/xchat { };
 
   xchm = callPackage ../applications/misc/xchm { };
@@ -8073,8 +8149,9 @@ let
     base14Fonts = "${ghostscript}/share/ghostscript/fonts";
   };
 
-  libxpdf = callPackage ../applications/misc/xpdf/libxpdf.nix {
-  };
+  xkb_switch = callPackage ../tools/X11/xkb-switch { };
+
+  libxpdf = callPackage ../applications/misc/xpdf/libxpdf.nix { };
 
   xpra = callPackage ../tools/X11/xpra {
     inherit (pythonPackages) notify;
@@ -8131,6 +8208,8 @@ let
 
   andyetitmoves = if stdenv.isLinux then callPackage ../games/andyetitmoves {} else null;
 
+  anki = callPackage ../games/anki { };
+
   asc = callPackage ../games/asc {
     lua = lua5;
     libsigcxx = libsigcxx12;
@@ -8160,10 +8239,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;
@@ -8184,13 +8263,6 @@ 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 {};
 
   freeciv = callPackage ../games/freeciv { };
@@ -8242,6 +8314,8 @@ let
     inherit libpng zlib;
   };
 
+  lincity_ng = callPackage ../games/lincity/ng.nix {};
+
   mars = callPackage ../games/mars { };
 
   micropolis = callPackage ../games/micropolis { };
@@ -8258,6 +8332,8 @@ let
 
   opentyrian = callPackage ../games/opentyrian { };
 
+  pingus = callPackage ../games/pingus {};
+
   pioneers = callPackage ../games/pioneers { };
 
   pong3d = callPackage ../games/pong3d { };
@@ -8287,10 +8363,11 @@ let
 
   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;
@@ -8318,12 +8395,7 @@ 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 { };
 
   tbe = callPackage ../games/the-butterfly-effect {};
 
@@ -8352,10 +8424,7 @@ let
 
   trigger = callPackage ../games/trigger { };
 
-  ufoai = callPackage ../games/ufoai {
-    inherit (gnome) gtksourceview gtkglext;
-    libpng = libpng12;
-  };
+  ufoai = callPackage ../games/ufoai { };
 
   ultimatestunts = callPackage ../games/ultimatestunts { };
 
@@ -8373,6 +8442,8 @@ let
 
   vectoroids = callPackage ../games/vectoroids { };
 
+  vessel = callPackage_i686 ../games/vessel { };
+
   warmux = callPackage ../games/warmux { };
 
   warsow = callPackage ../games/warsow {
@@ -8385,12 +8456,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
@@ -8445,9 +8518,15 @@ let
 
   kde4 = recurseIntoAttrs pkgs.kde47;
 
-  kde47 = kdePackagesFor (pkgs.kde47 // {boost = boost149;}) ../desktops/kde-4.7;
+  kde47 = kdePackagesFor (pkgs.kde47 // {
+      boost = boost149;
+      eigen = eigen2;
+    }) ../desktops/kde-4.7;
 
-  kde48 = kdePackagesFor (pkgs.kde48 // {boost = boost149;}) ../desktops/kde-4.8;
+  kde48 = kdePackagesFor (pkgs.kde48 // {
+      boost = boost149;
+      eigen = eigen2;
+    }) ../desktops/kde-4.8;
 
   kdePackagesFor = self: dir:
     let callPackageOrig = callPackage; in
@@ -8584,6 +8663,12 @@ let
 
   ### 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 { };
@@ -8630,8 +8715,6 @@ let
 
   paml = callPackage ../applications/science/biology/paml { };
 
-  /* slr = callPackage ../applications/science/biology/slr { }; */
-
   pal2nal = callPackage ../applications/science/biology/pal2nal { };
 
 
@@ -8659,6 +8742,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 {
@@ -8673,7 +8771,7 @@ let
 
   cvc3 = callPackage ../applications/science/logic/cvc3 {};
 
-  eprover = callPackage ../applications/science/logic/eProver {
+  eprover = callPackage ../applications/science/logic/eprover {
     texLive = texLiveAggregationFun {
       paths = [
         texLive texLiveExtra
@@ -8699,6 +8797,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
@@ -8890,20 +8990,8 @@ let
     stateDir = config.nix.stateDir or "/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;
-    };
-
   nut = callPackage ../applications/misc/nut { };
 
-  nut_2_6_3 = callPackage ../applications/misc/nut/2.6.3.nix { };
-
   disnix = callPackage ../tools/package-management/disnix { };
 
   disnix_activation_scripts = callPackage ../tools/package-management/disnix/activation-scripts {
@@ -8957,16 +9045,26 @@ let
 
   xlockmore = callPackage ../misc/screensavers/xlockmore { };
 
-  saneBackends = callPackage ../misc/sane-backends {
+  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;
+    };
+  };
+
+  saneBackends = callPackage ../applications/graphics/sane/backends.nix {
     gt68xxFirmware = config.sane.gt68xxFirmware or null;
     hotplugSupport = config.sane.hotplugSupport or true;
   };
 
-  saneBackendsSnapshot = callPackage ../misc/sane-backends/snapshot.nix {
+  saneBackendsGit = callPackage ../applications/graphics/sane/backends-git.nix {
     gt68xxFirmware = config.sane.gt68xxFirmware or null;
+    hotplugSupport = config.sane.hotplugSupport or true;
   };
 
-  saneFrontends = callPackage ../misc/sane-front { };
+  saneFrontends = callPackage ../applications/graphics/sane/frontends.nix { };
 
   slock = callPackage ../misc/screensavers/slock { };
 
@@ -9059,14 +9157,13 @@ 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 { };
-
   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 { };
@@ -9076,7 +9173,9 @@ let
     inherit (stdenv) mkDerivation;
   };
 
-  zsnes = callPackage_i686 ../misc/emulators/zsnes { };
+  zsnes = callPackage_i686 ../misc/emulators/zsnes {
+    libpng = libpng12;
+  };
 
   misc = import ../misc/misc.nix { inherit pkgs stdenv; };
 
diff --git a/pkgs/top-level/haskell-defaults.nix b/pkgs/top-level/haskell-defaults.nix
index aa43203fe533..69c99db89a2f 100644
--- a/pkgs/top-level/haskell-defaults.nix
+++ b/pkgs/top-level/haskell-defaults.nix
@@ -26,19 +26,22 @@
     self : self.haskellPlatformArgs_2012_4_0_0 self // {
       haskellPlatform = self.haskellPlatform_2012_4_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; };
     };
 
   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; };
     };
 
   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; };
     };
 
   ghc721Prefs = ghc722Prefs;
@@ -47,6 +50,7 @@
     self : self.haskellPlatformArgs_2011_4_0_0 self // {
       haskellPlatform = self.haskellPlatform_2011_4_0_0;
       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.Cabal_1_14_0; };
     };
@@ -55,6 +59,7 @@
     self : self.haskellPlatformArgs_2011_2_0_1 self // {
       haskellPlatform = self.haskellPlatform_2011_2_0_1;
       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.Cabal_1_14_0; };
     };
@@ -65,6 +70,7 @@
     self : self.haskellPlatformArgs_2011_2_0_0 self // {
       haskellPlatform = self.haskellPlatform_2011_2_0_0;
       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.Cabal_1_14_0; };
     };
@@ -75,7 +81,6 @@
     self : self.haskellPlatformArgs_2010_2_0_0 self // {
       haskellPlatform = self.haskellPlatform_2010_2_0_0;
       mtl1 = self.mtl_1_1_0_2;
-      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
@@ -100,7 +105,6 @@
       mtl1 = self.mtl_1_1_0_2;
       extensibleExceptions = self.extensibleExceptions_0_1_1_0;
       text = self.text_0_11_0_6;
-      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;
       jailbreakCabal = self.jailbreakCabal.override { Cabal = self.Cabal_1_14_0; };
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index 19ef0448cbf8..64b172c0c21e 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -129,7 +129,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     HTTP         = self.HTTP_4000_2_6;          # 7.6 ok
     HUnit        = self.HUnit_1_2_5_1;          # 7.6 ok
     mtl          = self.mtl_2_1_2;              # 7.6 ok
-    network      = self.network_2_4_0_1;        # 7.6 ok
+    network      = self.network_2_4_1_0;        # 7.6 ok
     OpenGL       = self.OpenGL_2_6_0_1;         # 7.6 ok
     parallel     = self.parallel_3_2_0_3;       # 7.6 ok
     parsec       = self.parsec_3_1_3;           # 7.6 ok
@@ -483,13 +483,15 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   base64Bytestring = callPackage ../development/libraries/haskell/base64-bytestring {};
 
+  base64Conduit = callPackage ../development/libraries/haskell/base64-conduit {};
+
   baseUnicodeSymbols = callPackage ../development/libraries/haskell/base-unicode-symbols {};
 
   basicPrelude = callPackage ../development/libraries/haskell/basic-prelude {};
 
-  benchpress = callPackage ../development/libraries/haskell/benchpress {
-    time = self.time_1_1_3;
-  };
+  benchpress = callPackage ../development/libraries/haskell/benchpress {};
+
+  bifunctors = callPackage ../development/libraries/haskell/bifunctors {};
 
   bimap = callPackage ../development/libraries/haskell/bimap {};
 
@@ -516,11 +518,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_3_4 = callPackage ../development/libraries/haskell/bmp/1.2.3.4.nix {};
+  bmp = self.bmp_1_2_2_1;       # later versions work only with ghc 7.6 and beyond
 
   Boolean = callPackage ../development/libraries/haskell/Boolean {};
 
@@ -578,6 +584,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   cipherAes = callPackage ../development/libraries/haskell/cipher-aes {};
 
+  cipherRc4 = callPackage ../development/libraries/haskell/cipher-rc4 {};
+
   classyPrelude = callPackage ../development/libraries/haskell/classy-prelude {};
 
   classyPreludeConduit = callPackage ../development/libraries/haskell/classy-prelude-conduit {};
@@ -606,9 +614,7 @@ 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;
-  };
+  convertible = callPackage ../development/libraries/haskell/convertible {};
 
   continuedFractions = callPackage ../development/libraries/haskell/continued-fractions {};
 
@@ -632,8 +638,14 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   cryptohash = callPackage ../development/libraries/haskell/cryptohash {};
 
+  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;
   };
@@ -687,12 +699,11 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   derp = callPackage ../development/libraries/haskell/derp {};
 
   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 {};
 
@@ -708,6 +719,8 @@ 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 {};
@@ -722,6 +735,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   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 {};
@@ -734,6 +749,8 @@ 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 {};
+
   editDistance = callPackage ../development/libraries/haskell/edit-distance {};
 
   editline = callPackage ../development/libraries/haskell/editline {};
@@ -748,6 +765,10 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   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 {};
@@ -794,6 +815,8 @@ 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 {};
@@ -889,6 +912,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     polyparse = self.polyparse_1_7;
   };
 
+  groupoids = callPackage ../development/libraries/haskell/groupoids {};
+
   hakyll = callPackage ../development/libraries/haskell/hakyll {};
 
   hamlet = callPackage ../development/libraries/haskell/hamlet {};
@@ -899,7 +924,9 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   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_5 = callPackage ../development/libraries/haskell/hashable/1.2.0.5.nix {};
+  hashable = self.hashable_1_1_2_5;
 
   hashedStorage = callPackage ../development/libraries/haskell/hashed-storage {};
 
@@ -1096,6 +1123,8 @@ 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 {};
+
   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;
@@ -1154,6 +1183,10 @@ 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 {};
@@ -1188,6 +1221,8 @@ 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 {};
 
   mpppc = callPackage ../development/libraries/haskell/mpppc {};
@@ -1211,7 +1246,9 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   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 {};
 
@@ -1219,14 +1256,24 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   NanoProlog = callPackage ../development/libraries/haskell/NanoProlog {};
 
+  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 {};
+
   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_2_4_0_1 = callPackage ../development/libraries/haskell/network/2.4.0.1.nix {};
-  network = self.network_2_4_0_1;
+  network_2_4_1_0 = callPackage ../development/libraries/haskell/network/2.4.1.0.nix {};
+  network = self.network_2_4_1_0;
 
   networkConduit = callPackage ../development/libraries/haskell/network-conduit {};
 
@@ -1252,6 +1299,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 {};
@@ -1344,6 +1393,10 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   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 {};
+
   projectTemplate = callPackage ../development/libraries/haskell/project-template {};
 
   processExtras = callPackage ../development/libraries/haskell/process-extras {};
@@ -1404,6 +1457,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   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   {};
@@ -1461,6 +1516,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   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 {};
@@ -1469,6 +1526,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   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 {};
@@ -1632,14 +1691,13 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   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 {};
@@ -1650,10 +1708,14 @@ 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 {};
 
+  typeLlevelNaturalNumber = callPackage ../development/libraries/haskell/type-level-natural-number {};
+
   unbound = callPackage ../development/libraries/haskell/unbound {};
 
   uniplate = callPackage ../development/libraries/haskell/uniplate {};
@@ -1754,13 +1816,9 @@ 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_2 = callPackage ../development/libraries/haskell/X11/1.6.0.2.nix {};
-  X11 = self.X11_1_6_0_2;
+  X11 = callPackage ../development/libraries/haskell/X11 {};
 
   X11Xft = callPackage ../development/libraries/haskell/X11-xft {};
 
@@ -1934,18 +1992,11 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     stm = self.stm_2_3;
   };
 
-  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.
 
@@ -1957,7 +2008,6 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     tar          = self.tar_0_3_2_0;
   };
 
-
   cabalGhci = callPackage ../development/tools/haskell/cabal-ghci {};
 
   cabalInstall_0_6_2  = callPackage ../tools/package-management/cabal-install/0.6.2.nix  {};
diff --git a/pkgs/top-level/make-tarball.nix b/pkgs/top-level/make-tarball.nix
index d2f74fe74c0e..e8d775a9a30c 100644
--- a/pkgs/top-level/make-tarball.nix
+++ b/pkgs/top-level/make-tarball.nix
@@ -47,16 +47,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,7 +72,7 @@ releaseTools.sourceTarball {
 
   distPhase = ''
     find . -name "\.svn" -exec rm -rvf {} \; -prune
-  
+
     mkdir -p $out/tarballs
     mkdir ../$releaseName
     cp -prd . ../$releaseName
diff --git a/pkgs/top-level/node-packages.nix b/pkgs/top-level/node-packages.nix
index 907f747ef7e2..083fb573087c 100644
--- a/pkgs/top-level/node-packages.nix
+++ b/pkgs/top-level/node-packages.nix
@@ -128,7 +128,7 @@ let self = {
     name = "bson-0.1.5";
     src = fetchurl {
       url = "http://registry.npmjs.org/bson/-/${name}.tgz";
-      sha256 = "3fad2209466740ea81d0bc285b92d940efe5104a6314946ea40180c431a19692";
+      sha256 = "58af4a1697b015190b40c2a7e5743f9d4494887ef98dfe2f58f24c70f2d31150";
     };
     deps = [
 
@@ -742,6 +742,19 @@ let self = {
     ];
   };
 
+  "optparse" = self."optparse-1.0.3";
+  
+  "optparse-1.0.3" = self.buildNodePackage rec {
+    name = "optparse-1.0.3";
+    src = fetchurl {
+      url = "http://registry.npmjs.org/optparse/-/${name}.tgz";
+      sha256 = "1cg99i4rq8azxikzqz0ykw4q971azbj49d3m7slj041yscb6m883";
+    };
+    deps = [
+    
+    ];
+  };
+
   "osenv" = self."osenv-0";
 
   "osenv-0" = self.buildNodePackage rec {
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index b085dfe49bbe..7e80f23a19ff 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -12,7 +12,7 @@ rec {
   inherit (pkgs) buildPerlPackage fetchurl stdenv perl fetchsvn;
 
   # 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";
@@ -30,10 +30,7 @@ rec {
     };
     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
     };
@@ -48,13 +45,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 {
@@ -89,6 +98,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 +200,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 {
@@ -259,38 +276,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 {
@@ -314,15 +346,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 +383,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 +417,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 +497,17 @@ 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";
     };
-    propagatedBuildInputs = [
-      CatalystRuntime CatalystPluginAuthentication
-      TestException SetObject UNIVERSALisa
-    ];
   };
 
   CatalystPluginConfigLoader = buildPerlPackage rec {
@@ -497,15 +537,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 +571,30 @@ 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";
+    };
+    propagatedBuildInputs = [ CatalystRuntime MIMETypes Moose MooseXTypes namespaceautoclean ];
+    meta = {
+      description = "Make serving static pages painless";
+      license = "perl";
     };
-    propagatedBuildInputs = [CatalystRuntime MIMETypes];
   };
 
   CatalystViewDownload = buildPerlPackage rec {
@@ -556,25 +607,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 +641,21 @@ rec {
       sha256 = "0a2mhfgv0kqmaxf2crs8mqk44lyhd9qcwlpzhrc0b0dh4z503mr4";
     };
     propagatedBuildInputs =
-      [ CatalystRuntime MooseXTraitsPluggable NamespaceAutoclean ListMoreUtils ];
+      [ CatalystRuntime MooseXTraitsPluggable namespaceautoclean ListMoreUtils ];
   };
 
-  CatalystXScriptServerStarman = buildPerlPackage rec {
-    name = "CatalystX-Script-Server-Starman-0.01";
+  CatalystXScriptServerStarman = buildPerlPackage {
+    name = "CatalystX-Script-Server-Starman-0.02";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/CatalystX/${name}.tar.gz";
-      sha256 = "18hpp35bjyw65x564m1m82mr0nmff6836vfjqdwf2lwsb4n8s4xr";
+      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";
+    };
   };
 
   CGICookieXS = buildPerlPackage rec {
@@ -622,20 +683,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 +716,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 +746,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 +811,15 @@ 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";
     };
   };
 
@@ -741,6 +831,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 +872,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 +911,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 +989,14 @@ rec {
     };
   };
 
-  ConfigGeneral = buildPerlPackage rec {
-    name = "Config-General-2.50";
+  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";
     };
   };
 
@@ -901,21 +1043,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";
     };
   };
 
@@ -1052,12 +1232,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 +1286,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 {
@@ -1136,7 +1325,7 @@ rec {
     };
     buildInputs = [ TestRequires ];
     propagatedBuildInputs =
-      [ ClassLoad Moose TaskWeaken TieToObject NamespaceClean ];
+      [ ClassLoad Moose TaskWeaken TieToObject namespaceclean ];
   };
 
   DateCalc = buildPerlPackage {
@@ -1156,14 +1345,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 +1414,19 @@ rec {
     propagatedBuildInputs = [ ClassLoad ClassSingleton ParamsValidate TryTiny ];
   };
 
+  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 {
@@ -1241,7 +1448,7 @@ rec {
 
   DBDPg = import ../development/perl-modules/DBD-Pg {
     inherit stdenv fetchurl buildPerlPackage DBI;
-    inherit (pkgs) postgresql;
+    postgresql = pkgs.postgresql92;
   };
 
   DBFile = import ../development/perl-modules/DB_File {
@@ -1249,38 +1456,46 @@ rec {
     inherit (pkgs) db4;
   };
 
-  DBI = buildPerlPackage rec {
+  DBI = buildPerlPackage {
     name = "DBI-1.616";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/T/TI/TIMB/${name}.tar.gz";
+      url = mirror://cpan/authors/id/T/TI/TIMB/DBI-1.616.tar.gz;
       sha256 = "0m6hk66xprjl314d5c665hnd1vch9a0b9y6ywvmf04kdqj33kkk0";
     };
+    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.08204";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AR/ARODLAND/${name}.tar.gz";
-      sha256 = "15k1kgbrsnkwr0ib6cyr114zk904lisy4k09gfiynag9wjhv47lm";
+      url = mirror://cpan/authors/id/G/GE/GETTY/DBIx-Class-0.08204.tar.gz;
+      sha256 = "0pghq6b60fyffb233hdk9qi47wcbf2sgp08679v9nxh4i5qp49gx";
+    };
+    buildInputs = [ DBDSQLite PackageStash TestException TestWarn ];
+    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 {
+  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 +1507,44 @@ rec {
     propagatedBuildInputs = [DBIxClass HTMLWidget];
   };
 
-  DBIxClassSchemaLoader = buildPerlPackage rec {
-    name = "DBIx-Class-Schema-Loader-0.07014";
+  DBIxClassIntrospectableM2M = buildPerlPackage {
+    name = "DBIx-Class-IntrospectableM2M-0.001001";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/DBIx/${name}.tar.gz";
-      sha256 = "0qrsh6i8p4mpx5bapn40cpsbvnvzivli71gymbiqjd0mjflbsjf6";
+      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";
     };
-    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";
+  DevelGlobalDestruction = buildPerlPackage {
+    name = "Devel-GlobalDestruction-0.09";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/N/NU/NUFFIN/${name}.tar.gz";
-      sha256 = "174m5dx2z89h4308gx6s6vmg93qzaq0bh9m91hp2vqbyialnarhw";
+      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 +1555,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 +1601,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 +1620,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 +1695,31 @@ rec {
     propagatedBuildInputs = [EmailSimple EmailAddress ModulePluggable ReturnValue];
   };
 
-  EmailSender = buildPerlPackage rec {
+  EmailSender = buildPerlPackage {
     name = "Email-Sender-0.120002";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Email-Sender-0.120002.tar.gz;
       sha256 = "1cp735ndmh76xzijsm1hd0yh0m9yj34jc8akjhidkn677h2021dc";
     };
-    buildInputs = [ TestMore ];
-    propagatedBuildInputs =
-      [ CaptureTiny EmailAbstract EmailAddress ListMoreUtils Moose
-        Throwable TryTiny
-      ];
+    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";
+    };
   };
 
-  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,10 +1741,10 @@ 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";
     };
   };
 
@@ -1494,14 +1756,19 @@ rec {
     };
   };
 
-  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,14 +1788,6 @@ rec {
     };
   };
 
-  ExtUtilsInstall = buildPerlPackage rec {
-    name = "ExtUtils-Install-1.54";
-    src = fetchurl {
-      url = "mirror://cpan/modules/by-module/ExtUtils/${name}.tar.gz";
-      sha256 = "19igil4iwh3jdyvjm8s0ypm8wxsny6nv4z3b3lkwhq0ccjgd3rp3";
-    };
-  };
-
   ExtUtilsMakeMaker = buildPerlPackage rec{
     name = "ExtUtils-MakeMaker-6.59";
     src = fetchurl {
@@ -1557,7 +1816,7 @@ rec {
     };
   };
 
-  FileChangeNotify = buildModule rec {
+  FileChangeNotify = buildPerlModule rec {
     name = "File-ChangeNotify-0.20";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/File/${name}.tar.gz";
@@ -1566,7 +1825,7 @@ rec {
     buildInputs = [ TestException ];
     propagatedBuildInputs =
       [ ClassMOP Moose MooseXParamsValidate MooseXSemiAffordanceAccessor
-        NamespaceAutoclean
+        namespaceautoclean
       ] ++ stdenv.lib.optional stdenv.isLinux LinuxInotify2;
   };
 
@@ -1623,10 +1882,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 ];
   };
@@ -1655,36 +1914,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";
     };
   };
 
@@ -1764,14 +2029,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 {
@@ -1818,13 +2102,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";
     };
   };
 
@@ -1837,13 +2128,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 {
@@ -1865,13 +2160,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 {
@@ -1917,13 +2216,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 {
@@ -1939,30 +2244,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";
     };
   };
 
@@ -1982,31 +2312,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 {
@@ -2018,23 +2356,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 {
@@ -2053,15 +2396,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 {
@@ -2073,6 +2420,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 {
@@ -2100,12 +2460,16 @@ rec {
   };
 
   IOSocketSSL = buildPerlPackage rec {
-    name = "IO-Socket-SSL-1.77";
+    name = "IO-Socket-SSL-1.81";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/IO/${name}.tar.gz";
-      sha256 = "2a090167a0d13cdefdac7fb25ca49decd5fd925f37d032bca98c73c4856570a9";
+      sha256 = "1vg7jpn7vz3a2j3fxjjkaxiiqg7azqmy7afrpghiqkjcr8b6zs9y";
     };
     propagatedBuildInputs = [ URI NetSSLeay ];
+    meta = {
+      description = "Nearly transparent SSL encapsulation for IO::Socket::INET";
+      license = "perl";
+    };
   };
 
   IOString = buildPerlPackage rec {
@@ -2132,13 +2496,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 {
@@ -2158,35 +2527,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";
@@ -2254,39 +2623,53 @@ rec {
     };
   };
 
-  JSON = buildPerlPackage rec {
+  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";
+    };
+    buildInputs = [ 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 {
@@ -2298,11 +2681,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";
     };
   };
 
@@ -2326,13 +2712,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 {
@@ -2353,12 +2743,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 {
@@ -2411,22 +2805,29 @@ rec {
     };
   };
 
-  LWP = buildPerlPackage rec {
-    name = "libwww-perl-6.03";
+  LWP = buildPerlPackage {
+    name = "libwww-perl-6.04";
     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.04.tar.gz;
+      sha256 = "0z92fpwk6lh2gghv050r0qb216jmjl2m0c6zby935q8lv0q5wwgr";
     };
-    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";
     };
   };
 
@@ -2441,6 +2842,19 @@ rec {
     doCheck = false; # tries to connect to https://www.apache.org/.
   };
 
+  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 {
     name = "LWPx-ParanoidAgent-1.07";
     src = fetchurl {
@@ -2508,25 +2922,29 @@ rec {
     buildInputs = [ ProcWaitStat ];
   };
 
-  MIMETypes = buildPerlPackage rec {
-    name = "MIME-Types-1.27";
+  MIMETypes = buildPerlPackage {
+    name = "MIME-Types-1.38";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MA/MARKOV/${name}.tar.gz";
-      sha256 = "1zhzyb85zbil2jwrh74rg3bnm9wl74fcg2s64y8b57bk04fdfb7l";
+      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 = [TestPod];
   };
 
-  ModuleBuild = buildPerlPackage rec {
-    name = "Module-Build-0.3800";
+  ModuleBuild = buildPerlPackage {
+    name = "Module-Build-0.4003";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Module/${name}.tar.gz";
-      sha256 = "1gk0xn5s48f0n3a6k4izw6sigsk84rk06hky7dd48hdmvrq23f4v";
+      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";
     };
-    propagatedBuildInputs =
-      [ ExtUtilsInstall ExtUtilsManifest ExtUtilsCBuilder ExtUtilsParseXS
-        CPANMeta PerlOSType ModuleMetadata
-      ];
   };
 
   ModuleFind = buildPerlPackage {
@@ -2537,6 +2955,35 @@ rec {
     };
   };
 
+  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";
+    };
+  };
+
   ModuleMetadata = buildPerlPackage rec {
     name = "Module-Metadata-1.000005";
     src = fetchurl {
@@ -2567,28 +3014,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 {
@@ -2610,7 +3087,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";
@@ -2619,44 +3096,91 @@ 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 {
@@ -2669,32 +3193,48 @@ rec {
     propagatedBuildInputs = [ Moose ];
   };
 
-  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 {
@@ -2713,7 +3253,7 @@ rec {
       sha256 = "0sqmpf2kw25847fwrrwpcfhrq694bgs8jbix7qxp9qyjm769np6n";
     };
     buildInputs = [ TestException TestUseOk ];
-    propagatedBuildInputs = [ ClassMOP Moose NamespaceAutoclean ];
+    propagatedBuildInputs = [ ClassMOP Moose namespaceautoclean ];
   };
 
   MooseXTraitsPluggable = buildPerlPackage rec {
@@ -2724,18 +3264,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 {
@@ -2754,7 +3298,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 {
@@ -2767,15 +3324,19 @@ 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";
     };
   };
 
-  MusicBrainzDiscID = buildModule rec {
+  MusicBrainzDiscID = buildPerlModule rec {
     name = "MusicBrainz-DiscID-0.03";
     src = fetchurl {
       url = "mirror://cpan/authors/id/N/NJ/NJH/${name}.tar.gz";
@@ -2799,22 +3360,33 @@ rec {
     doCheck = false; # Test performs network access.
   };
 
-  NamespaceAutoclean = buildPerlPackage rec {
-    name = "namespace-autoclean-0.12";
+  namespaceautoclean = buildPerlPackage rec {
+    name = "namespace-autoclean-0.13";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/B/BO/BOBTFISH/${name}.tar.gz";
-      sha256 = "125g5ny4sqf9kj1sxaqh1jipzyii56p9nsp45jg9fg67i4ljm9pg";
+      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";
     };
-    propagatedBuildInputs = [ BHooksEndOfScope ClassMOP NamespaceClean Moose ];
   };
 
-  NamespaceClean = buildPerlPackage rec {
-    name = "namespace-clean-0.21";
+  namespaceclean = buildPerlPackage rec {
+    name = "namespace-clean-0.24";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RI/RIBASUSHI/${name}.tar.gz";
-      sha256 = "0djqishj6mcw1jn9saff4i2glq89dq3rc7slpprcky31jay6jq5i";
+      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 {
@@ -2869,19 +3441,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";
     };
   };
 
@@ -2894,13 +3473,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 {
@@ -2932,26 +3528,33 @@ rec {
   };
 
   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 {
@@ -2992,7 +3595,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 {
@@ -3001,36 +3604,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 {
@@ -3042,19 +3660,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";
     };
   };
 
@@ -3067,10 +3708,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 ];
   };
@@ -3083,11 +3724,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";
     };
   };
 
@@ -3165,26 +3810,45 @@ rec {
     };
   };
 
-  Plack = buildPerlPackage rec {
-    name = "Plack-0.9985";
+  Plack = buildPerlPackage {
+    name = "Plack-1.0015";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MI/MIYAGAWA/${name}.tar.gz";
-      sha256 = "0cik1iwpwky7aliwi59z93ykd13ysp4xg5dps1vd4dhqylkn4ns8";
+      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 {
@@ -3223,11 +3887,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 = {
     };
   };
 
@@ -3347,6 +4013,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 {
@@ -3356,18 +4048,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";
     };
   };
 
@@ -3406,15 +4107,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 {
@@ -3460,16 +4164,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 {
@@ -3497,6 +4204,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 {
@@ -3521,11 +4254,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";
     };
   };
 
@@ -3536,16 +4275,48 @@ rec {
       sha256 = "1rmldr7jf4jvkhzlv8hgp48lrmybvinmhv8kcnrpa8las0ijm4vm";
     };
     propagatedBuildInputs =
-      [ LinguaENInflectPhrase TextUnidecode NamespaceClean ];
+      [ LinguaENInflectPhrase TextUnidecode namespaceclean ];
   };
 
-  SubExporter = buildPerlPackage rec {
-    name = "Sub-Exporter-0.982";
+  SubExporter = buildPerlPackage {
+    name = "Sub-Exporter-0.984";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "0xf8q05k5xs3bw6qy3pnnl5d670njxsxbw2dprl7n50hf488cbvj";
+      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 {
@@ -3556,20 +4327,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 {
@@ -3582,10 +4361,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";
     };
   };
 
@@ -3678,34 +4462,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 {
@@ -3749,22 +4540,43 @@ rec {
     buildInputs = [ LogTrace ];
   };
 
-  TestDeep = buildPerlPackage rec {
-    name = "Test-Deep-0.109";
+  TestCheckDeps = buildPerlPackage {
+    name = "Test-CheckDeps-0.002";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Test/${name}.tar.gz";
-      sha256 = "0nqqxj00ln3b4pma47bj2rcpblpvipfrchqbcxahlq9lh1q4p5s6";
+      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";
     };
-    propagatedBuildInputs = [TestTester TestNoWarnings];
   };
 
-  TestDifferences = buildPerlPackage rec {
-    name = "Test-Differences-0.500";
+  TestDeep = buildPerlPackage {
+    name = "Test-Deep-0.110";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/O/OV/OVID/${name}.tar.gz";
-      sha256 = "0ha36j6wr1d47zzilb28bvkm5lm5c6i4rqp4aqyknwg4qmagjr4w";
+      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 {
@@ -3776,13 +4588,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 {
@@ -3810,6 +4627,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 {
@@ -3821,12 +4653,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 {
@@ -3857,10 +4694,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";
     };
   };
 
@@ -3873,12 +4715,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 {
@@ -3898,13 +4744,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";
@@ -3915,20 +4755,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";
     };
   };
 
@@ -3940,26 +4784,32 @@ 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 {
@@ -3976,11 +4826,27 @@ rec {
     doCheck = false; # listens on an external port
   };
 
-  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";
     };
   };
 
@@ -3992,13 +4858,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 {
@@ -4044,20 +4914,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 {
@@ -4069,6 +4948,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 {
@@ -4086,11 +4979,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";
     };
   };
 
@@ -4120,10 +5017,16 @@ rec {
   };
 
   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";
     };
   };
 
@@ -4133,7 +5036,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 {
@@ -4146,11 +5053,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;
     };
   };
 
@@ -4162,11 +5072,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";
     };
   };
 
@@ -4178,11 +5093,15 @@ 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";
     };
   };
 
@@ -4249,14 +5168,32 @@ 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 = [LWP HTTPResponseEncoding HTTPServerSimple];
+    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 = [ URI ];
+    meta = {
+      description = "Database of robots.txt-derived permissions";
+      license = "perl";
+    };
   };
 
   X11GUITest = buildPerlPackage rec {
@@ -4369,27 +5306,29 @@ rec {
     };
   };
 
-  # XSLoader = buildPerlPackage {
-  #   name = "XSLoader-0.08";
-  #   src = fetchurl {
-  #     url = mirror://cpan/authors/id/S/SA/SAPER/XSLoader-0.08.tar.gz;
-  #     sha256 = "0mr4l3givrpyvz1kg0kap2ds8g0rza2cim9kbnjy8hi64igkixi5";
-  #   };
-  # };
-
-  YAML = buildPerlPackage rec {
-    name = "YAML-0.80";
+  YAML = buildPerlPackage {
+    name = "YAML-0.84";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/I/IN/INGY/${name}.tar.gz";
-      sha256 = "81ada73c7eda69dad3cc679b2facba50f2634edcc16c59a7b66bffb9f2fa0e90";
+      url = mirror://cpan/authors/id/M/MS/MSTROUT/YAML-0.84.tar.gz;
+      sha256 = "03349n2z32gwjqiq7l3g57avvphl2rw3lmwc8i5cl9hmfw51yd8a";
+    };
+    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 14f967bf8cf8..4ff31414722b 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
@@ -119,6 +119,11 @@ rec {
         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";
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index b864737d1635..64fa96af7ce0 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1,36 +1,94 @@
 { pkgs, python }:
 
-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
+
+  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;
+  };
+
+  offlineDistutils = import ../development/python-modules/offline-distutils {
+    inherit (pkgs) stdenv;
+    inherit python;
+  };
+
+  # packages defined elsewhere
 
   ipython = import ../shells/ipython {
     inherit (pkgs) stdenv fetchurl;
     inherit buildPythonPackage pythonPackages;
   };
 
+  pil = import ../development/python-modules/pil {
+    inherit (pkgs) fetchurl stdenv libjpeg zlib freetype;
+    inherit python buildPythonPackage;
+  };
 
-  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;
+  };
+
+  pygobject = import ../development/python-modules/pygobject {
+    inherit (pkgs) stdenv fetchurl pkgconfig glib;
+    inherit python;
+  };
+
+  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 {
     rev = "6bb3915636aaf86f046a017ffffd9a4ef395e199";
@@ -44,6 +102,7 @@ let pythonPackages = python.modules // rec {
 
     propagatedBuildInputs = [ notmuch pkgs.dbacl ];
 
+    # error: invalid command 'test'
     doCheck = false;
 
     postInstall = ''
@@ -55,21 +114,21 @@ 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;
     };
   };
 
 
   alot = buildPythonPackage rec {
-    rev = "5ed59825ffaeaacea90ea10be4b932c60428ed8e";
+    rev = "6b5f1a8bf68eecf4364f97c71ec177cf715c081e";
     name = "alot-0.3.3_${rev}";
 
     src = fetchurl {
       url = "https://github.com/pazz/alot/tarball/${rev}";
       name = "${name}.tar.bz";
-      sha256 = "1b724d47bf766ba3ca7cb6d27c7bb597dbc67dcae1347c5a0f01f80c2246ca07";
+      sha256 = "1l6b5gy0z549p54p2va1q7pxyiwb6ghqfy6gdm3kg1np9hw59rl4";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     propagatedBuildInputs = [ notmuch urwid twisted magic configobj pygpgme ];
@@ -83,7 +142,6 @@ let pythonPackages = python.modules // rec {
       homepage = https://github.com/pazz/alot;
       description = "Terminal MUA using notmuch mail";
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
     };
   };
 
@@ -113,6 +171,7 @@ let pythonPackages = python.modules // rec {
       sha1 = "f124e5e4a6644bf6d1734032a01ac44db1b25a29";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -132,6 +191,7 @@ let pythonPackages = python.modules // rec {
 
     buildInputs = [ pkgs.unzip pkgs.sqlite ];
 
+    # python: double free or corruption (fasttop): 0x0000000002fd4660 ***
     doCheck = false;
 
     meta = {
@@ -149,9 +209,14 @@ let pythonPackages = python.modules // rec {
       rev = "b2c9cdcabd";
       sha256 = "b0c12b8c48ed9180c7475fab18de50d63e1b517cfb46da4d2c66fc406fe902bc";
     };
+
     installCommand = "python setup.py install --prefix=$out";
+
+    # error: invalid command 'test'
     doCheck = false;
+
     propagatedBuildInputs = [ boto ];
+
   });
 
 
@@ -165,7 +230,7 @@ let pythonPackages = python.modules // rec {
 
     buildInputs = [ pkgs.unzip ];
 
-    # How do we run the tests?
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -206,7 +271,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1gasiy5lwbhsxw27g36d88n36xbj52434klisvqhljgckd4xqcy7";
     };
 
-    # No tests implemented
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -272,23 +337,39 @@ let pythonPackages = python.modules // rec {
   };
 
 
-  bugz = buildPythonPackage (rec {
-    name = "bugz-0.9.3";
+  # bugz = buildPythonPackage (rec {
+  #   name = "bugz-0.9.3";
+  #
+  #   src = fetchgit {
+  #     url = "https://github.com/williamh/pybugz.git";
+  #     rev = "refs/tags/0.9.3";
+  #   };
+  #
+  #   propagatedBuildInputs = [ argparse python.modules.ssl ];
+  #
+  #   doCheck = false;
+  #
+  #   meta = {
+  #     homepage = http://www.liquidx.net/pybugz/;
+  #     description = "Command line interface for Bugzilla";
+  #   };
+  # });
 
-    src = fetchgit {
-      url = "git://github.com/williamh/pybugz.git";
-      rev = "refs/tags/0.9.3";
-    };
 
-    propagatedBuildInputs = [ argparse python.modules.ssl ];
+  buildout = buildPythonPackage rec {
+    name = "buildout-${version}";
+    version = "1.7.0";
 
-    doCheck = false;
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.buildout/zc.${name}.tar.gz";
+      md5 = "4e3b521600e475c56a0a66459a5fc7bb";
+    };
 
-    meta = {
-      homepage = http://www.liquidx.net/pybugz/;
-      description = "Command line interface for Bugzilla";
+   meta = {
+      homepage = http://www.buildout.org/;
+      description = "A software build and configuration system";
     };
-  });
+  };
 
 
   carrot = buildPythonPackage rec {
@@ -338,6 +419,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1xlvanhnxgvwd7vvypbafyl6yqfkpnwa9rs9k3058z84gd86bz8d";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -373,13 +455,16 @@ let pythonPackages = python.modules // rec {
 
     propagatedBuildInputs = [ stompclient distribute ];
 
+    buildInputs = [ coverage 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;
     };
   });
 
@@ -391,6 +476,7 @@ let pythonPackages = python.modules // rec {
       md5 = "201dbaa732a9049c839f9bb6c27fc7b5";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -398,10 +484,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 = [ 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";
 
@@ -410,9 +533,9 @@ let pythonPackages = python.modules // rec {
       sha256 = "139yfm9yz9k33kgqw4khsljs10rkhhxyywbq9i82bh2r31cil1pp";
     };
 
-    buildInputs = [ pkgs.unzip ];
+    buildInputs = [ pkgs.unzip mock ];
 
-    # The tests fail - I don't know why
+    # couple of failing tests
     doCheck = false;
 
     meta = {
@@ -439,7 +562,7 @@ let pythonPackages = python.modules // rec {
     # 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 = {
@@ -481,31 +604,66 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  distribute = buildPythonPackage (rec {
-    name = "distribute-0.6.26";
+  distribute = stdenv.mkDerivation rec {
+    name = "distribute-0.6.34";
 
     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/distribute/distribute-0.6.34.tar.gz";
+      md5 = "4576ab843a6db5100fb22a72deadf56d";
     };
 
-    buildInputs = [ pkgs.unzip ];
+    buildInputs = [ python wrapPython offlineDistutils ];
 
-    installCommand =
-      ''
-        # ehm, YES, the --verbose flags needs to be there, otherwise it tries to patch setuptools!
-        easy_install --verbose --prefix=$out .
-      '';
-    doCheck = false;
+    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 {
@@ -532,6 +690,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "16s0anvpaccbqmdrhl71z73k0dy2sl166nnc2fbd5lshlgmj13ad";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -549,6 +708,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0snlrcvk92qj1v0n9dpycn6sw56w4zns4mpc30837q6yi7ylrx4f";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -583,7 +743,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1d8vg5a9q2ldnbxqap1893lqb66jwcsli2brbjx7mcnqrzcz449x";
     };
 
-    propagatedBuildInputs = [ pkgs.pil django_1_3 ];
+    propagatedBuildInputs = [ pil django_1_3 ];
 
     meta = {
       description = "A collection of useful extensions for Django";
@@ -604,7 +764,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.";
@@ -638,6 +801,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0wfz4nxl95jcr2f2mc5gijgighavcghg33plzbz5jyi531jpffss";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -705,13 +869,16 @@ let pythonPackages = python.modules // rec {
 
 
   flake8 = buildPythonPackage (rec {
-    name = "flake8-1.5";
+    name = "flake8-1.7.0";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/f/flake8/${name}.tar.gz";
-      md5 = "525be5c7fcaf85f6819c77752cb2ee72";
+      md5 = "a7830d1a6c23e889bc1fcaa4a87f53bd";
     };
 
+    buildInputs = [ nose ];
+
+    # 3 failing tests
     doCheck = false;
 
     meta = {
@@ -719,7 +886,6 @@ let pythonPackages = python.modules // rec {
       homepage = http://pypi.python.org/pypi/flake8;
       license = pkgs.lib.licenses.mit;
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
     };
   });
 
@@ -767,9 +933,6 @@ let pythonPackages = python.modules // rec {
 
     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/;
 
@@ -786,7 +949,6 @@ let pythonPackages = python.modules // rec {
       license = "MIT";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   });
 
@@ -816,7 +978,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 ];
@@ -842,13 +1005,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;
     };
   };
 
@@ -878,6 +1040,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";
@@ -914,6 +1079,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1wmd1svx5344alb8ff9vzdam1ccqdl0h7shp1xnsk843hqwc0fz0";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     postUnpack = "find . -print0 | xargs -0 touch";
@@ -926,24 +1092,29 @@ let pythonPackages = python.modules // rec {
 
 
   httplib2 = buildPythonPackage rec {
-    name = "httplib2-0.7.6";
+    name = "httplib2-0.7.7";
 
     src = fetchurl {
       url = "http://httplib2.googlecode.com/files/${name}.tar.gz";
-      sha256 = "baa7bf431fa9d3c1016562de717e1ebb322a99df72a2918f6b5b8f65fa65bc2e";
+      sha256 = "2e2ce18092c32d1ec54f8a447e14e33585e30f240b883bfeeca65f12b3bcfaf6";
     };
 
-    doCheck = false; # doesn't have a test
-
     meta = {
       homepage = "http://code.google.com/p/httplib2";
       description = "A comprehensive HTTP client library";
       license = pkgs.lib.licenses.mit;
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
     };
   };
 
+  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";
@@ -970,6 +1141,7 @@ let pythonPackages = python.modules // rec {
       md5 = "f4f7ddc7c5e55a47222a5cc6c0a87b6d";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -978,6 +1150,30 @@ 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 = [ ipython ];
+  };
+
+  jedi = buildPythonPackage (rec {
+    name = "jedi-0.5b5";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/j/jedi/${name}.tar.gz";
+      sha256 = "10xqdhda9kdbc22h4dphxqjncpdb80s1crxsirr5h016rw9czsa4";
+    };
+
+    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";
@@ -1009,6 +1205,7 @@ let pythonPackages = python.modules // rec {
       md5 = "506cf1b13020b3ed2f3c845ea0c9830e";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1027,10 +1224,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/;
@@ -1046,7 +1246,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/;
@@ -1127,6 +1328,23 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+  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";
@@ -1137,6 +1355,7 @@ let pythonPackages = python.modules // rec {
       md5 = "751e8055be2433dfd1a82e0fb1b12f13";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1152,6 +1371,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 ];
@@ -1228,6 +1448,7 @@ let pythonPackages = python.modules // rec {
       sha1 = "b71aeaacf31898c3b38d8b9ca5bcc0664499c0de";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1237,6 +1458,26 @@ 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";
+    };
+  };
+
+
   mutagen = buildPythonPackage (rec {
     name = "mutagen-1.20";
 
@@ -1256,6 +1497,7 @@ let pythonPackages = python.modules // rec {
   MySQL_python = buildPythonPackage {
     name = "MySQL-python-1.2.3";
 
+    # plenty of failing tests
     doCheck = false;
 
     src = fetchurl {
@@ -1263,7 +1505,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";
@@ -1283,6 +1527,7 @@ let pythonPackages = python.modules // rec {
 
     # No support of GUI yet.
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1315,7 +1560,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/;
@@ -1329,62 +1575,83 @@ let pythonPackages = python.modules // rec {
     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 ];
   };
 
+  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";
 
@@ -1393,7 +1660,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1kh4spwgqxm534qlzzf2ijchckvs0pwjxl1irhicjmlg7mybnfvx";
     };
 
-    buildInputs = [ python pkgs.pkgconfig pkgs.libnotify pkgs.pygobject pkgs.pygtk pkgs.glib pkgs.gtk pkgs.dbus_glib ];
+    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 .";
 
@@ -1421,7 +1688,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;
     };
   };
 
@@ -1439,6 +1705,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 ];
@@ -1451,7 +1719,7 @@ let pythonPackages = python.modules // rec {
   });
 
   oauth2 = buildPythonPackage (rec {
-    name = "auth2-1.5.211";
+    name = "oauth2-1.5.211";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/o/oauth2/oauth2-1.5.211.tar.gz";
@@ -1459,6 +1727,10 @@ let pythonPackages = python.modules // rec {
     };
 
     propagatedBuildInputs = [ httplib2 ];
+
+    buildInputs = [ mock coverage ];
+
+    # ServerNotFoundError: Unable to find the server at oauth-sandbox.sevengoslings.net
     doCheck = false;
 
     meta = {
@@ -1470,27 +1742,36 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  optfunc = buildPythonPackage ( rec {
-    name = "optfunc-git";
-
-    src = pkgs.fetchgit {
-      url = "http://github.com/simonw/optfunc.git";
-      rev = "e3fa034a545ed94ac5a039cf5b170c7d0ee21b7b";
+  # 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";
     };
-
-    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/";
-    };
-  });
+  }) else null;
 
   ply = buildPythonPackage (rec {
     name = "ply-3.2";
@@ -1522,7 +1803,6 @@ let pythonPackages = python.modules // rec {
       license = "revised-BSD";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   });
 
@@ -1535,7 +1815,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1bjy4jn51c50mpq51jbwk0glzd8bxz83gxdfkr9p95dmrd17c7hh";
     };
 
-    buildInputs = [ pkgs.pycrypto ];
+    buildInputs = [ pycrypto ];
 
     meta = {
       homepage = "http://www.lag.net/paramiko/";
@@ -1553,8 +1833,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;
     };
   };
 
@@ -1623,6 +1901,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0x8bfjjqygriry1iyygm5048ykl5qpbpzqfp6i8dhkslm3ryf5fk";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1647,10 +1926,19 @@ let pythonPackages = python.modules // rec {
       '';
 
       maintainers = [ stdenv.lib.maintainers.simons ];
-      platforms = python.meta.platforms;
     };
   };
 
+  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;
+  };
 
   polib = buildPythonPackage rec {
     name = "polib-${version}";
@@ -1661,6 +1949,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1sr2bb3g7rl7gr6156j5qv71kg06q1x01r1lbps9ksnyz37djn2q";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1699,9 +1988,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 {
@@ -1770,8 +2075,6 @@ let pythonPackages = python.modules // rec {
       python setup.py install --prefix=$out
     '';
 
-    doCheck = false;
-
     meta = {
       description = "Python bindings for PortAudio";
       homepage = "http://people.csail.mit.edu/hubert/pyaudio/";
@@ -1788,7 +2091,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "4a3a085ecf1fcd2736573538ffa114f1f4331b3bbbdd69381e6e172c49c9750f";
     };
 
-    doCheck = false;
+    buildInputs = [ pytz ];
 
     meta = {
       homepage = http://babel.edgewall.org;
@@ -1837,14 +2140,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";
@@ -1875,7 +2177,7 @@ let pythonPackages = python.modules // rec {
     };
     propagatedBuildInputs = [xe];
 
-    # tests not described in setup.py
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1908,6 +2210,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "5fd887c407015296a8fd3f4b867fe0fcca3179de97ccde90449853a3dfb802e1";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     propagatedBuildInputs = [ pkgs.gpgme ];
@@ -1917,7 +2220,6 @@ 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;
     };
   };
 
@@ -1953,7 +2255,10 @@ 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.";
@@ -1983,6 +2288,8 @@ let pythonPackages = python.modules // rec {
       sha256 = "1idks7j9bn62xzsaxkvhl7bdq6ws8kv8aa0wahfh7724qlbbcf1k";
     };
 
+    # ERROR: testExtended (tests.test_acls.AclExtensions)
+    # IOError: [Errno 0] Error
     doCheck = false;
 
     buildInputs = [ pkgs.acl ];
@@ -2013,23 +2320,19 @@ let pythonPackages = python.modules // rec {
 
 
   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; {
@@ -2070,6 +2373,16 @@ let pythonPackages = python.modules // rec {
       };
 
 
+  pyquery = buildPythonPackage rec {
+    name = "pyquery-1.2.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyquery/pyquery-1.2.4.tar.gz";
+      md5 = "268f08258738d21bc1920d7522f2a63b";
+    };
+    buildInputs = [ cssselect lxml ];
+  };
+
+
   pyreport = buildPythonPackage (rec {
     name = "pyreport-0.3.4c";
 
@@ -2078,6 +2391,7 @@ let pythonPackages = python.modules // rec {
       md5 = "3076164a7079891d149a23f9435581db";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2107,7 +2421,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 = {
@@ -2138,7 +2452,6 @@ let pythonPackages = python.modules // rec {
       license = "revised BSD";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   });
 
@@ -2169,9 +2482,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 = ''
@@ -2248,6 +2558,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0jmkffik6hdzs7ng8c65bggss2ai40nm59jykswdf5lpd36cxddq";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     buildInputs = [ pkgs.attr ];
@@ -2317,6 +2628,8 @@ let pythonPackages = python.modules // rec {
     };
 
     buildInputs = [freetype];
+
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2336,8 +2649,8 @@ let pythonPackages = python.modules // rec {
 
     propagatedBuildInputs =
       [ recaptcha_client pytz memcached dateutil paramiko flup pygments
-        djblets django_1_3 django_evolution pkgs.pycrypto python.modules.sqlite3
-        pysvn pkgs.pil psycopg2
+        djblets django_1_3 django_evolution pycrypto python.modules.sqlite3
+        pysvn pil psycopg2
       ];
   };
 
@@ -2350,6 +2663,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1c7ipk5vwqnln83rmai5jzyxkjdajdzbk5cgy1z83nyr5hbkgkqr";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2358,21 +2672,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;
@@ -2381,20 +2689,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";
@@ -2404,6 +2708,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";
@@ -2432,6 +2756,8 @@ let pythonPackages = python.modules // rec {
 
     buildInputs = [pkgs.gfortran];
     propagatedBuildInputs = [ numpy ];
+
+    # error: invalid command 'test'
     doCheck = false;
 
     # TODO: add ATLAS=${pkgs.atlas}
@@ -2484,7 +2810,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
@@ -2570,6 +2895,7 @@ let pythonPackages = python.modules // rec {
       md5 = "9e8099b57cd27493a6988e9c9b313e23";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2593,9 +2919,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";
@@ -2682,37 +3009,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 ];
@@ -2725,6 +3072,7 @@ let pythonPackages = python.modules // rec {
         --prefix LD_LIBRARY_PATH : $libspaths
     '';
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2752,6 +3100,23 @@ 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;
+    };
+  };
+
+
   trac = buildPythonPackage {
     name = "trac-0.12.2";
 
@@ -2760,6 +3125,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1ihf5031pc1wpwbxpfzzz2bcpwww795n5y22baglyim1lalivd65";
     };
 
+    # couple of failing tests
     doCheck = false;
 
     PYTHON_EGG_CACHE = "`pwd`/.egg-cache";
@@ -2773,15 +3139,56 @@ 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.8";
+    name = "turses-0.2.11";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/t/turses/${name}.tar.gz";
-      sha256 = "fbbc0ca93324535bcafa8434395caded8047e40c25d7a4004806415dd6ca023f";
+      sha256 = "0zd0fjb5rr5if8wp6kmi29wrkj7ypp4vz00xxb0if1kjrakczlvm";
     };
 
-    propagatedBuildInputs = [ oauth2 urwid tweepy ];
+    propagatedBuildInputs = [ oauth2 urwid tweepy ] ++ optional isPy26 argparse;
+
+    #buildInputs = [ tox ];
+    # needs tox
     doCheck = false;
 
     meta = {
@@ -2794,15 +3201,13 @@ let pythonPackages = python.modules // rec {
   });
 
   tweepy = buildPythonPackage (rec {
-    name = "tweepy-1.11";
+    name = "tweepy-1.13";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/t/tweepy/${name}.tar.gz";
-      sha256 = "2b9fa225e9254e2cbbb01e59c6e92d9c42e5d41d97e8c74dee93eb09babffde5";
+      sha256 = "1gaki8qvzi72jaj5xls51lc6fgs1xnm9c6jgpirwklpdn7y8wyy5";
     };
 
-    doCheck = false;
-
     meta = {
       homepage = "https://github.com/tweepy/tweepy";
       description = "Twitter library for python";
@@ -2813,14 +3218,14 @@ let pythonPackages = python.modules // rec {
   });
 
   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
@@ -2841,7 +3246,6 @@ let pythonPackages = python.modules // rec {
       license = "MIT";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   };
 
@@ -2869,6 +3273,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "4437076c8708e5754ea04540e46c7f4f233734ee3590bb8a96389264fb0650d0";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     propagatedBuildInputs = [ pycurl ];
@@ -2883,13 +3288,14 @@ let pythonPackages = python.modules // rec {
 
 
   urwid = buildPythonPackage (rec {
-    name = "urwid-1.0.2";
+    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 = "00542bbd15fae7ea60b02a7570edee2b";
+      md5 = "eca2e0413cf7216b01c84b99e0f2576d";
     };
 
     meta = {
@@ -2897,22 +3303,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.8.4";
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/v/virtualenv/${name}.tar.gz";
-      md5 = "1072b66d53c24e019a8f1304ac9d9fc5";
+      md5 = "1c7e56a7f895b2e71558f96e365ee7a7";
     };
 
     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";
@@ -2931,6 +3338,7 @@ let pythonPackages = python.modules // rec {
       md5 = "8492e46496e187b49fe5569b5639804e";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -3030,7 +3438,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0v9878cl0y9cczdsr6xjy8v9l139lc23h4m5f86p4kpf2wlnpi42";
     };
 
-    # tests not described in setup.py
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -3083,6 +3491,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";
 
@@ -3112,56 +3579,476 @@ 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 ];
+
+    # 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_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.20120929";
+    name = "cliapp-${version}";
+    version = "1.20121216";
 
     src = fetchurl rec {
-      url = "http://code.liw.fi/debian/pool/main/p/python-cliapp/python-cliapp_1.20120929.orig.tar.gz";
-      sha256 = "30d5077e53b3e45f892b1c49feaaf4f47e4664400ed71435e77a82a2b823a0f8";
+      url = "http://code.liw.fi/debian/pool/main/p/python-cliapp/python-cliapp_${version}.orig.tar.gz";
+      sha256 = "1bzvc4aj3w8g85qycwz1jxa73jj8rl6zrgd4hi78kr4dgslcfns5";
     };
 
     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;
     };
   };
 
@@ -3175,13 +4062,13 @@ let pythonPackages = python.modules // rec {
 
     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;
     };
   };
 
@@ -3195,34 +4082,115 @@ let pythonPackages = python.modules // rec {
 
     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.20121006";
+    name = "larch-${version}";
+    version = "1.20121216";
 
     src = fetchurl rec {
-      url = "http://code.liw.fi/debian/pool/main/p/python-larch/python-larch_1.20121006.orig.tar.gz";
-      sha256 = "b4482981010e9c22ee3fce6fdc664b8fc0a1a3a18ed30b40f247f3b44437ccfa";
+      url = "http://code.liw.fi/debian/pool/main/p/python-larch/python-larch_${version}.orig.tar.gz";
+      sha256 = "0w4hirs8wkp1hji6nxfmq4rahkd5rgw4cavvdhpdfr4mddycbis3";
     };
 
     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;
+    };
+  };
+
+  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 ];
+    };
+  };
+
+  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 ];
     };
   };
 
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index a1af20acc77c..63fffd7d3161 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -17,9 +17,9 @@ let
       #xorgserver.hostDrv = nativePlatforms;
     };
     nixUnstable.hostDrv = nativePlatforms;
-    linuxPackages_2_6_39.kernel.hostDrv = linux;
     linuxPackages_3_3.kernel.hostDrv = linux;
     linuxPackages_3_4.kernel.hostDrv = linux;
+    linuxPackages_3_6.kernel.hostDrv = linux;
   };
 
   /* Basic list of packages to be natively built,
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index f6db077b3136..d03f2724e1f0 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -1,7 +1,11 @@
 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 { };
 
   /* !!! Hack: poor man's memoisation function.  Necessary for prevent
      Nixpkgs from being evaluated again and again for every
@@ -10,7 +14,6 @@ rec {
     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,7 +22,6 @@ 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"; };
@@ -75,37 +77,37 @@ 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 
+  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 [])
+          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 {};
-    
+
   # 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
@@ -121,6 +123,6 @@ rec {
   /* 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 000000000000..e683a5c5c3a2
--- /dev/null
+++ b/pkgs/top-level/release-python.nix
@@ -0,0 +1,2014 @@
+/*
+  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; };
+  alienarena = { 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; };
+  boost147 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boost149 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boost151 = { 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; };
+  emacs22 = { 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_0 = { 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; };
+  gwt = { 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; };
+    ov511 = { 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; };
+  mercurial = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mercurialFull = { 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; };
+  openoffice = { 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; };
+  qt47 = { 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; };
+  speed_dreams = { 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; };
+  ufoai = { 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; };
+  vdrift = { 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; };
+    libgdu = { 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; };
+  xonotic = { 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 3201afb44a05..4098086c2f77 100644
--- a/pkgs/top-level/release-small.nix
+++ b/pkgs/top-level/release-small.nix
@@ -217,6 +217,5 @@ with (import ./release-lib.nix);
     ecb = linux;
     emacsw3m = linux;
     emms = linux;
-    nxml = all;
   };
 } ))
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index b09deca1350c..833210e8de9b 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -49,7 +49,6 @@ with (import ./release-lib.nix);
   chatzilla = linux;
   cksfv = all;
   classpath = linux;
-  consolekit = linux;
   coreutils = all;
   cpio = all;
   cron = linux;
@@ -146,7 +145,6 @@ with (import ./release-lib.nix);
   icewm = linux;
   idutils = all;
   ifplugd = linux;
-  imagemagick = allBut "i686-cygwin";
   impressive = linux;
   inetutils = linux;
   inkscape = linux;
@@ -252,7 +250,6 @@ with (import ./release-lib.nix);
   rubber = allBut "i686-cygwin";
   ruby = all;
   rxvt_unicode = linux;
-  samba = linux;
   screen = linux ++ darwin;
   scrot = linux;
   sdparm = linux;
@@ -346,7 +343,6 @@ with (import ./release-lib.nix);
     ecb = linux;
     emacsw3m = linux;
     emms = linux;
-    nxml = all;
   };
 
   emacs23Packages = emacs22Packages // {
@@ -354,8 +350,7 @@ with (import ./release-lib.nix);
   };
 
   firefox36Pkgs.firefox = linux;
-  firefox16Pkgs.firefox = linux;
-  firefox17Pkgs.firefox = linux;
+  firefox18Pkgs.firefox = linux;
 
   gnome = {
     gnome_panel = linux;