about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/audio/a2jmidid/default.nix10
-rw-r--r--pkgs/applications/audio/abcde/default.nix2
-rw-r--r--pkgs/applications/audio/amarok/default.nix6
-rw-r--r--pkgs/applications/audio/ams-lv2/default.nix27
-rw-r--r--pkgs/applications/audio/ardour/ardour3.nix60
-rw-r--r--pkgs/applications/audio/ardour/default.nix95
-rw-r--r--pkgs/applications/audio/audacious/default.nix10
-rw-r--r--pkgs/applications/audio/audacity/default.nix7
-rw-r--r--pkgs/applications/audio/aumix/default.nix2
-rw-r--r--pkgs/applications/audio/bristol/default.nix8
-rw-r--r--pkgs/applications/audio/calf/default.nix4
-rw-r--r--pkgs/applications/audio/cantata/default.nix104
-rw-r--r--pkgs/applications/audio/caps/default.nix4
-rw-r--r--pkgs/applications/audio/cd-discid/default.nix2
-rw-r--r--pkgs/applications/audio/clementine/clementine-1.2.1-include-paths.patch14
-rw-r--r--pkgs/applications/audio/clementine/default.nix54
-rw-r--r--pkgs/applications/audio/csound/default.nix6
-rw-r--r--pkgs/applications/audio/distrho/default.nix4
-rw-r--r--pkgs/applications/audio/drumkv1/default.nix8
-rw-r--r--pkgs/applications/audio/ekho/default.nix39
-rw-r--r--pkgs/applications/audio/espeak/default.nix16
-rw-r--r--pkgs/applications/audio/espeak/edit.nix54
-rw-r--r--pkgs/applications/audio/espeak/espeakedit-configurable-path-espeak-data.patch15
-rw-r--r--pkgs/applications/audio/espeak/espeakedit-configurable-sox-path.patch27
-rw-r--r--pkgs/applications/audio/espeak/espeakedit-fix-makefile.patch26
-rw-r--r--pkgs/applications/audio/flac/default.nix9
-rw-r--r--pkgs/applications/audio/fldigi/default.nix24
-rw-r--r--pkgs/applications/audio/fluidsynth/default.nix8
-rw-r--r--pkgs/applications/audio/gigedit/default.nix1
-rw-r--r--pkgs/applications/audio/gmpc/default.nix18
-rw-r--r--pkgs/applications/audio/gmu/default.nix2
-rw-r--r--pkgs/applications/audio/gpodder/default.nix45
-rw-r--r--pkgs/applications/audio/gtkpod/default.nix40
-rw-r--r--pkgs/applications/audio/guitarix/default.nix25
-rw-r--r--pkgs/applications/audio/hydrogen/default.nix8
-rw-r--r--pkgs/applications/audio/id3v2/default.nix2
-rw-r--r--pkgs/applications/audio/ingen/default.nix33
-rw-r--r--pkgs/applications/audio/jack-capture/default.nix4
-rw-r--r--pkgs/applications/audio/jack-oscrolloscope/default.nix4
-rw-r--r--pkgs/applications/audio/jack-rack/default.nix4
-rw-r--r--pkgs/applications/audio/jackmeter/default.nix10
-rw-r--r--pkgs/applications/audio/jalv/default.nix9
-rw-r--r--pkgs/applications/audio/ladspa-plugins/ladspah.nix33
-rw-r--r--pkgs/applications/audio/lash/default.nix6
-rw-r--r--pkgs/applications/audio/lastfmsubmitd/default.nix21
-rw-r--r--pkgs/applications/audio/lastwatch/default.nix3
-rw-r--r--pkgs/applications/audio/lingot/default.nix8
-rw-r--r--pkgs/applications/audio/linuxsampler/default.nix4
-rw-r--r--pkgs/applications/audio/lmms/default.nix20
-rw-r--r--pkgs/applications/audio/mda-lv2/default.nix4
-rw-r--r--pkgs/applications/audio/mhwaveedit/default.nix8
-rw-r--r--pkgs/applications/audio/mid2key/default.nix1
-rw-r--r--pkgs/applications/audio/mikmod/default.nix2
-rw-r--r--pkgs/applications/audio/milkytracker/decompressor_gzip.patch20
-rw-r--r--pkgs/applications/audio/milkytracker/default.nix44
-rw-r--r--pkgs/applications/audio/minimodem/default.nix29
-rw-r--r--pkgs/applications/audio/mixxx/default.nix2
-rw-r--r--pkgs/applications/audio/moc/default.nix27
-rw-r--r--pkgs/applications/audio/monkeys-audio/default.nix5
-rw-r--r--pkgs/applications/audio/mopidy-moped/default.nix24
-rw-r--r--pkgs/applications/audio/mopidy-spotify/default.nix24
-rw-r--r--pkgs/applications/audio/mopidy/default.nix29
-rw-r--r--pkgs/applications/audio/mp3info/default.nix2
-rw-r--r--pkgs/applications/audio/mp3splt/default.nix20
-rwxr-xr-xpkgs/applications/audio/mpc/default.nix10
-rw-r--r--pkgs/applications/audio/mpc123/default.nix2
-rw-r--r--pkgs/applications/audio/mpg123/default.nix6
-rw-r--r--pkgs/applications/audio/mpg321/default.nix2
-rwxr-xr-xpkgs/applications/audio/ncmpc/default.nix25
-rw-r--r--pkgs/applications/audio/opus-tools/default.nix8
-rw-r--r--pkgs/applications/audio/opusfile/default.nix17
-rw-r--r--pkgs/applications/audio/pamixer/default.nix38
-rw-r--r--pkgs/applications/audio/pavucontrol/default.nix2
-rw-r--r--pkgs/applications/audio/petrifoo/default.nix4
-rw-r--r--pkgs/applications/audio/pianobooster/default.nix15
-rw-r--r--pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake-gcc4.7.patch11
-rw-r--r--pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake.patch44
-rw-r--r--pkgs/applications/audio/praat/default.nix16
-rw-r--r--pkgs/applications/audio/projectm/default.nix51
-rw-r--r--pkgs/applications/audio/puredata/default.nix25
-rw-r--r--pkgs/applications/audio/qjackctl/default.nix9
-rw-r--r--pkgs/applications/audio/qmmp/default.nix7
-rw-r--r--pkgs/applications/audio/qsampler/default.nix1
-rw-r--r--pkgs/applications/audio/qsynth/default.nix9
-rw-r--r--pkgs/applications/audio/qtractor/default.nix8
-rw-r--r--pkgs/applications/audio/quodlibet/default.nix48
-rw-r--r--pkgs/applications/audio/rakarrack/default.nix4
-rw-r--r--pkgs/applications/audio/samplv1/default.nix8
-rw-r--r--pkgs/applications/audio/seq24/default.nix4
-rw-r--r--pkgs/applications/audio/setbfree/default.nix32
-rw-r--r--pkgs/applications/audio/snd/default.nix70
-rw-r--r--pkgs/applications/audio/snd/doc.patch62
-rw-r--r--pkgs/applications/audio/sonic-visualiser/default.nix38
-rw-r--r--pkgs/applications/audio/spotify/default.nix91
-rw-r--r--pkgs/applications/audio/streamripper/default.nix21
-rw-r--r--pkgs/applications/audio/synthv1/default.nix8
-rw-r--r--pkgs/applications/audio/transcode/default.nix25
-rwxr-xr-xpkgs/applications/audio/vimpc/default.nix34
-rw-r--r--pkgs/applications/audio/vmpk/default.nix26
-rw-r--r--pkgs/applications/audio/vorbis-tools/default.nix2
-rw-r--r--pkgs/applications/audio/xmp/default.nix20
-rw-r--r--pkgs/applications/audio/xsynth-dssi/default.nix4
-rw-r--r--pkgs/applications/audio/yoshimi/default.nix16
-rw-r--r--pkgs/applications/audio/zynaddsubfx/default.nix21
-rw-r--r--pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix15
-rw-r--r--pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch18
-rw-r--r--pkgs/applications/display-managers/lightdm/default.nix7
-rw-r--r--pkgs/applications/display-managers/lightdm/lightdm.patch143
-rw-r--r--pkgs/applications/display-managers/slim/default.nix12
-rw-r--r--pkgs/applications/display-managers/slim/runtime-paths.patch49
-rw-r--r--pkgs/applications/editors/atom/default.nix68
-rw-r--r--pkgs/applications/editors/bvi/default.nix2
-rw-r--r--pkgs/applications/editors/codeblocks/default.nix39
-rw-r--r--pkgs/applications/editors/codeblocks/writable-projects.patch18
-rw-r--r--pkgs/applications/editors/dhex/default.nix6
-rw-r--r--pkgs/applications/editors/eclipse/default.nix35
-rw-r--r--pkgs/applications/editors/ed/default.nix6
-rw-r--r--pkgs/applications/editors/emacs-23/builder.sh34
-rw-r--r--pkgs/applications/editors/emacs-23/default.nix72
-rw-r--r--pkgs/applications/editors/emacs-24/darwin-new-sections.patch50
-rw-r--r--pkgs/applications/editors/emacs-24/default.nix18
-rw-r--r--pkgs/applications/editors/emacs-24/macport.nix100
-rw-r--r--pkgs/applications/editors/emacs-modes/auto-complete/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/bbdb/3.nix25
-rw-r--r--pkgs/applications/editors/emacs-modes/bbdb/default.nix10
-rw-r--r--pkgs/applications/editors/emacs-modes/calfw/default.nix6
-rw-r--r--pkgs/applications/editors/emacs-modes/cedet/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/coffee/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/color-theme/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/cryptol/default.nix26
-rw-r--r--pkgs/applications/editors/emacs-modes/darcsum/darcs_context7
-rw-r--r--pkgs/applications/editors/emacs-modes/darcsum/default.nix34
-rw-r--r--pkgs/applications/editors/emacs-modes/ecb/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix7
-rw-r--r--pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/emms/default.nix5
-rw-r--r--pkgs/applications/editors/emacs-modes/ess/default.nix9
-rw-r--r--pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/gh/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/gist/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/haskell/default.nix6
-rw-r--r--pkgs/applications/editors/emacs-modes/hol_light/default.nix19
-rw-r--r--pkgs/applications/editors/emacs-modes/idris/default.nix31
-rw-r--r--pkgs/applications/editors/emacs-modes/jade/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/jdee/default.nix12
-rw-r--r--pkgs/applications/editors/emacs-modes/jdee/java-directory.patch6
-rw-r--r--pkgs/applications/editors/emacs-modes/js2/default.nix5
-rw-r--r--pkgs/applications/editors/emacs-modes/logito/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/magit/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/maude/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/metaweblog/default.nix31
-rw-r--r--pkgs/applications/editors/emacs-modes/ocaml/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/offlineimap/default.nix28
-rw-r--r--pkgs/applications/editors/emacs-modes/org/default.nix15
-rw-r--r--pkgs/applications/editors/emacs-modes/org2blog/default.nix17
-rw-r--r--pkgs/applications/editors/emacs-modes/pcache/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/proofgeneral/4.2.nix (renamed from pkgs/applications/editors/emacs-modes/proofgeneral/default.nix)6
-rw-r--r--pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix48
-rw-r--r--pkgs/applications/editors/emacs-modes/quack/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/rect-mark/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/remember/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/sbt-mode/default.nix24
-rw-r--r--pkgs/applications/editors/emacs-modes/scala-mode/v1.nix (renamed from pkgs/applications/editors/emacs-modes/scala-mode/default.nix)0
-rw-r--r--pkgs/applications/editors/emacs-modes/scala-mode/v2.nix24
-rw-r--r--pkgs/applications/editors/emacs-modes/structured-haskell-mode/default.nix23
-rw-r--r--pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/tuareg/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/writegood/default.nix30
-rw-r--r--pkgs/applications/editors/emacs-modes/xml-rpc/default.nix2
-rw-r--r--pkgs/applications/editors/flpsed/default.nix8
-rw-r--r--pkgs/applications/editors/geany/default.nix4
-rw-r--r--pkgs/applications/editors/gobby/default.nix2
-rw-r--r--pkgs/applications/editors/hexedit/default.nix4
-rw-r--r--pkgs/applications/editors/idea/default.nix91
-rw-r--r--pkgs/applications/editors/idea/pycharm.nix115
-rw-r--r--pkgs/applications/editors/jedit/default.nix26
-rw-r--r--pkgs/applications/editors/kdevelop/default.nix18
-rw-r--r--pkgs/applications/editors/leksah/default.nix28
-rw-r--r--pkgs/applications/editors/lighttable/default.nix58
-rw-r--r--pkgs/applications/editors/nano/default.nix6
-rw-r--r--pkgs/applications/editors/netbeans/default.nix10
-rw-r--r--pkgs/applications/editors/scite/default.nix35
-rw-r--r--pkgs/applications/editors/sublime/default.nix3
-rw-r--r--pkgs/applications/editors/sublime3/default.nix62
-rw-r--r--pkgs/applications/editors/texmacs/default.nix2
-rw-r--r--pkgs/applications/editors/texmaker/default.nix34
-rw-r--r--pkgs/applications/editors/texstudio/default.nix33
-rw-r--r--pkgs/applications/editors/vim/configurable.nix86
-rw-r--r--pkgs/applications/editors/vim/default.nix28
-rw-r--r--pkgs/applications/editors/vim/ft-nix-support.patch17
-rw-r--r--pkgs/applications/editors/vim/macvim.nix93
-rw-r--r--pkgs/applications/editors/vim/macvim.patch189
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.001489
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00277
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.003100
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.004232
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00548
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00666
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00795
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00871
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00964
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01079
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.011100
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.012202
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01399
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.014102
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.015106
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.016221
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01778
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01845
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01961
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.02082
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.02186
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.022148
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.02353
-rw-r--r--pkgs/applications/editors/vim/python_framework.patch23
-rw-r--r--pkgs/applications/editors/vim/qvim.nix126
-rw-r--r--pkgs/applications/editors/yi/yi-contrib.nix19
-rw-r--r--pkgs/applications/editors/yi/yi.nix63
-rw-r--r--pkgs/applications/editors/zed/default.nix103
-rw-r--r--pkgs/applications/editors/zed/node.nix634
-rw-r--r--pkgs/applications/editors/zile/default.nix4
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix19
-rw-r--r--pkgs/applications/graphics/alchemy/default.nix10
-rw-r--r--pkgs/applications/graphics/autopanosiftc/default.nix8
-rw-r--r--pkgs/applications/graphics/cinepaint/default.nix4
-rw-r--r--pkgs/applications/graphics/comical/default.nix2
-rw-r--r--pkgs/applications/graphics/darktable/default.nix4
-rw-r--r--pkgs/applications/graphics/dia/default.nix21
-rw-r--r--pkgs/applications/graphics/digikam/default.nix4
-rw-r--r--pkgs/applications/graphics/djview/default.nix2
-rw-r--r--pkgs/applications/graphics/feh/default.nix13
-rw-r--r--pkgs/applications/graphics/freecad/default.nix24
-rw-r--r--pkgs/applications/graphics/gcolor2/default.nix31
-rw-r--r--pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch46
-rw-r--r--pkgs/applications/graphics/geeqie/default.nix17
-rw-r--r--pkgs/applications/graphics/gimp/2.8.nix14
-rw-r--r--pkgs/applications/graphics/gimp/default.nix32
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix59
-rw-r--r--pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch200
-rw-r--r--pkgs/applications/graphics/giv/default.nix2
-rw-r--r--pkgs/applications/graphics/gocr/default.nix8
-rw-r--r--pkgs/applications/graphics/grafx2/default.nix28
-rw-r--r--pkgs/applications/graphics/graphicsmagick/1.3.7.nix2
-rw-r--r--pkgs/applications/graphics/graphicsmagick/default.nix8
-rw-r--r--pkgs/applications/graphics/hoodle/default.nix22
-rw-r--r--pkgs/applications/graphics/hugin/default.nix32
-rw-r--r--pkgs/applications/graphics/inkscape/default.nix18
-rw-r--r--pkgs/applications/graphics/inkscape/libpng-1.5.patch47
-rw-r--r--pkgs/applications/graphics/ipe/default.nix2
-rw-r--r--pkgs/applications/graphics/k3d/debian-patches.nix4
-rw-r--r--pkgs/applications/graphics/k3d/default.nix2
-rw-r--r--pkgs/applications/graphics/kipi-plugins/default.nix1
-rw-r--r--pkgs/applications/graphics/luminance-hdr/default.nix26
-rw-r--r--pkgs/applications/graphics/mcomix/default.nix6
-rw-r--r--pkgs/applications/graphics/meshlab/default.nix8
-rw-r--r--pkgs/applications/graphics/meshlab/gcc-4.7.patch38
-rw-r--r--pkgs/applications/graphics/meshlab/qt-4.8.patch54
-rw-r--r--pkgs/applications/graphics/minidjvu/default.nix2
-rw-r--r--pkgs/applications/graphics/mirage/default.nix14
-rw-r--r--pkgs/applications/graphics/mypaint/default.nix16
-rw-r--r--pkgs/applications/graphics/ocrad/default.nix2
-rw-r--r--pkgs/applications/graphics/openimageio/default.nix14
-rw-r--r--pkgs/applications/graphics/openscad/default.nix13
-rw-r--r--pkgs/applications/graphics/panotools/default.nix2
-rw-r--r--pkgs/applications/graphics/pencil/default.nix33
-rw-r--r--pkgs/applications/graphics/photivo/default.nix26
-rw-r--r--pkgs/applications/graphics/pinta/default.nix2
-rw-r--r--pkgs/applications/graphics/potrace/default.nix24
-rw-r--r--pkgs/applications/graphics/qiv/default.nix10
-rw-r--r--pkgs/applications/graphics/qiv/default.upstream3
-rw-r--r--pkgs/applications/graphics/qtpfsgui/default.nix2
-rw-r--r--pkgs/applications/graphics/sane/backends-git.nix17
-rw-r--r--pkgs/applications/graphics/sane/backends.nix19
-rw-r--r--pkgs/applications/graphics/sane/config.nix27
-rw-r--r--pkgs/applications/graphics/sane/frontends.nix2
-rw-r--r--pkgs/applications/graphics/sane/xsane.nix18
-rw-r--r--pkgs/applications/graphics/shotwell/default.nix62
-rw-r--r--pkgs/applications/graphics/smartdeblur/default.nix32
-rw-r--r--pkgs/applications/graphics/sxiv/default.nix8
-rw-r--r--pkgs/applications/graphics/synfigstudio/default.nix56
-rw-r--r--pkgs/applications/graphics/synfigstudio/synfig-cstring.patch12
-rw-r--r--pkgs/applications/graphics/tesseract/default.nix5
-rw-r--r--pkgs/applications/graphics/ufraw/default.nix10
-rw-r--r--pkgs/applications/graphics/viewnior/default.nix12
-rw-r--r--pkgs/applications/graphics/xaos/default.nix14
-rw-r--r--pkgs/applications/graphics/zgrviewer/default.nix8
-rw-r--r--pkgs/applications/ike/default.nix16
-rw-r--r--pkgs/applications/inferno/default.nix64
-rwxr-xr-xpkgs/applications/inferno/inferno31
-rw-r--r--pkgs/applications/misc/abook/default.nix2
-rw-r--r--pkgs/applications/misc/adobe-reader/default.nix6
-rw-r--r--pkgs/applications/misc/arbtt/default.nix24
-rw-r--r--pkgs/applications/misc/audio/sox/default.nix62
-rw-r--r--pkgs/applications/misc/audio/soxr/default.nix2
-rw-r--r--pkgs/applications/misc/avrdudess/default.nix42
-rw-r--r--pkgs/applications/misc/bibletime/default.nix14
-rw-r--r--pkgs/applications/misc/bitcoin/default.nix37
-rw-r--r--pkgs/applications/misc/blender/default.nix65
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-rw-r--r--pkgs/applications/misc/camlistore/default.nix31
-rw-r--r--pkgs/applications/misc/cdrtools/default.nix20
-rw-r--r--pkgs/applications/misc/cgminer/default.nix22
-rw-r--r--pkgs/applications/misc/cura/default.nix71
-rw-r--r--pkgs/applications/misc/curaengine/default.nix22
-rw-r--r--pkgs/applications/misc/d4x/default.nix2
-rw-r--r--pkgs/applications/misc/dmenu/default.nix7
-rw-r--r--pkgs/applications/misc/dunst/default.nix17
-rw-r--r--pkgs/applications/misc/electrum/default.nix32
-rw-r--r--pkgs/applications/misc/epdfview/default.nix2
-rw-r--r--pkgs/applications/misc/evopedia/default.nix2
-rw-r--r--pkgs/applications/misc/evtest/default.nix4
-rw-r--r--pkgs/applications/misc/fbreader/default.nix7
-rw-r--r--pkgs/applications/misc/fetchmail/default.nix6
-rw-r--r--pkgs/applications/misc/finalterm/default.nix60
-rw-r--r--pkgs/applications/misc/freicoin/default.nix6
-rw-r--r--pkgs/applications/misc/galculator/default.nix35
-rw-r--r--pkgs/applications/misc/gammu/bashcomp-dir.patch12
-rw-r--r--pkgs/applications/misc/gammu/default.nix29
-rw-r--r--pkgs/applications/misc/get_iplayer/default.nix8
-rw-r--r--pkgs/applications/misc/girara/default.nix4
-rw-r--r--pkgs/applications/misc/gkrellm/default.nix6
-rw-r--r--pkgs/applications/misc/gksu/default.nix48
-rw-r--r--pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch29
-rw-r--r--pkgs/applications/misc/gnome_terminator/default.nix30
-rw-r--r--pkgs/applications/misc/gnuradio-osmosdr/default.nix35
-rw-r--r--pkgs/applications/misc/gnuradio/default.nix77
-rw-r--r--pkgs/applications/misc/goldendict/default.nix2
-rw-r--r--pkgs/applications/misc/goldendict/gcc47.patch40
-rw-r--r--pkgs/applications/misc/googleearth/default.nix2
-rw-r--r--pkgs/applications/misc/gphoto2/default.nix4
-rw-r--r--pkgs/applications/misc/gpsbabel/default.nix2
-rw-r--r--pkgs/applications/misc/gpscorrelate/default.nix2
-rw-r--r--pkgs/applications/misc/gqrx/default.nix39
-rw-r--r--pkgs/applications/misc/grip/default.nix2
-rw-r--r--pkgs/applications/misc/gv/default.nix2
-rw-r--r--pkgs/applications/misc/hello/ex-2/default.nix7
-rw-r--r--pkgs/applications/misc/htmldoc/default.nix2
-rw-r--r--pkgs/applications/misc/ikiwiki/default.nix6
-rw-r--r--pkgs/applications/misc/jigdo/default.nix12
-rw-r--r--pkgs/applications/misc/kde-wacomtablet/default.nix10
-rw-r--r--pkgs/applications/misc/kdeconnect/default.nix36
-rw-r--r--pkgs/applications/misc/keepass/default.nix4
-rw-r--r--pkgs/applications/misc/keepassx/2.0.nix19
-rw-r--r--pkgs/applications/misc/keepassx/default.nix2
-rw-r--r--pkgs/applications/misc/keepassx/random.patch13
-rw-r--r--pkgs/applications/misc/krename/default.nix4
-rw-r--r--pkgs/applications/misc/krusader/default.nix1
-rw-r--r--pkgs/applications/misc/librecad/2.0.nix16
-rw-r--r--pkgs/applications/misc/librecad/default.nix12
-rw-r--r--pkgs/applications/misc/llpp/default.nix75
-rw-r--r--pkgs/applications/misc/lxappearance/default.nix17
-rw-r--r--pkgs/applications/misc/lyx/default.nix33
-rw-r--r--pkgs/applications/misc/makeself/default.nix20
-rw-r--r--pkgs/applications/misc/merkaartor/default.nix12
-rw-r--r--pkgs/applications/misc/mupdf/default.nix45
-rw-r--r--pkgs/applications/misc/mupdf/default.upstream7
-rw-r--r--pkgs/applications/misc/navipowm/default.nix2
-rw-r--r--pkgs/applications/misc/navit/default.nix2
-rw-r--r--pkgs/applications/misc/nc-indicators/default.nix18
-rw-r--r--pkgs/applications/misc/nut/default.nix20
-rw-r--r--pkgs/applications/misc/ocropus/default.nix69
-rw-r--r--pkgs/applications/misc/ocropus/display.patch17
-rw-r--r--pkgs/applications/misc/openjump/default.nix2
-rw-r--r--pkgs/applications/misc/pcmanfm/default.nix19
-rw-r--r--pkgs/applications/misc/pgadmin/default.nix6
-rw-r--r--pkgs/applications/misc/pitz/default.nix5
-rw-r--r--pkgs/applications/misc/posterazor/default.nix34
-rw-r--r--pkgs/applications/misc/printrun/default.nix36
-rw-r--r--pkgs/applications/misc/pstree/default.nix1
-rw-r--r--pkgs/applications/misc/qgis/default.nix2
-rw-r--r--pkgs/applications/misc/qtbitcointrader/default.nix33
-rw-r--r--pkgs/applications/misc/ranger/default.nix22
-rw-r--r--pkgs/applications/misc/redshift/default.nix6
-rw-r--r--pkgs/applications/misc/robomongo/default.nix25
-rw-r--r--pkgs/applications/misc/robomongo/robomongo.patch48
-rw-r--r--pkgs/applications/misc/rtl-sdr/default.nix30
-rw-r--r--pkgs/applications/misc/rxvt_unicode/default.nix24
-rw-r--r--pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch255
-rw-r--r--pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch21
-rw-r--r--pkgs/applications/misc/sakura/default.nix2
-rw-r--r--pkgs/applications/misc/slic3r/default.nix33
-rw-r--r--pkgs/applications/misc/spacefm/default.nix30
-rw-r--r--pkgs/applications/misc/st/default.nix10
-rw-r--r--pkgs/applications/misc/stardict/stardict.nix3
-rw-r--r--pkgs/applications/misc/surf/default.nix9
-rw-r--r--pkgs/applications/misc/sweethome3d/default.nix66
-rw-r--r--pkgs/applications/misc/sweethome3d/editors.nix90
-rw-r--r--pkgs/applications/misc/synergy/cryptopp.patch51
-rw-r--r--pkgs/applications/misc/synergy/default.nix22
-rw-r--r--pkgs/applications/misc/taffybar/default.nix27
-rw-r--r--pkgs/applications/misc/tangogps/default.nix2
-rw-r--r--pkgs/applications/misc/taskjuggler/default.nix2
-rw-r--r--pkgs/applications/misc/taskwarrior/default.nix8
-rw-r--r--pkgs/applications/misc/terminator/default.nix40
-rw-r--r--pkgs/applications/misc/tint2/default.nix32
-rw-r--r--pkgs/applications/misc/twmn/default.nix29
-rw-r--r--pkgs/applications/misc/vanitygen/default.nix4
-rw-r--r--pkgs/applications/misc/vifm/default.nix7
-rw-r--r--pkgs/applications/misc/viking/default.nix2
-rw-r--r--pkgs/applications/misc/vue/default.nix9
-rw-r--r--pkgs/applications/misc/wmname/default.nix2
-rw-r--r--pkgs/applications/misc/xca/default.nix9
-rw-r--r--pkgs/applications/misc/xchm/default.nix6
-rw-r--r--pkgs/applications/misc/xcruiser/default.nix30
-rw-r--r--pkgs/applications/misc/xfe/default.nix4
-rw-r--r--pkgs/applications/misc/xfontsel/default.nix8
-rw-r--r--pkgs/applications/misc/xlsfonts/default.nix8
-rw-r--r--pkgs/applications/misc/xmobar/add-freeration-variable.patch58
-rw-r--r--pkgs/applications/misc/xmobar/default.nix25
-rw-r--r--pkgs/applications/misc/xneur/default.nix2
-rw-r--r--pkgs/applications/misc/xterm/default.nix6
-rw-r--r--pkgs/applications/misc/yeganesh/default.nix2
-rw-r--r--pkgs/applications/misc/ykpers/default.nix23
-rw-r--r--pkgs/applications/misc/zathura/core/default.nix24
-rw-r--r--pkgs/applications/misc/zathura/default.nix29
-rw-r--r--pkgs/applications/misc/zathura/djvu/default.nix4
-rw-r--r--pkgs/applications/misc/zathura/pdf-mupdf/config.patch17
-rw-r--r--pkgs/applications/misc/zathura/pdf-mupdf/default.nix29
-rw-r--r--pkgs/applications/misc/zathura/pdf-poppler/default.nix12
-rw-r--r--pkgs/applications/misc/zathura/ps/default.nix4
-rw-r--r--pkgs/applications/networking/bittorrentsync/default.nix45
-rw-r--r--pkgs/applications/networking/browsers/chromium/browser.nix42
-rw-r--r--pkgs/applications/networking/browsers/chromium/common.nix220
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix304
-rw-r--r--pkgs/applications/networking/browsers/chromium/plugins.nix78
-rw-r--r--pkgs/applications/networking/browsers/chromium/sandbox.nix9
-rw-r--r--pkgs/applications/networking/browsers/chromium/sandbox_userns_30.patch293
-rw-r--r--pkgs/applications/networking/browsers/chromium/source/default.nix77
-rw-r--r--pkgs/applications/networking/browsers/chromium/source/sandbox_userns_36.patch (renamed from pkgs/applications/networking/browsers/chromium/sandbox_userns_31.patch)167
-rw-r--r--pkgs/applications/networking/browsers/chromium/source/sources.nix21
-rw-r--r--pkgs/applications/networking/browsers/chromium/source/update.nix122
-rw-r--r--pkgs/applications/networking/browsers/chromium/sources.nix18
-rwxr-xr-xpkgs/applications/networking/browsers/chromium/update.sh78
-rw-r--r--pkgs/applications/networking/browsers/conkeror/default.nix6
-rw-r--r--pkgs/applications/networking/browsers/dillo/default.nix31
-rw-r--r--pkgs/applications/networking/browsers/dwb/default.nix30
-rw-r--r--pkgs/applications/networking/browsers/elinks/default.nix25
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/default.nix339
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/generate_nix.rb217
-rw-r--r--pkgs/applications/networking/browsers/firefox/3.6.nix155
-rw-r--r--pkgs/applications/networking/browsers/firefox/30.nix211
-rw-r--r--pkgs/applications/networking/browsers/firefox/default.nix223
-rw-r--r--pkgs/applications/networking/browsers/firefox/disable-reporter.patch20
-rw-r--r--pkgs/applications/networking/browsers/firefox/gcc-4.6.patch13
-rw-r--r--pkgs/applications/networking/browsers/firefox/wrapper.nix6
-rw-r--r--pkgs/applications/networking/browsers/firefox/xulrunner-1.9.2_beta4-mips-bus-error.patch26
-rw-r--r--pkgs/applications/networking/browsers/firefox/xulrunner-chromium-mips.patch207
-rw-r--r--pkgs/applications/networking/browsers/firefox/xulrunner-mips-n32.patch764
-rw-r--r--pkgs/applications/networking/browsers/icecat-3/default.nix3
-rw-r--r--pkgs/applications/networking/browsers/kwebkitpart/default.nix7
-rw-r--r--pkgs/applications/networking/browsers/links2/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/lynx/default.nix10
-rw-r--r--pkgs/applications/networking/browsers/midori/default.nix75
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix13
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix6
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix5
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/gmtk/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix14
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/mplayerplug-in/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/netsurf/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/netsurf/haru.nix1
-rw-r--r--pkgs/applications/networking/browsers/netsurf/libCSS.nix2
-rw-r--r--pkgs/applications/networking/browsers/netsurf/libParserUtils.nix3
-rw-r--r--pkgs/applications/networking/browsers/netsurf/libnsbmp.nix3
-rw-r--r--pkgs/applications/networking/browsers/netsurf/libnsgif.nix3
-rw-r--r--pkgs/applications/networking/browsers/netsurf/libsvgtiny.nix2
-rw-r--r--pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix2
-rw-r--r--pkgs/applications/networking/browsers/rekonq/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/uzbl/default.nix68
-rw-r--r--pkgs/applications/networking/browsers/vimb/default.nix42
-rw-r--r--pkgs/applications/networking/browsers/vimprobable2/default.nix13
-rw-r--r--pkgs/applications/networking/browsers/w3m/default.nix3
-rw-r--r--pkgs/applications/networking/cluster/hadoop/default.nix4
-rw-r--r--pkgs/applications/networking/cluster/mesos/darwin.patch80
-rw-r--r--pkgs/applications/networking/cluster/mesos/default.nix107
-rw-r--r--pkgs/applications/networking/cluster/mesos/fetch-mesos-deps.sh1242
-rw-r--r--pkgs/applications/networking/cluster/mesos/mesos-deps.nix18
-rw-r--r--pkgs/applications/networking/cluster/spark/default.nix128
-rw-r--r--pkgs/applications/networking/davmail/default.nix25
-rw-r--r--pkgs/applications/networking/dropbox-cli/default.nix39
-rw-r--r--pkgs/applications/networking/dropbox/default.nix24
-rw-r--r--pkgs/applications/networking/esniper/default.nix20
-rw-r--r--pkgs/applications/networking/feedreaders/newsbeuter/default.nix11
-rw-r--r--pkgs/applications/networking/feedreaders/newsbeuter/dev.nix46
-rw-r--r--pkgs/applications/networking/ftp/filezilla/default.nix17
-rw-r--r--pkgs/applications/networking/ids/daq/default.nix2
-rw-r--r--pkgs/applications/networking/ids/snort/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/amsn/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/baresip/default.nix8
-rw-r--r--pkgs/applications/networking/instant-messengers/bitlbee/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/centerim/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/ekiga/autofoo.patch11
-rw-r--r--pkgs/applications/networking/instant-messengers/ekiga/boost.patch31
-rw-r--r--pkgs/applications/networking/instant-messengers/ekiga/default.nix88
-rw-r--r--pkgs/applications/networking/instant-messengers/fuze/default.nix53
-rw-r--r--pkgs/applications/networking/instant-messengers/gtmess/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/hipchat/default.nix111
-rw-r--r--pkgs/applications/networking/instant-messengers/jitsi/default.nix46
-rw-r--r--pkgs/applications/networking/instant-messengers/jitsi/jitsi.patch27
-rw-r--r--pkgs/applications/networking/instant-messengers/kadu/cmake.patch13
-rw-r--r--pkgs/applications/networking/instant-messengers/kadu/default.nix7
-rw-r--r--pkgs/applications/networking/instant-messengers/linphone/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix12
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix11
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin/default.nix9
-rw-r--r--pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix5
-rw-r--r--pkgs/applications/networking/instant-messengers/sflphone/default.nix8
-rw-r--r--pkgs/applications/networking/instant-messengers/silc-client/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/skype/default.nix21
-rw-r--r--pkgs/applications/networking/instant-messengers/teamspeak/client.nix61
-rw-r--r--pkgs/applications/networking/instant-messengers/teamspeak/server.nix99
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram-cli/default.nix32
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix20
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix7
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix22
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix21
-rw-r--r--pkgs/applications/networking/instant-messengers/tkabber/default.nix65
-rw-r--r--pkgs/applications/networking/instant-messengers/toxic/default.nix29
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch17
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/default.nix35
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch70
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff13
-rw-r--r--pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff22
-rw-r--r--pkgs/applications/networking/instant-messengers/utox/default.nix28
-rw-r--r--pkgs/applications/networking/instant-messengers/vacuum/default.nix4
-rw-r--r--pkgs/applications/networking/iptraf/default.nix2
-rw-r--r--pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch11
-rw-r--r--pkgs/applications/networking/irc/bip/default.nix13
-rw-r--r--pkgs/applications/networking/irc/chatzilla/default.nix12
-rw-r--r--pkgs/applications/networking/irc/hexchat/default.nix32
-rw-r--r--pkgs/applications/networking/irc/ii/default.nix6
-rw-r--r--pkgs/applications/networking/irc/irssi/fish/default.nix4
-rw-r--r--pkgs/applications/networking/irc/irssi/otr/default.nix8
-rw-r--r--pkgs/applications/networking/irc/konversation/default.nix5
-rw-r--r--pkgs/applications/networking/irc/quassel/default.nix27
-rw-r--r--pkgs/applications/networking/irc/weechat/default.nix24
-rw-r--r--pkgs/applications/networking/irc/weechat/devel.nix41
-rw-r--r--pkgs/applications/networking/jmeter/default.nix6
-rw-r--r--pkgs/applications/networking/mailreaders/mailpile/default.nix22
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/default.nix21
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/mailpath.patch12
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix4
-rw-r--r--pkgs/applications/networking/mailreaders/sup/default.nix37
-rw-r--r--pkgs/applications/networking/mailreaders/sylpheed/default.nix8
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix267
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird-bin/generate_nix.rb210
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix102
-rw-r--r--pkgs/applications/networking/msmtp/default.nix4
-rw-r--r--pkgs/applications/networking/mumble/default.nix57
-rw-r--r--pkgs/applications/networking/mumble/murmur.nix46
-rw-r--r--pkgs/applications/networking/newsreaders/kwooty/default.nix4
-rw-r--r--pkgs/applications/networking/newsreaders/liferea/default.nix51
-rw-r--r--pkgs/applications/networking/newsreaders/slrn/default.nix31
-rw-r--r--pkgs/applications/networking/notbit/default.nix24
-rw-r--r--pkgs/applications/networking/p2p/eiskaltdcpp/default.nix35
-rw-r--r--pkgs/applications/networking/p2p/freenet/default.nix14
-rw-r--r--pkgs/applications/networking/p2p/gnunet/default.nix19
-rw-r--r--pkgs/applications/networking/p2p/gnunet/svn.nix2
-rw-r--r--pkgs/applications/networking/p2p/ktorrent/default.nix6
-rw-r--r--pkgs/applications/networking/p2p/ldcpp/default.nix1
-rw-r--r--pkgs/applications/networking/p2p/mldonkey/default.nix4
-rw-r--r--pkgs/applications/networking/p2p/ncdc/default.nix23
-rw-r--r--pkgs/applications/networking/p2p/qbittorrent/default.nix25
-rw-r--r--pkgs/applications/networking/p2p/retroshare/0.6.nix58
-rw-r--r--pkgs/applications/networking/p2p/retroshare/default.nix64
-rw-r--r--pkgs/applications/networking/p2p/transmission-remote-gtk/default.nix14
-rw-r--r--pkgs/applications/networking/p2p/transmission/default.nix15
-rw-r--r--pkgs/applications/networking/p2p/tribler/default.nix2
-rw-r--r--pkgs/applications/networking/p2p/twister/default.nix62
-rw-r--r--pkgs/applications/networking/pjsip/default.nix2
-rw-r--r--pkgs/applications/networking/remote/freerdp/default.nix2
-rw-r--r--pkgs/applications/networking/remote/freerdp/unstable.nix4
-rw-r--r--pkgs/applications/networking/remote/rdesktop/default.nix10
-rw-r--r--pkgs/applications/networking/remote/remmina/default.nix28
-rw-r--r--pkgs/applications/networking/remote/remmina/lgthread.patch16
-rw-r--r--pkgs/applications/networking/remote/ssvnc/default.nix11
-rw-r--r--pkgs/applications/networking/remote/teamviewer/8.nix28
-rw-r--r--pkgs/applications/networking/remote/teamviewer/default.nix13
-rw-r--r--pkgs/applications/networking/seafile-client/default.nix39
-rw-r--r--pkgs/applications/networking/sniffers/etherape/default.nix6
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix33
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch62
-rw-r--r--pkgs/applications/networking/spideroak/default.nix62
-rw-r--r--pkgs/applications/networking/sync/rsync/default.nix22
-rw-r--r--pkgs/applications/networking/sync/unison/default.nix8
-rw-r--r--pkgs/applications/networking/syncthing/default.nix45
-rw-r--r--pkgs/applications/networking/vnstat/default.nix2
-rw-r--r--pkgs/applications/networking/yafc/default.nix12
-rw-r--r--pkgs/applications/networking/znc/default.nix15
-rw-r--r--pkgs/applications/networking/znc/modules.nix4
-rw-r--r--pkgs/applications/office/abiword/default.nix7
-rw-r--r--pkgs/applications/office/calligra/default.nix4
-rw-r--r--pkgs/applications/office/eventlist/default.nix2
-rw-r--r--pkgs/applications/office/gnucash/default.nix26
-rw-r--r--pkgs/applications/office/gnumeric/default.nix30
-rw-r--r--pkgs/applications/office/hledger-interest/default.nix7
-rw-r--r--pkgs/applications/office/hledger-irr/default.nix8
-rw-r--r--pkgs/applications/office/homebank/default.nix6
-rw-r--r--pkgs/applications/office/impressive/default.nix6
-rw-r--r--pkgs/applications/office/keepnote/default.nix8
-rw-r--r--pkgs/applications/office/kmymoney/default.nix14
-rw-r--r--pkgs/applications/office/kmymoney/qt-4.8.patch32
-rw-r--r--pkgs/applications/office/ledger/2.6.3.nix2
-rw-r--r--pkgs/applications/office/ledger/3.0.nix20
-rw-r--r--pkgs/applications/office/libreoffice/default.nix141
-rwxr-xr-xpkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh38
-rw-r--r--pkgs/applications/office/libreoffice/libreoffice-srcs.nix505
-rw-r--r--pkgs/applications/office/mmex/default.nix2
-rw-r--r--pkgs/applications/office/scribus/default.nix6
-rw-r--r--pkgs/applications/office/todo.txt-cli/default.nix28
-rw-r--r--pkgs/applications/office/zotero/default.nix44
-rw-r--r--pkgs/applications/office/zotero/zotero.sh3
-rw-r--r--pkgs/applications/science/astronomy/celestia/default.nix2
-rw-r--r--pkgs/applications/science/astronomy/gravit/default.nix2
-rw-r--r--pkgs/applications/science/astronomy/stellarium/default.nix11
-rw-r--r--pkgs/applications/science/astronomy/xplanet/default.nix6
-rw-r--r--pkgs/applications/science/astronomy/xplanet/giflib.patch130
-rw-r--r--pkgs/applications/science/biology/arb/default.nix1
-rw-r--r--pkgs/applications/science/biology/plink/default.nix3
-rw-r--r--pkgs/applications/science/chemistry/avogadro/default.nix8
-rw-r--r--pkgs/applications/science/electronics/archimedes/default.nix6
-rw-r--r--pkgs/applications/science/electronics/caneda/default.nix2
-rw-r--r--pkgs/applications/science/electronics/gtkwave/default.nix6
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix24
-rw-r--r--pkgs/applications/science/electronics/ngspice/default.nix6
-rw-r--r--pkgs/applications/science/electronics/pulseview/default.nix24
-rw-r--r--pkgs/applications/science/electronics/qfsm/default.nix3
-rw-r--r--pkgs/applications/science/electronics/qucs/default.nix2
-rw-r--r--pkgs/applications/science/electronics/tkgate/1.x.nix18
-rw-r--r--pkgs/applications/science/electronics/tkgate/2.x.nix17
-rw-r--r--pkgs/applications/science/electronics/verilog/default.nix7
-rw-r--r--pkgs/applications/science/electronics/xoscope/default.nix2
-rw-r--r--pkgs/applications/science/geometry/tetgen/default.nix8
-rw-r--r--pkgs/applications/science/logic/abc/default.nix27
-rw-r--r--pkgs/applications/science/logic/alt-ergo/default.nix23
-rw-r--r--pkgs/applications/science/logic/boolector/default.nix47
-rw-r--r--pkgs/applications/science/logic/coq/HEAD.nix57
-rw-r--r--pkgs/applications/science/logic/coq/default.nix8
-rw-r--r--pkgs/applications/science/logic/cvc3/default.nix4
-rw-r--r--pkgs/applications/science/logic/ekrhyper/default.nix8
-rw-r--r--pkgs/applications/science/logic/hol/default.nix4
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix28
-rw-r--r--pkgs/applications/science/logic/iprover/default.nix12
-rw-r--r--pkgs/applications/science/logic/leo2/default.nix22
-rw-r--r--pkgs/applications/science/logic/leo2/default.upstream6
-rw-r--r--pkgs/applications/science/logic/logisim/default.nix2
-rw-r--r--pkgs/applications/science/logic/ltl2ba/default.nix24
-rw-r--r--pkgs/applications/science/logic/matita/130312.nix2
-rw-r--r--pkgs/applications/science/logic/matita/default.nix2
-rw-r--r--pkgs/applications/science/logic/minisat/default.nix11
-rw-r--r--pkgs/applications/science/logic/opensmt/default.nix20
-rw-r--r--pkgs/applications/science/logic/picosat/default.nix2
-rw-r--r--pkgs/applications/science/logic/prooftree/default.nix40
-rw-r--r--pkgs/applications/science/logic/ssreflect/default.nix6
-rw-r--r--pkgs/applications/science/logic/stp/default.nix23
-rw-r--r--pkgs/applications/science/logic/stp/fixbuild.diff45
-rw-r--r--pkgs/applications/science/logic/stp/fixrefs.diff192
-rw-r--r--pkgs/applications/science/logic/tptp/default.nix15
-rw-r--r--pkgs/applications/science/logic/twelf/default.nix46
-rw-r--r--pkgs/applications/science/logic/verifast/default.nix43
-rw-r--r--pkgs/applications/science/logic/why3/default.nix22
-rw-r--r--pkgs/applications/science/logic/yices/default.nix40
-rw-r--r--pkgs/applications/science/logic/z3/default.nix46
-rw-r--r--pkgs/applications/science/math/R/default.nix9
-rw-r--r--pkgs/applications/science/math/content/default.nix1
-rw-r--r--pkgs/applications/science/math/eukleides/default.nix2
-rw-r--r--pkgs/applications/science/math/fricas/default.nix23
-rw-r--r--pkgs/applications/science/math/gap/default.nix22
-rw-r--r--pkgs/applications/science/math/glsurf/default.nix2
-rw-r--r--pkgs/applications/science/math/jags/default.nix4
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix6
-rw-r--r--pkgs/applications/science/math/maxima/default.nix6
-rw-r--r--pkgs/applications/science/math/pari/default.nix4
-rw-r--r--pkgs/applications/science/math/pssp/default.nix4
-rw-r--r--pkgs/applications/science/math/sage/default.nix31
-rw-r--r--pkgs/applications/science/math/singular/default.nix13
-rw-r--r--pkgs/applications/science/math/sloane/default.nix28
-rw-r--r--pkgs/applications/science/math/weka/default.nix2
-rw-r--r--pkgs/applications/science/math/wxmaxima/default.nix2
-rw-r--r--pkgs/applications/science/math/yacas/default.nix2
-rw-r--r--pkgs/applications/science/misc/boinc/default.nix8
-rw-r--r--pkgs/applications/science/misc/fityk/default.nix23
-rw-r--r--pkgs/applications/science/misc/golly/default.nix14
-rw-r--r--pkgs/applications/science/misc/megam/default.nix46
-rw-r--r--pkgs/applications/science/misc/megam/ocaml-3.12.patch12
-rw-r--r--pkgs/applications/science/misc/megam/ocaml-includes.patch21
-rw-r--r--pkgs/applications/science/misc/root/cmake.patch11
-rw-r--r--pkgs/applications/science/misc/root/default.nix27
-rw-r--r--pkgs/applications/science/misc/simgrid/default.nix37
-rw-r--r--pkgs/applications/science/misc/tulip/default.nix2
-rw-r--r--pkgs/applications/science/misc/vite/default.nix2
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix6
-rw-r--r--pkgs/applications/science/spyder/default.nix6
-rw-r--r--pkgs/applications/search/doodle/default.nix2
-rw-r--r--pkgs/applications/taxes/aangifte-2005/builder.sh17
-rw-r--r--pkgs/applications/taxes/aangifte-2005/default.nix13
-rw-r--r--pkgs/applications/taxes/aangifte-2006/default.nix3
-rw-r--r--pkgs/applications/taxes/aangifte-2007/default.nix3
-rw-r--r--pkgs/applications/taxes/aangifte-2008/default.nix3
-rw-r--r--pkgs/applications/taxes/aangifte-2009/default.nix3
-rw-r--r--pkgs/applications/taxes/aangifte-2010/default.nix3
-rw-r--r--pkgs/applications/taxes/aangifte-2011/default.nix3
-rw-r--r--pkgs/applications/taxes/aangifte-2012/default.nix3
-rw-r--r--pkgs/applications/taxes/aangifte-2013/default.nix41
-rw-r--r--pkgs/applications/version-management/arch/default.nix2
-rw-r--r--pkgs/applications/version-management/bazaar/add_certificates.patch11
-rw-r--r--pkgs/applications/version-management/bazaar/default.nix20
-rw-r--r--pkgs/applications/version-management/bazaar/tools.nix4
-rw-r--r--pkgs/applications/version-management/codeville/0.8.0.nix2
-rw-r--r--pkgs/applications/version-management/cvsps/default.nix2
-rw-r--r--pkgs/applications/version-management/darcs/default.nix3
-rw-r--r--pkgs/applications/version-management/fossil/default.nix6
-rw-r--r--pkgs/applications/version-management/git-and-tools/cgit/default.nix33
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix22
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-annex/default.nix68
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-bz/default.nix5
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-remote-hg/default.nix35
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/cert-path.patch12
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix30
-rw-r--r--pkgs/applications/version-management/git-and-tools/gitflow/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/github-backup/default.nix13
-rw-r--r--pkgs/applications/version-management/git-and-tools/hub/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/qgit/default.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/qgit/qgit-git.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/stgit/default.nix6
-rw-r--r--pkgs/applications/version-management/git-and-tools/svn2git-kde/default.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/svn2git/default.nix28
-rw-r--r--pkgs/applications/version-management/git-and-tools/tig/default.nix24
-rw-r--r--pkgs/applications/version-management/git-and-tools/topgit/default.nix2
-rw-r--r--pkgs/applications/version-management/git-repo/default.nix23
-rw-r--r--pkgs/applications/version-management/gitolite/default.nix35
-rw-r--r--pkgs/applications/version-management/gource/default.nix26
-rw-r--r--pkgs/applications/version-management/kdesvn/default.nix17
-rw-r--r--pkgs/applications/version-management/kdesvn/docbook.patch13
-rw-r--r--pkgs/applications/version-management/kdesvn/virtual_inheritance.patch11
-rw-r--r--pkgs/applications/version-management/meld/default.nix8
-rw-r--r--pkgs/applications/version-management/mercurial/default.nix11
-rw-r--r--pkgs/applications/version-management/monotone/default.nix13
-rw-r--r--pkgs/applications/version-management/monotone/default.upstream8
-rw-r--r--pkgs/applications/version-management/monotone/glibc-file-handle.patch166
-rw-r--r--pkgs/applications/version-management/mr/default.nix8
-rw-r--r--pkgs/applications/version-management/rapidsvn/default.nix2
-rw-r--r--pkgs/applications/version-management/rcs/default.nix12
-rw-r--r--pkgs/applications/version-management/subversion/default.nix26
-rw-r--r--pkgs/applications/version-management/tailor/default.nix5
-rw-r--r--pkgs/applications/version-management/tkcvs/default.nix2
-rw-r--r--pkgs/applications/version-management/vcprompt/default.nix28
-rw-r--r--pkgs/applications/version-management/vcsh/default.nix28
-rw-r--r--pkgs/applications/version-management/veracity/default.nix1
-rw-r--r--pkgs/applications/video/aegisub/default.nix67
-rw-r--r--pkgs/applications/video/avidemux/default.nix15
-rw-r--r--pkgs/applications/video/avxsynth/default.nix2
-rw-r--r--pkgs/applications/video/bangarang/default.nix4
-rw-r--r--pkgs/applications/video/bangarang/gcc-4.7.patch45
-rw-r--r--pkgs/applications/video/cc1394/default.nix1
-rw-r--r--pkgs/applications/video/cinelerra/default.nix4
-rw-r--r--pkgs/applications/video/coriander/default.nix2
-rw-r--r--pkgs/applications/video/dvb-apps/default.nix2
-rw-r--r--pkgs/applications/video/dvswitch/default.nix29
-rw-r--r--pkgs/applications/video/gnash/default.nix20
-rw-r--r--pkgs/applications/video/handbrake/default.nix100
-rw-r--r--pkgs/applications/video/handbrake/disable-unfree.patch101
-rw-r--r--pkgs/applications/video/kazam/bug_1190693.patch14
-rw-r--r--pkgs/applications/video/kazam/datadir.patch11
-rw-r--r--pkgs/applications/video/kazam/default.nix51
-rw-r--r--pkgs/applications/video/kdenlive/default.nix30
-rw-r--r--pkgs/applications/video/key-mon/default.nix4
-rw-r--r--pkgs/applications/video/kino/default.nix2
-rw-r--r--pkgs/applications/video/lxdvdrip/default.nix8
-rw-r--r--pkgs/applications/video/makemkv/builder.sh6
-rw-r--r--pkgs/applications/video/makemkv/default.nix2
-rw-r--r--pkgs/applications/video/miro/default.nix25
-rw-r--r--pkgs/applications/video/miro/youtube-feeds.patch15
-rw-r--r--pkgs/applications/video/mkvtoolnix/default.nix4
-rw-r--r--pkgs/applications/video/mplayer/default.nix19
-rw-r--r--pkgs/applications/video/mplayer2/default.nix16
-rw-r--r--pkgs/applications/video/mpv/default.nix132
-rw-r--r--pkgs/applications/video/ogmtools/default.nix2
-rw-r--r--pkgs/applications/video/omxplayer/default.nix4
-rw-r--r--pkgs/applications/video/pitivi/default.nix56
-rw-r--r--pkgs/applications/video/quvi/library.nix10
-rw-r--r--pkgs/applications/video/quvi/scripts.nix6
-rw-r--r--pkgs/applications/video/quvi/tool.nix20
-rw-r--r--pkgs/applications/video/shotcut/default.nix38
-rw-r--r--pkgs/applications/video/simplescreenrecorder/default.nix26
-rw-r--r--pkgs/applications/video/smplayer/default.nix4
-rw-r--r--pkgs/applications/video/subtitleeditor/default.nix45
-rw-r--r--pkgs/applications/video/tvtime/default.nix1
-rw-r--r--pkgs/applications/video/vlc/default.nix19
-rw-r--r--pkgs/applications/video/xawtv/default.nix32
-rw-r--r--pkgs/applications/video/xawtv/xawtv-3.95-libfs.patch22
-rw-r--r--pkgs/applications/video/xawtv/xawtv-3.95-makefile.patch21
-rw-r--r--pkgs/applications/video/xawtv/xawtv-3.95-page-mask.patch44
-rw-r--r--pkgs/applications/video/xbmc/default.nix42
-rw-r--r--pkgs/applications/video/xvidcap/default.nix2
-rw-r--r--pkgs/applications/virtualization/8086tiny/builder.sh28
-rw-r--r--pkgs/applications/virtualization/8086tiny/default.nix40
-rw-r--r--pkgs/applications/virtualization/OVMF/default.nix2
-rw-r--r--pkgs/applications/virtualization/bochs/default.nix63
-rw-r--r--pkgs/applications/virtualization/docker/default.nix44
-rw-r--r--pkgs/applications/virtualization/nova/client.nix1
-rw-r--r--pkgs/applications/virtualization/nova/default.nix15
-rw-r--r--pkgs/applications/virtualization/qemu/cve-2014-0150.patch14
-rw-r--r--pkgs/applications/virtualization/qemu/default.nix24
-rw-r--r--pkgs/applications/virtualization/qemu/linux-img/default.nix22
-rw-r--r--pkgs/applications/virtualization/virt-manager/custom_runner.py13
-rw-r--r--pkgs/applications/virtualization/virt-manager/default.nix106
-rw-r--r--pkgs/applications/virtualization/virt-viewer/default.nix56
-rw-r--r--pkgs/applications/virtualization/virtinst/default.nix6
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix20
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/default.nix10
-rw-r--r--pkgs/applications/virtualization/xen/default.nix3
-rw-r--r--pkgs/applications/window-managers/awesome/3.4.nix50
-rw-r--r--pkgs/applications/window-managers/awesome/default.nix98
-rw-r--r--pkgs/applications/window-managers/bar/default.nix25
-rw-r--r--pkgs/applications/window-managers/bspwm/default.nix29
-rw-r--r--pkgs/applications/window-managers/compiz/default.nix8
-rw-r--r--pkgs/applications/window-managers/compton/default.nix31
-rw-r--r--pkgs/applications/window-managers/dwm/confnotify-6.0.patch36
-rw-r--r--pkgs/applications/window-managers/dwm/default.nix4
-rw-r--r--pkgs/applications/window-managers/dzen2/default.nix36
-rw-r--r--pkgs/applications/window-managers/fvwm/default.nix3
-rw-r--r--pkgs/applications/window-managers/herbstluftwm/default.nix8
-rw-r--r--pkgs/applications/window-managers/i3/default.nix24
-rw-r--r--pkgs/applications/window-managers/i3/lock.nix4
-rw-r--r--pkgs/applications/window-managers/i3/status.nix4
-rw-r--r--pkgs/applications/window-managers/jwm/default.nix8
-rw-r--r--pkgs/applications/window-managers/matchbox/default.nix2
-rw-r--r--pkgs/applications/window-managers/openbox/default.nix17
-rw-r--r--pkgs/applications/window-managers/ratpoison/default.nix12
-rw-r--r--pkgs/applications/window-managers/ratpoison/glibc-fix.patch22
-rw-r--r--pkgs/applications/window-managers/stalonetray/default.nix4
-rw-r--r--pkgs/applications/window-managers/sxhkd/default.nix27
-rw-r--r--pkgs/applications/window-managers/tabbed/default.nix2
-rw-r--r--pkgs/applications/window-managers/trayer/default.nix27
-rw-r--r--pkgs/applications/window-managers/weston/default.nix24
-rw-r--r--pkgs/applications/window-managers/windowmaker/default.nix4
-rw-r--r--pkgs/applications/window-managers/xmonad/default.nix9
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-contrib.nix11
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-extras.nix7
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad_ghc_var_0.11.patch44
852 files changed, 17540 insertions, 8710 deletions
diff --git a/pkgs/applications/audio/a2jmidid/default.nix b/pkgs/applications/audio/a2jmidid/default.nix
index f6c17e6d8ed5..38192311ccfa 100644
--- a/pkgs/applications/audio/a2jmidid/default.nix
+++ b/pkgs/applications/audio/a2jmidid/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, alsaLib, dbus, jackaudio, pkgconfig, python }:
+{ stdenv, fetchurl, alsaLib, dbus, jack2, pkgconfig, python }:
 
 stdenv.mkDerivation rec {
   name = "a2jmidid-${version}";
-  version = "7";
+  version = "8";
 
   src = fetchurl {
     url = "http://download.gna.org/a2jmidid/${name}.tar.bz2";
-    sha256 = "1pl91y7npirhmikzlizpbyx2vkfvdkvc6qvc2lv4capj3cp6ypx7";
+    sha256 = "0pzm0qk5ilqhwz74pydg1jwrds27vm47185dakdrxidb5bv3b5ia";
   };
 
-  buildInputs = [ alsaLib dbus jackaudio pkgconfig python ];
+  buildInputs = [ alsaLib dbus jack2 pkgconfig python ];
 
   configurePhase = "python waf configure --prefix=$out";
 
@@ -22,6 +22,6 @@ stdenv.mkDerivation rec {
     description = "Daemon for exposing legacy ALSA sequencer applications in JACK MIDI system";
     license = licenses.gpl2;
     maintainers = [ maintainers.goibhniu ];
-
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/abcde/default.nix b/pkgs/applications/audio/abcde/default.nix
index 031b0fe93b59..1978fcf18749 100644
--- a/pkgs/applications/audio/abcde/default.nix
+++ b/pkgs/applications/audio/abcde/default.nix
@@ -61,7 +61,7 @@ in
 
     meta = {
       homepage = "http://lly.org/~rcw/abcde/page/";
-      license = "GPLv2+";
+      license = stdenv.lib.licenses.gpl2Plus;
       description = "Command-line audio CD ripper";
 
       longDescription = ''
diff --git a/pkgs/applications/audio/amarok/default.nix b/pkgs/applications/audio/amarok/default.nix
index 1dac3f6b853a..b1bcfe869f78 100644
--- a/pkgs/applications/audio/amarok/default.nix
+++ b/pkgs/applications/audio/amarok/default.nix
@@ -22,12 +22,10 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = "-DKDE4_BUILD_TESTS=OFF";
 
-  postInstall = ''
-    mkdir -p $out/nix-support
-    echo ${qtscriptgenerator} > $out/nix-support/propagated-user-env-packages
-  '';
+  propagatedUserEnvPkgs = [ qtscriptgenerator ];
 
   meta = {
+    repositories.git = git://anongit.kde.org/amarok.git;
     description = "Popular music player for KDE";
     license = "GPL";
     homepage = http://amarok.kde.org;
diff --git a/pkgs/applications/audio/ams-lv2/default.nix b/pkgs/applications/audio/ams-lv2/default.nix
new file mode 100644
index 000000000000..dd23504d3fad
--- /dev/null
+++ b/pkgs/applications/audio/ams-lv2/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, cairo, gtk, gtkmm, lv2, lvtk, pkgconfig, python }:
+
+stdenv.mkDerivation  rec {
+  name = "ams-lv2-${version}";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/blablack/ams-lv2/archive/v${version}.tar.gz";
+    sha256 = "0fa1ghf6qahbhj9j1ciyw0hr6nngwksa37hbs651mlz0fn7lz4xm";
+  };
+
+  buildInputs = [ cairo gtk gtkmm lv2 lvtk pkgconfig python ];
+
+  configurePhase = "python waf configure --prefix=$out";
+
+  buildPhase = "python waf";
+
+  installPhase = "python waf install";
+
+  meta = with stdenv.lib; {
+    description = "An LV2 port of the internal modules found in Alsa Modular Synth";
+    homepage = http://objectivewave.wordpress.com/ams-lv2;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/ardour/ardour3.nix b/pkgs/applications/audio/ardour/ardour3.nix
deleted file mode 100644
index bf2ee04cbce9..000000000000
--- a/pkgs/applications/audio/ardour/ardour3.nix
+++ /dev/null
@@ -1,60 +0,0 @@
-{ stdenv, fetchgit, alsaLib, aubio, boost, cairomm, curl, fftw
-, fftwSinglePrec, flac, glibc, glibmm, gtk, gtkmm, jackaudio
-, libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
-, librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
-, libusb, libuuid, libxml2, libxslt, lilv, lv2, makeWrapper, pango
-, perl, pkgconfig, python, serd, sord, sratom, suil }:
-
-let
-  # Ardour 3.0 tag
-  rev = "79db9422";
-in
-
-stdenv.mkDerivation {
-  name = "ardour-3.0";
-
-  src = fetchgit {
-    url = git://git.ardour.org/ardour/ardour.git;
-    inherit rev;
-    sha256 = "cdbe4ca6d4b639fcd66a3d1cf9c2816b4755655c9d81bdd2417263f413aa7096";
-  };
-
-  buildInputs = 
-    [ alsaLib aubio boost cairomm curl fftw fftwSinglePrec flac glibc
-      glibmm gtk gtkmm jackaudio libgnomecanvas libgnomecanvasmm liblo
-      libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
-      libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv lv2
-      makeWrapper pango perl pkgconfig python serd sord sratom suil
-    ];
-
-  patchPhase = ''
-    printf '#include "ardour/svn_revision.h"\nnamespace ARDOUR { const char* svn_revision = \"${rev}\"; }\n' > libs/ardour/svn_revision.cc
-    sed -e 's|^#!/usr/bin/perl.*$|#!${perl}/bin/perl|g' -i tools/fmt-bindings
-    sed -e 's|^#!/usr/bin/env.*$|#!${perl}/bin/perl|g' -i tools/*.pl
-    sed 's|/usr/include/libintl.h|${glibc}/include/libintl.h|' -i wscript
-  '';
-
-  configurePhase = "python waf configure --prefix=$out";
-
-  buildPhase = "python waf";
-
-  # For the custom ardour clearlooks gtk-engine to work, it must be
-  # moved to a directory called "engines" and added to GTK_PATH
-  installPhase = ''
-    python waf install
-    mkdir -pv $out/gtk2/engines
-    mv $out/lib/ardour3/libclearlooks.so $out/gtk2/engines/
-    wrapProgram $out/bin/ardour3 --prefix GTK_PATH : $out/gtk2
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Multi-track hard disk recording software";
-    longDescription = ''
-      Also read "The importance of Paying Something" on their homepage, please!
-    '';
-    homepage = http://ardour.org/;
-    license = licenses.gpl2;
-    platforms = platforms.linux;
-    maintainers = [ maintainers.goibhniu ];
-  };
-}
diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix
index 3ed650d4ae73..62b88cbe0775 100644
--- a/pkgs/applications/audio/ardour/default.nix
+++ b/pkgs/applications/audio/ardour/default.nix
@@ -1,50 +1,77 @@
-{ stdenv, fetchurl, scons, boost, pkgconfig, fftw, librdf_raptor2
-, librdf_rasqal, jackaudio, flac, libsamplerate, alsaLib, libxml2
-, lilv, lv2, serd, sord, sratom, suil # these are probably optional
-, libxslt, libsndfile, libsigcxx, libusb, cairomm, glib, pango
-, gtk, glibmm, gtkmm, libgnomecanvas, libgnomecanvasmm, liblo, aubio
-, fftwSinglePrec, libmad, automake, autoconf, libtool, liblrdf, curl }:
+{ stdenv, fetchgit, alsaLib, aubio, boost, cairomm, curl, fftw
+, fftwSinglePrec, flac, glibc, glibmm, gtk, gtkmm, jack2
+, libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
+, librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
+, libusb, libuuid, libxml2, libxslt, lilv, lv2, makeWrapper, pango
+, perl, pkgconfig, python, serd, sord, sratom, suil }:
+
+let
+  tag = "3.5.380";
+in
 
 stdenv.mkDerivation rec {
-  name = "ardour-${version}";
-  version = "2.8.16";
+  name = "ardour-${tag}";
 
-  src = fetchurl {
-    url = "mirror://gentoo/distfiles/${name}.tar.bz2";
-    sha256 = "0h2y0x4yznalllja53anjil2gmgcb26f39zshc4gl1d1kc8k5vip";
+  src = fetchgit {
+    url = git://git.ardour.org/ardour/ardour.git;
+    rev = "refs/tags/${tag}";
+    sha256 = "dbcbb2d9143e196d079c27b15266e47d24b81cb7591fe64b717f3485965ded7b";
   };
 
-  postPatch = ''
-    #sed -e "s#/usr/bin/which#type -P#" -i libs/glibmm2/autogen.sh
-    echo '#include "ardour/svn_revision.h"' > libs/ardour/svn_revision.cc
-    echo -e 'namespace ARDOUR {\n extern const char* svn_revision = "2.8.12";\n }\n' >> libs/ardour/svn_revision.cc
-  '';
+  buildInputs = 
+    [ alsaLib aubio boost cairomm curl fftw fftwSinglePrec flac glibc
+      glibmm gtk gtkmm jack2 libgnomecanvas libgnomecanvasmm liblo
+      libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
+      libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv lv2
+      makeWrapper pango perl pkgconfig python serd sord sratom suil
+    ];
 
-  buildInputs = [
-    scons boost pkgconfig fftw librdf_raptor2 librdf_rasqal jackaudio
-    flac libsamplerate alsaLib libxml2 libxslt libsndfile libsigcxx
-    #lilv lv2 serd sord sratom suil
-    libusb cairomm glib pango gtk glibmm gtkmm libgnomecanvas libgnomecanvasmm liblrdf
-    liblo aubio fftwSinglePrec libmad autoconf automake libtool curl
-  ];
-
-  buildPhase = ''
-    mkdir -p $out
-    export CXX=g++
-    scons PREFIX=$out SYSLIBS=1 install
+  patchPhase = ''
+    # The funny revision number is from `git describe rev`
+    printf '#include "libs/ardour/ardour/revision.h"\nnamespace ARDOUR { const char* revision = \"${tag}-g2f6065b\"; }\n' > libs/ardour/revision.cc
+    # Note the different version number
+    sed -i '33i rev = \"3.5-380-g2f6065b\"' wscript
+    sed 's|/usr/include/libintl.h|${glibc}/include/libintl.h|' -i wscript
+    sed -e 's|^#!/usr/bin/perl.*$|#!${perl}/bin/perl|g' -i tools/fmt-bindings
+    sed -e 's|^#!/usr/bin/env.*$|#!${perl}/bin/perl|g' -i tools/*.pl
   '';
 
-  installPhase = ":";
+  configurePhase = "python waf configure --optimize --prefix=$out";
+
+  buildPhase = "python waf";
+
+  # For the custom ardour clearlooks gtk-engine to work, it must be
+  # moved to a directory called "engines" and added to GTK_PATH
+  installPhase = ''
+    python waf install
+    mkdir -pv $out/gtk2/engines
+    cp build/libs/clearlooks-newer/libclearlooks.so $out/gtk2/engines/
+    wrapProgram $out/bin/ardour3 --prefix GTK_PATH : $out/gtk2
+
+    # Install desktop file
+    mkdir -p "$out/share/applications"
+    cat > "$out/share/applications/ardour.desktop" << EOF
+    [Desktop Entry]
+    Name=Ardour 3
+    GenericName=Digital Audio Workstation
+    Comment=Multitrack harddisk recorder
+    Exec=$out/bin/ardour3
+    Icon=$out/share/ardour3/icons/ardour_icon_256px.png
+    Terminal=false
+    Type=Application
+    X-MultipleArgs=false
+    Categories=GTK;Audio;AudioVideoEditing;AudioVideo;Video;
+    EOF
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Multi-track hard disk recording software";
     longDescription = ''
-      Broken: use ardour3-svn instead
       Also read "The importance of Paying Something" on their homepage, please!
     '';
     homepage = http://ardour.org/;
-    license = "GPLv2";
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
   };
 }
diff --git a/pkgs/applications/audio/audacious/default.nix b/pkgs/applications/audio/audacious/default.nix
index f9a8d0752415..409a831727bb 100644
--- a/pkgs/applications/audio/audacious/default.nix
+++ b/pkgs/applications/audio/audacious/default.nix
@@ -4,19 +4,19 @@
 }:
 
 let
-  version = "3.4.1";
+  version = "3.4.3";
 in
 stdenv.mkDerivation {
   name = "audacious-${version}";
 
   src = fetchurl {
     url = "http://distfiles.audacious-media-player.org/audacious-${version}.tar.bz2";
-    sha256 = "0wf99b0nrk90fyak4gpwi076qnsrmv1j8958cvi57rxig21lvvap";
+    sha256 = "04lzwdr1lx6ghbfxzygvnbmdl420w6rm453ds5lyb0hlvzs58d0q";
   };
 
   pluginsSrc = fetchurl {
     url = "http://distfiles.audacious-media-player.org/audacious-plugins-${version}.tar.bz2";
-    sha256 = "02ivrxs6109nmmz9pkbf9dkm36s2lyp9vfv59sm0acxxd4db71md";
+    sha256 = "00r88q9fs9a0gicdmk2svcans7igcqgacrw303a5bn44is7pmrmy";
   };
 
   buildInputs =
@@ -48,8 +48,8 @@ stdenv.mkDerivation {
       (
         source $stdenv/setup
         # gsettings schemas for file dialogues
-        for file in "$out"/bin/*; do
-          wrapProgram "$file" --prefix XDG_DATA_DIRS : "$XDG_ADD"
+        for file in "$out/bin/"*; do
+          wrapProgram "$file" --prefix XDG_DATA_DIRS : "$XDG_ADD:$GSETTINGS_SCHEMAS_PATH"
         done
       )
     '';
diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix
index 4a6797f9010b..7308d84e0984 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.4";
+  version = "2.0.5";
   name = "audacity-${version}";
 
   src = fetchurl {
     url = "http://audacity.googlecode.com/files/audacity-minsrc-${version}.tar.xz";
-    sha256 = "0pl92filykzs4g2pn7i02kdqgja326wjgafzw2vcgwn3dwrs4avp";
+    sha256 = "0y9bvc3a3zxsk31yg7bha029mzkjiw5i9m86kbyj7x8ps0fm91z2";
   };
 
   preConfigure = /* we prefer system-wide libs */ ''
@@ -31,7 +31,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Sound editor with graphical UI";
     homepage = http://audacity.sourceforge.net;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
   };
 }
diff --git a/pkgs/applications/audio/aumix/default.nix b/pkgs/applications/audio/aumix/default.nix
index 1e19a3ac5c39..41edd51e5f26 100644
--- a/pkgs/applications/audio/aumix/default.nix
+++ b/pkgs/applications/audio/aumix/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
       the command line or a script.
     '';
     homepage = http://www.jpj.net/~trevor/aumix.html;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/audio/bristol/default.nix b/pkgs/applications/audio/bristol/default.nix
index 0978b15bfaf0..b27ac0586025 100644
--- a/pkgs/applications/audio/bristol/default.nix
+++ b/pkgs/applications/audio/bristol/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, alsaLib, jackaudio, pkgconfig, pulseaudio, xlibs }:
+{ stdenv, fetchurl, alsaLib, jack2, pkgconfig, pulseaudio, xlibs }:
 
 stdenv.mkDerivation  rec {
   name = "bristol-${version}";
-  version = "0.60.10";
+  version = "0.60.11";
 
   src = fetchurl {
     url = "mirror://sourceforge/bristol/${name}.tar.gz";
-    sha256 = "070rn5zdx6vrqmq7w1rrpxig3bxlylbsw82nlmkjnhjrgm6yx753";
+    sha256 = "1fi2m4gmvxdi260821y09lxsimq82yv4k5bbgk3kyc3x1nyhn7vx";
   };
 
   buildInputs = [
-    alsaLib jackaudio pkgconfig pulseaudio xlibs.libX11 xlibs.libXext
+    alsaLib jack2 pkgconfig pulseaudio xlibs.libX11 xlibs.libXext
     xlibs.xproto
   ];
 
diff --git a/pkgs/applications/audio/calf/default.nix b/pkgs/applications/audio/calf/default.nix
index 6ed4b7cce98b..efab9202025d 100644
--- a/pkgs/applications/audio/calf/default.nix
+++ b/pkgs/applications/audio/calf/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, cairo, expat, fftwSinglePrec, fluidsynth, glib
-, gtk, jackaudio, ladspaH , libglade, lv2, pkgconfig }:
+, gtk, jack2, ladspaH , libglade, lv2, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "calf-${version}";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ 
-    cairo expat fftwSinglePrec fluidsynth glib gtk jackaudio ladspaH
+    cairo expat fftwSinglePrec fluidsynth glib gtk jack2 ladspaH
     libglade lv2 pkgconfig
   ];
 
diff --git a/pkgs/applications/audio/cantata/default.nix b/pkgs/applications/audio/cantata/default.nix
new file mode 100644
index 000000000000..31d5240529f7
--- /dev/null
+++ b/pkgs/applications/audio/cantata/default.nix
@@ -0,0 +1,104 @@
+{ stdenv, fetchurl, cmake
+, withQt4 ? true, qt4
+, withQt5 ? false, qt5
+
+# I'm unable to make KDE work here, crashes at runtime so I simply
+# make Qt4 the default until someone who wants KDE can figure it out.
+, withKDE4 ? false, kde4
+
+# Cantata doesn't build with cdparanoia enabled so we disable that
+# default for now until I (or someone else) figure it out.
+, withCdda ? false, cdparanoia
+, withCddb ? false, libcddb
+, withLame ? false, lame
+, withMusicbrainz ? false, libmusicbrainz5
+
+, withTaglib ? true, taglib, taglib_extras
+, withReplaygain ? true, ffmpeg, speex, mpg123
+, withMtp ? true, libmtp
+, withOnlineServices ? true
+, withDevices ? true, udisks2
+, withDynamic ? true
+, withHttpServer ? true
+, withStreams ? true
+}:
+
+# One and only one front-end.
+assert withQt5 -> withQt4 == false && withKDE4 == false;
+assert withQt4 -> withQt5 == false && withKDE4 == false;
+assert withKDE4 -> withQt4 == false && withQt5 == false;
+assert withQt4 || withQt5 || withKDE4;
+
+# Inter-dependencies.
+assert withCddb -> withCdda && withTaglib;
+assert withCdda -> withCddb && withMusicbrainz;
+assert withLame -> withCdda && withTaglib;
+assert withMtp -> withTaglib;
+assert withMusicbrainz -> withCdda && withTaglib;
+assert withOnlineServices -> withTaglib;
+assert withReplaygain -> withTaglib;
+
+let
+  version = "1.3.4";
+  pname = "cantata";
+  fstat = x: fn: "-DENABLE_" + fn + "=" + (if x then "ON" else "OFF");
+  fstats = x: map (fstat x);
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    inherit name;
+    url = "https://drive.google.com/uc?export=download&id=0Bzghs6gQWi60WTYtaXk3c1IzNVU";
+    sha256 = "0ris41v44nwd68f3zis9n9lyyc089dyhlxp37rrzflanrc6glpwq";
+  };
+
+  buildInputs =
+    [ cmake ]
+    ++ stdenv.lib.optional withQt4 qt4
+    ++ stdenv.lib.optional withQt5 qt5
+    ++ stdenv.lib.optional withKDE4 kde4.kdelibs
+    ++ stdenv.lib.optionals withTaglib [ taglib taglib_extras ]
+    ++ stdenv.lib.optionals withReplaygain [ ffmpeg speex mpg123 ]
+    ++ stdenv.lib.optional withCdda cdparanoia
+    ++ stdenv.lib.optional withCddb libcddb
+    ++ stdenv.lib.optional withLame lame
+    ++ stdenv.lib.optional withMtp libmtp
+    ++ stdenv.lib.optional withMusicbrainz libmusicbrainz5
+    ++ stdenv.lib.optional (withTaglib && !withKDE4 && withDevices) udisks2;
+
+  unpackPhase = "tar -xvf $src";
+  sourceRoot = "cantata-1.3.4";
+
+  # Qt4 is implicit when KDE is switched off.
+  cmakeFlags = stdenv.lib.flatten [
+    (fstats withKDE4 [ "KDE" "KWALLET" ])
+    (fstat withQt5 "QT5")
+    (fstats withTaglib [ "TAGLIB" "TAGLIB_EXTRAS" ])
+    (fstats withReplaygain [ "FFMPEG" "MPG123" "SPEEXDSP" ])
+    (fstat withCdda "CDPARANOIA")
+    (fstat withCddb "CDDB")
+    (fstat withLame "LAME")
+    (fstat withMtp "MTP")
+    (fstat withMusicbrainz "MUSICBRAINZ")
+    (fstat withOnlineServices "ONLINE_SERVICES")
+    (fstat withDynamic "DYNAMIC")
+    (fstat withDevices "DEVICES_SUPPORT")
+    (fstat withHttpServer "HTTP_SERVER")
+    (fstat withStreams "STREAMS")
+    "-DENABLE_HTTPS_SUPPORT=ON"
+    "-DENABLE_UDISKS2=ON"
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = "http://code.google.com/p/cantata/";
+    description = "A graphical client for MPD.";
+    license = licenses.gpl3;
+
+    # Technically Cantata can run on Windows so if someone wants to
+    # bother figuring that one out, be my guest.
+    platforms = platforms.linux;
+    maintainers = [ maintainers.fuuzetsu ];
+  };
+}
diff --git a/pkgs/applications/audio/caps/default.nix b/pkgs/applications/audio/caps/default.nix
index 81fb77c1c9a8..49880f6c0f31 100644
--- a/pkgs/applications/audio/caps/default.nix
+++ b/pkgs/applications/audio/caps/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl }:
 stdenv.mkDerivation rec {
   name = "caps-${version}";
-  version = "0.9.7";
+  version = "0.9.16";
   src = fetchurl {
     url = "http://www.quitte.de/dsp/caps_${version}.tar.bz2";
-    sha256 = "0ks98r3j404s9h88x50lj5lj4l64ijj29fz5i08iyq8jrb7r0zm0";
+    sha256 = "117l04w2zwqak856lihmaxg6f22vlz71knpxy0axiyri0x82lbwv";
   };
   configurePhase = ''
     echo "PREFIX = $out" > defines.make
diff --git a/pkgs/applications/audio/cd-discid/default.nix b/pkgs/applications/audio/cd-discid/default.nix
index c67830a94e77..1646f944a830 100644
--- a/pkgs/applications/audio/cd-discid/default.nix
+++ b/pkgs/applications/audio/cd-discid/default.nix
@@ -19,7 +19,7 @@ in
 
     meta = {
       homepage = http://lly.org/~rcw/cd-discid/;
-      license = "GPLv2+";
+      license = stdenv.lib.licenses.gpl2Plus;
       description = "cd-discid, a command-line utility to retrieve a disc's CDDB ID";
 
       longDescription = ''
diff --git a/pkgs/applications/audio/clementine/clementine-1.2.1-include-paths.patch b/pkgs/applications/audio/clementine/clementine-1.2.1-include-paths.patch
new file mode 100644
index 000000000000..4c17846b99df
--- /dev/null
+++ b/pkgs/applications/audio/clementine/clementine-1.2.1-include-paths.patch
@@ -0,0 +1,14 @@
+diff -ur clementine-1.2.1-a/CMakeLists.txt clementine-1.2.1-b/CMakeLists.txt
+--- clementine-1.2.1-a/CMakeLists.txt	2013-11-25 15:16:24.000000000 -0600
++++ clementine-1.2.1-b/CMakeLists.txt	2013-12-30 17:01:48.470011058 -0600
+@@ -158,6 +158,10 @@
+ include_directories(${TAGLIB_INCLUDE_DIRS})
+ include_directories(${QJSON_INCLUDE_DIRS})
+ include_directories(${GSTREAMER_INCLUDE_DIRS})
++include_directories(${GSTREAMER_APP_INCLUDE_DIRS})
++include_directories(${GSTREAMER_BASE_INCLUDE_DIRS})
++include_directories(${GSTREAMER_CDDA_INCLUDE_DIRS})
++include_directories(${GSTREAMER_TAG_INCLUDE_DIRS})
+ include_directories(${GLIB_INCLUDE_DIRS})
+ include_directories(${GLIBCONFIG_INCLUDE_DIRS})
+ include_directories(${LIBXML_INCLUDE_DIRS})
diff --git a/pkgs/applications/audio/clementine/default.nix b/pkgs/applications/audio/clementine/default.nix
new file mode 100644
index 000000000000..604c35f46ce9
--- /dev/null
+++ b/pkgs/applications/audio/clementine/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, boost, cmake, gettext, gstreamer, gst_plugins_base
+, liblastfm, qt4, taglib, fftw, glew, qjson, sqlite, libgpod, libplist
+, usbmuxd, libmtp, gvfs, libcdio, protobuf, libspotify, qca2, pkgconfig
+, sparsehash, config }:
+
+let withSpotify = config.clementine.spotify or false;
+in
+stdenv.mkDerivation {
+  name = "clementine-1.2.3";
+
+  src = fetchurl {
+    url = https://github.com/clementine-player/Clementine/archive/1.2.3.tar.gz;
+    sha256 = "1gx1109i4pylz6x7gvp4rdzc6dvh0w6in6hfbygw01d08l26bxbx";
+  };
+
+  patches = [ ./clementine-1.2.1-include-paths.patch ];
+
+  buildInputs = [
+    boost
+    cmake
+    fftw
+    gettext
+    glew
+    gst_plugins_base
+    gstreamer
+    gvfs
+    libcdio
+    libgpod
+    liblastfm
+    libmtp
+    libplist
+    pkgconfig
+    protobuf
+    qca2
+    qjson
+    qt4
+    sparsehash
+    sqlite
+    taglib
+    usbmuxd
+  ] ++ stdenv.lib.optional withSpotify libspotify;
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.clementine-player.org";
+    description = "A multiplatform music player";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.ttuegel ];
+    # libspotify is unfree
+    hydraPlatforms = optionals (!withSpotify) platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/csound/default.nix b/pkgs/applications/audio/csound/default.nix
index 34e98ae620db..19c590330f65 100644
--- a/pkgs/applications/audio/csound/default.nix
+++ b/pkgs/applications/audio/csound/default.nix
@@ -12,13 +12,13 @@
 }:
 
 stdenv.mkDerivation {
-  name = "csound-5.18.02";
+  name = "csound-5.19.01";
 
   enableParallelBuilding = true;
 
   src = fetchurl {
-    url = mirror://sourceforge/csound/Csound5.18.02.tar.gz;
-    sha256 = "4c461cf3bf60b83671224949dd33805379b7121bf2c0ad6af5e191e7f6f8adc8";
+    url = mirror://sourceforge/csound/Csound5.19.01.tar.gz;
+    sha256 = "078i69jwgadmxwa5ffn8h1py7cmd9asa8swnh38fyp56lzgzn669";
   };
 
   buildInputs = [ cmake libsndfile flex bison alsaLib pulseaudio tcltk ];
diff --git a/pkgs/applications/audio/distrho/default.nix b/pkgs/applications/audio/distrho/default.nix
index 809a02e1c7a5..aa3a76c3af13 100644
--- a/pkgs/applications/audio/distrho/default.nix
+++ b/pkgs/applications/audio/distrho/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, alsaLib, fftwSinglePrec, freetype, jackaudio
+{ stdenv, fetchgit, alsaLib, fftwSinglePrec, freetype, jack2
 , libxslt, lv2, pkgconfig, premake3, xlibs }:
 
 let
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [
-    alsaLib fftwSinglePrec freetype jackaudio pkgconfig premake3
+    alsaLib fftwSinglePrec freetype jack2 pkgconfig premake3
     xlibs.libX11 xlibs.libXcomposite xlibs.libXcursor xlibs.libXext
     xlibs.libXinerama xlibs.libXrender
   ];
diff --git a/pkgs/applications/audio/drumkv1/default.nix b/pkgs/applications/audio/drumkv1/default.nix
index 7fdd04ce96b8..775cf5ca606c 100644
--- a/pkgs/applications/audio/drumkv1/default.nix
+++ b/pkgs/applications/audio/drumkv1/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, jackaudio, libsndfile, lv2, qt4 }:
+{ stdenv, fetchurl, jack2, libsndfile, lv2, qt4 }:
 
 stdenv.mkDerivation rec {
   name = "drumkv1-${version}";
-  version = "0.3.2";
+  version = "0.5.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/drumkv1/${name}.tar.gz";
-    sha256 = "0bafg06iavri9dmg7hpz554kpqf1iv9crcdq46y4n4wyyxd7kajl";
+    sha256 = "16bjkp22hfpmzj5di98dddzslavgvhw5z7pgjzmjqz9dxvbqwq1k";
   };
 
-  buildInputs = [ jackaudio libsndfile lv2 qt4 ];
+  buildInputs = [ jack2 libsndfile lv2 qt4 ];
 
   meta = with stdenv.lib; {
     description = "An old-school drum-kit sampler synthesizer with stereo fx";
diff --git a/pkgs/applications/audio/ekho/default.nix b/pkgs/applications/audio/ekho/default.nix
new file mode 100644
index 000000000000..dd9b830be841
--- /dev/null
+++ b/pkgs/applications/audio/ekho/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, pkgconfig
+, libsndfile, pulseaudio
+}:
+
+let
+  version = "5.8.2";
+in stdenv.mkDerivation rec {
+  name = "ekho-${version}";
+
+  meta = with stdenv.lib; {
+    description = "Chinese text-to-speech software";
+    homepage    = "http://www.eguidedog.net/ekho.php";
+    longDescription = ''
+      Ekho (余音) is a free, open source and multilingual text-to-speech (TTS)
+      software. It supports Cantonese (Chinese dialect spoken in Hong Kong and
+      part of Guangdong province), Mandarin (standard Chinese), Zhaoan Hakka
+      (a dialect in Taiwan), Tibetan, Ngangien (an ancient Chinese before
+      Yuan Dynasty) and Korean (in trial).
+    '';
+    license        = licenses.gpl2Plus;
+    platforms      = platforms.linux;
+    hydraPlatforms = [];
+    maintainers    = with maintainers; [ iyzsong ];
+  };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/e-guidedog/Ekho/${version}/${name}.tar.xz";
+    sha256 = "0ym6lpcpsvwvsiwlzkl1509a2hljwcw7synngrmqjq1n49ww00nj";
+  };
+
+  preConfigure = with stdenv.lib; ''
+    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${optionalString stdenv.is64bit "-D_x86_64"}"
+    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DEKHO_DATA_PATH=\"$out/share/ekho-data\""
+  '';
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [ libsndfile pulseaudio ];
+}
diff --git a/pkgs/applications/audio/espeak/default.nix b/pkgs/applications/audio/espeak/default.nix
index e1cf5fee1cc7..0faf4841c71b 100644
--- a/pkgs/applications/audio/espeak/default.nix
+++ b/pkgs/applications/audio/espeak/default.nix
@@ -1,10 +1,11 @@
-{stdenv, fetchurl, unzip, portaudio }:
+{ stdenv, fetchurl, unzip, portaudio }:
+
+stdenv.mkDerivation rec {
+  name = "espeak-1.48.04";
 
-stdenv.mkDerivation {
-  name = "espeak-1.46.02";
   src = fetchurl {
-    url = mirror://sourceforge/espeak/espeak-1.46.02-source.zip;
-    sha256 = "1fjlv5fm0gzvr5wzy1dp4nspw04k0bqv3jymha2p2qfjbfifp2zg";
+    url = "mirror://sourceforge/espeak/${name}-source.zip";
+    sha256 = "0n86gwh9pw0jqqpdz7mxggllfr8k0r7pc67ayy7w5z6z79kig6mz";
   };
 
   buildInputs = [ unzip portaudio ];
@@ -21,9 +22,10 @@ stdenv.mkDerivation {
     makeFlags="PREFIX=$out DATADIR=$out/share/espeak-data"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Compact open source software speech synthesizer";
     homepage = http://espeak.sourceforge.net/;
-    license = "GPLv3+";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/espeak/edit.nix b/pkgs/applications/audio/espeak/edit.nix
index eb34335721f0..524a95bcca06 100644
--- a/pkgs/applications/audio/espeak/edit.nix
+++ b/pkgs/applications/audio/espeak/edit.nix
@@ -1,31 +1,57 @@
-{stdenv, fetchurl, unzip, portaudio, wxGTK}:
+{ stdenv, fetchurl, pkgconfig, unzip, portaudio, wxGTK, sox }:
+
+stdenv.mkDerivation rec {
+  name = "espeakedit-1.48.03";
 
-stdenv.mkDerivation {
-  name = "espeakedit-1.46.02";
   src = fetchurl {
-    url = mirror://sourceforge/espeak/espeakedit-1.46.02.zip;
-    sha256 = "1cc5r89sn8zz7b8wj4grx9xb7aqyi0ybj0li9hpy7hd67r56kqkl";
+    url = "mirror://sourceforge/espeak/${name}.zip";
+    sha256 = "0x8s7vpb7rw5x37yjzy1f98m4f2csdg89libb74fm36gn8ly0hli";
   };
 
-  buildInputs = [ unzip portaudio wxGTK ];
+  buildInputs = [ pkgconfig unzip portaudio wxGTK ];
+
+  # TODO:
+  # Uhm, seems like espeakedit still wants espeak-data/ in $HOME, even thought
+  # it should use $espeak/share/espeak-data. Have to contact upstream to get
+  # this fixed.
+  #
+  # Workaround:
+  #  cp -r $(nix-build -A espeak)/share/espeak-data ~
+  #  chmod +w ~/espeak-data
+
+  patches = [
+    ./espeakedit-fix-makefile.patch
+    ./espeakedit-configurable-sox-path.patch
+    ./espeakedit-configurable-path-espeak-data.patch
+  ];
 
-  patchPhase = if portaudio.api_version == 19 then ''
+  postPatch = ''
+    # Disable -Wall flag because it's noisy
+    sed -i "s/-Wall//g" src/Makefile
+
+    # Fixup paths (file names from above espeak-configurable* patches)
+    for file in src/compiledata.cpp src/readclause.cpp src/speech.h; do
+        sed -e "s|@sox@|${sox}/bin/sox|" \
+            -e "s|@prefix@|$out|" \
+            -i "$file"
+    done
+  '' + stdenv.lib.optionalString (portaudio.api_version == 19) ''
     cp src/portaudio19.h src/portaudio.h
-  '' else "";
+  '';
 
   buildPhase = ''
-    cd src
-    gcc -o espeakedit *.cpp `wx-config --cxxflags --libs`
+    make -C src
   '';
 
   installPhase = ''
-    ensureDir $out/bin
-    cp espeakedit $out/bin
+    mkdir -p "$out/bin"
+    cp src/espeakedit "$out/bin"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Phoneme editor for espeak";
     homepage = http://espeak.sourceforge.net/;
-    license = "GPLv3+";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/espeak/espeakedit-configurable-path-espeak-data.patch b/pkgs/applications/audio/espeak/espeakedit-configurable-path-espeak-data.patch
new file mode 100644
index 000000000000..e5c761a11b35
--- /dev/null
+++ b/pkgs/applications/audio/espeak/espeakedit-configurable-path-espeak-data.patch
@@ -0,0 +1,15 @@
+Don't hardcode /usr, use @prefix@.
+
+Author: Bjørn Forsman
+diff -uNr espeakedit-1.48.03.orig/src/speech.h espeakedit-1.48.03/src/speech.h
+--- espeakedit-1.48.03.orig/src/speech.h	2014-03-04 17:48:12.000000000 +0100
++++ espeakedit-1.48.03/src/speech.h	2014-07-22 18:21:40.860790719 +0200
+@@ -58,7 +58,7 @@
+ 
+ // will look for espeak_data directory here, and also in user's home directory
+ #ifndef PATH_ESPEAK_DATA
+-   #define PATH_ESPEAK_DATA  "/usr/share/espeak-data"
++   #define PATH_ESPEAK_DATA  "@prefix@/share/espeak-data"
+ #endif
+ 
+ typedef unsigned short USHORT;
diff --git a/pkgs/applications/audio/espeak/espeakedit-configurable-sox-path.patch b/pkgs/applications/audio/espeak/espeakedit-configurable-sox-path.patch
new file mode 100644
index 000000000000..1c5dfc21941a
--- /dev/null
+++ b/pkgs/applications/audio/espeak/espeakedit-configurable-sox-path.patch
@@ -0,0 +1,27 @@
+Make the path to 'sox' configurable by marking it '@sox@' (easy to match with sed).
+
+Author: Bjørn Forsman
+diff -uNr espeakedit-1.48.03.orig/src/compiledata.cpp espeakedit-1.48.03/src/compiledata.cpp
+--- espeakedit-1.48.03.orig/src/compiledata.cpp	2014-03-04 17:48:11.000000000 +0100
++++ espeakedit-1.48.03/src/compiledata.cpp	2014-07-22 16:38:50.261388452 +0200
+@@ -1884,7 +1884,7 @@
+             fname2 = msg;
+         }
+ 
+-        sprintf(command,"sox \"%s%s.wav\" -r %d -c1 -t wav %s\n",path_source,fname2,samplerate_native, fname_temp);
++        sprintf(command,"@sox@ \"%s%s.wav\" -r %d -c1 -t wav %s\n",path_source,fname2,samplerate_native, fname_temp);
+         if(system(command) != 0)
+         {
+             failed = 1;
+diff -uNr espeakedit-1.48.03.orig/src/readclause.cpp espeakedit-1.48.03/src/readclause.cpp
+--- espeakedit-1.48.03.orig/src/readclause.cpp	2014-03-04 17:48:11.000000000 +0100
++++ espeakedit-1.48.03/src/readclause.cpp	2014-07-22 16:38:37.190440504 +0200
+@@ -892,7 +892,7 @@
+ 			if((fd_temp = mkstemp(fname_temp)) >= 0)
+ 			{
+ 				close(fd_temp);
+-				sprintf(command,"sox \"%s\" -r %d -c1 -t wav %s\n", fname, samplerate, fname_temp);
++				sprintf(command,"@sox@ \"%s\" -r %d -c1 -t wav %s\n", fname, samplerate, fname_temp);
+ 				if(system(command) == 0)
+ 				{
+ 					fname = fname_temp;
diff --git a/pkgs/applications/audio/espeak/espeakedit-fix-makefile.patch b/pkgs/applications/audio/espeak/espeakedit-fix-makefile.patch
new file mode 100644
index 000000000000..9f8a65d2b0ca
--- /dev/null
+++ b/pkgs/applications/audio/espeak/espeakedit-fix-makefile.patch
@@ -0,0 +1,26 @@
+Fix broken Makefile:
+
+* fix syntax error (missing '\' to continue line):
+    Makefile:19: *** recipe commences before first target.  Stop.
+* Get portaudio library flags from pkg-config (to get -Lpath/to/portaudio/lib etc.)
+
+Author: Bjørn Forsman
+diff -uNr espeakedit-1.48.03.orig/src/Makefile espeakedit-1.48.03/src/Makefile
+--- espeakedit-1.48.03.orig/src/Makefile	2013-03-13 15:52:02.000000000 +0100
++++ espeakedit-1.48.03/src/Makefile	2014-07-22 15:34:17.524114822 +0200
+@@ -12,12 +12,11 @@
+ 
+ WX_LIBS = -pthread   `wx-config --libs`
+ 
+-LIBS=-lstdc++ -lportaudio
++LIBS=-lstdc++ `pkg-config --libs portaudio-2.0`
+ #LIBS=-lstdc++ /usr/lib/x86_64-linux-gnu/libportaudio.so.2
+ 
+-CPPFLAGS =  -Wall -g -fexceptions `wx-config --cflags`
+-	-I/usr/include/wx-2.8 \
+-	-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
++CPPFLAGS =  -Wall -g -fexceptions `wx-config --cflags` \
++	-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES \
+ 	-D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT
+ 
+ CXXFLAGS = -O2  -Wall -fexceptions `wx-config --cflags` \
diff --git a/pkgs/applications/audio/flac/default.nix b/pkgs/applications/audio/flac/default.nix
index 95ab82444785..0256eacc4361 100644
--- a/pkgs/applications/audio/flac/default.nix
+++ b/pkgs/applications/audio/flac/default.nix
@@ -10,15 +10,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libogg ];
 
-  doCheck = true; # takes lots of time but will be run rarely (small build-time closure)
-
-  enableParallelBuilding = true;
+  #doCheck = true; # takes lots of time
 
   outputs = [ "dev" "out" "bin" "doc" ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://xiph.org/flac/;
     description = "Library and tools for encoding and decoding the FLAC lossless audio file format";
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    maintainers = maintainers.mornfall;
   };
 }
diff --git a/pkgs/applications/audio/fldigi/default.nix b/pkgs/applications/audio/fldigi/default.nix
new file mode 100644
index 000000000000..e78095a9c5df
--- /dev/null
+++ b/pkgs/applications/audio/fldigi/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, hamlib, fltk13, libjpeg, libpng, portaudio, libsndfile,
+  libsamplerate, pulseaudio, libXinerama, gettext, pkgconfig, alsaLib }:
+
+stdenv.mkDerivation rec {
+  version = "3.21.82";
+  pname = "fldigi";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://www.w1hkj.com/downloads/${pname}/${name}.tar.gz";
+    sha256 = "1q2fc1zm9kfsjir4g6fh95vmjdq984iyxfcs6q4gjqy1znhqcyqs";
+  };
+
+  buildInputs = [ libXinerama gettext hamlib fltk13 libjpeg libpng portaudio
+                  libsndfile libsamplerate pulseaudio pkgconfig alsaLib ];
+
+  meta = {
+    description = "Digital modem program";
+    homepage = http://www.w1hkj.com/Fldigi.html;
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = with stdenv.lib.maintainers; [ relrod ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/fluidsynth/default.nix b/pkgs/applications/audio/fluidsynth/default.nix
index b0c5a88cb1a6..8cba482194e5 100644
--- a/pkgs/applications/audio/fluidsynth/default.nix
+++ b/pkgs/applications/audio/fluidsynth/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchurl, alsaLib, glib, jackaudio, libsndfile, pkgconfig
+{ stdenv, fetchurl, alsaLib, glib, jack2, libsndfile, pkgconfig
 , pulseaudio }:
 
 stdenv.mkDerivation  rec {
   name = "fluidsynth-${version}";
-  version = "1.1.5";
+  version = "1.1.6";
 
   src = fetchurl {
     url = "mirror://sourceforge/fluidsynth/${name}.tar.bz2";
-    sha256 = "1x73a5rsyvfmh1j0484kzgnk251q61g1g2jdja673l8fizi0xd24";
+    sha256 = "00gn93bx4cz9bfwf3a8xyj2by7w23nca4zxf09ll53kzpzglg2yj";
   };
 
   preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
@@ -21,7 +21,7 @@ stdenv.mkDerivation  rec {
     "-framework CoreAudio";
 
   buildInputs = [ glib libsndfile pkgconfig ]
-    ++ stdenv.lib.optionals (!stdenv.isDarwin) [ alsaLib pulseaudio jackaudio ];
+    ++ stdenv.lib.optionals (!stdenv.isDarwin) [ alsaLib pulseaudio jack2 ];
 
   meta = with stdenv.lib; {
     description = "Real-time software synthesizer based on the SoundFont 2 specifications";
diff --git a/pkgs/applications/audio/gigedit/default.nix b/pkgs/applications/audio/gigedit/default.nix
index be6970f01e16..269b48aebb8f 100644
--- a/pkgs/applications/audio/gigedit/default.nix
+++ b/pkgs/applications/audio/gigedit/default.nix
@@ -26,5 +26,6 @@ stdenv.mkDerivation rec {
     description = "Gigasampler file access library";
     license = licenses.gpl2;
     maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/gmpc/default.nix b/pkgs/applications/audio/gmpc/default.nix
index 10a2f0dcee94..728155c02bda 100644
--- a/pkgs/applications/audio/gmpc/default.nix
+++ b/pkgs/applications/audio/gmpc/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, libtool, intltool, pkgconfig, glib
-, gtk, curl, mpd_clientlib, libsoup, gob2, vala
+, gtk, curl, mpd_clientlib, libsoup, gob2, vala, libunique
 }:
 
 stdenv.mkDerivation rec {
@@ -15,22 +15,6 @@ stdenv.mkDerivation rec {
     buildInputs = [ pkgconfig glib ];
   };
 
-  libunique = stdenv.mkDerivation {
-    name = "libunique-1.1.6";
-    src = fetchurl {
-      url = http://ftp.gnome.org/pub/GNOME/sources/libunique/1.1/libunique-1.1.6.tar.gz;
-      sha256 = "2cb918dde3554228a211925ba6165a661fd782394bd74dfe15e3853dc9c573ea";
-    };
-    buildInputs = [ pkgconfig glib gtk ];
-
-    patches = [
-      (fetchurl {
-        url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/remove_G_CONST_RETURN.patch?h=packages/libunique";
-        sha256 = "0da2qi7cyyax4rr1p25drlhk360h8d3lapgypi5w95wj9k6bykhr";
-      })
-    ];
-  };
-
   src = fetchurl {
     url = "http://download.sarine.nl/Programs/gmpc/11.8/gmpc-11.8.16.tar.gz";
     sha256 = "0b3bnxf98i5lhjyljvgxgx9xmb6p46cn3a9cccrng14nagri9556";
diff --git a/pkgs/applications/audio/gmu/default.nix b/pkgs/applications/audio/gmu/default.nix
index e75be3e2c2be..f23ba66a3b51 100644
--- a/pkgs/applications/audio/gmu/default.nix
+++ b/pkgs/applications/audio/gmu/default.nix
@@ -30,6 +30,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://wejp.k.vu/projects/gmu;
     description = "Open source music player for portable gaming consoles and handhelds";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/audio/gpodder/default.nix b/pkgs/applications/audio/gpodder/default.nix
new file mode 100644
index 000000000000..19b61ebc76d4
--- /dev/null
+++ b/pkgs/applications/audio/gpodder/default.nix
@@ -0,0 +1,45 @@
+{ pkgs, stdenv, fetchurl, python, buildPythonPackage, pythonPackages, mygpoclient, intltool,
+  ipodSupport ? true, libgpod, gpodderHome ? "", gpodderDownloadDir ? "" }:
+
+with pkgs.lib;
+
+let
+  inherit (pythonPackages) coverage feedparser minimock sqlite3 dbus pygtk eyeD3;
+
+in buildPythonPackage rec {
+  name = "gpodder-3.7.0";
+
+  src = fetchurl {
+    url = "http://gpodder.org/src/${name}.tar.gz";
+    sha256 = "fa90ef4bdd3fd9eef95404f7f43f70912ae3ab4f8d24078484a2f3e11b14dc47";
+  };
+
+  buildInputs = [ coverage feedparser minimock sqlite3 mygpoclient intltool ];
+
+  propagatedBuildInputs = [ feedparser dbus mygpoclient sqlite3 pygtk eyeD3 ]
+    ++ stdenv.lib.optional ipodSupport libgpod;
+
+  postPatch = "sed -ie 's/PYTHONPATH=src/PYTHONPATH=\$(PYTHONPATH):src/' makefile";
+
+  checkPhase = "make unittest";
+
+  preFixup = ''
+    wrapProgram $out/bin/gpodder \
+      ${optionalString (gpodderHome != "") "--set GPODDER_HOME ${gpodderHome}"} \
+      ${optionalString (gpodderDownloadDir != "") "--set GPODDER_DOWNLOAD_DIR ${gpodderDownloadDir}"}
+  '';
+
+  installPhase = "DESTDIR=/ PREFIX=$out make install";
+
+  meta = {
+    description = "A podcatcher written in python";
+    longDescription = ''
+      gPodder downloads and manages free audio and video content (podcasts)
+      for you. Listen directly on your computer or on your mobile devices.
+    '';
+    homepage = "http://gpodder.org/";
+    license = "GPLv3";
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    maintainers = [ stdenv.lib.maintainers.skeidel ];
+  };
+}
diff --git a/pkgs/applications/audio/gtkpod/default.nix b/pkgs/applications/audio/gtkpod/default.nix
index 90e27c12ce3b..80a7cf52cd8d 100644
--- a/pkgs/applications/audio/gtkpod/default.nix
+++ b/pkgs/applications/audio/gtkpod/default.nix
@@ -1,25 +1,43 @@
-{ stdenv, fetchurl, pkgconfig, libgpod, gtk, glib, gettext, perl, perlXMLParser
-, libglade, flex, libid3tag, libvorbis, intltool }:
+{ stdenv, fetchurl, pkgconfig, makeWrapper, intltool, libgpod, curl, flac,
+  gnome3_12, gtk3, glib, gettext, perl, perlXMLParser , libglade, flex, libid3tag,
+  libvorbis, hicolor_icon_theme, gdk_pixbuf }:
 
-stdenv.mkDerivation {
-  name = "gtkpod-1.0.0";
+let
+  gnome = gnome3_12;
+
+in stdenv.mkDerivation rec {
+  version = "2.1.4";
+  name = "gtkpod-${version}";
 
   src = fetchurl {
-    url = mirror://sourceforge/gtkpod/gtkpod-1.0.0.tar.gz;
-    sha256 = "04jzybs55c27kyp7r9c58prcq0q4ssvj5iggva857f49s1ar826q";
+    url = "mirror://sourceforge/gtkpod/${name}.tar.gz";
+    sha256 = "ba12b35f3f24a155b68f0ffdaf4d3c5c7d1b8df04843a53306e1c83fc811dfaa";
   };
 
-  buildInputs = [ pkgconfig libgpod gettext perl perlXMLParser gtk libglade flex
-    libid3tag libvorbis intltool ];
+  propagatedUserEnvPkgs = [ gnome.gnome_themes_standard ];
+
+  buildInputs = [ pkgconfig makeWrapper intltool curl gettext perl perlXMLParser
+    flex libgpod libid3tag flac libvorbis gtk3 gdk_pixbuf libglade gnome.anjuta
+    gnome.gdl gnome.gnome_icon_theme_symbolic gnome.gnome_icon_theme
+    hicolor_icon_theme ];
 
   patchPhase = ''
     sed -i 's/which/type -P/' scripts/*.sh
   '';
 
-  meta = {
+  preFixup = ''
+    wrapProgram "$out/bin/gtkpod" \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gnome.gnome_themes_standard}/share:$out/share:$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
     description = "GTK Manager for an Apple ipod";
     homepage = http://gtkpod.sourceforge.net;
-    license = "GPLv2+";
-    platforms = with stdenv.lib.platforms; linux;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.skeidel ];
   };
 }
diff --git a/pkgs/applications/audio/guitarix/default.nix b/pkgs/applications/audio/guitarix/default.nix
index 17d53a621ca6..777c0ddb2e35 100644
--- a/pkgs/applications/audio/guitarix/default.nix
+++ b/pkgs/applications/audio/guitarix/default.nix
@@ -1,19 +1,20 @@
-{ stdenv, fetchurl, python, gettext, intltool, pkgconfig, jackaudio, libsndfile
-, glib, gtk, glibmm, gtkmm, fftw, librdf, ladspaH, boost }:
+{ stdenv, fetchurl, avahi, boost, fftw, gettext, glib, glibmm, gtk
+, gtkmm, intltool, jack2, ladspaH, librdf, libsndfile, lv2
+, pkgconfig, python }:
 
 stdenv.mkDerivation rec {
   name = "guitarix-${version}";
-  version = "0.25.2";
+  version = "0.28.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/guitarix/guitarix2-${version}.tar.bz2";
-    sha256 = "1wcg3yc2iy72hj6z9l88393f00by0iwhhn8xrc3q55p4rj0mnrga";
+    sha256 = "0ks5avylyicqfj9l1wf4gj62i8m6is2jmp0h11h5l2wbg3xiwxjd";
   };
 
-  buildInputs =
-    [ python gettext intltool pkgconfig jackaudio libsndfile glib gtk glibmm
-      gtkmm fftw librdf ladspaH boost
-    ];
+  buildInputs = [
+    avahi boost fftw gettext glib glibmm gtk gtkmm intltool jack2
+    ladspaH librdf libsndfile lv2 pkgconfig python
+  ];
 
   configurePhase = "python waf configure --prefix=$out";
 
@@ -21,7 +22,7 @@ stdenv.mkDerivation rec {
 
   installPhase = "python waf install";
 
-  meta = { 
+  meta = with stdenv.lib; { 
     description = "A virtual guitar amplifier for Linux running with JACK";
     longDescription = ''
         guitarix is a virtual guitar amplifier for Linux running with
@@ -46,8 +47,8 @@ stdenv.mkDerivation rec {
       crazy sounds never heard before.
     '';
     homepage = http://guitarix.sourceforge.net/;
-    license = stdenv.lib.licenses.gpl3Plus;
-    maintainers = [ stdenv.lib.maintainers.astsmtl ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ astsmtl goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/hydrogen/default.nix b/pkgs/applications/audio/hydrogen/default.nix
index bb10f24b90a2..10f15f5882cb 100644
--- a/pkgs/applications/audio/hydrogen/default.nix
+++ b/pkgs/applications/audio/hydrogen/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, alsaLib, boost, glib, jackaudio, ladspaPlugins
+{ stdenv, fetchurl, alsaLib, boost, glib, jack2, ladspaPlugins
 , libarchive, liblrdf , libsndfile, pkgconfig, qt4, scons, subversion }:
 
 stdenv.mkDerivation rec {
-  version = "0.9.5";
+  version = "0.9.5.1";
   name = "hydrogen-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/hydrogen/hydrogen-${version}.tar.gz";
-    sha256 = "1hyri49va2ss26skd6p9swkx0kbr7ggifbahkrcfgj8yj7pp6g4n";
+    sha256 = "1fvyp6gfzcqcc90dmaqbm11p272zczz5pfz1z4lj33nfr7z0bqgb";
   };
 
   buildInputs = [ 
-    alsaLib boost glib jackaudio ladspaPlugins libarchive liblrdf
+    alsaLib boost glib jack2 ladspaPlugins libarchive liblrdf
     libsndfile pkgconfig qt4 scons subversion
   ];
 
diff --git a/pkgs/applications/audio/id3v2/default.nix b/pkgs/applications/audio/id3v2/default.nix
index a7835f020d14..b96872c7ef0c 100644
--- a/pkgs/applications/audio/id3v2/default.nix
+++ b/pkgs/applications/audio/id3v2/default.nix
@@ -23,6 +23,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A command line editor for id3v2 tags";
     homepage = http://id3v2.sourceforge.net/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/audio/ingen/default.nix b/pkgs/applications/audio/ingen/default.nix
new file mode 100644
index 000000000000..ac46ff6140c1
--- /dev/null
+++ b/pkgs/applications/audio/ingen/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchsvn, boost, ganv, glibmm, gtk, gtkmm, jack2, lilv
+, lv2, pkgconfig, python, raul, serd, sord, sratom, suil
+}:
+
+stdenv.mkDerivation  rec {
+  name = "ingen-svn-${rev}";
+  rev = "5317";
+
+  src = fetchsvn {
+    url = "http://svn.drobilla.net/lad/trunk/ingen";
+    rev = rev;
+    sha256 = "0zm3wbv9qsingjyr95nwin3khmnf3wq3fz2xa6p420dpcy6qnl4x";
+  };
+
+  buildInputs = [
+    boost ganv glibmm gtk gtkmm jack2 lilv lv2 pkgconfig python
+    raul serd sord sratom suil
+  ];
+
+  configurePhase = "python waf configure --prefix=$out";
+
+  buildPhase = "python waf";
+
+  installPhase = "python waf install";
+
+  meta = with stdenv.lib; {
+    description = "A modular audio processing system using JACK and LV2 or LADSPA plugins";
+    homepage = http://drobilla.net/software/ingen;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/jack-capture/default.nix b/pkgs/applications/audio/jack-capture/default.nix
index 3b8f0f652a8b..2e6f6b0dd828 100644
--- a/pkgs/applications/audio/jack-capture/default.nix
+++ b/pkgs/applications/audio/jack-capture/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jackaudio, libsndfile, pkgconfig }:
+{ stdenv, fetchurl, jack2, libsndfile, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "jack_capture-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0sk7b92my1v1g7rhkpl1c608rb0rdb28m9zqfll95kflxajd16zv";
   };
 
-  buildInputs = [ jackaudio libsndfile pkgconfig ];
+  buildInputs = [ jack2 libsndfile pkgconfig ];
 
   buildPhase = "PREFIX=$out make jack_capture";
 
diff --git a/pkgs/applications/audio/jack-oscrolloscope/default.nix b/pkgs/applications/audio/jack-oscrolloscope/default.nix
index dbceb0a336c5..7b4d12a5b877 100644
--- a/pkgs/applications/audio/jack-oscrolloscope/default.nix
+++ b/pkgs/applications/audio/jack-oscrolloscope/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, jackaudio, mesa, pkgconfig }:
+{ stdenv, fetchurl, SDL, jack2, mesa, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "jack_oscrolloscope-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1pl55in0sj7h5r06n1v91im7d18pplvhbjhjm1fdl39zwnyxiash";
   };
 
-  buildInputs = [ SDL jackaudio mesa pkgconfig ];
+  buildInputs = [ SDL jack2 mesa pkgconfig ];
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/applications/audio/jack-rack/default.nix b/pkgs/applications/audio/jack-rack/default.nix
index 1d1128e663d3..8ac47c570dfb 100644
--- a/pkgs/applications/audio/jack-rack/default.nix
+++ b/pkgs/applications/audio/jack-rack/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, jackaudio, ladspaH, gtk, alsaLib, libxml2, librdf }:
+{ stdenv, fetchurl, pkgconfig, jack2, ladspaH, gtk, alsaLib, libxml2, librdf }:
 stdenv.mkDerivation rec {
   name = "jack-rack-1.4.7";
   src = fetchurl {
     url = "mirror://sourceforge/jack-rack/${name}.tar.bz2";
     sha256 = "1lmibx9gicagcpcisacj6qhq6i08lkl5x8szysjqvbgpxl9qg045";
   };
-  buildInputs = [ pkgconfig jackaudio ladspaH gtk alsaLib libxml2 librdf ];
+  buildInputs = [ pkgconfig jack2 ladspaH gtk alsaLib libxml2 librdf ];
 
   meta = {
     description = ''An effects "rack" for the JACK low latency audio API'';
diff --git a/pkgs/applications/audio/jackmeter/default.nix b/pkgs/applications/audio/jackmeter/default.nix
index 97c39982a65d..74d98184d9dd 100644
--- a/pkgs/applications/audio/jackmeter/default.nix
+++ b/pkgs/applications/audio/jackmeter/default.nix
@@ -1,19 +1,19 @@
-{ stdenv, fetchurl, jackaudio, pkgconfig }:
+{ stdenv, fetchurl, jack2, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "jackmeter-0.3";
+  name = "jackmeter-0.4";
 
   src = fetchurl {
     url = "http://www.aelius.com/njh/jackmeter/${name}.tar.gz";
-    sha256 = "03siznnq3f0nnqyighgw9qdq1y4bfrrxs0mk6394pza3sz4b6sgp";
+    sha256 = "1cnvgx3jv0yvxlqy0l9k285zgvazmh5k8m4l7lxckjfm5bn6hm1r";
   };
 
-  buildInputs = [ jackaudio pkgconfig ];
+  buildInputs = [ jack2 pkgconfig ];
 
   meta = { 
     description = "Console jack loudness meter";
     homepage = http://www.aelius.com/njh/jackmeter/;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.marcweber ];
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/applications/audio/jalv/default.nix b/pkgs/applications/audio/jalv/default.nix
index 5655c7d832b9..70ef5bdec5cb 100644
--- a/pkgs/applications/audio/jalv/default.nix
+++ b/pkgs/applications/audio/jalv/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, gtk, jackaudio, lilv, lv2, pkgconfig, python
+{ stdenv, fetchurl, gtk, jack2, lilv, lv2, pkgconfig, python
 , serd, sord , sratom, suil }:
 
 stdenv.mkDerivation  rec {
   name = "jalv-${version}";
-  version = "1.4.0";
+  version = "1.4.4";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "1hq968fhiz86428krqhjl3vlw71bigc9bsfcv97zgvsjh0fh6qa0";
+    sha256 = "1iql1r52rmf87q6jkxhcxa3lpq7idzzg55ma91wphywyvh29q7lf";
   };
 
   buildInputs = [
-    gtk jackaudio lilv lv2 pkgconfig python serd sord sratom suil
+    gtk jack2 lilv lv2 pkgconfig python serd sord sratom suil
   ];
 
   configurePhase = "python waf configure --prefix=$out";
@@ -25,5 +25,6 @@ stdenv.mkDerivation  rec {
     homepage = http://drobilla.net/software/jalv;
     license = licenses.isc;
     maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/ladspa-plugins/ladspah.nix b/pkgs/applications/audio/ladspa-plugins/ladspah.nix
index 30ba34af16c5..8c4d8a8c1ed5 100644
--- a/pkgs/applications/audio/ladspa-plugins/ladspah.nix
+++ b/pkgs/applications/audio/ladspa-plugins/ladspah.nix
@@ -1,28 +1,17 @@
-{ stdenv, fetchurl, builderDefs }:
+{ runCommand, fetchurl }:
+
+let
 
-let 
   src = fetchurl {
     url = http://www.ladspa.org/ladspa_sdk/ladspa.h.txt;
     sha256 = "1b908csn85ng9sz5s5d1mqk711cmawain2z8px2ajngihdrynb67";
   };
+
 in
-  let localDefs = builderDefs.passthru.function {
-    buildInputs = [];
-    inherit src;
-  };
-  in with localDefs;
-let
-  copyFile = fullDepEntry ("
-    mkdir -p \$out/include
-    cp ${src} \$out/include/ladspa.h
-  ") [minInit defEnsureDir];
-in
-stdenv.mkDerivation {
-  name = "ladspa.h";
-  builder = writeScript "ladspa.h-builder"
-    (textClosure localDefs [copyFile]);
-  meta = {
-    description = "LADSPA format audio plugins";
-    inherit src;
-  };
-}
+
+runCommand "ladspa.h"
+  { meta.description = "LADSPA format audio plugins"; }
+  ''
+    mkdir -p $out/include
+    cp ${src} $out/include/ladspa.h
+  ''
diff --git a/pkgs/applications/audio/lash/default.nix b/pkgs/applications/audio/lash/default.nix
index 72087c76b05d..e42babf13ef8 100644
--- a/pkgs/applications/audio/lash/default.nix
+++ b/pkgs/applications/audio/lash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, gtk, jackaudio, libuuid, libxml2
+{ stdenv, fetchurl, alsaLib, gtk, jack2, libuuid, libxml2
 , makeWrapper, pkgconfig, readline }:
 
 assert libuuid != null;
@@ -15,7 +15,7 @@ stdenv.mkDerivation  rec {
   # http://permalink.gmane.org/gmane.linux.redhat.fedora.extras.cvs/822346
   patches = [ ./socket.patch ./gcc-47.patch ];
 
-  buildInputs = [ alsaLib gtk jackaudio libuuid libxml2 makeWrapper
+  buildInputs = [ alsaLib gtk jack2 libuuid libxml2 makeWrapper
     pkgconfig readline ];
 
   postInstall = ''
@@ -25,7 +25,7 @@ stdenv.mkDerivation  rec {
   '';
 
   meta = with stdenv.lib; {
-    description = "LASH Audio Session Handler";
+    description = "A Linux Audio Session Handler";
     longDescription = ''
       Session management system for GNU/Linux audio applications.
     '';
diff --git a/pkgs/applications/audio/lastfmsubmitd/default.nix b/pkgs/applications/audio/lastfmsubmitd/default.nix
new file mode 100644
index 000000000000..314361329c75
--- /dev/null
+++ b/pkgs/applications/audio/lastfmsubmitd/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pythonPackages }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "lastfmsubmitd-${version}";
+  namePrefix = ""; 
+  version = "1.0.6";
+
+  src = fetchurl {
+    url = "http://www.red-bean.com/decklin/lastfmsubmitd/lastfmsubmitd-${version}.tar.gz";
+    sha256 = "c2636d5095a95167366bacd458624d67b046e060244fa54ba2c2e3efb79f9b0e";
+  };
+
+  doCheck = false;
+
+  installCommand = "python setup.py install --prefix=$out";
+
+  meta = {
+    homepage = "http://www.red-bean.com/decklin/lastfmsubmitd/";
+    description = "An last.fm audio scrobbler and daemon";
+  };
+}
diff --git a/pkgs/applications/audio/lastwatch/default.nix b/pkgs/applications/audio/lastwatch/default.nix
index 324a0b0bebcb..2cffb0ebacf4 100644
--- a/pkgs/applications/audio/lastwatch/default.nix
+++ b/pkgs/applications/audio/lastwatch/default.nix
@@ -19,11 +19,10 @@ pythonPackages.buildPythonPackage rec {
 
   propagatedBuildInputs = pythonPath;
 
-  installCommand = "python setup.py install --prefix=$out";
-
   meta = {
     homepage = "https://github.com/aszlig/LastWatch";
     description = "An inotify-based last.fm audio scrobbler";
     license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/lingot/default.nix b/pkgs/applications/audio/lingot/default.nix
index 44d946af2dbd..4b07c84b0be8 100644
--- a/pkgs/applications/audio/lingot/default.nix
+++ b/pkgs/applications/audio/lingot/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, intltool, gtk, alsaLib, libglade }:
 
 stdenv.mkDerivation {
-  name = "lingot-0.9.0";
+  name = "lingot-0.9.1";
 
   src = fetchurl {
-    url = mirror://savannah/lingot/lingot-0.9.0.tar.gz;
-    sha256 = "07z129lp8m4sz608q409wb11c639w7cbn497r7bscgg08p6c07xb";
+    url = mirror://savannah/lingot/lingot-0.9.1.tar.gz;
+    sha256 = "0ygras6ndw2fylwxx86ac11pcr2y2bcfvvgiwrh92z6zncx254gc";
   };
 
   buildInputs = [ pkgconfig intltool gtk alsaLib libglade ];
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Not a Guitar-Only tuner";
     homepage = http://www.nongnu.org/lingot/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [viric];
   };
diff --git a/pkgs/applications/audio/linuxsampler/default.nix b/pkgs/applications/audio/linuxsampler/default.nix
index 1408a1775ee5..2c4b26543ebb 100644
--- a/pkgs/applications/audio/linuxsampler/default.nix
+++ b/pkgs/applications/audio/linuxsampler/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchsvn, alsaLib, asio, autoconf, automake, bison
-, jackaudio, libgig, libsndfile, libtool, lv2, pkgconfig }:
+, jack2, libgig, libsndfile, libtool, lv2, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "linuxsampler-svn-${version}";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [ 
-   alsaLib asio autoconf automake bison jackaudio libgig libsndfile
+   alsaLib asio autoconf automake bison jack2 libgig libsndfile
    libtool lv2 pkgconfig
   ];
 
diff --git a/pkgs/applications/audio/lmms/default.nix b/pkgs/applications/audio/lmms/default.nix
index 8cdb99412f44..dd0649811bbb 100644
--- a/pkgs/applications/audio/lmms/default.nix
+++ b/pkgs/applications/audio/lmms/default.nix
@@ -1,17 +1,25 @@
-{ stdenv, fetchurl, SDL, alsaLib, cmake, fftw, jackaudio, libogg,
-libsamplerate, libsndfile, pkgconfig, pulseaudio, qt4 }:
+{ stdenv, fetchurl, SDL, alsaLib, cmake, fftwSinglePrec, jack2, libogg
+, libsamplerate, libsndfile, pkgconfig, pulseaudio, qt4, freetype
+}:
 
 stdenv.mkDerivation  rec {
   name = "lmms-${version}";
-  version = "0.4.10";
+  version = "0.4.15";
 
   src = fetchurl {
     url = "mirror://sourceforge/lmms/${name}.tar.bz2";
-    sha256 = "035cqmxcbr9ipnicdv5l7h05q2hqbavxkbaxyq06ppnv2y7fxwrb";
+    sha256 = "02q2gbsqwk3hf9kvzz58a5bxmlb4cfr2mzy41wdvbxxdm2pcl101";
   };
 
-  buildInputs = [ SDL alsaLib cmake fftw jackaudio libogg
-    libsamplerate libsndfile pkgconfig pulseaudio qt4 ];
+  buildInputs = [
+    SDL alsaLib cmake fftwSinglePrec jack2 libogg libsamplerate
+    libsndfile pkgconfig pulseaudio qt4
+  ];
+
+  # work around broken build system of 0.4.*
+  NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype2";
+
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     description = "Linux MultiMedia Studio";
diff --git a/pkgs/applications/audio/mda-lv2/default.nix b/pkgs/applications/audio/mda-lv2/default.nix
index 8b7d5527372b..9d3cdc2eea38 100644
--- a/pkgs/applications/audio/mda-lv2/default.nix
+++ b/pkgs/applications/audio/mda-lv2/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "mda-lv2-${version}";
-  version = "1.0.0";
+  version = "1.2.2";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "1dbgvpz9qvlwsfkq9c0dx45bm223wwrzgiddlyln1agpns3qbf0f";
+    sha256 = "0hh40c5d2m0k5gb3vw031l6lqn59dg804an3mkmhkc7qv4gc6xm4";
   };
 
   buildInputs = [ fftwSinglePrec lv2 pkgconfig python ];
diff --git a/pkgs/applications/audio/mhwaveedit/default.nix b/pkgs/applications/audio/mhwaveedit/default.nix
index 8f8fadb02e47..a1e81be3cb37 100644
--- a/pkgs/applications/audio/mhwaveedit/default.nix
+++ b/pkgs/applications/audio/mhwaveedit/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, SDL , alsaLib, gtk, jackaudio, ladspaH
+{ stdenv, fetchurl, SDL , alsaLib, gtk, jack2, ladspaH
 , ladspaPlugins, libsamplerate, libsndfile, pkgconfig, pulseaudio }:
 
 stdenv.mkDerivation  rec {
   name = "mhwaveedit-${version}";
-  version = "1.4.21";
+  version = "1.4.23";
 
   src = fetchurl {
     url = "http://download.gna.org/mhwaveedit/${name}.tar.bz2";
-    sha256 = "0jl7gvhwsz4fcn5d146h4m6i3hlxdsw4mmj280cv9g70p6zqi1w7";
+    sha256 = "010rk4mr631s440q9cfgdxx2avgzysr9aq52diwdlbq9cddifli3";
   };
 
   buildInputs =
-   [ SDL alsaLib gtk jackaudio ladspaH libsamplerate libsndfile
+   [ SDL alsaLib gtk jack2 ladspaH libsamplerate libsndfile
      pkgconfig pulseaudio
    ];
 
diff --git a/pkgs/applications/audio/mid2key/default.nix b/pkgs/applications/audio/mid2key/default.nix
index 1e163391a397..26ea2c7b0b2c 100644
--- a/pkgs/applications/audio/mid2key/default.nix
+++ b/pkgs/applications/audio/mid2key/default.nix
@@ -21,5 +21,6 @@ stdenv.mkDerivation rec {
     description = "A simple tool which maps midi notes to simulated keystrokes";
     license = licenses.gpl3;
     maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/mikmod/default.nix b/pkgs/applications/audio/mikmod/default.nix
index a86e09278c3c..f38ff4697313 100644
--- a/pkgs/applications/audio/mikmod/default.nix
+++ b/pkgs/applications/audio/mikmod/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Tracker music player for the terminal";
     homepage = http://mikmod.shlomifish.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [ viric ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/audio/milkytracker/decompressor_gzip.patch b/pkgs/applications/audio/milkytracker/decompressor_gzip.patch
new file mode 100644
index 000000000000..c64421116dea
--- /dev/null
+++ b/pkgs/applications/audio/milkytracker/decompressor_gzip.patch
@@ -0,0 +1,20 @@
+https://bugs.archlinux.org/task/31324
+https://410333.bugs.gentoo.org/attachment.cgi?id=322456
+
+diff -ur src.old/compression/DecompressorGZIP.cpp src/compression/DecompressorGZIP.cpp
+--- src.old/compression/DecompressorGZIP.cpp	2012-08-28 17:54:46.000000000 +0200
++++ src/compression/DecompressorGZIP.cpp	2012-08-28 17:55:21.000000000 +0200
+@@ -57,11 +57,11 @@
+ 	
+ bool DecompressorGZIP::decompress(const PPSystemString& outFileName, Hints hint)
+ {
+-    gzFile *gz_input_file = NULL;
++    gzFile gz_input_file = NULL;
+ 	int len = 0;
+ 	pp_uint8 *buf;
+ 	
+-	if ((gz_input_file = (void **)gzopen (fileName.getStrBuffer(), "r")) == NULL)
++	if ((gz_input_file = gzopen (fileName.getStrBuffer(), "r")) == NULL)
+ 		return false;
+ 	
+ 	if ((buf = new pp_uint8[0x10000]) == NULL)
diff --git a/pkgs/applications/audio/milkytracker/default.nix b/pkgs/applications/audio/milkytracker/default.nix
new file mode 100644
index 000000000000..eadbaabcf560
--- /dev/null
+++ b/pkgs/applications/audio/milkytracker/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, SDL, alsaLib, autoconf, automake, jack2, perl
+, zlib, zziplib
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.90.85";
+  name = "milkytracker-${version}";
+
+  src = fetchurl {
+    url = "http://milkytracker.org/files/milkytracker-0.90.85.tar.gz";
+    sha256 = "184pk0k9nv461a61sh6lb62wfadjwwk8ri3z5kpdbqnyssz0zfpv";
+  };
+
+  # Get two official patches.
+  no_zzip_patch = fetchurl {
+    url = "http://www.milkytracker.org/files/patches-0.90.85/no_zziplib_dep.patch";
+    sha256 = "1w550q7pxa7w6v2v19ljk03hayacrs6y887izg11a1983wk7qzb3";
+      };
+
+  fix_64bit_patch = fetchurl {
+    url = "http://www.milkytracker.org/files/patches-0.90.85/64bit_freebsd_fix.patch";
+    sha256 = "0gwd4zslbd8kih80k4v7n2c65kvm2cq3kl6d7y33z1l007vzyvf6";
+  };
+
+  patchPhase = ''
+    patch ./src/tracker/sdl/SDL_Main.cpp < ${fix_64bit_patch}
+    patch < ${no_zzip_patch}
+    patch ./src/compression/DecompressorGZIP.cpp < ${./decompressor_gzip.patch}
+  '';
+
+  preBuild=''
+    export CPATH=${zlib}/lib
+  '';
+
+  buildInputs = [ SDL alsaLib autoconf automake jack2 perl zlib zziplib ];
+
+  meta = {
+    description = "Music tracker application, similar to Fasttracker II.";
+    homepage = http://milkytracker.org;
+    license = stdenv.lib.licenses.gpl3Plus;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = [ stdenv.lib.maintainers.zoomulator ];
+  };
+}
diff --git a/pkgs/applications/audio/minimodem/default.nix b/pkgs/applications/audio/minimodem/default.nix
new file mode 100644
index 000000000000..6f2bf8cdb1c7
--- /dev/null
+++ b/pkgs/applications/audio/minimodem/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, pkgconfig, fftw, fftwSinglePrec, alsaLib, libsndfile, pulseaudio }:
+
+stdenv.mkDerivation rec {
+  version = "0.19";
+  pname = "minimodem";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://www.whence.com/${pname}/${name}.tar.gz";
+    sha256 = "003xyqjq59wcjafrdv1b8w34xsn4nvzz51wwd7mqddajh0g4dz4g";
+  };
+
+  buildInputs = [ pkgconfig fftw fftwSinglePrec alsaLib libsndfile pulseaudio ];
+
+  meta = {
+    description = "General-purpose software audio FSK modem";
+    longDescription = ''
+    Minimodem is a command-line program which decodes (or generates) audio
+    modem tones at any specified baud rate, using various framing protocols. It
+    acts a general-purpose software FSK modem, and includes support for various
+    standard FSK protocols such as Bell103, Bell202, RTTY, NOAA SAME, and
+    Caller-ID.
+    '';
+    homepage = http://www.whence.com/minimodem/;
+    license = stdenv.lib.licenses.gpl3Plus;
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [ relrod ];
+  };
+}
diff --git a/pkgs/applications/audio/mixxx/default.nix b/pkgs/applications/audio/mixxx/default.nix
index b76eecc9e4ad..e3422d4ba069 100644
--- a/pkgs/applications/audio/mixxx/default.nix
+++ b/pkgs/applications/audio/mixxx/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   buildPhase = ''
     runHook preBuild
-    ensureDir "$out"
+    mkdir -p "$out"
     scons \
       -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
       $sconsFlags "prefix=$out"
diff --git a/pkgs/applications/audio/moc/default.nix b/pkgs/applications/audio/moc/default.nix
new file mode 100644
index 000000000000..e5264f5c3d2f
--- /dev/null
+++ b/pkgs/applications/audio/moc/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, ncurses, pkgconfig, alsaLib, flac, libmad, speex, ffmpeg
+, libvorbis, mpc, libsndfile, jack2, db, libmodplug, timidity, libid3tag
+, libtool
+}:
+
+stdenv.mkDerivation rec {
+  name = "moc-${version}";
+  version = "2.5.0-beta2";
+
+  src = fetchurl {
+    url = "http://ftp.daper.net/pub/soft/moc/unstable/moc-${version}.tar.bz2";
+    sha256 = "486d50584c3fb0067b8c03af54e44351633a7740b18dc3b7358322051467034c";
+  };
+
+  configurePhase = "./configure prefix=$out";
+
+  buildInputs = [
+    ncurses pkgconfig alsaLib flac libmad speex ffmpeg libvorbis
+    mpc libsndfile jack2 db libmodplug timidity libid3tag libtool
+  ];
+
+  meta = {
+    description = "MOC (music on console) is a console audio player for LINUX/UNIX designed to be powerful and easy to use.";
+    homepage = http://moc.daper.net/;
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/applications/audio/monkeys-audio/default.nix b/pkgs/applications/audio/monkeys-audio/default.nix
index 48b0b52c5ea7..08aa7e017b21 100644
--- a/pkgs/applications/audio/monkeys-audio/default.nix
+++ b/pkgs/applications/audio/monkeys-audio/default.nix
@@ -11,4 +11,9 @@ stdenv.mkDerivation rec {
     url = "http://deb-multimedia.org/pool/main/m/${pname}/${pname}_${version}.orig.tar.gz";
     sha256 = "0kjfwzfxfx7f958b2b1kf8yj655lp0ppmn0sh57gbkjvj8lml7nz";
   };
+
+  meta = with stdenv.lib; {
+    platforms = platforms.linux;
+    maintainers = maintainers.mornfall;
+  };
 }
diff --git a/pkgs/applications/audio/mopidy-moped/default.nix b/pkgs/applications/audio/mopidy-moped/default.nix
new file mode 100644
index 000000000000..c50a1798b47f
--- /dev/null
+++ b/pkgs/applications/audio/mopidy-moped/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pythonPackages, mopidy }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "mopidy-moped-${version}";
+
+  version = "0.3.3";
+
+  src = fetchurl {
+    url = "https://github.com/martijnboland/moped/archive/v${version}.tar.gz";
+    sha256 = "19f3asqx7wmla53nhrxzdwj6qlkjv2rcwh34jxp27bz7nkhn0ihv";
+  };
+
+  propagatedBuildInputs = [ mopidy ];
+
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/martijnboland/moped;
+    description = "A web client for Mopidy";
+    license = licenses.mit;
+    maintainers = [ maintainers.rickynils ];
+    hydraPlatforms = [];
+  };
+}
diff --git a/pkgs/applications/audio/mopidy-spotify/default.nix b/pkgs/applications/audio/mopidy-spotify/default.nix
new file mode 100644
index 000000000000..6223ffb0d81f
--- /dev/null
+++ b/pkgs/applications/audio/mopidy-spotify/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pythonPackages, mopidy }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "mopidy-spotify-${version}";
+
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/mopidy/mopidy-spotify/archive/v${version}.tar.gz";
+    sha256 = "1fgxakylsx0nggis11v6bxfy8h3dl1n1v86liyfcj0xazb1mx69m";
+  };
+
+  propagatedBuildInputs = [ mopidy pythonPackages.pyspotify ];
+
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.mopidy.com/;
+    description = "Mopidy extension for playing music from Spotify.";
+    license = licenses.asl20;
+    maintainers = [ maintainers.rickynils ];
+    hydraPlatforms = [];
+  };
+}
diff --git a/pkgs/applications/audio/mopidy/default.nix b/pkgs/applications/audio/mopidy/default.nix
index 611d9f4226dd..bbdd1f05fde5 100644
--- a/pkgs/applications/audio/mopidy/default.nix
+++ b/pkgs/applications/audio/mopidy/default.nix
@@ -5,40 +5,33 @@
 pythonPackages.buildPythonPackage rec {
   name = "mopidy-${version}";
 
-  version = "0.15.0";
+  version = "0.19.3";
 
   src = fetchurl {
     url = "https://github.com/mopidy/mopidy/archive/v${version}.tar.gz";
-    sha256 = "1fpnddcx6343wgxzh10s035w21g8jmfh2kzgx32w0xsshpra3gn1";
+    sha256 = "0rjq69vqak1d6fhvih259wmwp50xgr6x0x5nd0hl6hlkbbysc8dp";
   };
 
   propagatedBuildInputs = with pythonPackages; [
-   gst_python pygobject pykka pyspotify pylast cherrypy ws4py
+    gst_python pygobject pykka tornado gst_plugins_base gst_plugins_good
   ];
 
-  # python zip complains about old timestamps
-  preConfigure = ''
-    find -print0 | xargs -0 touch
-  '';
-
   # There are no tests
   doCheck = false;
 
   postInstall = ''
-    for p in $out/bin/mopidy $out/bin/mopidy-scan; do
-      wrapProgram $p \
-        --prefix GST_PLUGIN_PATH : ${gst_plugins_good}/lib/gstreamer-0.10 \
-        --prefix GST_PLUGIN_PATH : ${gst_plugins_base}/lib/gstreamer-0.10
-    done
+    wrapProgram $out/bin/mopidy \
+      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.mopidy.com/;
     description = ''
-      A music server which can play music from Spotify and from your
-      local hard drive.
+      An extensible music server that plays music from local disk, Spotify,
+      SoundCloud, Google Play Music, and more.
     '';
-    maintainers = [ stdenv.lib.maintainers.rickynils ];
-    platforms = [];
+    license = licenses.asl20;
+    maintainers = [ maintainers.rickynils ];
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/audio/mp3info/default.nix b/pkgs/applications/audio/mp3info/default.nix
index d5a8138a5001..0f33726eaeed 100644
--- a/pkgs/applications/audio/mp3info/default.nix
+++ b/pkgs/applications/audio/mp3info/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://www.ibiblio.org/mp3info/;
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/applications/audio/mp3splt/default.nix b/pkgs/applications/audio/mp3splt/default.nix
new file mode 100644
index 000000000000..b1970a998d50
--- /dev/null
+++ b/pkgs/applications/audio/mp3splt/default.nix
@@ -0,0 +1,20 @@
+{ fetchurl, stdenv, libmp3splt, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "mp3splt-2.6.1";
+
+  src = fetchurl {
+    url = "http://prdownloads.sourceforge.net/mp3splt/${name}.tar.gz";
+    sha256 = "783a903fafbcf47f06673136a78b78d32a8e616a6ae06b79b459a32090dd14f7";
+  };
+
+  buildInputs = [ libmp3splt pkgconfig ];
+
+  meta = {
+    description = "utility to split mp3, ogg vorbis and FLAC files without decoding";
+    homepage = http://sourceforge.net/projects/mp3splt/;
+    license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.bosu ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/applications/audio/mpc/default.nix b/pkgs/applications/audio/mpc/default.nix
index bd21550a64cf..54ae5476efdd 100755
--- a/pkgs/applications/audio/mpc/default.nix
+++ b/pkgs/applications/audio/mpc/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, mpd_clientlib }:
 
 stdenv.mkDerivation rec {
-  version = "0.23";
+  version = "0.25";
   name = "mpc-${version}";
 
   src = fetchurl {
-    url = "http://www.musicpd.org/download/mpc/0/${name}.tar.bz2";
-    sha256 = "1ir96wfgq5qfdd2s06zfycv38g3bhn3bpndwx9hwf1w507rvifi9";
+    url = "http://www.musicpd.org/download/mpc/0/${name}.tar.xz";
+    sha256 = "095gmik5vrnab5a1g92qiznn48w7499fr0gldp3s6xd26kvs9kvh";
   };
 	
   buildInputs = [ mpd_clientlib ]; 
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A minimalist command line interface to MPD";
     homepage = http://www.musicpd.org/clients/mpc/;
-    license = "GPL2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.algorith ];
     platforms = stdenv.lib.platforms.linux;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/applications/audio/mpc123/default.nix b/pkgs/applications/audio/mpc123/default.nix
index 2f00638961c3..cd4343b1beb4 100644
--- a/pkgs/applications/audio/mpc123/default.nix
+++ b/pkgs/applications/audio/mpc123/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
     description = "mpc123, a Musepack (.mpc) audio player";
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu; # arbitrary choice
diff --git a/pkgs/applications/audio/mpg123/default.nix b/pkgs/applications/audio/mpg123/default.nix
index 029c2ba4bcdf..3edb7ae6793b 100644
--- a/pkgs/applications/audio/mpg123/default.nix
+++ b/pkgs/applications/audio/mpg123/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, alsaLib }:
 
 stdenv.mkDerivation {
-  name = "mpg123-1.15.4";
+  name = "mpg123-1.19.0";
 
   src = fetchurl {
-    url = mirror://sourceforge/mpg123/mpg123-1.15.4.tar.bz2;
-    sha256 = "05aizspky9mp1bq2lfrkjzrsnjykl7gkbrhn93xcarj5b2izv1b8";
+    url = mirror://sourceforge/mpg123/mpg123-1.19.0.tar.bz2;
+    sha256 = "06xhd68mj9yp0r6l771aq0d7xgnl402a3wm2mvhxmd3w3ph29446";
   };
 
   buildInputs = stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
diff --git a/pkgs/applications/audio/mpg321/default.nix b/pkgs/applications/audio/mpg321/default.nix
index ffec1a5736c3..e58397350cb1 100644
--- a/pkgs/applications/audio/mpg321/default.nix
+++ b/pkgs/applications/audio/mpg321/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "mpg321, a command-line MP3 player";
     homepage = http://mpg321.sourceforge.net/;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;
   };
diff --git a/pkgs/applications/audio/ncmpc/default.nix b/pkgs/applications/audio/ncmpc/default.nix
new file mode 100755
index 000000000000..94fa50a88836
--- /dev/null
+++ b/pkgs/applications/audio/ncmpc/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, pkgconfig, glib, ncurses, mpd_clientlib, libintlOrEmpty }:
+
+stdenv.mkDerivation rec {
+  version = "0.23";
+  name = "ncmpc-${version}";
+
+  src = fetchurl {
+    url = "http://www.musicpd.org/download/ncmpc/0/ncmpc-${version}.tar.xz";
+    sha256 = "d7b30cefaf5c74a5d8ab18ab8275e0102ae12e8ee6d6f8144f8e4cc9a97b5de4";
+  };
+
+  buildInputs = [ pkgconfig glib ncurses mpd_clientlib ]
+    ++ libintlOrEmpty;
+
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
+
+  meta = with stdenv.lib; {
+    description = "Curses-based interface for MPD (music player daemon)";
+    homepage    = http://www.musicpd.org/clients/ncmpc/;
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ _1126 ];
+    platforms   = platforms.all;
+  };
+}
+
diff --git a/pkgs/applications/audio/opus-tools/default.nix b/pkgs/applications/audio/opus-tools/default.nix
index a543aa32eea5..791763ced362 100644
--- a/pkgs/applications/audio/opus-tools/default.nix
+++ b/pkgs/applications/audio/opus-tools/default.nix
@@ -1,13 +1,13 @@
-{stdenv, fetchurl, libogg, libao, pkgconfig, libopus}:
+{stdenv, fetchurl, libogg, libao, pkgconfig, libopus, flac}:
 
 stdenv.mkDerivation rec {
-  name = "opus-tools-0.1.6";
+  name = "opus-tools-0.1.8";
   src = fetchurl {
     url = "http://downloads.xiph.org/releases/opus/${name}.tar.gz";
-    sha256 = "1hd2ych34y3qy4rj4hd5cp29ixy891afizlsxphsfvfplk1dp1nc";
+    sha256 = "1xm2lhdz92n9zmk496lyagisyzja46kx8q340vay9i51krbqiqg4";
   };
 
-  buildInputs = [ libogg libao pkgconfig libopus ];
+  buildInputs = [ libogg libao pkgconfig libopus flac ];
 
   meta = {
     description = "Tools to work with opus encoded audio streams";
diff --git a/pkgs/applications/audio/opusfile/default.nix b/pkgs/applications/audio/opusfile/default.nix
new file mode 100644
index 000000000000..50df35b974f6
--- /dev/null
+++ b/pkgs/applications/audio/opusfile/default.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchurl, pkgconfig, openssl, libogg, libopus}:
+
+stdenv.mkDerivation rec {
+  name = "opusfile-0.4";
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/opus/${name}.tar.gz";
+    sha256 = "0h4iwyqgid0cibqwzckz3r94qfp09099nk1cx5nz6i3cf08yldlq";
+  };
+
+  buildInputs = [ pkgconfig openssl libogg libopus ];
+
+  meta = {
+    description = "High-level API for decoding and seeking in .opus files";
+    homepage = http://www.opus-codec.org/;
+    license = "BSD";
+  };
+}
diff --git a/pkgs/applications/audio/pamixer/default.nix b/pkgs/applications/audio/pamixer/default.nix
new file mode 100644
index 000000000000..acdda1799d03
--- /dev/null
+++ b/pkgs/applications/audio/pamixer/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchgit, pulseaudio, boost }:
+
+let
+  tag = "1.1";
+in
+
+stdenv.mkDerivation rec {
+
+  name = "pamixer-${tag}";
+
+  src = fetchgit {
+    url = git://github.com/cdemoulins/pamixer;
+    rev = "refs/tags/${tag}";
+    sha256 = "03r0sbfj85wp6yxa87pjg69ivmk0mxxa2nykr8gf2c607igmb034";
+  };
+
+  buildInputs = [ pulseaudio boost ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp pamixer $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "pamixer is like amixer but for pulseaudio.";
+    longDescription = "Features:
+      - Get the current volume of the default sink, the default source or a selected one by his id
+      - Set the volume for the default sink, the default source or any other device
+      - List the sinks
+      - List the sources
+      - Increase / Decrease the volume for a device
+      - Mute or unmute a device";
+    homepage = https://github.com/cdemoulins/pamixer;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers._1126 ];
+  };
+}
diff --git a/pkgs/applications/audio/pavucontrol/default.nix b/pkgs/applications/audio/pavucontrol/default.nix
index 02a27bedb67f..ca08624e98f3 100644
--- a/pkgs/applications/audio/pavucontrol/default.nix
+++ b/pkgs/applications/audio/pavucontrol/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://freedesktop.org/software/pulseaudio/pavucontrol/ ;
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
diff --git a/pkgs/applications/audio/petrifoo/default.nix b/pkgs/applications/audio/petrifoo/default.nix
index 2e53a22bff3b..152ee442761e 100644
--- a/pkgs/applications/audio/petrifoo/default.nix
+++ b/pkgs/applications/audio/petrifoo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, alsaLib, cmake, gtk, jackaudio, libgnomecanvas
+{ stdenv, fetchgit, alsaLib, cmake, gtk, jack2, libgnomecanvas
 , libpthreadstubs, libsamplerate, libsndfile, libtool, libxml2
 , pkgconfig }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs =
-   [ alsaLib cmake  gtk jackaudio libgnomecanvas libpthreadstubs
+   [ alsaLib cmake  gtk jack2 libgnomecanvas libpthreadstubs
      libsamplerate libsndfile libtool libxml2 pkgconfig
    ];
 
diff --git a/pkgs/applications/audio/pianobooster/default.nix b/pkgs/applications/audio/pianobooster/default.nix
index d5cdffbed952..67848cdc804b 100644
--- a/pkgs/applications/audio/pianobooster/default.nix
+++ b/pkgs/applications/audio/pianobooster/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, cmake, qt4 }:
+{ stdenv, fetchurl, alsaLib, cmake, mesa, makeWrapper, qt4 }:
 
 stdenv.mkDerivation  rec {
   name = "pianobooster-${version}";
@@ -9,14 +9,25 @@ stdenv.mkDerivation  rec {
     sha256 = "1xwyap0288xcl0ihjv52vv4ijsjl0yq67scc509aia4plmlm6l35";
   };
 
+  patches = [
+    ./pianobooster-0.6.4b-cmake.patch
+    ./pianobooster-0.6.4b-cmake-gcc4.7.patch
+  ];
+
   preConfigure = "cd src";
 
-  buildInputs = [ alsaLib cmake qt4 ];
+  buildInputs = [ alsaLib cmake makeWrapper mesa qt4 ];
+
+  postInstall = ''
+    wrapProgram $out/bin/pianobooster \
+      --prefix LD_LIBRARY_PATH : ${mesa}/lib
+  '';
 
   meta = with stdenv.lib; {
     description = "A MIDI file player that teaches you how to play the piano";
     homepage = http://pianobooster.sourceforge.net;
     license = licenses.gpl3;
+    platforms = platforms.linux;
     maintainers = [ maintainers.goibhniu ];
   };
 }
diff --git a/pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake-gcc4.7.patch b/pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake-gcc4.7.patch
new file mode 100644
index 000000000000..2b1b28c5a849
--- /dev/null
+++ b/pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake-gcc4.7.patch
@@ -0,0 +1,11 @@
+--- pianobooster-src-0.6.4b/src/CMakeLists.txt.orig	2013-04-06 10:48:02.469532914 -0700
++++ pianobooster-src-0.6.4b/src/CMakeLists.txt	2013-04-06 10:48:12.989532445 -0700
+@@ -203,8 +203,6 @@
+         ${PIANOBOOSTER_UI_HDRS} )

+ ENDIF(WIN32)

+ 

+-SET_TARGET_PROPERTIES(pianobooster PROPERTIES LINK_FLAGS "-mwindows")

+-

+ IF (USE_PCH)

+ ADD_PRECOMPILED_HEADER( pianobooster ${CMAKE_CURRENT_SOURCE_DIR}/precompile/precompile.h )

+ ENDIF (USE_PCH)

diff --git a/pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake.patch b/pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake.patch
new file mode 100644
index 000000000000..8cdd8738e2b3
--- /dev/null
+++ b/pkgs/applications/audio/pianobooster/pianobooster-0.6.4b-cmake.patch
@@ -0,0 +1,44 @@
+--- pianobooster-src-0.6.4b/src/CMakeLists.txt.orig
++++ pianobooster-src-0.6.4b/src/CMakeLists.txt
+@@ -2,12 +2,6 @@
+ # for the debug build type cmake -DCMAKE_BUILD_TYPE=Debug

+ SET(CMAKE_BUILD_TYPE Release)

+ SET(CMAKE_VERBOSE_MAKEFILE OFF)

+-SET(USE_FLUIDSYNTH OFF)

+-

+-# The inplace directory is mainly for windows builds

+-# SET(FLUIDSYNTH_INPLACE_DIR C:/download/misc/ljb/fluidsynth-1.0.9)

+-SET(FLUIDSYNTH_INPLACE_DIR /home/louis/build/fluidsynth-1.0.9)

+-

+ 

+ # Testing precompiled headers  it does not work -- leave as OFF.

+ SET(USE_PCH OFF)

+@@ -78,18 +72,7 @@
+     ADD_DEFINITIONS(-DPB_USE_FLUIDSYNTH)

+     MESSAGE("Building using fluidsynth")

+     SET( PB_BASE_SRCS MidiDeviceFluidSynth.cpp )

+-

+-    IF(FLUIDSYNTH_INPLACE_DIR)

+-        INCLUDE_DIRECTORIES(${FLUIDSYNTH_INPLACE_DIR}/include/)

+-        IF(WIN32)

+-            LINK_LIBRARIES( ${FLUIDSYNTH_INPLACE_DIR}/src/.libs/libfluidsynth.dll.a)

+-        ENDIF(WIN32)

+-        IF(UNIX)

+-            LINK_LIBRARIES(${FLUIDSYNTH_INPLACE_DIR}/src/.libs/libfluidsynth.so)

+-        ENDIF(UNIX)

+-    ELSEIF(FLUIDSYNTH_INPLACE_DIR)

+-        LINK_LIBRARIES( fluidsynth)

+-    ENDIF(FLUIDSYNTH_INPLACE_DIR)

++	LINK_LIBRARIES(fluidsynth)

+ ENDIF(USE_FLUIDSYNTH)

+ 

+ 

+@@ -214,8 +197,6 @@
+ INSTALL(TARGETS pianobooster RUNTIME DESTINATION bin)

+ #INSTALL( index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en  SUBDIR kmidimon )

+ 

+-INSTALL( FILES ../README.txt  DESTINATION share/doc/pianobooster )

+-

+ INSTALL ( FILES images/pianobooster.png DESTINATION share/pixmaps )

+ 

+ 

diff --git a/pkgs/applications/audio/praat/default.nix b/pkgs/applications/audio/praat/default.nix
index f2f196acdd85..86c68d087b77 100644
--- a/pkgs/applications/audio/praat/default.nix
+++ b/pkgs/applications/audio/praat/default.nix
@@ -1,18 +1,19 @@
-{stdenv, fetchurl, alsaLib, gtk, pkgconfig }:
+{ stdenv, fetchurl, alsaLib, gtk, pkgconfig }:
 
 stdenv.mkDerivation {
-  name = "praat-5323";
+  name = "praat-5365";
+
   src = fetchurl {
-    url = http://www.fon.hum.uva.nl/praat/praat5323_sources.tar.gz;
-    sha256 = "1m0m5165h74mw5xhmnnyzh5ans3cn78w5rs9572sa1512cams203";
+    url = http://www.fon.hum.uva.nl/praat/praat5365_sources.tar.gz;
+    sha256 = "1w3mcq0mipx88i7ckhvzhmdj0p67nhppnn7kbkp21d01yyyz5rgq";
   };
 
   configurePhase = ''
-    cp makefiles/makefile.defs.linux makefile.defs
+    cp makefiles/makefile.defs.linux.alsa makefile.defs
   '';
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp praat $out/bin
   '';
 
@@ -21,6 +22,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Doing phonetics by computer";
     homepage = http://www.fon.hum.uva.nl/praat/;
-    license = "GPLv2+"; # Has some 3rd-party code in it though
+    license = stdenv.lib.licenses.gpl2Plus; # Has some 3rd-party code in it though
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/projectm/default.nix b/pkgs/applications/audio/projectm/default.nix
new file mode 100644
index 000000000000..508b6743cc39
--- /dev/null
+++ b/pkgs/applications/audio/projectm/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, pkgconfig, cmake
+, glew, ftgl, ttf_bitstream_vera
+, withQt ? true, qt4
+, withLibvisual ? false, libvisual, SDL
+, withJack ? false, jack2
+, withPulseAudio ? true, pulseaudio
+}:
+
+assert withJack       -> withQt;
+assert withPulseAudio -> withQt;
+
+stdenv.mkDerivation {
+  name = "projectm-2.1.0";
+
+  meta = {
+    description = "Music Visualizer";
+    homepage = "http://projectm.sourceforge.net/";
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.linux;
+  };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/projectm/2.1.0/projectM-complete-2.1.0-Source.tar.gz";
+    sha256 = "1vh6jk68a0jdb6qwppb6f8cbgmhnv2ba3bcavzfd6sq06gq08cji";
+  };
+
+  patchPhase = ''
+    sed -i 's:''${LIBVISUAL_PLUGINSDIR}:''${CMAKE_INSTALL_PREFIX}/lib/libvisual-0.4:' \
+      src/projectM-libvisual/CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [ pkgconfig cmake ];
+
+  cmakeFlags = ''
+    -DprojectM_FONT_MENU=${ttf_bitstream_vera}/share/fonts/truetype/VeraMono.ttf
+    -DprojectM_FONT_TITLE=${ttf_bitstream_vera}/share/fonts/truetype/Vera.ttf
+    -DINCLUDE-PROJECTM-TEST=OFF
+    -DINCLUDE-PROJECTM-QT=${if withQt then "ON" else "OFF"}
+    -DINCLUDE-PROJECTM-LIBVISUAL=${if withLibvisual then "ON" else "OFF"}
+    -DINCLUDE-PROJECTM-JACK=${if withJack then "ON" else "OFF"}
+    -DINCLUDE-PROJECTM-PULSEAUDIO=${if withPulseAudio then "ON" else "OFF"}
+  '';
+
+  buildInputs = with stdenv.lib;
+    [ glew ftgl ]
+    ++ optional withQt qt4
+    ++ optionals withLibvisual [ libvisual SDL ]
+    ++ optional withJack jack2
+    ++ optional withPulseAudio pulseaudio
+    ;
+}
diff --git a/pkgs/applications/audio/puredata/default.nix b/pkgs/applications/audio/puredata/default.nix
index b1df008398db..9abca0cb0141 100644
--- a/pkgs/applications/audio/puredata/default.nix
+++ b/pkgs/applications/audio/puredata/default.nix
@@ -1,23 +1,28 @@
-{ stdenv, fetchurl, alsaLib, autoconf, automake, fftw, gettext, glib
-, jackaudio, libX11, libtool, makeWrapper, pkgconfig, tcl, tk
+{ stdenv, fetchurl, autoreconfHook, gettext, makeWrapper
+, alsaLib, jack2, tk
 }:
 
 stdenv.mkDerivation  rec {
   name = "puredata-${version}";
-  version = "0.44-0";
+  version = "0.45-4";
 
   src = fetchurl {
     url = "mirror://sourceforge/pure-data/pd-${version}.src.tar.gz";
-    sha256 = "031bvqfnlpfx0y5n0l5rmslziqc6jgmk99x1prgh1rmhjhjdnijw";
+    sha256 = "1ls2ap5yi2zxvmr247621g4jx0hhfds4j5704a050bn2n3l0va2p";
   };
 
-  buildInputs = [
-    alsaLib autoconf automake fftw gettext glib jackaudio libX11
-    libtool makeWrapper pkgconfig tcl tk
-  ];
+  patchPhase = ''
+    rm portaudio/configure.in
+  '';
+
+  nativeBuildInputs = [ autoreconfHook gettext makeWrapper ];
+
+  buildInputs = [ alsaLib jack2 ];
 
-  preConfigure = ''
-    ./autogen.sh
+  configureFlags = ''
+    --enable-alsa
+    --enable-jack
+    --disable-portaudio
   '';
 
   postInstall = ''
diff --git a/pkgs/applications/audio/qjackctl/default.nix b/pkgs/applications/audio/qjackctl/default.nix
index e70d51ce857c..ba875255d4a0 100644
--- a/pkgs/applications/audio/qjackctl/default.nix
+++ b/pkgs/applications/audio/qjackctl/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, qt4, alsaLib, jackaudio, dbus }:
+{ stdenv, fetchurl, qt4, alsaLib, jack2, dbus }:
 
 stdenv.mkDerivation rec {
-  version = "0.3.9";
+  version = "0.3.11";
   name = "qjackctl-${version}";
 
   # some dependencies such as killall have to be installed additionally
 
   src = fetchurl {
     url = "mirror://sourceforge/qjackctl/${name}.tar.gz";
-    sha256 = "0a4s7lwd5b67qbwv1yck8bw6zz8ffx1gza5fwflfqrfcfl3dds2y";
+    sha256 = "1wjzrgx3n2asyxk6cnfcm34msaw84qvsqy08bd4qnghrgpl96hwl";
   };
 
-  buildInputs = [ qt4 alsaLib jackaudio dbus ];
+  buildInputs = [ qt4 alsaLib jack2 dbus ];
 
   configureFlags = "--enable-jack-version";
 
@@ -19,5 +19,6 @@ stdenv.mkDerivation rec {
     description = "A Qt application to control the JACK sound server daemon";
     homepage = http://qjackctl.sourceforge.net/;
     license = "GPL";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/qmmp/default.nix b/pkgs/applications/audio/qmmp/default.nix
index 8b99988f07b4..a18ef97dd60a 100644
--- a/pkgs/applications/audio/qmmp/default.nix
+++ b/pkgs/applications/audio/qmmp/default.nix
@@ -28,11 +28,11 @@
 # handle that.
 
 stdenv.mkDerivation rec {
-  name = "qmmp-0.7.0";
+  name = "qmmp-0.7.6";
 
   src = fetchurl {
     url = "http://qmmp.ylsoftware.com/files/${name}.tar.bz2";
-    sha256 = "0g8qcs82y3dy06lsgam2w6gh2ccx0frlw9fp4xg947vi3a16g6ig";
+    sha256 = "1hq08ii06lyfg516jrvxdfcjj509gvglvdlsr96aqi1fh8v4k5p9";
   };
 
   buildInputs =
@@ -54,6 +54,7 @@ stdenv.mkDerivation rec {
     homepage = http://qmmp.ylsoftware.com/;
     license = licenses.gpl2;
     platforms = platforms.linux;
-    maintainers = [maintainers.bjornfor];
+    maintainers = [ maintainers.bjornfor ];
+    repositories.svn = http://qmmp.googlecode.com/svn/;
   };
 }
diff --git a/pkgs/applications/audio/qsampler/default.nix b/pkgs/applications/audio/qsampler/default.nix
index 7cfe73c9c750..b851517b8724 100644
--- a/pkgs/applications/audio/qsampler/default.nix
+++ b/pkgs/applications/audio/qsampler/default.nix
@@ -20,5 +20,6 @@ stdenv.mkDerivation rec {
     description = "graphical frontend to LinuxSampler";
     license = licenses.gpl2;
     maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/qsynth/default.nix b/pkgs/applications/audio/qsynth/default.nix
index 96221348f88c..a5d0e7e621e2 100644
--- a/pkgs/applications/audio/qsynth/default.nix
+++ b/pkgs/applications/audio/qsynth/default.nix
@@ -1,20 +1,21 @@
-{ stdenv, fetchurl, alsaLib, fluidsynth, jackaudio, qt4 }:
+{ stdenv, fetchurl, alsaLib, fluidsynth, jack2, qt4 }:
 
 stdenv.mkDerivation  rec {
   name = "qsynth-${version}";
-  version = "0.3.6";
+  version = "0.3.8";
 
   src = fetchurl {
     url = "mirror://sourceforge/qsynth/${name}.tar.gz";
-    sha256 = "0g7vaffpgs7v2p71ml5p7fzxz50mhlaklgf9zk4wbfk1hslqv5mm";
+    sha256 = "0wmq61cq93x2l00xwr871373mj3dwamz1dg6v62x7s8m1612ndrw";
   };
 
-  buildInputs = [ alsaLib fluidsynth jackaudio qt4 ];
+  buildInputs = [ alsaLib fluidsynth jack2 qt4 ];
 
   meta = with stdenv.lib; {
     description = "Fluidsynth GUI";
     homepage = http://sourceforge.net/projects/qsynth;
     license = licenses.gpl2Plus;
+    platforms = platforms.linux;
     maintainers = [ maintainers.goibhniu ];
   };
 }
diff --git a/pkgs/applications/audio/qtractor/default.nix b/pkgs/applications/audio/qtractor/default.nix
index 3c31aff4232c..4177dbeeb0cb 100644
--- a/pkgs/applications/audio/qtractor/default.nix
+++ b/pkgs/applications/audio/qtractor/default.nix
@@ -1,18 +1,18 @@
-{ alsaLib, autoconf, automake, dssi, fetchurl, gtk, jackaudio
+{ alsaLib, autoconf, automake, dssi, fetchurl, gtk, jack2
 , ladspaH, ladspaPlugins, liblo, libmad, libsamplerate, libsndfile
 , libtool, libvorbis, pkgconfig, qt4, rubberband, stdenv }:
 
 stdenv.mkDerivation rec {
-  version = "0.5.4";
+  version = "0.6.2";
   name = "qtractor-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/qtractor/${name}.tar.gz";
-    sha256 = "08vnvjl4w6z49s5shnip0qlwib0gwixw9wrqbazkh62i328fa05l";
+    sha256 = "08cr4lgm8bkkmsvfljszcqij3i52n989s7ncrbrn17n61rmgf8yw";
   };
 
   buildInputs =
-    [ alsaLib autoconf automake dssi gtk jackaudio ladspaH
+    [ alsaLib autoconf automake dssi gtk jack2 ladspaH
       ladspaPlugins liblo libmad libsamplerate libsndfile libtool
       libvorbis pkgconfig qt4 rubberband
     ];
diff --git a/pkgs/applications/audio/quodlibet/default.nix b/pkgs/applications/audio/quodlibet/default.nix
index 9f4859d6e070..38c679d7a3e4 100644
--- a/pkgs/applications/audio/quodlibet/default.nix
+++ b/pkgs/applications/audio/quodlibet/default.nix
@@ -1,48 +1,61 @@
-{ stdenv, fetchurl, python, buildPythonPackage, mutagen, pygtk, pygobject
-, pythonDBus, gst_python, gst_plugins_base, gst_plugins_good, gst_plugins_ugly }:
+{ stdenv, fetchurl, python, buildPythonPackage, mutagen, pygtk, pygobject, intltool
+, pythonDBus, gst_python, withGstPlugins ? false, gst_plugins_base ? null
+, gst_plugins_good ? null, gst_plugins_ugly ? null, gst_plugins_bad ? null }:
 
-let version = "2.5"; in
+assert withGstPlugins -> gst_plugins_base != null
+                         || gst_plugins_good != null
+                         || gst_plugins_ugly != null
+                         || gst_plugins_bad != null;
+
+let version = "2.6.3"; in
 
 buildPythonPackage {
   # call the package quodlibet and just quodlibet
-  name = "quodlibet-${version}";
+  name = "quodlibet-${version}"
+         + stdenv.lib.optionalString withGstPlugins "-with-gst-plugins";
   namePrefix = "";
 
   # XXX, tests fail
   doCheck = false;
 
-  src = [
+  srcs = [
     (fetchurl {
-      url = "https://quodlibet.googlecode.com/files/quodlibet-${version}.tar.gz";
-      sha256 = "0qrmlz7m1jpmriy8bgycjiwzbf3annznkn4x5k32yy9bylxa7lwb";
+      url = "https://bitbucket.org/lazka/quodlibet-files/raw/default/releases/quodlibet-${version}.tar.gz";
+      sha256 = "0ilasi4b0ay8r6v6ba209wsm80fq2nmzigzc5kvphrk71jwypx6z";
      })
     (fetchurl {
-      url = "https://quodlibet.googlecode.com/files/quodlibet-plugins-${version}.tar.gz";
-      sha256 = "0kf2mkq2zk38626bn48gscvy6ir04f5b2z57ahlxlqy8imv2cjff";
+      url = "https://bitbucket.org/lazka/quodlibet-files/raw/default/releases/quodlibet-plugins-${version}.tar.gz";
+      sha256 = "1rv08rhdjad8sjhplqsspcf4vkazgkxyshsqmbfbrrk5kvv57ybc";
      })
-  ];       
+  ];
+
+  preConfigure = ''
+    # TODO: for now don't a apply gdist overrides, will be needed for shipping icons, gtk, etc
+    sed -i /distclass/d setup.py
+  '';
 
   sourceRoot = "quodlibet-${version}";
+
   postUnpack = ''
     # the patch searches for plugins in directory ../plugins
     # so link the appropriate directory there
     ln -sf quodlibet-plugins-${version} plugins
   '';
+
   patches = [ ./quodlibet-package-plugins.patch ];
 
-  buildInputs = [
-    gst_plugins_base gst_plugins_good gst_plugins_ugly
+  buildInputs = stdenv.lib.optionals withGstPlugins [
+    gst_plugins_base gst_plugins_good gst_plugins_ugly gst_plugins_bad
   ];
 
   propagatedBuildInputs = [
-    mutagen pygtk pygobject pythonDBus gst_python
+    mutagen pygtk pygobject pythonDBus gst_python intltool
   ];
 
-  postInstall = ''
+  postInstall = stdenv.lib.optionalString withGstPlugins ''
     # Wrap quodlibet so it finds the GStreamer plug-ins
-    wrapProgram "$out/bin/quodlibet" --prefix                                 \
-      GST_PLUGIN_PATH ":"                                                     \
-      "${gst_plugins_base}/lib/gstreamer-0.10:${gst_plugins_good}/lib/gstreamer-0.10:${gst_plugins_ugly}/lib/gstreamer-0.10"
+    wrapProgram "$out/bin/quodlibet" --prefix \
+      GST_PLUGIN_SYSTEM_PATH ":" "$GST_PLUGIN_SYSTEM_PATH"                                                     \
   '';
 
   meta = {
@@ -62,6 +75,7 @@ buildPythonPackage {
       & internet radio, and all major audio formats.
     '';
 
+    maintainers = [ stdenv.lib.maintainers.coroa ];
     homepage = http://code.google.com/p/quodlibet/;
   };
 }
diff --git a/pkgs/applications/audio/rakarrack/default.nix b/pkgs/applications/audio/rakarrack/default.nix
index ba84fe5eaec2..257a9967a5b0 100644
--- a/pkgs/applications/audio/rakarrack/default.nix
+++ b/pkgs/applications/audio/rakarrack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, alsaUtils, fltk, jackaudio, libXft,
+{ stdenv, fetchurl, alsaLib, alsaUtils, fltk, jack2, libXft,
 libXpm, libjpeg, libpng, libsamplerate, libsndfile, zlib }:
 
 stdenv.mkDerivation  rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation  rec {
 
   patches = [ ./fltk-path.patch ];
 
-  buildInputs = [ alsaLib alsaUtils fltk jackaudio libXft libXpm libjpeg
+  buildInputs = [ alsaLib alsaUtils fltk jack2 libXft libXpm libjpeg
     libpng libsamplerate libsndfile zlib ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/audio/samplv1/default.nix b/pkgs/applications/audio/samplv1/default.nix
index 584b23b6a01c..0cbdfa6973db 100644
--- a/pkgs/applications/audio/samplv1/default.nix
+++ b/pkgs/applications/audio/samplv1/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, jackaudio, libsndfile, lv2, qt4 }:
+{ stdenv, fetchurl, jack2, libsndfile, lv2, qt4 }:
 
 stdenv.mkDerivation rec {
   name = "samplv1-${version}";
-  version = "0.3.2";
+  version = "0.5.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/samplv1/${name}.tar.gz";
-    sha256 = "1j6q3ywbdsyhskc60p7k8ph058ylrrmjmri3q1wr2d2akcaqvb7m";
+    sha256 = "02mm5y1yzklvs5bpxl86y3dqcg7migfybmin8llk91pws6rl9b41";
   };
 
-  buildInputs = [ jackaudio libsndfile lv2 qt4 ];
+  buildInputs = [ jack2 libsndfile lv2 qt4 ];
 
   meta = with stdenv.lib; {
     description = "An old-school all-digital polyphonic sampler synthesizer with stereo fx";
diff --git a/pkgs/applications/audio/seq24/default.nix b/pkgs/applications/audio/seq24/default.nix
index 9f168f54eafd..10376e02f433 100644
--- a/pkgs/applications/audio/seq24/default.nix
+++ b/pkgs/applications/audio/seq24/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, gtkmm, jackaudio, pkgconfig }:
+{ stdenv, fetchurl, alsaLib, gtkmm, jack2, pkgconfig }:
 
 stdenv.mkDerivation  rec {
   name = "seq24-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation  rec {
     sha256 = "07n80zj95i80vjmsflnlbqx5vv90qmp5f6a0zap8d30849l4y258";
   };
 
-  buildInputs = [ alsaLib gtkmm jackaudio pkgconfig ];
+  buildInputs = [ alsaLib gtkmm jack2 pkgconfig ];
 
   meta = with stdenv.lib; {
     description = "minimal loop based midi sequencer";
diff --git a/pkgs/applications/audio/setbfree/default.nix b/pkgs/applications/audio/setbfree/default.nix
new file mode 100644
index 000000000000..5119c384cf6a
--- /dev/null
+++ b/pkgs/applications/audio/setbfree/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, alsaLib, freetype, ftgl, jack2, libX11, lv2
+, mesa, pkgconfig, ttf_bitstream_vera
+}:
+
+stdenv.mkDerivation  rec {
+  name = "setbfree-${version}";
+  version = "0.7.5";
+
+  src = fetchurl {
+    url = "https://github.com/pantherb/setBfree/archive/v${version}.tar.gz";
+    sha256 = "1chlmgwricc6l4kyg35vc9v8f1n8psr28iihn4a9q2prj1ihqcbc";
+  };
+
+  patchPhase = ''
+    sed 's#/usr/local#$(out)#g' -i common.mak
+    sed 's#/usr/share/fonts/truetype/ttf-bitstream-vera#${ttf_bitstream_vera}/share/fonts/truetype#g' \
+      -i b_synth/Makefile
+  '';
+
+  buildInputs = [
+    alsaLib freetype ftgl jack2 libX11 lv2 mesa pkgconfig
+    ttf_bitstream_vera
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A DSP tonewheel organ emulator";
+    homepage = http://setbfree.org;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/snd/default.nix b/pkgs/applications/audio/snd/default.nix
index a49bfd9cccf4..52cd2ad35ce1 100644
--- a/pkgs/applications/audio/snd/default.nix
+++ b/pkgs/applications/audio/snd/default.nix
@@ -1,58 +1,26 @@
-args : 
-let 
-  lib = args.lib;
-  fetchurl = args.fetchurl;
-  fullDepEntry = args.fullDepEntry;
+{ stdenv, fetchurl, pkgconfig
+, gtk2, alsaLib
+, fftw, gsl
+}:
 
-  version = lib.attrByPath ["version"] "9.4" args; 
-  buildInputs = with args; [gtk glib pkgconfig 
-     libXpm gmp gettext libX11 fftw]
-      ++ (lib.optional (args ? ruby) args.ruby)
-      ++ (lib.optional (args ? mesa) args.mesa)
-      ++ (lib.optional (args ? guile) args.guile)
-      ++ (lib.optional (args ? libtool) args.libtool)
-      ++ (lib.optional (args ? sndlib) args.sndlib)
-      ++ (lib.optional (args ? alsaLib) args.alsaLib)
-      ++ (lib.optional (args ? jackaudio) args.jackaudio)
-      ;
-  configureFlags = ["--with-gtk" "--with-xpm"]
-    ++ (lib.optional (args ? ruby)   "--with-ruby" )
-    ++ (lib.optional (args ? mesa)   "--with-gl"   )
-    ++ (lib.optional (args ? guile)  "--with-guile")
-    ++ (lib.optional (args ? sndlib) "--with-midi" )
-    ++ (lib.optional (args ? alsaLib)  "--with-alsa")
-    ++ (lib.optional (args ? jackaudio) "--with-jack" )
-    ++ [ "--with-fftw" "--htmldir=$out/share/snd/html" "--with-doc-dir=$out/share/snd/html" ]
-    ;
-in
-rec {
-  src = fetchurl {
-    url = "mirror://sourceforge/snd/snd-${version}.tar.gz";
-    sha256 = "0zqgfnkvkqxby1k74mwba1r4pb520glcsz5jjmpzm9m41nqnghmm";
-  };
-
-  inherit buildInputs;
-  configureFlags = [];
-
-  /* doConfigure should be specified separately */
-  phaseNames = ["doConfigure" "preBuild" "makeDocsWork" 
-    "doMakeInstall" "doForceShare"];
-
-  makeDocsWork = fullDepEntry ''
-                # hackish way to make html docs work
-                h="$out/share/snd/html"; mkdir -p "$h"; cp *.html "$h"
-                patch -p1 < ${./doc.patch}
-                sed "s@HTML-DIR@$h@" -i index.scm snd-help.c
-            '' ["defEnsureDir"];
-
-  preBuild = fullDepEntry (''
-		export NIX_LDFLAGS="$NIX_LDFLAGS -L${args.libX11}/lib -lX11"
-            '') ["minInit" "doUnpack" "makeDocsWork"];
+stdenv.mkDerivation rec {
+  name = "snd-14.3";
 
-  name = "snd-" + version;
   meta = {
     description = "Sound editor";
     homepage = http://ccrma.stanford.edu/software/snd;
-    inherit src;
+    platforms = stdenv.lib.platforms.linux;
   };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/snd/${name}.tar.gz";
+    sha256 = "04shk34pza507kvm40dc6sdz5jz533z4q2h7m9hgqvw1r3f57ms6";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  buildInputs = [
+    gtk2 alsaLib
+    fftw gsl
+  ];
 }
diff --git a/pkgs/applications/audio/snd/doc.patch b/pkgs/applications/audio/snd/doc.patch
deleted file mode 100644
index 4c40151e9881..000000000000
--- a/pkgs/applications/audio/snd/doc.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-diff --git a/index.scm b/index.scm
-index 2148a58..713939c 100644
---- a/index.scm
-+++ b/index.scm
-@@ -18,24 +18,7 @@ and if one is found, and the Snd documentation can be found, calls (html-program
- 	    (lambda (n)
- 	      ;; look for doc on current dir, then html dir, then global dir
- 	      ;; snd.html is what we'll search for
--	      (let ((dir (if (file-exists? "snd.html") 
--			     (getcwd)
--			     (if (and (string? (html-dir))
--				      (file-exists? (string-append (html-dir) "/snd.html")))
--				 (html-dir)
--				 (if (file-exists? "/usr/share/doc/snd-9/snd.html")
--				     "/usr/share/doc/snd-9"
--				     (if (file-exists? "/usr/local/share/doc/snd-9/snd.html")
--					 "/usr/local/share/doc/snd-9"
--					 (if (file-exists? "/usr/doc/snd-9/snd.html")
--					     "/usr/doc/snd-9"
--					     (if (file-exists? "/usr/share/doc/snd-8/snd.html")
--						 "/usr/share/doc/snd-8"
--						 (if (file-exists? "/usr/local/share/doc/snd-8/snd.html")
--						     "/usr/local/share/doc/snd-8"
--						     (if (file-exists? "/usr/doc/snd-8/snd.html")
--							 "/usr/doc/snd-8"
--							 #f))))))))))
-+	      (let (dir "HTML-DIR")
- 		(if dir
- 		    (if (or (string=? (html-program) "netscape")
- 			    (string=? (html-program) "mozilla")
-diff --git a/snd-help.c b/snd-help.c
-index a6557e0..a40a02e 100644
---- a/snd-help.c
-+++ b/snd-help.c
-@@ -3554,26 +3554,7 @@ static char *doc_files[DOC_DIRECTORIES] = {
-   
- static char *html_directory(void)
- {
--  int i;
--  if (mus_file_probe("snd.html"))
--    return(mus_getcwd());
--  if (html_dir(ss))
--    {
--      bool happy;
--      char *hd = NULL;
--      hd = (char *)CALLOC(snd_strlen(html_dir(ss)) + 16, sizeof(char));
--      sprintf(hd, html_dir(ss), "/snd.html");
--      happy = mus_file_probe(hd);
--      FREE(hd);
--      if (happy) return(copy_string(html_dir(ss)));
--    }
--#ifdef MUS_DEFAULT_DOC_DIR
--  if (mus_file_probe(MUS_DEFAULT_DOC_DIR "/snd.html"))
--    return(copy_string(MUS_DEFAULT_DOC_DIR "/snd.html"));
--#endif
--  for (i = 0; i < DOC_DIRECTORIES; i++)
--    if (mus_file_probe(doc_files[i])) return(copy_string(doc_directories[i]));
--  return(NULL);
-+  return (copy_string ("HTML-DIR"));
- }
- 
- 
diff --git a/pkgs/applications/audio/sonic-visualiser/default.nix b/pkgs/applications/audio/sonic-visualiser/default.nix
index aeb90c09455b..42c390620427 100644
--- a/pkgs/applications/audio/sonic-visualiser/default.nix
+++ b/pkgs/applications/audio/sonic-visualiser/default.nix
@@ -1,26 +1,29 @@
 # TODO add plugins having various licenses, see http://www.vamp-plugins.org/download.html
 
-{ stdenv, fetchurl, alsaLib, bzip2, fftw, jackaudio, libX11, liblo
+{ stdenv, fetchurl, alsaLib, bzip2, fftw, jack2, libX11, liblo
 , libmad, libogg, librdf, librdf_raptor, librdf_rasqal, libsamplerate
-, libsndfile, makeWrapper, pkgconfig, pulseaudio, qt4, redland
-, rubberband, vampSDK 
+, libsndfile, pkgconfig, pulseaudio, qt5, redland
+, rubberband, serd, sord, vampSDK
 }:
 
 stdenv.mkDerivation rec {
   name = "sonic-visualiser-${version}";
-  version = "1.9";
+  version = "2.3";
 
   src = fetchurl {
-    url = "http://code.soundsoftware.ac.uk/attachments/download/194/${name}.tar.gz";
-    sha256 = "00igf7j6s8xfyxnlkbqma0yby9pknxqzy8cmh0aw95ix80cw56fq";
+
+    url = "http://code.soundsoftware.ac.uk/attachments/download/918/${name}.tar.gz";
+    sha256 = "1f06w2rin4r2mbi00bg3nmqdi2xdy9vq4jcmfanxzj3ld66ik40c";
   };
 
   buildInputs =
-    [ libsndfile qt4 fftw /* should be fftw3f ??*/ bzip2 librdf rubberband
+    [ libsndfile qt5 fftw /* should be fftw3f ??*/ bzip2 librdf rubberband
       libsamplerate vampSDK alsaLib librdf_raptor librdf_rasqal redland
+      serd
+      sord
       pkgconfig
       # optional
-      jackaudio
+      jack2
       # portaudio
       pulseaudio
       libmad
@@ -28,11 +31,10 @@ stdenv.mkDerivation rec {
       # fishsound
       liblo
       libX11
-      makeWrapper
     ];
 
   buildPhase = ''
-    for i in sonic-visualiser svapp svcore svgui; 
+    for i in sonic-visualiser svapp svcore svgui;
       do cd $i && qmake -makefile PREFIX=$out && cd ..;
     done
     make
@@ -40,19 +42,15 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p $out/{bin,share/sonic-visualiser}
-    cp sonic-visualiser/sonic-visualiser $out/bin
-    cp -r sonic-visualiser/samples $out/share/sonic-visualiser/samples
-    wrapProgram $out/bin/sonic-visualiser --prefix LD_LIBRARY_PATH : ${libX11}/lib
+    cp sonic-visualiser $out/bin/
+    cp -r samples $out/share/sonic-visualiser/
   '';
 
-  meta = { 
+  meta = with stdenv.lib; {
     description = "View and analyse contents of music audio files";
     homepage = http://www.sonicvisualiser.org/;
-    license = "GPLv2";
-    maintainers = 
-      [ stdenv.lib.maintainers.marcweber 
-        stdenv.lib.maintainers.goibhniu 
-      ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu maintainers.marcweber ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix
index 615ee6a93cc9..59b82d155da9 100644
--- a/pkgs/applications/audio/spotify/default.nix
+++ b/pkgs/applications/audio/spotify/default.nix
@@ -1,24 +1,64 @@
 { fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl, freetype
 , glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf
-, libgcrypt, chromium, sqlite, gst_plugins_base, gstreamer, udev }:
+, libgcrypt, chromium, sqlite, gst_plugins_base, gstreamer, udev, fontconfig
+, dbus, expat }:
 
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
 
 let
-  version = "0.9.4.183";
+  version = if stdenv.system == "i686-linux"
+    then "0.9.4.183.g644e24e.428"
+    else "0.9.11.27.g2b1a638.81";
+
   qt4webkit =
     if stdenv.system == "i686-linux" then
       fetchurl {
-        name = "libqtwebkit4_2.2_i386.deb";
-        url = http://mirrors.us.kernel.org/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.2~2011week36-0ubuntu1_i386.deb;
-        sha256 = "0hi6cwx2b2cwa4nv5phqqw526lc8p9x7kjkcza9x47ny3npw2924";
+        name = "libqtwebkit4_2.3.2_i386.deb";
+        url = http://ie.archive.ubuntu.com/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.3.2-0ubuntu7_i386.deb;
+        sha256 = "0q4abhczx91ma57fjss0gn8j6nkfbfsbsh6kxhykzj88dih2s8rn";
       }
     else
       fetchurl {
-        name = "libqtwebkit4_2.2_amd64.deb";
-        url = http://ie.archive.ubuntu.com/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.2~2011week36-0ubuntu1_amd64.deb;
-        sha256 = "0bvy6qz9y19ck391z8c049v07y4vdyvgykpxi7x1nvn078p1imiw";
+        name = "libqtwebkit4_2.3.2_amd64.deb";
+        url = http://ie.archive.ubuntu.com/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.3.2-0ubuntu7_amd64.deb;
+        sha256 = "0sac88avfivwkfhmd6fik7ili8fdznqas6741dbspf9mfnawbwch";
       };
+
+  deps = [
+    alsaLib
+    atk
+    cairo
+    cups
+    dbus
+    expat
+    fontconfig
+    freetype
+    GConf
+    gdk_pixbuf
+    glib
+    gst_plugins_base
+    gstreamer
+    gtk
+    libgcrypt
+    libpng
+    nss
+    pango
+    qt4
+    sqlite
+    stdenv.gcc.gcc
+    xlibs.libX11
+    xlibs.libXcomposite
+    xlibs.libXdamage
+    xlibs.libXext
+    xlibs.libXfixes
+    xlibs.libXi
+    xlibs.libXrandr
+    xlibs.libXrender
+    xlibs.libXrender
+    xlibs.libXScrnSaver
+    #xlibs.libXss
+  ];
+
 in
 
 stdenv.mkDerivation {
@@ -27,13 +67,13 @@ stdenv.mkDerivation {
   src =
     if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g644e24e.428-1_i386.deb";
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}-1_i386.deb";
         sha256 = "1wl6v5x8vm74h5lxp8fhvmih8l122aadsf1qxvpk0k3y6mbx0ifa";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
-        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g644e24e.428-1_amd64.deb";
-        sha256 = "1yniln6iswrrrny01qr2w5zcvam0vnrvy9mwbnk9i14i2ch0f3fx";
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}-1_amd64.deb";
+        sha256 = "0yfljiw01kssj3qaz8m0ppgrpjs6xrhzlr2wccp64bsnmin7g4sg";
       }
     else throw "Spotify not supported on this platform.";
 
@@ -51,34 +91,51 @@ stdenv.mkDerivation {
       # Work around Spotify referring to a specific minor version of
       # OpenSSL.
       mkdir $out/lib
-      ln -s ${openssl}/lib/libssl.so $out/lib/libssl.so.0.9.8
-      ln -s ${openssl}/lib/libcrypto.so $out/lib/libcrypto.so.0.9.8
+
       ln -s ${nss}/lib/libnss3.so $out/lib/libnss3.so.1d
       ln -s ${nss}/lib/libnssutil3.so $out/lib/libnssutil3.so.1d
       ln -s ${nss}/lib/libsmime3.so $out/lib/libsmime3.so.1d
+
+      ${if stdenv.system == "x86_64-linux" then ''
+      ln -s ${openssl}/lib/libssl.so $out/lib/libssl.so.1.0.0
+      ln -s ${openssl}/lib/libcrypto.so $out/lib/libcrypto.so.1.0.0
+      ln -s ${nspr}/lib/libnspr4.so $out/lib/libnspr4.so
+      ln -s ${nspr}/lib/libplc4.so $out/lib/libplc4.so
+      '' else ''
+      ln -s ${openssl}/lib/libssl.so $out/lib/libssl.so.0.9.8
+      ln -s ${openssl}/lib/libcrypto.so $out/lib/libcrypto.so.0.9.8
       ln -s ${nspr}/lib/libnspr4.so $out/lib/libnspr4.so.0d
       ln -s ${nspr}/lib/libplc4.so $out/lib/libplc4.so.0d
+      ''}
 
       # Work around Spotify trying to open libudev.so.0 (which we don't have)
       ln -s ${udev}/lib/libudev.so.1 $out/lib/libudev.so.0
 
       mkdir -p $out/bin
 
+      rpath="$out/spotify-client/Data:$out/lib:$out/spotify-client:${stdenv.gcc.gcc}/lib64"
+
       ln -s $out/spotify-client/spotify $out/bin/spotify
+
+      patchelf \
+        --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+        --set-rpath $rpath $out/spotify-client/spotify
+
       patchelf \
         --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
-        --set-rpath $out/spotify-client/Data:$out/lib:$out/spotify-client:${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib stdenv.gcc.gcc freetype glib pango cairo atk gdk_pixbuf gtk GConf cups sqlite]}:${stdenv.gcc.gcc}/lib64 \
-        $out/spotify-client/spotify
+        --set-rpath $rpath $out/spotify-client/Data/SpotifyHelper
 
       dpkg-deb -x ${qt4webkit} ./
       mkdir -p $out/lib/
       cp -v usr/lib/*/* $out/lib/
 
       preload=$out/libexec/spotify/libpreload.so
+      librarypath="${stdenv.lib.makeLibraryPath deps}:$out/lib"
       mkdir -p $out/libexec/spotify
       gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC
 
-      wrapProgram $out/bin/spotify --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ GConf libpng cups libgcrypt sqlite gst_plugins_base gstreamer]}:$out/lib"
+      wrapProgram $out/bin/spotify --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "$librarypath"
+      wrapProgram $out/spotify-client/Data/SpotifyHelper --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "$librarypath"
 
       # Desktop file
       mkdir -p "$out/share/applications/"
@@ -92,7 +149,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = https://www.spotify.com/;
     description = "Spotify for Linux allows you to play music from the Spotify music service";
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/applications/audio/streamripper/default.nix b/pkgs/applications/audio/streamripper/default.nix
new file mode 100644
index 000000000000..2df1e1e3b3b5
--- /dev/null
+++ b/pkgs/applications/audio/streamripper/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl , glib, pkgconfig, libogg, libvorbis }:
+
+stdenv.mkDerivation rec {
+  name = "streamripper-${version}";
+  version = "1.64.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/streamripper/${name}.tar.gz";
+    sha256 = "0hnyv3206r0rfprn3k7k6a0j959kagsfyrmyjm3gsf3vkhp5zmy1";
+  };
+
+  buildInputs = [ pkgconfig glib libogg libvorbis ];
+
+  meta = with stdenv.lib; {
+    homepage = http://streamripper.sourceforge.net/;
+    description = "Application that lets you record streaming mp3 to your hard drive";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ the-kenny ];
+  };
+}
diff --git a/pkgs/applications/audio/synthv1/default.nix b/pkgs/applications/audio/synthv1/default.nix
index aadce32dda41..c6c464b9ad70 100644
--- a/pkgs/applications/audio/synthv1/default.nix
+++ b/pkgs/applications/audio/synthv1/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, qt4, jackaudio, lv2 }:
+{ stdenv, fetchurl, qt4, jack2, lv2 }:
 
 stdenv.mkDerivation rec {
   name = "synthv1-${version}";
-  version = "0.3.2";
+  version = "0.5.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/synthv1/${name}.tar.gz";
-    sha256 = "1230yf49qfw540yvp5n7sh6mf3k8590pzwc5mragd3nd6k6apgw9";
+    sha256 = "011kjccrdwb62rpck5gb8h4kvvm8rk6n77lj78ykxz4pxip5hf14";
   };
 
-  buildInputs = [ qt4 jackaudio lv2 ];
+  buildInputs = [ qt4 jack2 lv2 ];
 
   meta = with stdenv.lib; {
     description = "An old-school 4-oscillator subtractive polyphonic synthesizer with stereo fx";
diff --git a/pkgs/applications/audio/transcode/default.nix b/pkgs/applications/audio/transcode/default.nix
new file mode 100644
index 000000000000..c414992a12dd
--- /dev/null
+++ b/pkgs/applications/audio/transcode/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, flac, lame, zlib, libjpeg, libvorbis, libtheora, libxml2
+, lzo, libdvdread, pkgconfig, x264, libmpeg2, xvidcore }:
+
+stdenv.mkDerivation rec {
+  name = "transcode-1.1.7";
+  src = fetchurl {
+    url = "https://bitbucket.org/france/transcode-tcforge/downloads/${name}.tar.bz2";
+    sha256 = "1e4e72d8e0dd62a80b8dd90699f5ca64c9b0cb37a5c9325c184166a9654f0a92";
+  };
+
+  buildInputs = [ flac lame zlib libjpeg libvorbis libtheora libxml2 lzo
+                  libdvdread pkgconfig x264 libmpeg2 xvidcore ];
+  configureFlags = "--disable-ffmpeg --disable-libavcodec --disable-libavformat
+    --enable-lzo --enable-ogg --enable-vorbis --enable-theora --enable-libxml2
+    --enable-x264 --enable-libmpeg2 --enable-xvid";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Suite of command line utilities for transcoding video and audio codecs, and for converting beween different container formats";
+    homepage = http://www.transcoding.org/;
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/vimpc/default.nix b/pkgs/applications/audio/vimpc/default.nix
new file mode 100755
index 000000000000..3e365cae8e94
--- /dev/null
+++ b/pkgs/applications/audio/vimpc/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, autoconf, automake, mpd_clientlib, ncurses, pcre, pkgconfig, taglib }:
+
+stdenv.mkDerivation rec {
+  version = "0.09.0";
+  name = "vimpc-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/boysetsfrog/vimpc/archive/v${version}.tar.gz";
+    sha256 = "13eb229a5e9eee491765ee89f7fe6a38140a41a01434b117da3869d725c15706";
+  };
+
+  buildInputs = [ autoconf
+                  automake
+                  mpd_clientlib
+                  ncurses
+                  pcre
+                  pkgconfig
+                  taglib
+                ];
+
+  preConfigure = "./autogen.sh";
+
+  postInstall = ''
+    mkdir -p $out/etc
+    cp doc/vimpcrc.example $out/etc
+  '';
+
+  meta = {
+    description = "A vi/vim inspired client for the Music Player Daemon (mpd).";
+    homepage = https://github.com/boysetsfrog/vimpc;
+    license = "GPL3";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/vmpk/default.nix b/pkgs/applications/audio/vmpk/default.nix
new file mode 100644
index 000000000000..9a75fa5f3831
--- /dev/null
+++ b/pkgs/applications/audio/vmpk/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, cmake, pkgconfig
+, qt4, jack2
+}:
+
+let
+  version = "0.5.1";
+in stdenv.mkDerivation rec {
+  name = "vmpk-${version}";
+
+  meta = with stdenv.lib; {
+    description = "Virtual MIDI Piano Keyboard";
+    homepage    = "http://vmpk.sourceforge.net/";
+    license     = licenses.gpl3Plus;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ iyzsong ];
+  };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/vmpk/${version}/${name}.tar.bz2";
+    sha256 = "11fqnxgs9hr9255d93n7lazxzjwn8jpmn23nywdksh0pb1ffvfrc";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  buildInputs = [ qt4 jack2 ];
+}
diff --git a/pkgs/applications/audio/vorbis-tools/default.nix b/pkgs/applications/audio/vorbis-tools/default.nix
index 5db7cc30cf8c..e4e5b7ff81a3 100644
--- a/pkgs/applications/audio/vorbis-tools/default.nix
+++ b/pkgs/applications/audio/vorbis-tools/default.nix
@@ -16,6 +16,6 @@ stdenv.mkDerivation {
       files, notably the `ogg123' player and the `oggenc' encoder.
     '';
     homepage = http://xiph.org/vorbis/;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/audio/xmp/default.nix b/pkgs/applications/audio/xmp/default.nix
new file mode 100644
index 000000000000..7f21d389cf5f
--- /dev/null
+++ b/pkgs/applications/audio/xmp/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, pkgconfig, alsaLib, libxmp }:
+
+stdenv.mkDerivation rec {
+  name = "xmp-4.0.7";
+
+  meta = with stdenv.lib; {
+    description = "Extended module player";
+    homepage    = "http://xmp.sourceforge.net/";
+    license     = licenses.gpl2Plus;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ iyzsong ];
+  };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xmp/xmp/${name}.tar.gz";
+    sha256 = "0qgzzaxhshz5l7s21x89xb43pbbi0zap6a4lk4s7gjp1qca2agcw";
+  };
+
+  buildInputs = [ pkgconfig alsaLib libxmp ];
+}
diff --git a/pkgs/applications/audio/xsynth-dssi/default.nix b/pkgs/applications/audio/xsynth-dssi/default.nix
index 0cfbfb4c9bd1..85e7235400b2 100644
--- a/pkgs/applications/audio/xsynth-dssi/default.nix
+++ b/pkgs/applications/audio/xsynth-dssi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, autoconf, automake, dssi, gtk, jackaudio,
+{ stdenv, fetchurl, alsaLib, autoconf, automake, dssi, gtk, jack2,
 ladspaH, ladspaPlugins, liblo, pkgconfig }:
 
 stdenv.mkDerivation  rec {
@@ -10,7 +10,7 @@ stdenv.mkDerivation  rec {
     sha256 = "00nwv2pqjbmxqdc6xdm0cljq6z05lv4y6bibmhz1kih9lm0lklnk";
   };
 
-  buildInputs = [ alsaLib autoconf automake dssi gtk jackaudio ladspaH
+  buildInputs = [ alsaLib autoconf automake dssi gtk jack2 ladspaH
     ladspaPlugins liblo pkgconfig ];
 
   installPhase = ''
diff --git a/pkgs/applications/audio/yoshimi/default.nix b/pkgs/applications/audio/yoshimi/default.nix
index bce7e0ef5ee0..91142691055b 100644
--- a/pkgs/applications/audio/yoshimi/default.nix
+++ b/pkgs/applications/audio/yoshimi/default.nix
@@ -1,19 +1,23 @@
-{ stdenv, fetchurl, alsaLib, boost, cmake, fftwSinglePrec, fltk
-, jackaudio, libsndfile, mesa, minixml, pkgconfig, zlib }:
+{ stdenv, fetchurl, alsaLib, boost, cairo, cmake, fftwSinglePrec, fltk
+, jack2, libsndfile, mesa, minixml, pkgconfig, zlib
+}:
 
 assert stdenv ? glibc;
 
 stdenv.mkDerivation  rec {
   name = "yoshimi-${version}";
-  version = "0.060.12";
+  version = "1.2.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/yoshimi/${name}.tar.bz2";
-    sha256 = "14javywkw6af9z9c7jr06rzdgzncyaz2ab6f0v0k6bgdndlcgslc";
+    sha256 = "1w23ral1qrbg9gqx833giqmchx7952f18yaa52aya9shsdlla83c";
   };
 
-  buildInputs = [ alsaLib boost fftwSinglePrec fltk jackaudio libsndfile mesa
-    minixml zlib ];
+  buildInputs = [
+    alsaLib boost cairo fftwSinglePrec fltk jack2 libsndfile mesa
+    minixml zlib
+  ];
+
   nativeBuildInputs = [ cmake pkgconfig ];
 
   preConfigure = "cd src";
diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix
index fcec85b7fe57..a5aa7d5c8d95 100644
--- a/pkgs/applications/audio/zynaddsubfx/default.nix
+++ b/pkgs/applications/audio/zynaddsubfx/default.nix
@@ -1,28 +1,21 @@
-{ stdenv, fetchurl, alsaLib, cmake, fftw, fltk13, minixml, pkgconfig, zlib }:
+{ stdenv, fetchurl, alsaLib, cmake, jack2, fftw, fltk13, minixml
+, pkgconfig, zlib
+}:
 
 stdenv.mkDerivation  rec {
   name = "zynaddsubfx-${version}";
-  version = "2.4.1";
+  version = "2.4.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/zynaddsubfx/ZynAddSubFX-${version}.tar.bz2";
-    sha256 = "1zn5lgh76rrbfj8d4jys2gc1j2pqrbdd18ywfdrk0s7jq4inwyfg";
+    sha256 = "0kgmwyh4rhyqdfrdzhbzjjk2hzggkp9c4aac6sy3xv6cc1b5jjxq";
   };
 
-  buildInputs = [ alsaLib fftw fltk13 minixml zlib ];
+  buildInputs = [ alsaLib jack2 fftw fltk13 minixml zlib ];
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  patches = [
-    (fetchurl {
-      url = http://patch-tracker.debian.org/patch/series/dl/zynaddsubfx/2.4.0-1.2/09_fluid_1.3.patch;
-      sha256 = "06wl7fs44b24ls1fzh21596n6zzc3ywm2bcdfrkfiiwpzin3yjq6";
-    })
-  ];
-
-#installPhase = "mkdir -pv $out/bin; cp -v zynaddsubfx $out/bin";
-
   meta = with stdenv.lib; {
-    description = "high quality software synthesizer";
+    description = "High quality software synthesizer";
     homepage = http://zynaddsubfx.sourceforge.net;
     license = licenses.gpl2;
     platforms = platforms.linux;
diff --git a/pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix b/pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix
index 0b8863752d2a..69f1eef9cecb 100644
--- a/pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix
+++ b/pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix
@@ -10,18 +10,24 @@
 
 let
   ver_branch = "1.6";
-  version = "1.5.1"; # 1.5.2 and 1.6.0 result into infinite cycling of X in restarts
+  version = "1.6.1";
 in
 stdenv.mkDerivation rec {
   name = "lightdm-gtk-greeter-${version}";
 
   src = fetchurl {
     url = "${meta.homepage}/${ver_branch}/${version}/+download/${name}.tar.gz";
-    sha256 = "08fnsbnay5jhd7ps8n91i6c227zq6xizpyn34qhqzykrga8pxkpc";
+    sha256 = "1nb8ljrbrp1zga083g3b633xi3izxxm4jipw1qgial1x16mqc0hz";
   };
 
-  patches = [ ./lightdm-gtk-greeter.patch ];
-  patchFlags = "-p0";
+  patches = [
+    ./lightdm-gtk-greeter.patch
+    (fetchurl { # CVE-2014-0979, https://bugs.launchpad.net/lightdm-gtk-greeter/+bug/1266449
+      url = "https://launchpadlibrarian.net/161796033/07_fix-NULL-username.patch";
+      sha256 = "1sqkhsz1z10k6vlmlrqrfx452lznv30885fmnzc73p2zxdlw9q1a";
+    })
+  ];
+  patchFlags = "-p1";
 
   buildInputs = [ pkgconfig lightdm intltool ]
     ++ (if useGTK2 then [ gtk2 makeWrapper ] else [ gtk3 ]);
@@ -39,5 +45,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://launchpad.net/lightdm-gtk-greeter;
     platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.ocharles ];
   };
 }
diff --git a/pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch b/pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch
index 5ae5603b4dd6..ea9e0eaec936 100644
--- a/pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch
+++ b/pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch
@@ -1,13 +1,13 @@
-=== modified file 'src/lightdm-gtk-greeter.c'
---- src/lightdm-gtk-greeter.c	2013-02-09 23:20:39 +0000
-+++ src/lightdm-gtk-greeter.c	2013-03-29 12:21:34 +0000
-@@ -1273,7 +1273,7 @@
-     gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (session_combo), renderer, TRUE);
-     gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (session_combo), renderer, "text", 0);
-     model = gtk_combo_box_get_model (session_combo);
+diff --git a/src/lightdm-gtk-greeter.c b/src/lightdm-gtk-greeter.c
+index cc5f9e1..d615dc1 100644
+--- a/src/lightdm-gtk-greeter.c
++++ b/src/lightdm-gtk-greeter.c
+@@ -1716,7 +1716,7 @@ main (int argc, char **argv)
+     gtk_container_add (GTK_CONTAINER (menuitem), image);
+     gtk_widget_show (GTK_WIDGET (menuitem));
+     
 -    items = lightdm_get_sessions ();
 +    items = lightdm_get_sessions (greeter);
+     GSList *sessions = NULL;
      for (item = items; item; item = item->next)
      {
-         LightDMSession *session = item->data;
-
diff --git a/pkgs/applications/display-managers/lightdm/default.nix b/pkgs/applications/display-managers/lightdm/default.nix
index 598c42199bec..d4c6f24d69a3 100644
--- a/pkgs/applications/display-managers/lightdm/default.nix
+++ b/pkgs/applications/display-managers/lightdm/default.nix
@@ -3,18 +3,18 @@
 
 let
   ver_branch = "1.8";
-  version = "1.7.0";
+  version = "1.8.6";
 in
 stdenv.mkDerivation rec {
   name = "lightdm-${version}";
 
   src = fetchurl {
     url = "${meta.homepage}/${ver_branch}/${version}/+download/${name}.tar.xz";
-    sha256 = "0nwwjgc9xvwili6714ag88wsrf0lr5hv1i6z9f0xvin4ym18cbs5";
+    sha256 = "17ivc0c4dbnc0fzd581j53cn6hdav34zz2hswjzy8aczbpk605qi";
   };
 
   patches = [ ./lightdm.patch ];
-  patchFlags = "-p0";
+  patchFlags = "-p1";
 
   buildInputs = [
     pkgconfig pam libxcb glib libXdmcp itstool libxml2 intltool libxklavier libgcrypt
@@ -27,5 +27,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://launchpad.net/lightdm;
     platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.ocharles ];
   };
 }
diff --git a/pkgs/applications/display-managers/lightdm/lightdm.patch b/pkgs/applications/display-managers/lightdm/lightdm.patch
index a6e53bafcc79..d81e0aae56d5 100644
--- a/pkgs/applications/display-managers/lightdm/lightdm.patch
+++ b/pkgs/applications/display-managers/lightdm/lightdm.patch
@@ -1,7 +1,8 @@
-=== modified file 'liblightdm-gobject/greeter.c'
---- liblightdm-gobject/greeter.c	2013-01-31 20:56:09 +0000
-+++ liblightdm-gobject/greeter.c	2013-03-29 14:15:58 +0000
-@@ -567,6 +567,21 @@
+diff --git a/liblightdm-gobject/greeter.c b/liblightdm-gobject/greeter.c
+index 9387118..635cea0 100644
+--- a/liblightdm-gobject/greeter.c
++++ b/liblightdm-gobject/greeter.c
+@@ -567,6 +567,21 @@ lightdm_greeter_get_default_session_hint (LightDMGreeter *greeter)
  }
  
  /**
@@ -23,11 +24,11 @@
   * lightdm_greeter_get_hide_users_hint:
   * @greeter: A #LightDMGreeter
   *
-
-=== modified file 'liblightdm-gobject/lightdm/greeter.h'
---- liblightdm-gobject/lightdm/greeter.h	2013-01-31 20:56:09 +0000
-+++ liblightdm-gobject/lightdm/greeter.h	2013-03-29 11:56:11 +0000
-@@ -93,6 +93,8 @@
+diff --git a/liblightdm-gobject/lightdm/greeter.h b/liblightdm-gobject/lightdm/greeter.h
+index 7d8988f..2b54909 100644
+--- a/liblightdm-gobject/lightdm/greeter.h
++++ b/liblightdm-gobject/lightdm/greeter.h
+@@ -93,6 +93,8 @@ gboolean lightdm_greeter_get_select_guest_hint (LightDMGreeter *greeter);
  
  const gchar *lightdm_greeter_get_autologin_user_hint (LightDMGreeter *greeter);
  
@@ -36,19 +37,19 @@
  gboolean lightdm_greeter_get_autologin_guest_hint (LightDMGreeter *greeter);
  
  gint lightdm_greeter_get_autologin_timeout_hint (LightDMGreeter *greeter);
-
-=== modified file 'liblightdm-gobject/lightdm/session.h'
---- liblightdm-gobject/lightdm/session.h	2013-01-31 20:56:09 +0000
-+++ liblightdm-gobject/lightdm/session.h	2013-03-29 11:59:16 +0000
+diff --git a/liblightdm-gobject/lightdm/session.h b/liblightdm-gobject/lightdm/session.h
+index 13ddcd9..cdb2fd6 100644
+--- a/liblightdm-gobject/lightdm/session.h
++++ b/liblightdm-gobject/lightdm/session.h
 @@ -12,6 +12,7 @@
- #define _LIGHTDM_SESSION_H_
+ #define LIGHTDM_SESSION_H_
  
  #include <glib-object.h>
 +#include "greeter.h"
  
  G_BEGIN_DECLS
  
-@@ -42,9 +43,9 @@
+@@ -42,9 +43,9 @@ typedef struct
  
  GType lightdm_session_get_type (void);
  
@@ -60,10 +61,10 @@
  
  const gchar *lightdm_session_get_key (LightDMSession *session);
  
-
-=== modified file 'liblightdm-gobject/session.c'
---- liblightdm-gobject/session.c	2013-01-31 20:56:09 +0000
-+++ liblightdm-gobject/session.c	2013-03-29 14:16:48 +0000
+diff --git a/liblightdm-gobject/session.c b/liblightdm-gobject/session.c
+index 949778f..db5e18a 100644
+--- a/liblightdm-gobject/session.c
++++ b/liblightdm-gobject/session.c
 @@ -11,6 +11,7 @@
  #include <string.h>
  #include <gio/gdesktopappinfo.h>
@@ -72,7 +73,7 @@
  #include "lightdm/session.h"
  
  enum {
-@@ -167,7 +168,7 @@
+@@ -189,7 +190,7 @@ load_sessions (const gchar *sessions_dir)
  }
  
  static void
@@ -81,18 +82,17 @@
  {
      GKeyFile *config_key_file = NULL;
      gchar *config_path = NULL;
-@@ -183,8 +184,8 @@
+@@ -205,8 +206,7 @@ update_sessions (void)
      remote_sessions_dir = g_strdup (REMOTE_SESSIONS_DIR);
  
      /* Use session directory from configuration */
 -    /* FIXME: This should be sent in the greeter connection */
 -    config_path = g_build_filename (CONFIG_DIR, "lightdm.conf", NULL);
 +    config_path = g_strdup (lightdm_greeter_get_config_path (greeter));
-+
      config_key_file = g_key_file_new ();
      result = g_key_file_load_from_file (config_key_file, config_path, G_KEY_FILE_NONE, &error);
-     if (error)
-@@ -228,9 +229,9 @@
+     if (error && !g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
+@@ -250,9 +250,9 @@ update_sessions (void)
   * Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
   **/
  GList *
@@ -104,7 +104,7 @@
      return local_sessions;
  }
  
-@@ -242,9 +243,9 @@
+@@ -264,9 +264,9 @@ lightdm_get_sessions (void)
   * Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
   **/
  GList *
@@ -116,78 +116,29 @@
      return remote_sessions;
  }
  
-
-=== modified file 'src/display.c'
---- src/display.c	2013-03-26 22:22:49 +0000
-+++ src/display.c	2013-03-29 12:12:43 +0000
-@@ -62,6 +62,9 @@
-     /* Program to run sessions through */
-     gchar *session_wrapper;
- 
-+    /* Path to the configuration file that lightdm is running under */
-+    gchar *config_path;
+diff --git a/src/lightdm.c b/src/lightdm.c
+index 7d35034..910164c 100644
+--- a/src/lightdm.c
++++ b/src/lightdm.c
+@@ -1142,6 +1142,9 @@ main (int argc, char **argv)
+         }
+     }
+     g_clear_error (&error);
 +
-     /* TRUE if in a user session */
-     gboolean in_user_session;
- 
-@@ -213,6 +216,14 @@
- }
- 
- void
-+display_set_config_path (Display *display, const gchar *config_path)
-+{
-+    g_return_if_fail (display != NULL);
-+    g_free (display->priv->config_path);
-+    display->priv->config_path = g_strdup (config_path);
-+}
-+
-+void
- display_set_show_remote_login_hint (Display *display, gboolean show_remote_login)
- {
-     g_return_if_fail (display != NULL);
-@@ -436,6 +447,7 @@
-     greeter_set_hint (display->priv->greeter, "show-remote-login", display->priv->greeter_show_remote_login ? "true" : "false");
-     if (display->priv->greeter_is_lock)
-         greeter_set_hint (display->priv->greeter, "lock-screen", "true");
-+    greeter_set_hint (display->priv->greeter, "config-path", display->priv->config_path);
- 
-     /* Run greeter as unprivileged user */
-     if (getuid () != 0)
-
-=== modified file 'src/display.h'
---- src/display.h	2013-03-26 22:22:49 +0000
-+++ src/display.h	2013-03-29 12:12:37 +0000
-@@ -80,6 +80,8 @@
- 
- void display_set_user_session (Display *display, SessionType type, const gchar *session_name);
- 
-+void display_set_config_path (Display *display, const gchar *config_path);
++    config_set_string (config_get_instance (), "SeatDefaults", "config-path", config_path);
 +
- gboolean display_start (Display *display);
- 
- gboolean display_get_is_ready (Display *display);
-
-=== modified file 'src/lightdm.c'
---- src/lightdm.c	2013-03-07 21:40:31 +0000
-+++ src/lightdm.c	2013-03-29 11:48:45 +0000
-@@ -1050,6 +1050,7 @@
-     g_debug ("Starting Light Display Manager %s, UID=%i PID=%i", VERSION, getuid (), getpid ());
- 
-     g_debug ("Loaded configuration from %s", config_path);
-+    config_set_string (config_get_instance (), "LightDM", "config-path", config_path);
      g_free (config_path);
  
-     g_debug ("Using D-Bus name %s", LIGHTDM_BUS_NAME);
-
-=== modified file 'src/seat.c'
---- src/seat.c	2013-03-26 22:22:49 +0000
-+++ src/seat.c	2013-03-29 12:13:00 +0000
-@@ -536,6 +536,7 @@
-     if (!session_name)
-         session_name = seat_get_string_property (seat, "user-session");
-     display_set_user_session (display, SESSION_TYPE_LOCAL, session_name);
-+    display_set_config_path (display, config_get_string (config_get_instance (), "LightDM", "config-path"));
- 
-     seat->priv->displays = g_list_append (seat->priv->displays, display);
-     g_signal_emit (seat, signals[DISPLAY_ADDED], 0, display);
-
+     /* Set default values */
+diff --git a/src/seat.c b/src/seat.c
+index e2b9c2c..a950ea2 100644
+--- a/src/seat.c
++++ b/src/seat.c
+@@ -1137,6 +1137,7 @@ create_greeter_session (Seat *seat)
+     greeter_set_hint (greeter_session, "show-manual-login", seat_get_boolean_property (seat, "greeter-show-manual-login") ? "true" : "false");
+     greeter_set_hint (greeter_session, "show-remote-login", seat_get_boolean_property (seat, "greeter-show-remote-login") ? "true" : "false");
+     greeter_set_hint (greeter_session, "has-guest-account", seat_get_allow_guest (seat) && seat_get_boolean_property (seat, "greeter-allow-guest") ? "true" : "false");
++    greeter_set_hint (greeter_session, "config-path", seat_get_string_property (seat, "config-path"));
+ 
+     g_object_unref (session_config);
+ 
diff --git a/pkgs/applications/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix
index 0b5bcccfb21a..42d2c777aea2 100644
--- a/pkgs/applications/display-managers/slim/default.nix
+++ b/pkgs/applications/display-managers/slim/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, pkgconfig, xorg, libjpeg, libpng
-, fontconfig, freetype, pam, dbus_libs }:
+, fontconfig, freetype, pam, dbus_libs, makeWrapper, pkgs }:
 
 stdenv.mkDerivation rec {
   name = "slim-1.3.6";
 
   src = fetchurl {
-    url = "http://download.berlios.de/slim/${name}.tar.gz";
+    url = "mirror://sourceforge/slim.berlios/${name}.tar.gz";
     sha256 = "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1";
   };
 
@@ -20,22 +20,24 @@ stdenv.mkDerivation rec {
       ./run-once.patch
     ];
 
-  preConfigure = "substituteInPlace CMakeLists.txt --replace /etc $out/etc --replace /lib $out/lib";
+  preConfigure = "substituteInPlace CMakeLists.txt --replace /lib $out/lib";
 
   cmakeFlags = [ "-DUSE_PAM=1" ];
 
+  NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype";
+
   enableParallelBuilding = true;
 
   buildInputs =
     [ cmake pkgconfig libjpeg libpng fontconfig freetype
       pam dbus_libs
-      xorg.libX11 xorg.libXext xorg.libXrandr xorg.libXrender xorg.libXmu xorg.libXft
+      xorg.libX11 xorg.libXext xorg.libXrandr xorg.libXrender xorg.libXmu xorg.libXft makeWrapper
     ];
 
   NIX_CFLAGS_LINK = "-lXmu";
 
   meta = {
-    homepage = http://slim.berlios.de;
+    homepage = http://sourceforge.net/projects/slim.berlios/; # berlios shut down; I found no replacement yet
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/display-managers/slim/runtime-paths.patch b/pkgs/applications/display-managers/slim/runtime-paths.patch
index f6811dbe6682..5a8e07bfbf07 100644
--- a/pkgs/applications/display-managers/slim/runtime-paths.patch
+++ b/pkgs/applications/display-managers/slim/runtime-paths.patch
@@ -1,6 +1,6 @@
-diff -ru -x '*~' slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
+diff -ru slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
 --- slim-1.3.6-orig/app.cpp	2013-10-02 00:38:05.000000000 +0200
-+++ slim-1.3.6/app.cpp	2013-10-15 11:02:55.629263422 +0200
++++ slim-1.3.6/app.cpp	2014-03-30 19:01:04.115414201 +0200
 @@ -200,7 +200,9 @@
  
  	/* Read configuration and theme */
@@ -23,3 +23,48 @@ diff -ru -x '*~' slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
  		themeName = cfg->getOption("current_theme");
  		string::size_type pos;
  		if ((pos = themeName.find(",")) != string::npos) {
+diff -ru slim-1.3.6-orig/CMakeLists.txt slim-1.3.6/CMakeLists.txt
+--- slim-1.3.6-orig/CMakeLists.txt	2013-10-02 00:38:05.000000000 +0200
++++ slim-1.3.6/CMakeLists.txt	2014-03-30 19:16:48.445069729 +0200
+@@ -23,7 +23,7 @@
+ 
+ set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
+ set(PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/slim")
+-set(SYSCONFDIR "/etc")
++set(SYSCONFDIR "$ENV{out}/etc")
+ set(LIBDIR "/lib")
+ set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
+ 
+@@ -40,7 +40,7 @@
+ set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DPACKAGE=\"slim\"")
+ set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DVERSION=\"${SLIM_VERSION}\"")
+ set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DPKGDATADIR=\"${PKGDATADIR}\"")
+-set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DSYSCONFDIR=\"${SYSCONFDIR}\"")
++set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DSYSCONFDIR=\"/etc\"")
+ 
+ # Flags
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O2")
+Only in slim-1.3.6: CMakeLists.txt~
+diff -ru slim-1.3.6-orig/slimlock.cpp slim-1.3.6/slimlock.cpp
+--- slim-1.3.6-orig/slimlock.cpp	2013-10-02 00:38:05.000000000 +0200
++++ slim-1.3.6/slimlock.cpp	2014-03-30 19:01:04.115414201 +0200
+@@ -106,13 +106,17 @@
+ 	unsigned int cfg_passwd_timeout;
+ 	// Read user's current theme
+ 	cfg = new Cfg;
+-	cfg->readConf(CFGFILE);
++	char *cfgfile = getenv("SLIM_CFGFILE");
++	if (!cfgfile) cfgfile = CFGFILE;
++	cfg->readConf(cfgfile);
+ 	cfg->readConf(SLIMLOCKCFG);
+ 	string themebase = "";
+ 	string themefile = "";
+ 	string themedir = "";
+ 	themeName = "";
+-	themebase = string(THEMESDIR) + "/";
++	char *themesdir = getenv("SLIM_THEMESDIR");
++	if (!themesdir) themesdir = THEMESDIR;
++	themebase = string(themesdir) + "/";
+ 	themeName = cfg->getOption("current_theme");
+ 	string::size_type pos;
+ 	if ((pos = themeName.find(",")) != string::npos) {
diff --git a/pkgs/applications/editors/atom/default.nix b/pkgs/applications/editors/atom/default.nix
new file mode 100644
index 000000000000..51844f641794
--- /dev/null
+++ b/pkgs/applications/editors/atom/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchurl, buildEnv, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
+, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
+, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xlibs
+}:
+
+let
+  atomEnv = buildEnv {
+    name = "env-atom";
+    paths = [
+      stdenv.gcc.gcc zlib glib dbus gtk atk pango freetype libgnome_keyring3
+      fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
+      xlibs.libXrender xlibs.libX11 xlibs.libXext xlibs.libXdamage xlibs.libXtst
+      xlibs.libXcomposite xlibs.libXi xlibs.libXfixes
+    ];
+  };
+in stdenv.mkDerivation rec {
+  name = "atom-${version}";
+  version = "0.99.0";
+
+  src = fetchurl {
+      url = https://github.com/hotice/webupd8/raw/master/atom-linux64-0.99.0~git20140525.tar.xz;
+      sha256 = "55c2415c96e1182ae1517751cbea1db64e9962683b384cfe5e182aec10aebecd";
+      name = "${name}.tar.xz";
+  };
+
+  iconsrc = fetchurl {
+    url = https://raw.githubusercontent.com/atom/atom/master/resources/atom.png;
+    sha256 = "66dc0b432eed7bcd738b7c1b194e539178a83d427c78f103041981f2b840e030";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "atom";
+    exec = "atom";
+    icon = iconsrc;
+    comment = "A hackable text editor for the 21st Century";
+    desktopName = "Atom";
+    genericName = "Text editor";
+    categories = "Development;TextEditor";
+  };
+
+  buildInputs = [ atomEnv makeWrapper ];
+
+  phases = [ "installPhase" ];
+
+  installPhase = ''
+    mkdir -p $out/share/atom
+    mkdir -p $out/bin
+    tar -C $out/share/atom -xvf $src
+    patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      $out/share/atom/atom
+    patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      $out/share/atom/resources/app/apm/node_modules/atom-package-manager/bin/node
+    makeWrapper $out/share/atom/atom $out/bin/atom \
+      --prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64"
+
+    # Create a desktop item.
+    mkdir -p "$out/share/applications"
+    cp "${desktopItem}"/share/applications/* "$out/share/applications/"  
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A hackable text editor for the 21st Century";
+    homepage = https://atom.io/;
+    license = [ licenses.mit ];
+    maintainers = [ maintainers.offline ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/applications/editors/bvi/default.nix b/pkgs/applications/editors/bvi/default.nix
index 84b810bf4602..e598fa19c5ea 100644
--- a/pkgs/applications/editors/bvi/default.nix
+++ b/pkgs/applications/editors/bvi/default.nix
@@ -13,6 +13,6 @@ stdenv.mkDerivation {
   meta = { 
     description = "Hex editor with vim style keybindings";
     homepage = http://bvi.sourceforge.net/download.html;
-    license = "GPL2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/editors/codeblocks/default.nix b/pkgs/applications/editors/codeblocks/default.nix
new file mode 100644
index 000000000000..1bf4bb1f8e6f
--- /dev/null
+++ b/pkgs/applications/editors/codeblocks/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, file, zip, wxGTK, gtk
+, contribPlugins ? false, hunspell, gamin, boost
+}:
+
+with { inherit (stdenv.lib) optionalString optional optionals; };
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${stdenv.lib.optionalString contribPlugins "full-"}${version}";
+  version = "13.12";
+  pname = "codeblocks";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/codeblocks/Sources/${version}/codeblocks_${version}-1.tar.gz";
+    sha256 = "044njhps4cm1ijfdyr5f9wjyd0vblhrz9b4603ma52wcdq25093p";
+  };
+
+  buildInputs = [ automake autoconf libtool pkgconfig file zip wxGTK gtk ]
+    ++ optionals contribPlugins [ hunspell gamin boost ];
+  enableParallelBuilding = true;
+  patches = [ ./writable-projects.patch ];
+  preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file";
+  postConfigure = optionalString stdenv.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.gcc.libc}/sbin/ldconfig";
+  configureFlags = [ "--enable-pch=no" ]
+    ++ optional contribPlugins "--with-contrib-plugins";
+
+  meta = with stdenv.lib; {
+    maintainers = [ maintainers.linquize ];
+    platforms = platforms.all;
+    description = "The open source, cross platform, free C, C++ and Fortran IDE";
+    longDescription =
+      ''
+        Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users.
+        It is designed to be very extensible and fully configurable.
+        Finally, an IDE with all the features you need, having a consistent look, feel and operation across platforms.
+      '';
+    homepage = http://www.codeblocks.org;
+    license = licenses.gpl3;
+  };
+}
diff --git a/pkgs/applications/editors/codeblocks/writable-projects.patch b/pkgs/applications/editors/codeblocks/writable-projects.patch
new file mode 100644
index 000000000000..3b6364a52a1c
--- /dev/null
+++ b/pkgs/applications/editors/codeblocks/writable-projects.patch
@@ -0,0 +1,18 @@
+diff --git a/src/plugins/scriptedwizard/wiz.cpp b/src/plugins/scriptedwizard/wiz.cpp
+index 0eb4b27..7d469fe 100644
+--- a/src/plugins/scriptedwizard/wiz.cpp
++++ b/src/plugins/scriptedwizard/wiz.cpp
+@@ -785,6 +785,13 @@ void Wiz::CopyFiles(cbProject* theproject, const wxString&  prjdir, const wxStri
+             }
+         }
+         if (do_copy) wxCopyFile(srcfile, dstfile, true);
++        // Noticed! Files in Nix Store are readonly, so make the copied file writable
++        if (do_copy)
++        {
++            struct stat statbuf;
++            if (!::stat(dstfile.mb_str(), &statbuf))
++                ::chmod(dstfile.mb_str(), statbuf.st_mode | 0200);
++        }
+ 
+         // and add it to the project
+         fname.MakeRelativeTo(prjdir);
diff --git a/pkgs/applications/editors/dhex/default.nix b/pkgs/applications/editors/dhex/default.nix
index 45b7de900e26..7a0e9e59d7e5 100644
--- a/pkgs/applications/editors/dhex/default.nix
+++ b/pkgs/applications/editors/dhex/default.nix
@@ -12,9 +12,9 @@ stdenv.mkDerivation rec {
   buildInputs = [ ncurses ];
  
   installPhase = ''
-    ensureDir $out/bin
-    ensureDir $out/share/man/man1
-    ensureDir $out/share/man/man5
+    mkdir -p $out/bin
+    mkdir -p $out/share/man/man1
+    mkdir -p $out/share/man/man5
 
     cp dhex $out/bin
     cp dhex.1 $out/share/man/man1
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index fe3c74249072..b32981ccb944 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, patchelf, makeDesktopItem, makeWrapper
+{ stdenv, fetchurl, makeDesktopItem, makeWrapper
 , freetype, fontconfig, libX11, libXext, libXrender, zlib
 , glib, gtk, libXtst, jre
 }:
@@ -23,7 +23,7 @@ let
         categories = "Application;Development;";
       };
 
-      buildInputs = [ makeWrapper patchelf ];
+      buildInputs = [ makeWrapper ];
 
       buildCommand = ''
         # Unpack tarball.
@@ -176,6 +176,22 @@ in {
         };
   };
 
+  eclipse_cpp_43 = buildEclipse {
+    name = "eclipse-cpp-4.3.2";
+    description = "Eclipse IDE for C/C++ Developers";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk-x86_64.tar.gz;
+          sha256 = "16zhjm6bx78263b1clg75kfiliahkhwg0k116vp9fj039nlpc30l";
+        }
+      else
+        fetchurl {
+          url = http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk.tar.gz;
+          sha256 = "0d6jlj7hwz8blx6csrlyi2h2prql0wckbh7ihwjmgclwpcpj84g6";
+        };
+  };
+
   eclipse_sdk_421 = buildEclipse {
     name = "eclipse-sdk-4.2.1";
     description = "Eclipse Classic";
@@ -222,4 +238,19 @@ in {
     };
   };
 
+  eclipse_sdk_44 = buildEclipse {
+    name = "eclipse-sdk-4.4";
+    description = "Eclipse Classic";
+    sources = {
+      "x86_64-linux" = fetchurl {
+          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.4-201406061215/eclipse-SDK-4.4-linux-gtk-x86_64.tar.gz;
+          sha256 = "14hdkijsjq0hhzi9ijpwjjkhz7wm0pry86l3dniy5snlh3l5bsb2";
+        };
+      "i686-linux" = fetchurl {
+          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.4-201406061215/eclipse-SDK-4.4-linux-gtk.tar.gz;
+          sha256 = "0hjc4zrsmik6vff851p0a4ydnx99840j2xrx8348kk6h0af8vx6z";
+        };
+    };
+  };
+
 }
diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index 3e22cfd0412d..d3e9a4c46794 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "ed-1.7";
+  name = "ed-1.9";
 
   src = fetchurl {
     url = "mirror://gnu/ed/${name}.tar.gz";
-    sha256 = "0c908wb5pm48rjrrfbm5dhrqzys8f1dbvi90dn0vgwjzk80l2hl9";
+    sha256 = "122syihsx2hwzj75mkf5a9ssiky2xby748kp4cc00wzhmp7p5cym";
   };
 
   /* FIXME: Tests currently fail on Darwin:
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
       full-screen editors such as GNU Emacs or GNU Moe.
     '';
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     homepage = http://www.gnu.org/software/ed/;
 
diff --git a/pkgs/applications/editors/emacs-23/builder.sh b/pkgs/applications/editors/emacs-23/builder.sh
deleted file mode 100644
index d04e7a4fdd3f..000000000000
--- a/pkgs/applications/editors/emacs-23/builder.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-source $stdenv/setup
-
-# This hook is supposed to be run on Linux. It patches the proper locations of
-# the crt{1,i,n}.o files into the build to ensure that Emacs is linked with
-# *our* versions, not the ones found in the system, as it would do by default.
-# On other platforms, this appears to be unnecessary.
-preConfigure() {
-    case "${system}" in
-	x86_64-linux)	glibclibdir=lib64 ;;
-	i686-linux)	glibclibdir=lib ;;
-        *)              return;
-    esac
-
-    libc=$(cat ${NIX_GCC}/nix-support/orig-libc)
-    echo "libc: $libc"
-
-    for i in src/s/*.h src/m/*.h; do
-        substituteInPlace $i \
-            --replace /usr/${glibclibdir}/crt1.o $libc/${glibclibdir}/crt1.o \
-            --replace /usr/${glibclibdir}/crti.o $libc/${glibclibdir}/crti.o \
-            --replace /usr/${glibclibdir}/crtn.o $libc/${glibclibdir}/crtn.o \
-            --replace /usr/lib/crt1.o $libc/${glibclibdir}/crt1.o \
-            --replace /usr/lib/crti.o $libc/${glibclibdir}/crti.o \
-            --replace /usr/lib/crtn.o $libc/${glibclibdir}/crtn.o
-    done
-
-    for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do
-        substituteInPlace $i --replace /bin/pwd pwd
-    done
-}
-
-preBuild="make bootstrap"
-
-genericBuild
diff --git a/pkgs/applications/editors/emacs-23/default.nix b/pkgs/applications/editors/emacs-23/default.nix
deleted file mode 100644
index ab5c8e49e7f1..000000000000
--- a/pkgs/applications/editors/emacs-23/default.nix
+++ /dev/null
@@ -1,72 +0,0 @@
-{ stdenv, fetchurl, ncurses, x11, libXaw, libXpm, Xaw3d
-, pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif
-, libtiff, librsvg, texinfo, gconf
-}:
-
-assert (gtk != null) -> (pkgconfig != null);
-assert (libXft != null) -> libpng != null;	# probably a bug
-assert stdenv.isDarwin -> libXaw != null;	# fails to link otherwise
-
-stdenv.mkDerivation rec {
-  name = "emacs-23.4";
-
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = "mirror://gnu/emacs/${name}.tar.bz2";
-    sha256 = "1fc8x5p38qihg7l6z2b1hjc534lnjb8gqpwgywlwg5s3csg6ymr6";
-  };
-
-  buildInputs =
-    [ ncurses x11 texinfo libXaw Xaw3d libXpm libpng libjpeg libungif
-      libtiff librsvg libXft gconf
-    ]
-    ++ stdenv.lib.optionals (gtk != null) [ gtk pkgconfig ]
-    ++ stdenv.lib.optional stdenv.isLinux dbus;
-
-  configureFlags =
-    stdenv.lib.optionals (gtk != null) [ "--with-x-toolkit=gtk" "--with-xft"]
-
-    # On NixOS, help Emacs find `crt*.o'.
-    ++ stdenv.lib.optional (stdenv ? glibc)
-         [ "--with-crt-dir=${stdenv.glibc}/lib" ];
-
-  postInstall = ''
-    cat >$out/share/emacs/site-lisp/site-start.el <<EOF
-;; nixos specific load-path
-(when (getenv "NIX_PROFILES") (setq load-path
-                      (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
-                                               (split-string (getenv "NIX_PROFILES"))))
-                       load-path)))
-EOF
-  '';
-
-  doCheck = true;
-
-  meta = {
-    description = "GNU Emacs 23.x, the extensible, customizable text editor";
-
-    longDescription = ''
-      GNU Emacs is an extensible, customizable text editor—and more.  At its
-      core is an interpreter for Emacs Lisp, a dialect of the Lisp
-      programming language with extensions to support text editing.
-
-      The features of GNU Emacs include: content-sensitive editing modes,
-      including syntax coloring, for a wide variety of file types including
-      plain text, source code, and HTML; complete built-in documentation,
-      including a tutorial for new users; full Unicode support for nearly all
-      human languages and their scripts; highly customizable, using Emacs
-      Lisp code or a graphical interface; a large number of extensions that
-      add other functionality, including a project planner, mail and news
-      reader, debugger interface, calendar, and more.  Many of these
-      extensions are distributed with GNU Emacs; others are available
-      separately.
-    '';
-
-    homepage = http://www.gnu.org/software/emacs/;
-    license = "GPLv3+";
-
-    maintainers = with stdenv.lib.maintainers; [ simons chaoflow ];
-    platforms = stdenv.lib.platforms.all;
-  };
-}
diff --git a/pkgs/applications/editors/emacs-24/darwin-new-sections.patch b/pkgs/applications/editors/emacs-24/darwin-new-sections.patch
new file mode 100644
index 000000000000..dfd72fe3f511
--- /dev/null
+++ b/pkgs/applications/editors/emacs-24/darwin-new-sections.patch
@@ -0,0 +1,50 @@
+http://bazaar.launchpad.net/~naesten/emacs/nextstep-stuff/revision/108961
+
+diff -ru emacs-24.3-orig/src/unexmacosx.c emacs-24.3/src/unexmacosx.c
+--- emacs-24.3-orig/src/unexmacosx.c	2013-01-01 21:37:17.000000000 +0100
++++ emacs-24.3/src/unexmacosx.c	2014-08-09 18:39:52.000000000 +0200
+@@ -838,7 +838,7 @@
+ 	  if (!(sectp->addr <= (unsigned long)my_edata
+ 		&& my_size <= sectp->size))
+ 	    unexec_error ("my_edata is not in section %s", SECT_DATA);
+-	  if (!unexec_write (sectp->offset, (void *) sectp->addr, my_size))
++          if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size))
+ 	    unexec_error ("cannot write section %s", SECT_DATA);
+ 	  if (!unexec_copy (sectp->offset + my_size, old_file_offset + my_size,
+ 			    sectp->size - my_size))
+@@ -880,6 +880,27 @@
+ 	  if (!unexec_write (header_offset, sectp, sizeof (struct section)))
+ 	    unexec_error ("cannot write section %.16s's header", sectp->sectname);
+ 	}
++      else if (strncmp (sectp->sectname, "__bss", 5) == 0
++	       || strncmp (sectp->sectname, "__pu_bss", 8) == 0)
++	{
++	  sectp->flags = S_REGULAR;
++	  
++	  /* These sections are produced by GCC 4.6+.
++
++	     FIXME: We possibly ought to clear uninitialized local
++	     variables in statically linked libraries like for
++	     SECT_BSS (__bss) above, but setting up the markers we
++	     need in lastfile.c would be rather messy.  See
++	     darwin_output_aligned_bss () in gcc/config/darwin.c for
++	     the root of the problem, keeping in mind that the
++	     sections are numbered by their alignment in GCC 4.6, but
++	     by log2(alignment) in GCC 4.7.  */
++
++	  if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size))
++	    unexec_error ("cannot copy section %.16s", sectp->sectname);
++	  if (!unexec_write (header_offset, sectp, sizeof (struct section)))
++	    unexec_error ("cannot write section %.16s's header", sectp->sectname);
++	}
+       else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
+ 	       || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
+ 	       || strncmp (sectp->sectname, "__got", 16) == 0
+@@ -891,6 +912,7 @@
+ 	       || strncmp (sectp->sectname, "__program_vars", 16) == 0
+ 	       || strncmp (sectp->sectname, "__mod_init_func", 16) == 0
+ 	       || strncmp (sectp->sectname, "__mod_term_func", 16) == 0
++	       || strncmp (sectp->sectname, "__static_data", 16) == 0
+ 	       || strncmp (sectp->sectname, "__objc_", 7) == 0)
+ 	{
+ 	  if (!unexec_copy (sectp->offset, old_file_offset, sectp->size))
diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix
index 18e263dae67e..329fa3a5626e 100644
--- a/pkgs/applications/editors/emacs-24/default.nix
+++ b/pkgs/applications/editors/emacs-24/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchurl, ncurses, x11, libXaw, libXpm, Xaw3d
 , pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif
-, libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
+, libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, openssl
 , alsaLib, cairo
-, withX ? true
+, withX ? !stdenv.isDarwin, withGTK ? true
 }:
 
 assert (libXft != null) -> libpng != null;	# probably a bug
@@ -18,20 +18,24 @@ stdenv.mkDerivation rec {
     sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh";
   };
 
+  patches = [ ./darwin-new-sections.patch ];
+
   buildInputs =
-    [ ncurses gconf libxml2 gnutls alsaLib pkgconfig texinfo ]
+    [ ncurses gconf libxml2 openssl alsaLib pkgconfig texinfo ]
     ++ stdenv.lib.optional stdenv.isLinux dbus
     ++ stdenv.lib.optionals withX
       [ x11 libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
-        imagemagick gtk ]
-    ++ stdenv.lib.optional stdenv.isDarwin cairo;
+        imagemagick gtk gconf ]
+    ++ stdenv.lib.optional (stdenv.isDarwin && withX) cairo;
 
   configureFlags =
-    ( if withX then 
+    ( if withX && withGTK then
         [ "--with-x-toolkit=gtk" "--with-xft"]
+      else (if withX then
+        [ "--with-x-toolkit=lucid" "--with-xft" ]
       else
         [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
-          "--with-gif=no" "--with-tiff=no" ] )
+          "--with-gif=no" "--with-tiff=no" ] ) )
     # On NixOS, help Emacs find `crt*.o'.
     ++ stdenv.lib.optional (stdenv ? glibc)
          [ "--with-crt-dir=${stdenv.glibc}/lib" ];
diff --git a/pkgs/applications/editors/emacs-24/macport.nix b/pkgs/applications/editors/emacs-24/macport.nix
new file mode 100644
index 000000000000..d9b32351040b
--- /dev/null
+++ b/pkgs/applications/editors/emacs-24/macport.nix
@@ -0,0 +1,100 @@
+{ stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls
+}:
+
+stdenv.mkDerivation rec {
+  emacsName = "emacs-24.3";
+  name = "${emacsName}-mac-4.8";
+
+  #builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "mirror://gnu/emacs/${emacsName}.tar.xz";
+    sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh";
+  };
+
+  macportSrc = fetchurl {
+    url = "ftp://ftp.math.s.chiba-u.ac.jp/emacs/${name}.tar.gz";
+    sha256 = "194y341zrpjp75mc3099kjc0inr1d379wwsnav257bwsc967h8yx";
+  };
+
+  patches = [ ./darwin-new-sections.patch ];
+
+  buildInputs = [ ncurses pkgconfig texinfo libxml2 gnutls ];
+
+  postUnpack = ''
+    mv $emacsName $name
+    tar xzf $macportSrc
+    mv $name $emacsName
+  '';
+
+  preConfigure = ''
+    patch -p0 < patch-mac
+
+    # The search for 'tputs' will fail because it's in ncursesw within the
+    # ncurses package, yet Emacs' configure script only looks in ncurses.
+    # Further, we need to make sure that the -L option occurs before mention
+    # of the library, so that it finds it within the Nix store.
+    sed -i 's/tinfo ncurses/tinfo ncursesw/' configure
+    ncurseslib=$(echo ${ncurses}/lib | sed 's#/#\\/#g')
+    sed -i "s/OLIBS=\$LIBS/OLIBS=\"-L$ncurseslib \$LIBS\"/" configure
+    sed -i 's/LIBS="\$LIBS_TERMCAP \$LIBS"/LIBS="\$LIBS \$LIBS_TERMCAP"/' configure
+
+    configureFlagsArray=(
+      LDFLAGS=-L${ncurses}/lib
+      --with-xml2=yes
+      --with-gnutls=yes
+      --with-mac
+      --enable-mac-app=$out/Applications
+    )
+    makeFlagsArray=(
+      CFLAGS=-O3
+      LDFLAGS="-O3 -L${ncurses}/lib"
+    );
+  '';
+
+  postInstall = ''
+    cat >$out/share/emacs/site-lisp/site-start.el <<EOF
+    ;; nixos specific load-path
+    (when (getenv "NIX_PROFILES") (setq load-path
+                          (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
+                             (split-string (getenv "NIX_PROFILES"))))
+                    load-path)))
+
+    ;; make tramp work for NixOS machines
+    (eval-after-load 'tramp '(add-to-list 'tramp-remote-path "/run/current-system/sw/bin"))
+    EOF
+  '';
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "GNU Emacs 24, the extensible, customizable text editor";
+    homepage    = http://www.gnu.org/software/emacs/;
+    license     = licenses.gpl3Plus;
+    maintainers = with maintainers; [ jwiegley ];
+    platforms   = platforms.darwin;
+
+    longDescription = ''
+      GNU Emacs is an extensible, customizable text editor—and more.  At its
+      core is an interpreter for Emacs Lisp, a dialect of the Lisp
+      programming language with extensions to support text editing.
+
+      The features of GNU Emacs include: content-sensitive editing modes,
+      including syntax coloring, for a wide variety of file types including
+      plain text, source code, and HTML; complete built-in documentation,
+      including a tutorial for new users; full Unicode support for nearly all
+      human languages and their scripts; highly customizable, using Emacs
+      Lisp code or a graphical interface; a large number of extensions that
+      add other functionality, including a project planner, mail and news
+      reader, debugger interface, calendar, and more.  Many of these
+      extensions are distributed with GNU Emacs; others are available
+      separately.
+
+      This is "Mac port" addition to GNU Emacs 24. This provides a native
+      GUI support for Mac OS X 10.4 - 10.9. Note that Emacs 23 and later
+      already contain the official GUI support via the NS (Cocoa) port for
+      Mac OS X 10.4 and later. So if it is good enough for you, then you
+      don't need to try this.
+    '';
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/auto-complete/default.nix b/pkgs/applications/editors/emacs-modes/auto-complete/default.nix
index 75f484d295b5..40f172316efc 100644
--- a/pkgs/applications/editors/emacs-modes/auto-complete/default.nix
+++ b/pkgs/applications/editors/emacs-modes/auto-complete/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Auto-complete extension for Emacs";
     homepage = http://cx4a.org/software/auto-complete/;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/bbdb/3.nix b/pkgs/applications/editors/emacs-modes/bbdb/3.nix
new file mode 100644
index 000000000000..556bf83fab72
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/bbdb/3.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, emacs }:
+
+stdenv.mkDerivation rec {
+  name = "bbdb-3.1.2";
+
+  src = fetchurl {
+    url = "http://download.savannah.gnu.org/releases/bbdb/${name}.tar.gz";
+    sha256 = "1gs16bbpiiy01w9pyg12868r57kx1v3hnw04gmqsmpc40l1hyy05";
+  };
+
+  buildInputs = [ emacs ];
+
+  # Hack to disable documentation as there is no way to tell bbdb to
+  # NOT build pdfs. I really don't want to pull in TexLive here...
+  preConfigure = ''
+   substituteInPlace ./Makefile.in \
+     --replace "SUBDIRS = lisp doc tex" "SUBDIRS = lisp"
+  '';
+
+  meta = {
+    homepage = "http://savannah.nongnu.org/projects/bbdb/";
+    description = "The Insidious Big Brother Database (BBDB), a contact management utility for Emacs, version 3";
+    license = "GPL";
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/bbdb/default.nix b/pkgs/applications/editors/emacs-modes/bbdb/default.nix
index da92c38d0780..ed96e6892833 100644
--- a/pkgs/applications/editors/emacs-modes/bbdb/default.nix
+++ b/pkgs/applications/editors/emacs-modes/bbdb/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, emacs, texinfo, ctags}:
 
-stdenv.mkDerivation {
-  name = "bbdb-2.35";
+stdenv.mkDerivation rec {
+  name = "bbdb-2.36";
 
   src = fetchurl {
     # not using mirror:// because it produces a different file
-    url = http://bbdb.sourceforge.net/bbdb-2.35.tar.gz;
-    sha256 = "3fb1316e2ed74d47ca61187fada550e58797467bd9e8ad67343ed16da769f916";
+    url = "http://bbdb.sourceforge.net/${name}.tar.gz";
+    sha256 = "1rmw94l71ahfbynyy0bijfy488q9bl5ksl4zpvg7j9dbmgbh296r";
   };
 
   patches = [ ./install-infodir.patch ];
@@ -28,8 +28,8 @@ stdenv.mkDerivation {
   '';
 
   meta = {
+    homepage = "http://bbdb.sourceforge.net/";
     description = "The Insidious Big Brother Database (BBDB), a contact management utility for Emacs";
-    homepage = http://bbdb.sourceforge.net/;
     license = "GPL";
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/calfw/default.nix b/pkgs/applications/editors/emacs-modes/calfw/default.nix
index 8934238ffa3a..c173684fab4c 100644
--- a/pkgs/applications/editors/emacs-modes/calfw/default.nix
+++ b/pkgs/applications/editors/emacs-modes/calfw/default.nix
@@ -16,17 +16,17 @@ stdenv.mkDerivation rec {
 
   installPhase =
     ''
-       ensureDir "$out/share/doc/${name}"
+       mkdir -p "$out/share/doc/${name}"
        cp -v readme.md "$out/share/doc/${name}"
 
-       ensureDir "$out/share/emacs/site-lisp/"
+       mkdir -p "$out/share/emacs/site-lisp/"
        cp *.el "$out/share/emacs/site-lisp/"
     '';
 
   meta = {
     description = "A calendar framework for Emacs";
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     maintainers = with stdenv.lib.maintainers; [ chaoflow ];
     platforms = stdenv.lib.platforms.gnu;
diff --git a/pkgs/applications/editors/emacs-modes/cedet/default.nix b/pkgs/applications/editors/emacs-modes/cedet/default.nix
index 779fc8a146e1..e350dc08e71c 100644
--- a/pkgs/applications/editors/emacs-modes/cedet/default.nix
+++ b/pkgs/applications/editors/emacs-modes/cedet/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
       Development Environment), and COGRE (COnnected GRaph Editor).
     '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     homepage = http://cedet.sourceforge.net/;
   };
diff --git a/pkgs/applications/editors/emacs-modes/coffee/default.nix b/pkgs/applications/editors/emacs-modes/coffee/default.nix
index a0ba61431655..495b1aca4b53 100644
--- a/pkgs/applications/editors/emacs-modes/coffee/default.nix
+++ b/pkgs/applications/editors/emacs-modes/coffee/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Emacs major mode for CoffeeScript, unfancy JavaScript";
     homepage = https://github.com/defunkt/coffee-mode;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/color-theme/default.nix b/pkgs/applications/editors/emacs-modes/color-theme/default.nix
index bad277d61ce3..a3d76a307c74 100644
--- a/pkgs/applications/editors/emacs-modes/color-theme/default.nix
+++ b/pkgs/applications/editors/emacs-modes/color-theme/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Emacs-lisp mode for skinning your Emacs";
     homepage = http://www.nongnu.org/color-theme;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/cryptol/default.nix b/pkgs/applications/editors/emacs-modes/cryptol/default.nix
new file mode 100644
index 000000000000..5b408ad7999d
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/cryptol/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, emacs }:
+
+stdenv.mkDerivation rec {
+  name    = "cryptol-mode-${version}";
+  version = "0.1.0";
+
+  src = fetchurl {
+    url    = "https://github.com/thoughtpolice/cryptol-mode/archive/v${version}.tar.gz";
+    sha256 = "1qyrqvfgpg1nyk1clv7v94r3amm02613hrak5732xzn6iak81cc0";
+  };
+
+  buildInputs = [ emacs ];
+
+  installPhase = ''
+    install -d $out/share/emacs/site-lisp
+    install *.el *.elc $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    description = "Emacs major mode for Cryptol";
+    homepage    = "https://thoughtpolice/cryptol-mode";
+    license     = stdenv.lib.licenses.gpl3Plus;
+    platforms   = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/darcsum/darcs_context b/pkgs/applications/editors/emacs-modes/darcsum/darcs_context
new file mode 100644
index 000000000000..7e9de1ed80b5
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/darcsum/darcs_context
@@ -0,0 +1,7 @@
+
+Context:
+
+[TAG 1.3
+Simon Michael <simon@joyful.com>**20131103203640
+ Ignore-this: d12bac373e4aa0e5ffe6c390e1dfe269
+] 
diff --git a/pkgs/applications/editors/emacs-modes/darcsum/default.nix b/pkgs/applications/editors/emacs-modes/darcsum/default.nix
new file mode 100644
index 000000000000..349146dbdd89
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/darcsum/default.nix
@@ -0,0 +1,34 @@
+# To automatically load darcsum when needed, add the following to your emacs init file:
+#
+#   (autoload 'darcsum-changes "darcsum" nil t)
+#   (autoload 'darcsum-whatsnew "darcsum" nil t)
+#   (autoload 'darcsum-view "darcsum" nil t)
+#
+# (These lines were copied from 50darcsum.el in the darcsum repository.)
+
+
+{ fetchdarcs, stdenv }:
+
+stdenv.mkDerivation {
+  name = "darcsum-1.3";
+
+  src = fetchdarcs {
+    url = http://hub.darcs.net/simon/darcsum;
+    context = ./darcs_context;
+    sha256 = "18dyk2apmnjapd604a5njfqwjri1mc7lgjaajy9phicpibgdrwzh";
+  };
+
+  phases = [ "unpackPhase" "installPhase" ];
+
+  installPhase = ''
+    install -d "$out/share/emacs/site-lisp"
+    install darcsum.el "$out/share/emacs/site-lisp"
+  '';
+
+  meta = {
+    description = "A pcl-cvs like interface for managing darcs patches.";
+    homepage = "http://hub.darcs.net/simon/darcsum";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.falsifian ];
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/ecb/default.nix b/pkgs/applications/editors/emacs-modes/ecb/default.nix
index 33f0299f5f00..807bb91f850c 100644
--- a/pkgs/applications/editors/emacs-modes/ecb/default.nix
+++ b/pkgs/applications/editors/emacs-modes/ecb/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
       navigation and overview.
     '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     homepage = http://ecb.sourceforge.net/;
 
diff --git a/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix b/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
index 9db6e4cb7364..af031a6e1a16 100644
--- a/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
+++ b/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
@@ -1,4 +1,4 @@
-{ clangStdenv, fetchgit, llvm, clangUnwrapped }:
+{ clangStdenv, fetchgit, llvm, clang }:
 
 clangStdenv.mkDerivation {
   name = "emacs-clang-complete-async-20130218";
@@ -8,7 +8,7 @@ clangStdenv.mkDerivation {
     sha256 = "1c8zqi6axbsb951azz9iqx3j52j30nd9ypv396hvids3g02cirrf";
   };
 
-  buildInputs = [ llvm clangUnwrapped ];
+  buildInputs = [ llvm clang.clang ];
 
   installPhase = ''
     mkdir -p $out/bin
@@ -20,7 +20,6 @@ clangStdenv.mkDerivation {
   meta = {
     homepage = "https://github.com/Golevka/emacs-clang-complete-async";
     description = "An emacs plugin to complete C and C++ code using libclang";
-    license = "GPLv3+";
+    license = clangStdenv.lib.licenses.gpl3Plus;
   };
 }
-
diff --git a/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix b/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix
index e0373fca5df5..26f313f038df 100644
--- a/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix
+++ b/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix
@@ -52,10 +52,10 @@ stdenv.mkDerivation rec {
       developed a simple Emacs interface to w3m.
     '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     homepage = http://emacs-w3m.namazu.org/;
 
-    maintainers = [ ];
+    maintainers = [ stdenv.lib.maintainers.mornfall ];
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/emms/default.nix b/pkgs/applications/editors/emacs-modes/emms/default.nix
index 5439ba9e4d6e..a44be28399dc 100644
--- a/pkgs/applications/editors/emacs-modes/emms/default.nix
+++ b/pkgs/applications/editors/emacs-modes/emms/default.nix
@@ -64,9 +64,10 @@ stdenv.mkDerivation rec {
 
     homepage = http://www.gnu.org/software/emms/;
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.gnu;
+    platforms = stdenv.lib.platforms.unix;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/ess/default.nix b/pkgs/applications/editors/emacs-modes/ess/default.nix
index 4bd5148b9508..46e20a58ee68 100644
--- a/pkgs/applications/editors/emacs-modes/ess/default.nix
+++ b/pkgs/applications/editors/emacs-modes/ess/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, emacs, texinfo }:
 
-stdenv.mkDerivation {
-  name = "ess-13.05";
+stdenv.mkDerivation rec {
+  name = "ess-13.09";
 
   src = fetchurl {
-    url = "http://ess.r-project.org/downloads/ess/ess-13.05.tgz";
-    sha256 = "007rd8hg1aclr2i8178ym5c4bi7vgmwkp802v1mkgr85h50zlfdk";
+    url = "http://ess.r-project.org/downloads/ess/${name}.tgz";
+    sha256 = "1lki3vb6p7cw98zqq0gaia68flpqrjkd6dcl85fs0cc8qf55yqnh";
   };
 
   buildInputs = [ emacs texinfo ];
@@ -16,5 +16,6 @@ stdenv.mkDerivation {
     description = "Emacs Speaks Statistics";
     homepage = "http://ess.r-project.org/";
     license = stdenv.lib.licenses.gpl2Plus;
+    hydraPlatforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix b/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
index 4b2692a5e22a..eae338d241de 100644
--- a/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
+++ b/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://www.emacswiki.org/emacs/download/flymake-cursor.el";
-    sha256 = "1qqppd1786w8pl1avjb01n23lwihb7m0hr23abjklsxz03gmp4qz";
+    sha256 = "10cpzrd588ya52blghxss5zkn6x8hc7bx1h0qbcdlybbmkjgpkxr";
   };
 
   phases = [ "buildPhase" "installPhase"];
@@ -26,7 +26,5 @@ stdenv.mkDerivation rec {
     description = "Displays flymake error msg in minibuffer after delay";
     homepage = http://www.emacswiki.org/emacs/flymake-cursor.el;
     license = stdenv.lib.licenses.publicDomain;
-
-    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/gh/default.nix b/pkgs/applications/editors/emacs-modes/gh/default.nix
index 28773e97c409..dca84a7936d7 100644
--- a/pkgs/applications/editors/emacs-modes/gh/default.nix
+++ b/pkgs/applications/editors/emacs-modes/gh/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A (very early) GitHub client library for Emacs";
     homepage = https://github.com/sigma/gh.el;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/gist/default.nix b/pkgs/applications/editors/emacs-modes/gist/default.nix
index 21a2137dd392..08471247f081 100644
--- a/pkgs/applications/editors/emacs-modes/gist/default.nix
+++ b/pkgs/applications/editors/emacs-modes/gist/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Emacs integration for gist.github.com";
     homepage = https://github.com/sigma/gist.el;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/haskell/default.nix b/pkgs/applications/editors/emacs-modes/haskell/default.nix
index a1e52e1c301c..3f4b93dc6381 100644
--- a/pkgs/applications/editors/emacs-modes/haskell/default.nix
+++ b/pkgs/applications/editors/emacs-modes/haskell/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, emacs, texinfo }:
 
 stdenv.mkDerivation rec {
-  name = "haskell-mode-13.07";
+  name = "haskell-mode-13.10";
 
   src = fetchurl {
-    url = "https://github.com/haskell/haskell-mode/archive/v13.07.tar.gz";
-    sha256 = "15c8ncj9mykkrizy1a8l94gq37s8hj13v3p5rgyaj9z0cwgl85kx";
+    url = "https://github.com/haskell/haskell-mode/archive/v13.10.tar.gz";
+    sha256 = "0hcg7wpalcdw8j36m8vd854zrrgym074r7m903rpwfrhx9mlg02b";
   };
 
   buildInputs = [ emacs texinfo ];
diff --git a/pkgs/applications/editors/emacs-modes/hol_light/default.nix b/pkgs/applications/editors/emacs-modes/hol_light/default.nix
index 24eba20be6cc..c32669239f88 100644
--- a/pkgs/applications/editors/emacs-modes/hol_light/default.nix
+++ b/pkgs/applications/editors/emacs-modes/hol_light/default.nix
@@ -1,15 +1,12 @@
-{stdenv, fetchsvn}:
+{ stdenv, fetchsvn }:
 
-let
-  revision = "73";
-in
-
-stdenv.mkDerivation {
-  name = "hol_light_mode-${revision}";
+stdenv.mkDerivation rec {
+  name    = "hol_light-mode-${version}";
+  version = "73";
 
   src = fetchsvn {
     url = http://seanmcl-ocaml-lib.googlecode.com/svn/trunk/workshop/software/emacs;
-    rev = revision;
+    rev = version;
     sha256 = "3ca83098960439da149a47e1caff32536601559a77f04822be742a390c67feb7";
   };
 
@@ -20,6 +17,10 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    description = "A HOL Light mode for emacs";
+    description = "A HOL Light mode for Emacs";
+    homepage    = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
+    license     = stdenv.lib.licenses.gpl2Plus;
+    platforms   = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/idris/default.nix b/pkgs/applications/editors/emacs-modes/idris/default.nix
new file mode 100644
index 000000000000..28375dcb68df
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/idris/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, emacs }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "idris-mode";
+  version = "0.9.13.1";
+
+  src = fetchurl {
+    url = "https://github.com/idris-hackers/${pname}/archive/${version}.tar.gz";
+    sha256 = "0ymjbkwsq7qra691wyldw91xcdgrbx3468vvrha5jj92v7nwb8wx";
+  };
+
+  buildInputs = [ emacs ];
+
+  buildPhase = ''
+    emacs -L . --batch -f batch-byte-compile *.el
+  '';
+
+  installPhase = ''
+    install -d $out/share/emacs/site-lisp
+    install *.el *.elc $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    description = "Emacs major mode for Idris";
+    homepage = https://github.com/idris-hackers/idris-mode;
+    license = stdenv.lib.licenses.gpl3;
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/jade/default.nix b/pkgs/applications/editors/emacs-modes/jade/default.nix
index ab0e3512ef28..925fa54c735f 100644
--- a/pkgs/applications/editors/emacs-modes/jade/default.nix
+++ b/pkgs/applications/editors/emacs-modes/jade/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Emacs major mode for jade and stylus";
     homepage = https://github.com/brianc/jade-mode;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/jdee/default.nix b/pkgs/applications/editors/emacs-modes/jdee/default.nix
index b25d178d1648..e47da7a41934 100644
--- a/pkgs/applications/editors/emacs-modes/jdee/default.nix
+++ b/pkgs/applications/editors/emacs-modes/jdee/default.nix
@@ -26,8 +26,8 @@ in
       mkdir -p "dist"
       cat > build.properties <<EOF
         dist.lisp.dir = dist/share/emacs/site-lisp
-        dist.java.lib.dir = dist/lib/java
-        dist.jar.jde.file = dist/lib/java/jde.jar
+        dist.java.lib.dir = dist/share/java
+        dist.jar.jde.file = dist/share/java/jde.jar
         dist.java.src.dir = dist/src/${name}/java
         dist.doc.dir  dist/doc/${name}
         prefix.dir = $out
@@ -40,7 +40,7 @@ in
       for i in "lisp/"*.el
       do
         sed -i "$i" -e "s|@out@|$out|g ;
-                        s|@javadir@|$out/lib/java|g ;
+                        s|@javadir@|$out/share/java|g ;
                         s|@datadir@|$out/share/${name}|g"
       done
     '';
@@ -55,7 +55,7 @@ in
 
       # Move everything that's not a JAR to $datadir.  This includes
       # `sun_checks.xml', license files, etc.
-      cd "$out/lib/java"
+      cd "$out/share/java"
       for i in *
       do
         if echo $i | grep -qv '\.jar''$'
@@ -89,9 +89,11 @@ in
         * Java source interpreter (Pat Neimeyer's BeanShell)
       '';
 
-      license = "GPLv2+";
+      license = stdenv.lib.licenses.gpl2Plus;
 
       maintainers = [ ];
       platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+
+      broken = true;
     };
   }
diff --git a/pkgs/applications/editors/emacs-modes/jdee/java-directory.patch b/pkgs/applications/editors/emacs-modes/jdee/java-directory.patch
index 53aa8edc6eaa..ec03749daa67 100644
--- a/pkgs/applications/editors/emacs-modes/jdee/java-directory.patch
+++ b/pkgs/applications/editors/emacs-modes/jdee/java-directory.patch
@@ -14,7 +14,7 @@ Tell the elisp code about the right Java directory.
 -    (oset this bsh-cmd-dir (expand-file-name "bsh-commands" jde-java-directory))
 -    (oset this checkstyle-jar  (expand-file-name "lib/checkstyle-all.jar" jde-java-directory))
 -    (oset this regexp-jar (expand-file-name "lib/jakarta-regexp.jar" jde-java-directory))
-+  (let ((jde-java-directory "@out@/lib/java"))
++  (let ((jde-java-directory "@out@/share/java"))
 +
 +    (oset this bsh-cmd-dir "@datadir@/bsh-commands")
 +    (oset this checkstyle-jar  (expand-file-name "checkstyle-all.jar" jde-java-directory))
@@ -38,7 +38,7 @@ Tell the elisp code about the right Java directory.
 -	  (concat
 -	   (jde-find-jde-data-directory)
 -	   "java/"))
-+	 (jde-java-directory "@out@/lib/java")
++	 (jde-java-directory "@out@/share/java")
  	 (args (append
  		(unless jde-checkstyle-expanded-properties-file
  		  (jde-checkstyle-get-property-args this))
@@ -67,7 +67,7 @@ Tell the elisp code about the right Java directory.
 -	     (jde-java-directory
 -	      (expand-file-name "java"
 -	       (jde-find-jde-data-directory)))
-+	     (jde-java-directory "@out@/lib/java")
++	     (jde-java-directory "@out@/share/java")
  	     (vm-args 
  		(let (args)
  		  (setq args 
diff --git a/pkgs/applications/editors/emacs-modes/js2/default.nix b/pkgs/applications/editors/emacs-modes/js2/default.nix
index cbd883304348..47e62a281fb0 100644
--- a/pkgs/applications/editors/emacs-modes/js2/default.nix
+++ b/pkgs/applications/editors/emacs-modes/js2/default.nix
@@ -1,12 +1,11 @@
 { stdenv, fetchgit, emacs }:
 
 stdenv.mkDerivation {
-  name = "js2-mode-0-20120712";
+  name = "js2-mode-0-20140114";
 
   src = fetchgit {
     url = "git://github.com/mooz/js2-mode.git";
-    rev = "f8cb9c52614e0a8e477f1ac557585ed950246c9b";
-    sha256 = "37055b7e8c1d9eee6b86f6b9b9d74ad196cc43701bc2263ffd539a3e44025047";
+    sha256 = "dbdc07b864a9506a21af445c7fb1c75fbffadaac980ee7bbf752470d8054bd65";
   };
 
   buildInputs = [ emacs ];
diff --git a/pkgs/applications/editors/emacs-modes/logito/default.nix b/pkgs/applications/editors/emacs-modes/logito/default.nix
index 09161ec80678..a47f04472ec7 100644
--- a/pkgs/applications/editors/emacs-modes/logito/default.nix
+++ b/pkgs/applications/editors/emacs-modes/logito/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "tiny logging framework for Emacs";
     homepage = https://github.com/sigma/logito;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix b/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix
index 72086e54fece..b75c51d3bd74 100644
--- a/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix
+++ b/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Insert dummy pseudo Latin text for Emacs";
     homepage = http://www.emacswiki.org/emacs/LoremIpsum;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/magit/default.nix b/pkgs/applications/editors/emacs-modes/magit/default.nix
index 4e2601cc106c..076caf5235b2 100644
--- a/pkgs/applications/editors/emacs-modes/magit/default.nix
+++ b/pkgs/applications/editors/emacs-modes/magit/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://github.com/magit/magit";
     description = "Magit, an Emacs interface to Git";
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     longDescription = ''
       With Magit, you can inspect and modify your Git repositories with
diff --git a/pkgs/applications/editors/emacs-modes/maude/default.nix b/pkgs/applications/editors/emacs-modes/maude/default.nix
index b6b043fb7b8d..57c2b2890be7 100644
--- a/pkgs/applications/editors/emacs-modes/maude/default.nix
+++ b/pkgs/applications/editors/emacs-modes/maude/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Emacs mode for the programming language Maude";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.all;
     maintainers = [ stdenv.lib.maintainers.simons ];
   };
diff --git a/pkgs/applications/editors/emacs-modes/metaweblog/default.nix b/pkgs/applications/editors/emacs-modes/metaweblog/default.nix
new file mode 100644
index 000000000000..77bfedf62748
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/metaweblog/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchgit, emacs, xmlRpc }:
+
+stdenv.mkDerivation rec {
+  name = "metaweblog-0.1";
+
+  src = fetchgit {
+    url = https://github.com/punchagan/metaweblog.git;
+    rev = "ceda65048afaa4c7596c7f50ced998c59ef41167";
+    sha256 = "a4c10bb1b4be574e560f87d5f07da4e24e5fffe9ecc83e6d4f9325f3a7eb1e2f";
+  };
+
+  buildInputs = [ emacs ];
+  propagatedUserEnvPkgs = [ xmlRpc ];
+
+  buildPhase = ''
+    emacs -L . -L ${xmlRpc}/share/emacs/site-lisp --batch -f batch-byte-compile *.el
+  '';
+
+  installPhase = ''
+    install -d $out/share/emacs/site-lisp
+    install *.el* $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    description = "an emacs library to access metaweblog based weblogs";
+    homepage = https://github.com/punchagan/metaweblog;
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/ocaml/default.nix b/pkgs/applications/editors/emacs-modes/ocaml/default.nix
index 1d81a0b7ff1e..9e4496ff1a48 100644
--- a/pkgs/applications/editors/emacs-modes/ocaml/default.nix
+++ b/pkgs/applications/editors/emacs-modes/ocaml/default.nix
@@ -18,7 +18,7 @@ in stdenv.mkDerivation {
 
   installPhase = ''
     cd emacs;
-    ensureDir "$out/share/emacs/site-lisp" "$out/bin"
+    mkdir -p "$out/share/emacs/site-lisp" "$out/bin"
     EMACSDIR=$out/share/emacs/site-lisp make simple-install install-ocamltags
   '';
 
diff --git a/pkgs/applications/editors/emacs-modes/offlineimap/default.nix b/pkgs/applications/editors/emacs-modes/offlineimap/default.nix
new file mode 100644
index 000000000000..d94da4f88d9e
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/offlineimap/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchgit, emacs }:
+
+stdenv.mkDerivation rec {
+  rev = "646482203aacdf847d57d0a96263fddcfc33fb61";
+  name = "emacs-offlineimap-${rev}";
+
+  src = fetchgit {
+    inherit rev;
+    url = "git://git.naquadah.org/offlineimap-el.git";
+    sha256 = "0az4llfgva4wvpljyc5s2m7ggfnj06ssp32x8bncr5fzksha3r7b";
+  };
+
+  buildInputs = [ emacs ];
+
+  installPhase = ''
+    substituteInPlace offlineimap.el --replace "Machine.MachineUI" "machineui"
+    emacs --batch -f batch-byte-compile offlineimap.el
+    install -d $out/share/emacs/site-lisp
+    install offlineimap.el offlineimap.elc $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    description = "OfflineIMAP support for Emacs";
+    homepage = "http://julien.danjou.info/projects/emacs-packages#offlineimap";
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/org/default.nix b/pkgs/applications/editors/emacs-modes/org/default.nix
index ad2bd2f0ba6a..d5a7b0ded8a2 100644
--- a/pkgs/applications/editors/emacs-modes/org/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org/default.nix
@@ -1,15 +1,16 @@
-{ fetchurl, stdenv, emacs, texinfo, which, texLive }:
+{ fetchurl, stdenv, emacs, texinfo, which, texLive, texLiveCMSuper
+, texLiveAggregationFun }:
 
 stdenv.mkDerivation rec {
-  name = "org-8.2.1";
+  name = "org-8.2.7c";
 
   src = fetchurl {
     url = "http://orgmode.org/${name}.tar.gz";
-    sha256 = "625e2b6786158bcf6c43194075f7638ab8048c68a60025289a051c407e467823";
+    sha256 = "0qqf58xqw1kkgjxm9z40s6h7xd209rx3933klla22lryv3yclc1k";
   };
 
   buildInputs = [ emacs ];
-  nativeBuildInputs = [ texinfo texLive ];
+  nativeBuildInputs = [ (texLiveAggregationFun { paths=[ texinfo texLive texLiveCMSuper ]; }) ];
 
   configurePhase =
     '' sed -i mk/default.mk \
@@ -41,9 +42,9 @@ stdenv.mkDerivation rec {
          than that found in GNU Emacs.
       '';
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ chaoflow ];
-    platforms = stdenv.lib.platforms.gnu;
+    maintainers = with stdenv.lib.maintainers; [ chaoflow pSub ];
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/org2blog/default.nix b/pkgs/applications/editors/emacs-modes/org2blog/default.nix
index e72560be8f44..5c1aec7e02b7 100644
--- a/pkgs/applications/editors/emacs-modes/org2blog/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org2blog/default.nix
@@ -1,19 +1,22 @@
-{ stdenv, fetchgit, emacs, xmlRpc }:
+{ stdenv, fetchgit, emacs, org, xmlRpc, metaweblog }:
 
 stdenv.mkDerivation rec {
-  name = "org2blog-0.5";
+  name = "org2blog-0.8.1";
 
   src = fetchgit {
     url = https://github.com/punchagan/org2blog.git;
-    rev = "338abe30e9bc89684f8384f8deaf826b63844da6";
-    sha256 = "46ab31e90d0d54071c126b7d5599a3e82062baa79ddf26b988bcb88d306d6827";
+    rev = "5f573ff3e4007c16517a5fe28c4f5d8dde3f8a77";
+    sha256 = "e83c08ceece92bb507be70046db4a7fa87a4af34ad3f84a727e0bd6a1dd99a33";
   };
 
   buildInputs = [ emacs ];
-  propagatedUserEnvPkgs = [ xmlRpc ];
+  propagatedUserEnvPkgs = [ org xmlRpc metaweblog ];
 
   buildPhase = ''
-    emacs -L . -L ${xmlRpc}/share/emacs/site-lisp --batch -f batch-byte-compile *.el
+    emacs -L . -L ${org}/share/emacs/site-lisp/org \
+               -L ${xmlRpc}/share/emacs/site-lisp \
+               -L ${metaweblog}/share/emacs/site-lisp \
+               --batch -f batch-byte-compile *.el
   '';
 
   installPhase = ''
@@ -24,7 +27,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Publish directly from Emacs’ org-mode to WordPress blogs";
     homepage = https://github.com/punchagan/org2blog;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/pcache/default.nix b/pkgs/applications/editors/emacs-modes/pcache/default.nix
index c0aa07726788..f4dcf03dee84 100644
--- a/pkgs/applications/editors/emacs-modes/pcache/default.nix
+++ b/pkgs/applications/editors/emacs-modes/pcache/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Persistent caching for Emacs";
     homepage = https://github.com/sigma/pcache.el;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix b/pkgs/applications/editors/emacs-modes/proofgeneral/4.2.nix
index 3f974423fd70..c026d058b4e3 100644
--- a/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
+++ b/pkgs/applications/editors/emacs-modes/proofgeneral/4.2.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation (rec {
                s|/sbin/install-info|install-info|g"
 
 
-       # Workaround for bug #458 
+       # Workaround for bug #458
        # ProofGeneral 4.2 byte-compilation fails with Emacs 24.2.90
        # http://proofgeneral.inf.ed.ac.uk/trac/ticket/458
        sed -i "Makefile" \
@@ -48,7 +48,7 @@ stdenv.mkDerivation (rec {
       interactive theorem provers), based on the customizable text editor Emacs.
     '';
     homepage = http://proofgeneral.inf.ed.ac.uk;
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.unix;  # arbitrary choice
   };
 })
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix b/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix
new file mode 100644
index 000000000000..3a492dc0c7f4
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, emacs, texinfo, texLive, perl, which, automake }:
+
+stdenv.mkDerivation (rec {
+  name = "ProofGeneral-4.3pre131011";
+
+  src = fetchurl {
+    url = http://proofgeneral.inf.ed.ac.uk/releases/ProofGeneral-4.3pre131011.tgz;
+    sha256 = "0104iy2xik5npkdg9p2ir6zqyrmdc93azrgm3ayvg0z76vmnb816";
+  };
+
+  sourceRoot = name;
+
+  buildInputs = [ emacs texinfo texLive perl which ];
+
+  prePatch =
+    '' sed -i "Makefile" \
+           -e "s|^\(\(DEST_\)\?PREFIX\)=.*$|\1=$out|g ; \
+               s|/sbin/install-info|install-info|g"
+
+
+       sed -i "bin/proofgeneral" -e's/which/type -p/g'
+
+       # @image{ProofGeneral} fails, so remove it.
+       sed -i '94d' doc/PG-adapting.texi
+       sed -i '96d' doc/ProofGeneral.texi
+    '';
+
+  preBuild = ''
+    make clean;
+  '';
+
+  installPhase =
+    # Copy `texinfo.tex' in the right place so that `texi2pdf' works.
+    '' cp -v "${automake}/share/"automake-*/texinfo.tex doc
+       make install install-doc
+    '';
+
+  meta = {
+    description = "Proof General, an Emacs front-end for proof assistants";
+    longDescription = ''
+      Proof General is a generic front-end for proof assistants (also known as
+      interactive theorem provers), based on the customizable text editor Emacs.
+    '';
+    homepage = http://proofgeneral.inf.ed.ac.uk;
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.unix;  # arbitrary choice
+  };
+})
diff --git a/pkgs/applications/editors/emacs-modes/quack/default.nix b/pkgs/applications/editors/emacs-modes/quack/default.nix
index bef1ebe5859b..95634a24ded4 100644
--- a/pkgs/applications/editors/emacs-modes/quack/default.nix
+++ b/pkgs/applications/editors/emacs-modes/quack/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Enhanced Emacs support for editing and running Scheme code";
     homepage = http://www.neilvandyke.org/quack/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/rect-mark/default.nix b/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
index 896dbdac71be..1f218439a5ff 100644
--- a/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
+++ b/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Mark a rectangle of text with highlighting";
     homepage = http://emacswiki.org/emacs/RectangleMark;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/remember/default.nix b/pkgs/applications/editors/emacs-modes/remember/default.nix
index ea17a9b792ae..7c0bc517755a 100644
--- a/pkgs/applications/editors/emacs-modes/remember/default.nix
+++ b/pkgs/applications/editors/emacs-modes/remember/default.nix
@@ -40,6 +40,6 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = http://gna.org/projects/remember-el/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/sbt-mode/default.nix b/pkgs/applications/editors/emacs-modes/sbt-mode/default.nix
new file mode 100644
index 000000000000..092026aca88a
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/sbt-mode/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, emacs, unzip }:
+
+stdenv.mkDerivation {
+
+  name = "sbt-mode-2014-06-05";
+
+  src = fetchurl {
+    url = "https://github.com/hvesalai/sbt-mode/archive/676f22d9658989de401d299ed0250db9b911574d.zip";
+    sha256 = "0b8qrr3yp48ggl757d3a6bz633mbf4zxqpcwsh47b1ckiwa3nb2h";
+  };
+
+  buildInputs = [ unzip emacs ];
+
+  installPhase = ''
+    mkdir -p "$out/share/emacs/site-lisp"
+    cp -v *.el *.elc "$out/share/emacs/site-lisp/"
+  '';
+
+  meta = {
+    homepage = "https://github.com/hvesalai/scala-mode2";
+    description = "An Emacs mode for editing Scala code";
+    license = "permissive";
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/scala-mode/default.nix b/pkgs/applications/editors/emacs-modes/scala-mode/v1.nix
index f82d467066a6..f82d467066a6 100644
--- a/pkgs/applications/editors/emacs-modes/scala-mode/default.nix
+++ b/pkgs/applications/editors/emacs-modes/scala-mode/v1.nix
diff --git a/pkgs/applications/editors/emacs-modes/scala-mode/v2.nix b/pkgs/applications/editors/emacs-modes/scala-mode/v2.nix
new file mode 100644
index 000000000000..13d3f4b00d1f
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/scala-mode/v2.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, emacs, unzip }:
+
+stdenv.mkDerivation {
+
+  name = "scala-mode2-2014-06-05";
+
+  src = fetchurl {
+    url = "https://github.com/hvesalai/scala-mode2/archive/af2dc30226c890ff7d49d727450f8006b90781df.zip";
+    sha256 = "1jj08li9lfg5291jzj170wa3cmyf3g2a0j80cy5307l0mdawp9vx";
+  };
+
+  buildInputs = [ unzip emacs ];
+
+  installPhase = ''
+    mkdir -p "$out/share/emacs/site-lisp"
+    cp -v *.el *.elc "$out/share/emacs/site-lisp/"
+  '';
+
+  meta = {
+    homepage = "https://github.com/hvesalai/scala-mode2";
+    description = "An Emacs mode for editing Scala code";
+    license = "permissive";
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/structured-haskell-mode/default.nix b/pkgs/applications/editors/emacs-modes/structured-haskell-mode/default.nix
new file mode 100644
index 000000000000..a9c2478d451c
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/structured-haskell-mode/default.nix
@@ -0,0 +1,23 @@
+{ cabal, emacs, haskellMode, haskellSrcExts }:
+
+cabal.mkDerivation (self: {
+  pname = "structured-haskell-mode";
+  version = "1.0.3";
+  sha256 = "0axmw8bj51q8v0wd4jp6giw9dnv0mp7kp8yd16s4nm4hcqgrh5h2";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ haskellSrcExts haskellMode ];
+  buildTools = [ emacs ];
+  postInstall = ''
+    emacs -L elisp -L ${haskellMode}/share/emacs/site-lisp \
+      --batch -f batch-byte-compile "elisp/"*.el
+    install -d $out/share/emacs/site-lisp
+    install "elisp/"*.el "elisp/"*.elc  $out/share/emacs/site-lisp
+  '';
+  meta = {
+    homepage = "https://github.com/chrisdone/structured-haskell-mode";
+    description = "Structured editing Emacs mode for Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
index e942189714ea..aa27e302e5d6 100644
--- a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
+++ b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Two-pane file manager for Emacs based on Dired and inspired by MC";
     homepage = http://www.emacswiki.org/emacs/Sunrise_Commander;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/emacs-modes/tuareg/default.nix b/pkgs/applications/editors/emacs-modes/tuareg/default.nix
index 17957ffc276b..3fd592f3dba6 100644
--- a/pkgs/applications/editors/emacs-modes/tuareg/default.nix
+++ b/pkgs/applications/editors/emacs-modes/tuareg/default.nix
@@ -15,7 +15,7 @@ in stdenv.mkDerivation {
   buildInputs = [ emacs ];
 
   installPhase = ''
-    ensureDir "$out/share/emacs/site-lisp"
+    mkdir -p "$out/share/emacs/site-lisp"
     cp *.el *.elc  "$out/share/emacs/site-lisp"
   '';
 
diff --git a/pkgs/applications/editors/emacs-modes/writegood/default.nix b/pkgs/applications/editors/emacs-modes/writegood/default.nix
new file mode 100644
index 000000000000..d196c3fee804
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/writegood/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, emacs}:
+
+let version = "2.0";
+
+in stdenv.mkDerivation {
+  name = "writegood-mode-${version}";
+  src = fetchurl {
+    url = "https://github.com/bnbeckwith/writegood-mode/archive/v${version}.tar.gz";
+    sha256 = "0wf7bj9d00ggy3xigym885a3njfr98i3aqrrawf8x6lgbfc56dgp";
+  };
+
+  buildInputs = [ emacs ];
+
+  buildPhase = ''
+    emacs -L . --batch -f batch-byte-compile *.el
+  '';
+
+  installPhase = ''
+    install -d $out/share/emacs/site-lisp
+    install *.el *.elc $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    description = "Emacs minor mode that aids in finding common writing problems";
+    homepage = https://github.com/bnbeckwith/writegood-mode;
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.pSub ];
+    license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix b/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
index cee0f0ca5534..661430516b70 100644
--- a/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
+++ b/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Elisp implementation of clientside XML-RPC";
     homepage = https://launchpad.net/xml-rpc-el;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/flpsed/default.nix b/pkgs/applications/editors/flpsed/default.nix
index 15605218b741..d9f62216fac9 100644
--- a/pkgs/applications/editors/flpsed/default.nix
+++ b/pkgs/applications/editors/flpsed/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, fltk13, ghostscript}:
 
 stdenv.mkDerivation {
-  name = "flpsed-0.7.0";
+  name = "flpsed-0.7.1";
 
   src = fetchurl {
-    url = "http://www.ecademix.com/JohannesHofmann/flpsed-0.7.0.tar.gz";
-    sha1 = "7966fd3b6fb3aa2a376386533ed4421ebb66ad62";
+    url = "http://www.ecademix.com/JohannesHofmann/flpsed-0.7.1.tar.gz";
+    sha256 = "16i3mjc1cdx2wiwfhnv3z2ywmjma9785vwl3l31izx9l51w7ngj3";
   };
 
   buildInputs = [ fltk13 ghostscript ];
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   meta = {
     description = "WYSIWYG PostScript annotator";
     homepage = "http://http://flpsed.org/flpsed.html";
-    license = "GPLv3";
+    license = stdenv.lib.licenses.gpl3;
     platforms = stdenv.lib.platforms.mesaPlatforms;
   };
 }
diff --git a/pkgs/applications/editors/geany/default.nix b/pkgs/applications/editors/geany/default.nix
index e7c8e276d27b..d7ed048cdaa8 100644
--- a/pkgs/applications/editors/geany/default.nix
+++ b/pkgs/applications/editors/geany/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, gtk2, which, pkgconfig, intltool }:
 
 let
-  version = "1.23";
+  version = "1.23.1";
 in
 
 stdenv.mkDerivation rec {
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://download.geany.org/${name}.tar.bz2";
-    sha256 = "1c78rggjaz9fa8gj25wka1sa3argvixnzrarmqvwh0s8d5ragm6d";
+    sha256 = "1bcgjxywggsljs9kq22kr9xpzrq5xr7pb9d1b71rwryqb5pb25c8";
   };
 
   buildInputs = [ gtk2 which pkgconfig intltool ];
diff --git a/pkgs/applications/editors/gobby/default.nix b/pkgs/applications/editors/gobby/default.nix
index 4d48ba69086e..5ef198745312 100644
--- a/pkgs/applications/editors/gobby/default.nix
+++ b/pkgs/applications/editors/gobby/default.nix
@@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     homepage = http://gobby.0x539.de/;
     description = "A GTK-based collaborative editor supporting multiple documents in one session and a multi-user chat";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ maintainers.phreedom ];
     platforms = platforms.all;
   };
diff --git a/pkgs/applications/editors/hexedit/default.nix b/pkgs/applications/editors/hexedit/default.nix
index 07985dc214ae..ee9f44d06da4 100644
--- a/pkgs/applications/editors/hexedit/default.nix
+++ b/pkgs/applications/editors/hexedit/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "hexedit-${version}";
-  version = "1.2.12";
+  version = "1.2.13";
 
   src = fetchurl {
     url = "http://rigaux.org/${name}.src.tgz";
-    sha256 = "bcffbf3d128516cc4e1da64485866fbb5f62754f2af8327e7a527855186ba10f";
+    sha256 = "1mwdp1ikk64cqmagnrrps5jkn3li3n47maiqh2qc1xbp1ains4ka";
   };
 
   buildInputs = [ ncurses ];
diff --git a/pkgs/applications/editors/idea/default.nix b/pkgs/applications/editors/idea/default.nix
new file mode 100644
index 000000000000..e5cfbcdfe178
--- /dev/null
+++ b/pkgs/applications/editors/idea/default.nix
@@ -0,0 +1,91 @@
+{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip, jdk
+, coreutils, gnugrep, which, git
+}:
+
+let
+
+  buildIdea =
+  { name, version, build, src, description, license }:
+
+  stdenv.mkDerivation rec {
+    inherit name build src;
+    ideaItem = makeDesktopItem {
+      name = "IDEA";
+      exec = "idea";
+      comment = "Integrated Development Environment";
+      desktopName = "IntelliJ IDEA";
+      genericName = "Integrated Development Environment";
+      categories = "Application;Development;";
+    };
+
+    buildInputs = [ makeWrapper patchelf p7zip ];
+
+    buildCommand = ''
+      tar xvzf $src
+      mkdir -p $out
+      cp -a idea-$build $out
+
+      interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
+
+      7z x $out/idea-$build/lib/snappy-java-1.0.5.jar
+      rm $out/idea-$build/lib/snappy-java-1.0.5.jar
+      if [ "${stdenv.system}" == "x86_64-linux" ];then
+        patchelf --set-interpreter $interpreter $out/idea-$build/bin/fsnotifier64
+        patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ org/xerial/snappy/native/Linux/amd64/libsnappyjava.so
+      else
+        patchelf --set-interpreter $interpreter $out/idea-$build/bin/fsnotifier
+        patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ org/xerial/snappy/native/Linux/i386/libsnappyjava.so
+      fi
+      7z a -tzip $out/idea-$build/lib/snappy-java-1.0.5.jar .
+
+      mkdir -p $out/bin
+
+      jdk=${jdk}/lib/openjdk
+
+      makeWrapper $out/idea-$build/bin/idea.sh $out/bin/idea \
+        --prefix PATH : ${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin \
+        --prefix LD_RUN_PATH : ${stdenv.gcc.gcc}/lib/ \
+        --prefix JDK_HOME : $jdk \
+        --prefix IDEA_JDK : $jdk
+
+        mkdir -p $out/share/applications
+        cp "${ideaItem}/share/applications/"* $out/share/applications
+        patchShebangs $out
+    '';
+
+    meta = {
+      homepage = http://www.jetbrains.com/idea/;
+      inherit description;
+      inherit license;
+      maintainers = [ stdenv.lib.maintainers.edwtjo ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  };
+
+in {
+
+  idea_community = buildIdea rec {
+    name = "idea-community-${version}";
+    version = "13.1.3";
+    build = "IC-135.909";
+    description = "IntelliJ IDEA 13 Community Edition";
+    license = stdenv.lib.licenses.asl20;
+    src = fetchurl {
+      url = "http://download-ln.jetbrains.com/idea/ideaIC-${version}.tar.gz";
+      sha256 = "62ed937ef68df16eef4d32772b6510835527f95020db1c76643f17ed2c067b51";
+    };
+  };
+
+  idea_ultimate = buildIdea rec {
+    name = "idea-ultimate-${version}";
+    version = "13.1.3";
+    build = "IU-135.909";
+    description = "IntelliJ IDEA 13 Ultimate Edition";
+    license = stdenv.lib.licenses.unfree;
+    src = fetchurl {
+      url = "http://download-ln.jetbrains.com/idea/ideaIU-${version}.tar.gz";
+      sha256 = "6d99e49a63a197e19381a85535ab424a7832653db8cceb3bca7d53615ec7a53d";
+    };
+  };
+
+}
diff --git a/pkgs/applications/editors/idea/pycharm.nix b/pkgs/applications/editors/idea/pycharm.nix
new file mode 100644
index 000000000000..6a2064549bbc
--- /dev/null
+++ b/pkgs/applications/editors/idea/pycharm.nix
@@ -0,0 +1,115 @@
+{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip, jdk
+, coreutils, gnugrep, which, git, python
+}:
+
+let
+
+  buildPycharm =
+  { name, version, build, src, description, license }:
+
+  stdenv.mkDerivation rec {
+    inherit name build src;
+    desktopItem = makeDesktopItem {
+      name = "pycharm";
+      exec = "pycharm";
+      comment = "Powerful Python and Django IDE";
+      desktopName = "PyCharm";
+      genericName = "Powerful Python and Django IDE";
+      categories = "Application;Development;";
+      icon = "pycharm";
+    };
+
+    buildInputs = [ makeWrapper patchelf p7zip ];
+
+    propagatedUserEnvPkgs = [ python ];
+
+    patchPhase = ''
+      interpreter="$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)"
+      snappyPath="lib/snappy-java-1.0.5"
+
+      7z x -o"$snappyPath" "$snappyPath.jar"
+      if [ "${stdenv.system}" == "x86_64-linux" ]; then
+        patchelf --set-interpreter "$interpreter" bin/fsnotifier64
+        patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
+      else
+        patchelf --set-interpreter "$interpreter" bin/fsnotifier
+        patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
+      fi
+      7z a -tzip "$snappyPath.jar" ./"$snappyPath"/*
+      rm -vr "$snappyPath"
+    '';
+
+    installPhase = ''
+      mkdir -vp "$out/bin" "$out/$name" "$out/share/pixmaps"
+      cp -va . "$out/$name"
+      ln -s "$out/$name/bin/pycharm.png" "$out/share/pixmaps/"
+
+      jdk="${jdk}/lib/openjdk"
+      makeWrapper "$out/$name/bin/pycharm.sh" "$out/bin/pycharm" \
+        --prefix PATH : "${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
+        --prefix LD_RUN_PATH : "${stdenv.gcc.gcc}/lib/" \
+        --prefix JDK_HOME : "$jdk" \
+        --prefix PYCHARM_JDK : "$jdk"
+
+      cp -a "${desktopItem}"/* "$out"
+    '';
+
+    meta = with stdenv.lib; {
+      homepage = "https://www.jetbrains.com/pycharm/";
+      inherit description;
+      inherit license;
+      maintainers = [ maintainers.jgeerds ];
+      platforms = platforms.linux;
+    };
+  };
+
+in {
+
+  pycharm-community-313 = buildPycharm rec {
+    name = "pycharm-community-${version}";
+    version = "3.1.3";
+    build = "133.1347";
+    description = "PyCharm 3.1 Community Edition";
+    license = stdenv.lib.licenses.asl20;
+    src = fetchurl {
+      url = "http://download.jetbrains.com/python/${name}.tar.gz";
+      sha256 = "f671ee4c99207c179f168b5b98fa23afe90a94c3a3914367b95a46b0c2881b23";
+    };
+  };
+
+  pycharm-community-341 = buildPycharm rec {
+    name = "pycharm-community-${version}";
+    version = "3.4.1";
+    build = "135.1057";
+    description = "PyCharm 3.4 Community Edition";
+    license = stdenv.lib.licenses.asl20;
+    src = fetchurl {
+      url = "http://download.jetbrains.com/python/${name}.tar.gz";
+      sha256 = "96427b1e842e7c09141ec4d3ede627c5ca7d821c0d6c98169b56a34f9035ef64";
+    };
+  };
+
+  pycharm-professional-313 = buildPycharm rec {
+    name = "pycharm-professional-${version}";
+    version = "3.1.3";
+    build = "133.1347";
+    description = "PyCharm 3.1 Professional Edition";
+    license = stdenv.lib.licenses.unfree;
+    src = fetchurl {
+      url = "http://download.jetbrains.com/python/${name}.tar.gz";
+      sha256 = "e0c2db8f18cb825a95de6ddc4b0b9f93c5643bf34cca9f1b3c2fa37fd7c14f11";
+    };
+  };
+
+  pycharm-professional-341 = buildPycharm rec {
+    name = "pycharm-professional-${version}";
+    version = "3.4.1";
+    build = "135.1057";
+    description = "PyCharm 3.4 Professional Edition";
+    license = stdenv.lib.licenses.unfree;
+    src = fetchurl {
+      url = "http://download.jetbrains.com/python/${name}.tar.gz";
+      sha256 = "e4f85f3248e8985ac9f8c326543f979b47ba1d7ac6b128a2cf2b3eb8ec545d2b";
+    };
+  };
+}
diff --git a/pkgs/applications/editors/jedit/default.nix b/pkgs/applications/editors/jedit/default.nix
index efaf719c7c47..8a57f650fb4a 100644
--- a/pkgs/applications/editors/jedit/default.nix
+++ b/pkgs/applications/editors/jedit/default.nix
@@ -1,20 +1,20 @@
-{ stdenv, fetchurl, ant, jre }:
+{ stdenv, fetchurl, ant, jdk }:
+
+let version = "4.4.2"; in
 
 stdenv.mkDerivation {
-  name = "jedit-4.4.2";
+  name = "jedit-${version}";
 
   src = fetchurl {
-    url = mirror://sourceforge/jedit/jedit4.4.2source.tar.bz2;
+    url = "mirror://sourceforge/jedit/jedit${version}source.tar.bz2";
     sha256 = "5e9ad9c32871b77ef0b9fe46dcfcea57ec52558d36113b7280194a33430b8ceb";
   };
 
-  setSourceRoot = ''
-    sourceRoot=jEdit
-  '';
+  buildInputs = [ ant jdk ];
 
-  buildPhase = ''
-     ant build
-  '';
+  sourceRoot = "jEdit";
+
+  buildPhase = "ant build";
 
   installPhase = ''
     mkdir -p $out/share/jEdit
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
     cp -r macros/* $out/share/jEdit/macros
     mkdir -p $out/share/jEdit/doc
     cp -r doc/* $out/share/jEdit/doc
-    
+
     sed -i "s|Icon=.*|Icon=$out/share/jEdit/icons/jedit-icon48.png|g" package-files/linux/deb/jedit.desktop
     mkdir -p $out/share/applications
     mv package-files/linux/deb/jedit.desktop $out/share/applications/jedit.desktop
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
     patch package-files/linux/jedit << EOF
     5a6,8
     > # specify the correct JAVA_HOME
-    > JAVA_HOME=${jre}
+    > JAVA_HOME=${jdk.jre}/lib/openjdk/jre
     > 
     EOF
     sed -i "s|/usr/share/jEdit/@jar.filename@|$out/share/jEdit/jedit.jar|g" package-files/linux/jedit
@@ -44,9 +44,7 @@ stdenv.mkDerivation {
     chmod +x $out/bin/jedit
   '';
 
-  buildInputs = [ ant ];
-
-  meta = { 
+  meta = {
     description = "Mature programmer's text editor (Java based)";
     homepage = http://www.jedit.org;
     license = "GPL";
diff --git a/pkgs/applications/editors/kdevelop/default.nix b/pkgs/applications/editors/kdevelop/default.nix
index 14f9c1eb0d49..b815b0523471 100644
--- a/pkgs/applications/editors/kdevelop/default.nix
+++ b/pkgs/applications/editors/kdevelop/default.nix
@@ -1,28 +1,20 @@
 { stdenv, fetchurl, kdevplatform, cmake, pkgconfig, automoc4, shared_mime_info,
-  kdebase_workspace, gettext, perl, okteta }:
+  kdebase_workspace, gettext, perl, okteta, qjson }:
 
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
-  version = "4.3.1";
+  version = "4.6.0";
   pname = "kdevelop";
 
   src = fetchurl {
-    url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.bz2";
-    sha256 = "0015hv39rqhyq1w6jw65lx7ls4l5pc3a2asvd5zsd65831vrfxxs";
+    url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.xz";
+    sha256 = "1ee9e7b8c46f575dd29d920cfd6284130f2e738a2e1f52dfd97b075fab2e4c73";
   };
 
-  buildInputs = [ kdevplatform kdebase_workspace okteta ];
+  buildInputs = [ kdevplatform kdebase_workspace okteta qjson ];
 
   nativeBuildInputs = [ cmake pkgconfig automoc4 shared_mime_info gettext perl ];
 
-  patches =
-    [ ( fetchurl {
-        url = https://git.reviewboard.kde.org/r/105211/diff/raw/;
-        name = "okteta-0.9.patch"; # fixes build with KDE-4.9.x
-        sha256 = "1mvqhw7jr1vi66l3jgam3slyfafcvwy4g3iapfi69dpfnzhmcxl0";
-      } )
-    ];
-
   NIX_CFLAGS_COMPILE = "-I${okteta}/include/KDE";
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/editors/leksah/default.nix b/pkgs/applications/editors/leksah/default.nix
deleted file mode 100644
index 86f0106ed050..000000000000
--- a/pkgs/applications/editors/leksah/default.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ cabal, binary, binaryShared, Cabal, deepseq, enumerator, filepath
-, gio, glib, gtk, gtksourceview2, hslogger, leksahServer, ltk, mtl
-, network, parsec, QuickCheck, regexBase, regexTdfa, strict, text
-, time, transformers, utf8String
-}:
-
-cabal.mkDerivation (self: {
-  pname = "leksah";
-  version = "0.12.1.3";
-  sha256 = "1w61wnd0nq9iqh0pwn9dz3m4qn3m0zasv0m3ki4k7plcdrmkqb3y";
-  isLibrary = true;
-  isExecutable = true;
-  buildDepends = [
-    binary binaryShared Cabal deepseq enumerator filepath gio glib gtk
-    gtksourceview2 hslogger leksahServer ltk mtl network parsec
-    QuickCheck regexBase regexTdfa strict text time transformers
-    utf8String
-  ];
-  testDepends = [ Cabal QuickCheck ];
-  noHaddock = true;
-  meta = {
-    homepage = "http://www.leksah.org";
-    description = "Haskell IDE written in Haskell";
-    license = "GPL";
-    platforms = self.stdenv.lib.platforms.linux;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/applications/editors/lighttable/default.nix b/pkgs/applications/editors/lighttable/default.nix
new file mode 100644
index 000000000000..b5ab1950e2b6
--- /dev/null
+++ b/pkgs/applications/editors/lighttable/default.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchurl, buildEnv, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
+, dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
+, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xlibs, udev
+}:
+
+let
+  libPath = stdenv.lib.makeLibraryPath [
+      stdenv.gcc.gcc zlib glib dbus gtk atk pango freetype libgnome_keyring3 nss
+      fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gnome3.gconf
+      xlibs.libXrender xlibs.libX11 xlibs.libXext xlibs.libXdamage xlibs.libXtst
+      xlibs.libXcomposite xlibs.libXi xlibs.libXfixes
+];
+in
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "LightTable-${version}";
+  version = "0.6.7";
+
+  src = 
+    if stdenv.system == "i686-linux" then
+      fetchurl {
+        name = "LightTableLinux.tar.gz";
+        url = https://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.7/LightTableLinux.tar.gz;
+        sha256 = "3b09f9665ed1b4abb7c1ca16286ac7222caf6dc124059be6db4cb9f5fd041e73";
+      }
+    else
+      fetchurl {
+        name = "LightTableLinux64.tar.gz";
+        url = https://d35ac8ww5dfjyg.cloudfront.net/playground/bins/0.6.7/LightTableLinux64.tar.gz;
+        sha256 = "710d670ccc30aadba521ccb723388679ee6404aac662297a005432c811d59e82";
+      };
+
+  buildInputs = [ makeWrapper ];
+  phases = [ "installPhase" ];
+
+  installPhase = ''
+    tar xvf ${src}
+    mkdir -p $out/bin
+    mv LightTable $out/
+
+    patchelf \
+      --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath}:${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
+      $out/LightTable/ltbin
+
+    ln -s ${udev}/lib/libudev.so.1 $out/LightTable/libudev.so.0
+
+    makeWrapper $out/LightTable/ltbin $out/bin/lighttable \
+      --prefix "LD_LIBRARY_PATH" : $out/LightTable
+  '';
+
+  meta = with stdenv.lib; {
+    description = "the next generation code editor";
+    homepage = http://www.lighttable.com/;
+    license = [ licenses.gpl3 ];
+  };
+}
diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix
index 15cdadb04f53..caea8758d958 100644
--- a/pkgs/applications/editors/nano/default.nix
+++ b/pkgs/applications/editors/nano/default.nix
@@ -2,17 +2,19 @@
 
 stdenv.mkDerivation (rec {
   pname = "nano";
-  version = "2.2.6";
+  version = "2.3.6";
 
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/nano/${name}.tar.gz";
-    sha256 = "0yp6pid67k8h7394spzw0067fl2r7rxm2b6kfccg87g8nlry2s5y";
+    sha256 = "a74bf3f18b12c1c777ae737c0e463152439e381aba8720b4bc67449f36a09534";
   };
 
   buildInputs = [ ncurses gettext ];
 
+  configureFlags = "sysconfdir=/etc";
+
   meta = {
     homepage = http://www.nano-editor.org/;
     description = "A small, user-friendly console text editor";
diff --git a/pkgs/applications/editors/netbeans/default.nix b/pkgs/applications/editors/netbeans/default.nix
index f1fd9adbe86a..5a2afebdd5cf 100644
--- a/pkgs/applications/editors/netbeans/default.nix
+++ b/pkgs/applications/editors/netbeans/default.nix
@@ -11,10 +11,10 @@ let
   };
 in
 stdenv.mkDerivation {
-  name = "netbeans-7.2";
+  name = "netbeans-7.4";
   src = fetchurl {
-    url = http://download.netbeans.org/netbeans/7.2/final/zip/netbeans-7.2-201207171143-ml.zip;
-    sha256 = "18ya1w291hdnc35vb12yqnai82wmqm7351wn82fax12kzha5fmci";
+    url = http://download.netbeans.org/netbeans/7.4/final/zip/netbeans-7.4-201310111528.zip;
+    sha256 = "0nrnghnsdix5cmp86xi1gmvarhjk2k8mlbld3dfa9impm8gpv6mx";
   };
   buildCommand = ''
     # Unpack and copy the stuff
@@ -25,7 +25,9 @@ stdenv.mkDerivation {
     # Create a wrapper capable of starting it
     mkdir -p $out/bin
     makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
-      --prefix PATH : ${jdk}/bin:${which}/bin
+      --prefix PATH : ${jdk}/bin:${which}/bin \
+      --prefix JAVA_HOME : ${jdk}/lib/openjdk \
+      --add-flags "--jdkhome ${jdk}/lib/openjdk"
       
     # Create desktop item, so we can pick it from the KDE/GNOME menu
     mkdir -p $out/share/applications
diff --git a/pkgs/applications/editors/scite/default.nix b/pkgs/applications/editors/scite/default.nix
new file mode 100644
index 000000000000..234ee1f065e4
--- /dev/null
+++ b/pkgs/applications/editors/scite/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, gtk }:
+
+let
+  version = "3.3.7";
+
+  version_short = stdenv.lib.replaceChars [ "." ] [ "" ] "${version}";
+in stdenv.mkDerivation {
+  name = "scite-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/scintilla/SciTE/${version}/scite${version_short}.tgz";
+    sha256 = "0x7i6yxq50frsjkrp3lc5zy0d1ssq2n91igjn0dmqajpg7kls2dd";
+  };
+
+  buildInputs = [ pkgconfig gtk ];
+  sourceRoot = "scintilla/gtk";
+
+  buildPhase = ''
+    make
+    cd ../../scite/gtk
+    make prefix=$out/
+  '';
+
+  installPhase = ''
+    make install prefix=$out/
+  '';
+
+  meta = {
+    homepage = "http://www.scintilla.org/SciTE.html";
+    description = "SCIntilla based Text Editor";
+    license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = stdenv.lib.maintainers.rszibele;
+  };
+}
diff --git a/pkgs/applications/editors/sublime/default.nix b/pkgs/applications/editors/sublime/default.nix
index cfa44d9285cc..0c967e05ba11 100644
--- a/pkgs/applications/editors/sublime/default.nix
+++ b/pkgs/applications/editors/sublime/default.nix
@@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out/bin
     mv Sublime* $out/sublime
     ln -s $out/sublime/sublime_text $out/bin/sublime
+    ln -s $out/sublime/sublime_text $out/bin/sublime2
 
     echo ${libPath}
     patchelf \
@@ -34,6 +35,6 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Sophisticated text editor for code, markup and prose";
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
   };
 }
diff --git a/pkgs/applications/editors/sublime3/default.nix b/pkgs/applications/editors/sublime3/default.nix
new file mode 100644
index 000000000000..3ef557cef4b3
--- /dev/null
+++ b/pkgs/applications/editors/sublime3/default.nix
@@ -0,0 +1,62 @@
+{ fetchurl, stdenv, glib, xlibs, cairo, gtk, pango, makeWrapper}:
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+let
+  build = "3059";
+  libPath = stdenv.lib.makeLibraryPath [glib xlibs.libX11 gtk cairo pango];
+in let
+  # package with just the binaries
+  sublime = stdenv.mkDerivation {
+    name = "sublimetext3-${build}-bin";
+
+    src =
+      if stdenv.system == "i686-linux" then
+        fetchurl {
+          name = "sublimetext-3.0.59.tar.bz2";
+          url = "http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_${build}_x32.tar.bz2";
+          sha256 = "5ee7b42b5db057108e97b86fd408124fc3f7b56662b2851f59d91f8f0c288088";
+        }
+      else
+        fetchurl {
+          name = "sublimetext-3.0.59.tar.bz2";
+          url = "http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_${build}_x64.tar.bz2";
+          sha256 = "da3039687664d33a734cea0151b2291ece9c7f35e5b73df5b2b5eac28a20b972";
+        };
+
+    dontStrip = true;
+    dontPatchELF = true;
+    buildInputs = [ makeWrapper ];
+
+    buildPhase = ''
+      for i in sublime_text plugin_host crash_reporter; do
+        patchelf \
+          --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          --set-rpath ${libPath}:${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
+          $i
+      done
+    '';
+
+    installPhase = ''
+      mkdir -p $out
+      cp -prvd * $out/
+      # Without this, plugin_host crashes, even though it has the rpath
+      wrapProgram $out/plugin_host --prefix LD_PRELOAD : ${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}/libgcc_s.so.1
+    '';
+  };
+in stdenv.mkDerivation {
+  name = "sublimetext3-${build}";
+
+  phases = [ "installPhase" ];
+  installPhase = ''
+    mkdir -p $out/bin
+    ln -s ${sublime}/sublime_text $out/bin/sublime
+    ln -s ${sublime}/sublime_text $out/bin/sublime3
+  '';
+
+  meta = {
+    description = "Sophisticated text editor for code, markup and prose";
+    maintainers = stdenv.lib.maintainers.wmertens;
+    license = stdenv.lib.licenses.unfree;
+  };
+}
diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix
index 1c6d86a2f3da..ce863312251c 100644
--- a/pkgs/applications/editors/texmacs/default.nix
+++ b/pkgs/applications/editors/texmacs/default.nix
@@ -88,7 +88,7 @@ stdenv.mkDerivation rec {
          collaborative authoring are planned for later.
       '';
     homepage = http://texmacs.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
diff --git a/pkgs/applications/editors/texmaker/default.nix b/pkgs/applications/editors/texmaker/default.nix
new file mode 100644
index 000000000000..16335a550653
--- /dev/null
+++ b/pkgs/applications/editors/texmaker/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, qt4, popplerQt4, zlib, pkgconfig, poppler}:
+
+stdenv.mkDerivation rec {
+  pname = "texmaker";
+  version = "4.1.1";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://www.xm1math.net/texmaker/${name}.tar.bz2";
+    sha256 = "1h5rxdq6f05wk3lnlw96fxwrb14k77cx1mwy648127h2c8nsgw4z";
+  };
+
+  buildInputs = [ qt4 popplerQt4 zlib ];
+
+  nativeBuildInputs = [ pkgconfig poppler ];
+
+  preConfigure = ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${poppler}/include/poppler/) " # for poppler-config.h
+    qmake PREFIX=$out DESKTOPDIR=$out/share/applications ICONDIR=$out/share/pixmaps texmaker.pro
+  '';
+
+  meta = with stdenv.lib; {
+    description = "TeX and LaTeX editor";
+    longDescription=''
+	This editor is a full fledged IDE for TeX and
+	LaTeX editing with completion, structure viewer, preview,
+	spell checking and support of any compilation chain.
+	'';
+    homepage = "http://www.xm1math.net/texmaker/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cfouche ];
+  };
+}
diff --git a/pkgs/applications/editors/texstudio/default.nix b/pkgs/applications/editors/texstudio/default.nix
new file mode 100644
index 000000000000..cd7f0b78c235
--- /dev/null
+++ b/pkgs/applications/editors/texstudio/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, qt4, popplerQt4, zlib}:
+
+stdenv.mkDerivation rec {
+  pname = "texstudio";
+  version = "2.7.0";
+  name = "${pname}-${version}";
+  altname="Texstudio";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/texstudio/${name}.tar.gz";
+    sha256 = "167d78nfk265jjvl129nr70v8ladb2rav2qyhw7ngr6m54gak831";
+  };
+
+  buildInputs = [ qt4 popplerQt4 zlib ];
+
+  preConfigure = ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${popplerQt4}/include/poppler/qt4) "
+    qmake PREFIX=$out texstudio.pro
+  '';
+
+  meta = with stdenv.lib; {
+    description = "TeX and LaTeX editor";
+    longDescription=''
+	Fork of TeXMaker, this editor is a full fledged IDE for 
+	LaTeX editing with completion, structure viewer, preview,
+	spell checking and support of any compilation chain.
+	'';
+    homepage = "http://texstudio.sourceforge.net/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cfouche ];
+  };
+}
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index 789ddcc10395..710ceb7d31f1 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -1,9 +1,35 @@
 # TODO tidy up eg The patchelf code is patching gvim even if you don't build it..
 # but I have gvim with python support now :) - Marc
-args@{source ? "default", ...}: with args;
-
-
-let inherit (args.composableDerivation) composableDerivation edf; in
+args@{pkgs, source ? "default", ...}: with args;
+
+
+let inherit (args.composableDerivation) composableDerivation edf;
+  nixosRuntimepath = pkgs.writeText "nixos-vimrc" ''
+    set nocompatible
+    syntax on
+
+    function! NixosPluginPath()
+      let seen = {}
+      for p in reverse(split($NIX_PROFILES))
+        for d in split(glob(p . '/share/vim-plugins/*'))
+          let pluginname = substitute(d, ".*/", "", "")
+          if !has_key(seen, pluginname)
+            exec 'set runtimepath^='.d
+            let seen[pluginname] = 1
+          endif
+        endfor
+      endfor
+    endfunction
+
+    execute NixosPluginPath()
+
+    if filereadable("/etc/vimrc")
+      source /etc/vimrc
+    elseif filereadable("/etc/vim/vimrc")
+      source /etc/vim/vimrc
+    endif
+  '';
+in
 composableDerivation {
   # use gccApple to compile on darwin
   mkDerivation = ( if stdenv.isDarwin
@@ -11,18 +37,20 @@ composableDerivation {
                    else stdenv ).mkDerivation;
 } (fix: {
 
-    name = "vim_configurable-7.4.23";
+    name = "vim_configurable-7.4.335";
 
     enableParallelBuilding = true; # test this
 
-    src = 
+    src =
       builtins.getAttr source {
       "default" =
         # latest release
-        args.fetchurl {
-            url = ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2;
-            sha256 = "1pjaffap91l2rb9pjnlbrpvb3ay5yhhr3g91zabjvw1rqk9adxfh";
-          };
+      args.fetchhg {
+            url = "https://vim.googlecode.com/hg/";
+            rev = "v7-4-335";
+            sha256 = "0qnpzfcbi6fhz82pj68l4vrnigca1akq2ksrxz6krwlfhns6jhhj";
+      };
+
       "vim-nox" =
           {
             # vim nox branch: client-server without X by uing sockets
@@ -33,16 +61,13 @@ composableDerivation {
           }.src;
       };
 
+    prePatch = "cd src";
+
     # if darwin support is enabled, we want to make sure we're not building with
     # OS-installed python framework
-    preConfigure
-      = stdenv.lib.optionalString
-        (stdenv.isDarwin && (config.vim.darwin or true)) ''
-          # TODO: we should find a better way of doing this as, if the configure
-          # file changes, we need to change these line numbers
-          sed -i "5641,5644d" src/auto/configure
-          sed -i "5648d" src/auto/configure
-        '';
+    patches = stdenv.lib.optionals
+      (stdenv.isDarwin && (config.vim.darwin or true))
+      [ ./python_framework.patch ];
 
     configureFlags
       = [ "--enable-gui=${args.gui}" "--with-features=${args.features}" ];
@@ -51,16 +76,6 @@ composableDerivation {
       = [ ncurses pkgconfig gtk libX11 libXext libSM libXpm libXt libXaw libXau
           libXmu glib libICE ];
 
-    prePatch = "cd src";
-    
-    patches =
-      [ ./patches/7.4.001 ./patches/7.4.002 ./patches/7.4.003 ./patches/7.4.004
-        ./patches/7.4.005 ./patches/7.4.006 ./patches/7.4.007 ./patches/7.4.008
-        ./patches/7.4.009 ./patches/7.4.010 ./patches/7.4.011 ./patches/7.4.012
-        ./patches/7.4.013 ./patches/7.4.014 ./patches/7.4.015 ./patches/7.4.016
-        ./patches/7.4.017 ./patches/7.4.018 ./patches/7.4.019 ./patches/7.4.020
-        ./patches/7.4.021 ./patches/7.4.022 ./patches/7.4.023 ];
-
     # most interpreters aren't tested yet.. (see python for example how to do it)
     flags = {
         ftNix = {
@@ -93,7 +108,17 @@ composableDerivation {
 
       // edf { name = "tcl"; enable = { nativeBuildInputs = [tcl]; }; } #Include Tcl interpreter.
       // edf { name = "ruby"; feat = "rubyinterp"; enable = { nativeBuildInputs = [ruby]; };} #Include Ruby interpreter.
-      // edf { name = "lua" ; feat = "luainterp"; enable = { nativeBuildInputs = [lua]; configureFlags = ["--with-lua-prefix=${args.lua}"];};}
+      // edf {
+        name = "lua";
+        feat = "luainterp";
+        enable = {
+          nativeBuildInputs = [lua];
+          configureFlags = [
+            "--with-lua-prefix=${args.lua}"
+            "--enable-luainterp"
+          ];
+        };
+      }
       // edf { name = "cscope"; } #Include cscope interface.
       // edf { name = "workshop"; } #Include Sun Visual Workshop support.
       // edf { name = "netbeans"; } #Disable NetBeans integration support.
@@ -108,6 +133,7 @@ composableDerivation {
       ;
 
   cfg = {
+    luaSupport       = config.vim.lua or true;
     pythonSupport    = config.vim.python or true;
     rubySupport      = config.vim.ruby or true;
     nlsSupport       = config.vim.nls or false;
@@ -145,6 +171,8 @@ composableDerivation {
     echo $nativeBuildInputs
     echo $rpath
     patchelf --set-rpath $rpath $out/bin/{vim,gvim}
+
+    ln -sfn ${nixosRuntimepath} $out/share/vim/vimrc
   '';
 
   dontStrip = 1;
diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix
index a2672b5c0d67..95f654eb8cac 100644
--- a/pkgs/applications/editors/vim/default.nix
+++ b/pkgs/applications/editors/vim/default.nix
@@ -1,16 +1,18 @@
-{ stdenv, fetchurl, ncurses, gettext, pkgconfig }:
+{ stdenv, fetchhg, ncurses, gettext, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  patchLevel = "23";
-  name       = "vim-7.4.${patchLevel}";
- 
-  src = fetchurl {
-    url    = "ftp://ftp.vim.org/pub/vim/unix/${name}.tar.bz2";
-    sha256 = "1pjaffap91l2rb9pjnlbrpvb3ay5yhhr3g91zabjvw1rqk9adxfh";
+  name = "vim-${version}";
+
+  version = "7.4.335";
+
+  src = fetchhg {
+    url = "https://vim.googlecode.com/hg/";
+    rev = "v7-4-335";
+    sha256 = "0qnpzfcbi6fhz82pj68l4vrnigca1akq2ksrxz6krwlfhns6jhhj";
   };
 
   enableParallelBuilding = true;
- 
+
   buildInputs = [ ncurses pkgconfig ];
   nativeBuildInputs = [ gettext ];
 
@@ -44,16 +46,6 @@ stdenv.mkDerivation rec {
   #   sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure
   # '';
 
-  prePatch = "cd src";
-  
-  patches =
-    [ ./patches/7.4.001 ./patches/7.4.002 ./patches/7.4.003 ./patches/7.4.004
-      ./patches/7.4.005 ./patches/7.4.006 ./patches/7.4.007 ./patches/7.4.008
-      ./patches/7.4.009 ./patches/7.4.010 ./patches/7.4.011 ./patches/7.4.012
-      ./patches/7.4.013 ./patches/7.4.014 ./patches/7.4.015 ./patches/7.4.016
-      ./patches/7.4.017 ./patches/7.4.018 ./patches/7.4.019 ./patches/7.4.020
-      ./patches/7.4.021 ./patches/7.4.022 ./patches/7.4.023 ];
-
   meta = with stdenv.lib; {
     description = "The most popular clone of the VI editor";
     homepage    = http://www.vim.org;
diff --git a/pkgs/applications/editors/vim/ft-nix-support.patch b/pkgs/applications/editors/vim/ft-nix-support.patch
index 4b5a742dac1c..ed508784813c 100644
--- a/pkgs/applications/editors/vim/ft-nix-support.patch
+++ b/pkgs/applications/editors/vim/ft-nix-support.patch
@@ -23,7 +23,7 @@ new file mode 100644
 index 0000000..a2f9918
 --- /dev/null
 +++ b/runtime/syntax/nix.vim
-@@ -0,0 +1,40 @@
+@@ -0,0 +1,47 @@
 +" Vim syntax file
 +" Language:	nix
 +" Maintainer:	Marc Weber <marco-oweber@gmx.de>
@@ -38,15 +38,16 @@ index 0000000..a2f9918
 +  finish
 +endif
 +
-+syn keyword	nixKeyword	let throw inherit import true false null with
++syn keyword	nixKeyword	let in rec assert inherit import true false null with ...
++syn keyword	nixBuiltin	import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation
 +syn keyword	nixConditional	if else then
 +syn keyword     nixBrace        ( ) { } =
 +syn keyword     nixBuiltin         __currentSystem __currentTime __isFunction __getEnv __trace __toPath __pathExists 
 +  \ __readFile __toXML __toFile __filterSource __attrNames __getAttr __hasAttr __isAttrs __listToAttrs __isList 
 +  \ __head __tail __add __sub __lessThan __substring __stringLength
 +
-+syn match nixAttr "\w\+\ze\s*="
-+syn match nixFuncArg "\zs\w\+\ze\s*:"
++syn match nixAttr "[a-zA-Z0-9-_]\+\ze\s*="
++syn match nixFuncArg "\zs[a-zA-Z0-9-_]\+\ze\s*:"
 +syn region nixStringParam start=+\${+ end=+}+
 +syn region nixMultiLineComment start=+/\*+ skip=+\\"+ end=+\*/+
 +syn match  nixEndOfLineComment "#.*$"
@@ -54,6 +55,7 @@ index 0000000..a2f9918
 +syn region nixString         start=+"+ skip=+\\"+ end=+"+ contains=nixStringParam
 +
 +hi def link nixKeyword       Keyword
++hi def link nixBuiltin       Function
 +hi def link nixConditional   Conditional
 +hi def link nixBrace         Special
 +hi def link nixString        String
@@ -64,3 +66,10 @@ index 0000000..a2f9918
 +hi def link nixEndOfLineComment Comment
 +hi def link nixAttr        Identifier
 +hi def link nixFuncArg     Identifier
++
++let b:current_syntax = "nix"
++
++" scan backwards to find begining of multiline statements
++syn sync ccomment nixMultiLineComment minlines=10 maxlines=500
++syn sync ccomment nixStringIndented minlines=10 maxlines=500
++syn sync ccomment nixString maxlines=10
diff --git a/pkgs/applications/editors/vim/macvim.nix b/pkgs/applications/editors/vim/macvim.nix
new file mode 100644
index 000000000000..feafa7b99777
--- /dev/null
+++ b/pkgs/applications/editors/vim/macvim.nix
@@ -0,0 +1,93 @@
+{ stdenv, stdenvAdapters, gccApple, fetchFromGitHub, ncurses, gettext,
+  pkgconfig, cscope, python, ruby, tcl, perl, luajit
+}:
+
+let inherit (stdenvAdapters.overrideGCC stdenv gccApple) mkDerivation;
+in mkDerivation rec {
+  name = "macvim-${version}";
+
+  version = "7.4.355";
+
+  src = fetchFromGitHub {
+    owner = "genoma";
+    repo = "macvim";
+    rev = "c18a61f9723565664ffc2eda9179e96c95860e25";
+    sha256 = "190bngg8m4bwqcia7w24gn7mmqkhk0mavxy81ziwysam1f652ymf";
+  };
+
+  enableParallelBuilding = true;
+
+  buildInputs = [
+    gettext ncurses pkgconfig luajit ruby tcl perl python
+  ];
+
+  patches = [ ./macvim.patch ];
+
+  postPatch = ''
+    substituteInPlace src/MacVim/mvim --replace "# VIM_APP_DIR=/Applications" "VIM_APP_DIR=$out/Applications"
+
+    # Don't create custom icons.
+    substituteInPlace src/MacVim/icons/Makefile --replace '$(MAKE) -C makeicns' ""
+    substituteInPlace src/MacVim/icons/make_icons.py --replace "dont_create = False" "dont_create = True"
+
+    # Full path to xcodebuild
+    substituteInPlace src/Makefile --replace "xcodebuild" "/usr/bin/xcodebuild"
+  '';
+
+  configureFlags = [
+      #"--enable-cscope" # TODO: cscope doesn't build on Darwin yet
+      "--enable-fail-if-missing"
+      "--with-features=huge"
+      "--enable-gui=macvim"
+      "--enable-multibyte"
+      "--enable-nls"
+      "--enable-luainterp=dynamic"
+      "--enable-pythoninterp=dynamic"
+      "--enable-perlinterp=dynamic"
+      "--enable-rubyinterp=dynamic"
+      "--enable-tclinterp=yes"
+      "--with-luajit"
+      "--with-lua-prefix=${luajit}"
+      "--with-ruby-command=${ruby}/bin/ruby"
+      "--with-tclsh=${tcl}/bin/tclsh"
+      "--with-tlib=ncurses"
+      "--with-compiledby=Nix"
+  ];
+
+  preConfigure = ''
+    DEV_DIR=$(/usr/bin/xcode-select -print-path)/Platforms/MacOSX.platform/Developer
+    configureFlagsArray+=(
+      "--with-developer-dir=$DEV_DIR"
+    )
+  '';
+
+  postInstall = ''
+    mkdir -p $out/Applications
+    cp -r src/MacVim/build/Release/MacVim.app $out/Applications
+
+    rm $out/bin/{Vimdiff,Vimtutor,Vim,ex,rVim,rview,view}
+
+    cp src/MacVim/mvim $out/bin
+    cp src/vimtutor $out/bin
+
+    for prog in "vimdiff" "vi" "vim" "ex" "rvim" "rview" "view"; do
+      ln -s $out/bin/mvim $out/bin/$prog
+    done
+
+    # Fix rpaths
+    exe="$out/Applications/MacVim.app/Contents/MacOS/Vim"
+    libperl=$(dirname $(find ${perl} -name "libperl.dylib"))
+    install_name_tool -add_rpath ${luajit}/lib $exe
+    install_name_tool -add_rpath ${tcl}/lib $exe
+    install_name_tool -add_rpath ${python}/lib $exe
+    install_name_tool -add_rpath $libperl $exe
+    install_name_tool -add_rpath ${ruby}/lib $exe
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Vim - the text editor - for Mac OS X";
+    homepage    = https://github.com/b4winckler/macvim;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms   = platforms.darwin;
+  };
+}
diff --git a/pkgs/applications/editors/vim/macvim.patch b/pkgs/applications/editors/vim/macvim.patch
new file mode 100644
index 000000000000..a789b9952d2b
--- /dev/null
+++ b/pkgs/applications/editors/vim/macvim.patch
@@ -0,0 +1,189 @@
+diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj
+index 1c5ff47..677a2cc 100644
+--- a/src/MacVim/MacVim.xcodeproj/project.pbxproj
++++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj
+@@ -437,6 +437,8 @@
+ /* Begin PBXProject section */
+ 		29B97313FDCFA39411CA2CEA /* Project object */ = {
+ 			isa = PBXProject;
++			attributes = {
++			};
+ 			buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MacVim" */;
+ 			compatibilityVersion = "Xcode 2.4";
+ 			developmentRegion = English;
+@@ -632,6 +634,7 @@
+ 				INSTALL_PATH = "$(HOME)/Applications";
+ 				MACOSX_DEPLOYMENT_TARGET = "";
+ 				ONLY_ACTIVE_ARCH = YES;
++				OTHER_LDFLAGS = "-headerpad_max_install_names";
+ 				PRODUCT_NAME = MacVim;
+ 				VERSIONING_SYSTEM = "apple-generic";
+ 				WARNING_CFLAGS = "-Wall";
+@@ -662,6 +665,7 @@
+ 				INSTALL_PATH = "$(HOME)/Applications";
+ 				MACOSX_DEPLOYMENT_TARGET = "";
+ 				ONLY_ACTIVE_ARCH = YES;
++				OTHER_LDFLAGS = "-headerpad_max_install_names";
+ 				PRODUCT_NAME = MacVim;
+ 				VERSIONING_SYSTEM = "apple-generic";
+ 				WRAPPER_EXTENSION = app;
+
+diff --git a/src/vimtutor b/src/vimtutor
+index 70d9ec7..b565a1a 100755
+--- a/src/vimtutor
++++ b/src/vimtutor
+@@ -16,7 +16,7 @@ seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
+ if test "$1" = "-g"; then 
+   # Try to use the GUI version of Vim if possible, it will fall back
+   # on Vim if Gvim is not installed.
+-  seq="gvim gvim8 gvim75 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq"
++  seq="mvim gvim gvim8 gvim75 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq"
+   shift
+ fi
+ 
+
+diff --git a/src/auto/configure b/src/auto/configure
+index bc9f074..9b9125e 100755
+--- a/src/auto/configure
++++ b/src/auto/configure
+@@ -2252,7 +2252,7 @@ rm -f conftest.val
+   as_fn_set_status $ac_retval
+ 
+ } # ac_fn_c_compute_int
+-cat >auto/config.log <<_ACEOF
++cat >config.log <<_ACEOF
+ This file contains any messages produced by compilers while
+ running configure, to aid debugging if configure makes a mistake.
+ 
+@@ -2262,7 +2262,7 @@ generated by GNU Autoconf 2.69.  Invocation command line was
+   $ $0 $@
+ 
+ _ACEOF
+-exec 5>>auto/config.log
++exec 5>>config.log
+ {
+ cat <<_ASUNAME
+ ## --------- ##
+@@ -5377,10 +5377,7 @@ $as_echo "no" >&6; }
+   fi
+ 
+   if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
+-    if test "x$MACOSX" = "xyes"; then
+-      MZSCHEME_LIBS="-framework Racket"
+-      MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+-    elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
++    if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then
+       MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"
+       MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
+     elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libracket3m.a"; then
+@@ -5716,23 +5713,6 @@ $as_echo ">>> too old; need Perl version 5.003_01 or later <<<" >&6; }
+   fi
+ 
+   if test "x$MACOSX" = "xyes"; then
+-        dir=/System/Library/Perl
+-    darwindir=$dir/darwin
+-    if test -d $darwindir; then
+-      PERL=/usr/bin/perl
+-    else
+-            dir=/System/Library/Perl/5.8.1
+-      darwindir=$dir/darwin-thread-multi-2level
+-      if test -d $darwindir; then
+-	PERL=/usr/bin/perl
+-      fi
+-    fi
+-    if test -n "$PERL"; then
+-      PERL_DIR="$dir"
+-      PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
+-      PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
+-      PERL_LIBS="-L$darwindir/CORE -lperl"
+-    fi
+                 PERL_LIBS=`echo "$PERL_LIBS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
+     PERL_CFLAGS=`echo "$PERL_CFLAGS" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
+   fi
+@@ -5926,10 +5906,6 @@ __:
+ eof
+ 	    	    eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
+ 	    rm -f -- "${tmp_mkf}"
+-	    if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
+-		"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
+-	      vi_cv_path_python_plibs="-framework Python"
+-	    else
+ 	      if test "${vi_cv_var_python_version}" = "1.4"; then
+ 		  vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
+ 	      else
+@@ -5937,7 +5913,6 @@ eof
+ 	      fi
+ 	      vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
+ 	      	      vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
+-	    fi
+ 
+ fi
+ 
+@@ -6004,13 +5979,6 @@ rm -f core conftest.err conftest.$ac_objext \
+ $as_echo "no" >&6; }
+ 	fi
+ 
+-                                if test -n "$MACSDK"; then
+-          PYTHON_CFLAGS=
+-          PYTHON_LIBS=-framework Python
+-          PYTHON_CONFDIR=
+-          PYTHON_GETPATH_CFLAGS=
+-        fi
+-
+ 			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python are sane" >&5
+ $as_echo_n "checking if compile and link flags for Python are sane... " >&6; }
+ 	cflags_save=$CFLAGS
+@@ -6853,11 +6821,7 @@ $as_echo "$tclver - OK" >&6; };
+ 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Tcl include" >&5
+ $as_echo_n "checking for location of Tcl include... " >&6; }
+-      if test "x$MACOSX" != "xyes"; then
+ 	tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
+-      else
+-		tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
+-      fi
+       TCL_INC=
+       for try in $tclinc; do
+ 	if test -f "$try/tcl.h"; then
+@@ -6875,12 +6839,8 @@ $as_echo "<not found>" >&6; }
+       if test -z "$SKIP_TCL"; then
+ 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of tclConfig.sh script" >&5
+ $as_echo_n "checking for location of tclConfig.sh script... " >&6; }
+-	if test "x$MACOSX" != "xyes"; then
+ 	  tclcnf=`echo $tclinc | sed s/include/lib/g`
+ 	  tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
+-	else
+-	  	  tclcnf="/System/Library/Frameworks/Tcl.framework"
+-	fi
+ 	for try in $tclcnf; do
+ 	  if test -f $try/tclConfig.sh; then
+ 	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try/tclConfig.sh" >&5
+@@ -7050,10 +7010,6 @@ $as_echo "$rubyhdrdir" >&6; }
+ 	if test -f "$rubylibdir/$librubya"; then
+ 	  librubyarg="$librubyarg"
+ 	  RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
+-        elif test -d "/System/Library/Frameworks/Ruby.framework"; then
+-                        RUBY_LIBS="-framework Ruby"
+-                        RUBY_CFLAGS="-DRUBY_VERSION=$rubyversion"
+-            librubyarg=
+ 	fi
+ 
+ 	if test "X$librubyarg" != "X"; then
+@@ -14061,7 +14017,7 @@ fi
+ 
+ _ACEOF
+ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+-exec 5>>auto/config.log
++exec 5>>config.log
+ {
+   echo
+   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+@@ -14653,7 +14609,7 @@ if test "$no_create" != yes; then
+     ac_config_status_args="$ac_config_status_args --quiet"
+   exec 5>/dev/null
+   $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+-  exec 5>>auto/config.log
++  exec 5>>config.log
+   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+   # would make configure fail if this is the last instruction.
+   $ac_cs_success || as_fn_exit 1
diff --git a/pkgs/applications/editors/vim/patches/7.4.001 b/pkgs/applications/editors/vim/patches/7.4.001
deleted file mode 100644
index 5788972a569d..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.001
+++ /dev/null
@@ -1,489 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.001
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.001
-Problem:    Character classes such as [a-z] to not react to 'ignorecase'.
-	    Breaks man page highlighting. (Mario Grgic)
-Solution:   Add separate items for classes that react to 'ignorecase'.  Clean
-	    up logic handling character classes.  Add more tests.
-Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
-
-
-*** ../vim-7.4.000/src/regexp_nfa.c	2013-08-01 18:27:51.000000000 +0200
---- src/regexp_nfa.c	2013-08-14 11:49:50.000000000 +0200
-***************
-*** 29,34 ****
---- 29,37 ----
-  # define NFA_REGEXP_DEBUG_LOG	"nfa_regexp_debug.log"
-  #endif
-  
-+ /* Added to NFA_ANY - NFA_NUPPER_IC to include a NL. */
-+ #define NFA_ADD_NL		31
-+ 
-  enum
-  {
-      NFA_SPLIT = -1024,
-***************
-*** 183,188 ****
---- 186,198 ----
-      NFA_NLOWER,		/*	Match non-lowercase char */
-      NFA_UPPER,		/*	Match uppercase char */
-      NFA_NUPPER,		/*	Match non-uppercase char */
-+     NFA_LOWER_IC,	/*	Match [a-z] */
-+     NFA_NLOWER_IC,	/*	Match [^a-z] */
-+     NFA_UPPER_IC,	/*	Match [A-Z] */
-+     NFA_NUPPER_IC,	/*	Match [^A-Z] */
-+ 
-+     NFA_FIRST_NL = NFA_ANY + NFA_ADD_NL,
-+     NFA_LAST_NL = NFA_NUPPER_IC + NFA_ADD_NL,
-  
-      NFA_CURSOR,		/*	Match cursor pos */
-      NFA_LNUM,		/*	Match line number */
-***************
-*** 199,207 ****
-      NFA_MARK_LT,	/*	Match < mark */
-      NFA_VISUAL,		/*	Match Visual area */
-  
--     NFA_FIRST_NL = NFA_ANY + ADD_NL,
--     NFA_LAST_NL = NFA_NUPPER + ADD_NL,
-- 
-      /* Character classes [:alnum:] etc */
-      NFA_CLASS_ALNUM,
-      NFA_CLASS_ALPHA,
---- 209,214 ----
-***************
-*** 578,583 ****
---- 585,592 ----
-   * On failure, return 0 (=FAIL)
-   * Start points to the first char of the range, while end should point
-   * to the closing brace.
-+  * Keep in mind that 'ignorecase' applies at execution time, thus [a-z] may
-+  * need to be interpreted as [a-zA-Z].
-   */
-      static int
-  nfa_recognize_char_class(start, end, extra_newl)
-***************
-*** 681,687 ****
-  	return FAIL;
-  
-      if (newl == TRUE)
-! 	extra_newl = ADD_NL;
-  
-      switch (config)
-      {
---- 690,696 ----
-  	return FAIL;
-  
-      if (newl == TRUE)
-! 	extra_newl = NFA_ADD_NL;
-  
-      switch (config)
-      {
-***************
-*** 710,722 ****
-  	case CLASS_not | CLASS_az | CLASS_AZ:
-  	    return extra_newl + NFA_NALPHA;
-  	case CLASS_az:
-! 	   return extra_newl + NFA_LOWER;
-  	case CLASS_not | CLASS_az:
-! 	    return extra_newl + NFA_NLOWER;
-  	case CLASS_AZ:
-! 	    return extra_newl + NFA_UPPER;
-  	case CLASS_not | CLASS_AZ:
-! 	    return extra_newl + NFA_NUPPER;
-      }
-      return FAIL;
-  }
---- 719,731 ----
-  	case CLASS_not | CLASS_az | CLASS_AZ:
-  	    return extra_newl + NFA_NALPHA;
-  	case CLASS_az:
-! 	   return extra_newl + NFA_LOWER_IC;
-  	case CLASS_not | CLASS_az:
-! 	    return extra_newl + NFA_NLOWER_IC;
-  	case CLASS_AZ:
-! 	    return extra_newl + NFA_UPPER_IC;
-  	case CLASS_not | CLASS_AZ:
-! 	    return extra_newl + NFA_NUPPER_IC;
-      }
-      return FAIL;
-  }
-***************
-*** 914,920 ****
-  		break;
-  	    }
-  
-! 	    extra = ADD_NL;
-  
-  	    /* "\_[" is collection plus newline */
-  	    if (c == '[')
---- 923,929 ----
-  		break;
-  	    }
-  
-! 	    extra = NFA_ADD_NL;
-  
-  	    /* "\_[" is collection plus newline */
-  	    if (c == '[')
-***************
-*** 970,976 ****
-  	    }
-  #endif
-  	    EMIT(nfa_classcodes[p - classchars]);
-! 	    if (extra == ADD_NL)
-  	    {
-  		EMIT(NFA_NEWL);
-  		EMIT(NFA_OR);
---- 979,985 ----
-  	    }
-  #endif
-  	    EMIT(nfa_classcodes[p - classchars]);
-! 	    if (extra == NFA_ADD_NL)
-  	    {
-  		EMIT(NFA_NEWL);
-  		EMIT(NFA_OR);
-***************
-*** 1240,1260 ****
-  	    {
-  		/*
-  		 * Try to reverse engineer character classes. For example,
-! 		 * recognize that [0-9] stands for  \d and [A-Za-z_] with \h,
-  		 * and perform the necessary substitutions in the NFA.
-  		 */
-  		result = nfa_recognize_char_class(regparse, endp,
-! 							    extra == ADD_NL);
-  		if (result != FAIL)
-  		{
-! 		    if (result >= NFA_DIGIT && result <= NFA_NUPPER)
-! 			EMIT(result);
-! 		    else	/* must be char class + newline */
-  		    {
-! 			EMIT(result - ADD_NL);
-  			EMIT(NFA_NEWL);
-  			EMIT(NFA_OR);
-  		    }
-  		    regparse = endp;
-  		    mb_ptr_adv(regparse);
-  		    return OK;
---- 1249,1269 ----
-  	    {
-  		/*
-  		 * Try to reverse engineer character classes. For example,
-! 		 * recognize that [0-9] stands for \d and [A-Za-z_] for \h,
-  		 * and perform the necessary substitutions in the NFA.
-  		 */
-  		result = nfa_recognize_char_class(regparse, endp,
-! 							 extra == NFA_ADD_NL);
-  		if (result != FAIL)
-  		{
-! 		    if (result >= NFA_FIRST_NL && result <= NFA_LAST_NL)
-  		    {
-! 			EMIT(result - NFA_ADD_NL);
-  			EMIT(NFA_NEWL);
-  			EMIT(NFA_OR);
-  		    }
-+ 		    else
-+ 			EMIT(result);
-  		    regparse = endp;
-  		    mb_ptr_adv(regparse);
-  		    return OK;
-***************
-*** 1504,1510 ****
-  			     * collection, add an OR below. But not for negated
-  			     * range. */
-  			    if (!negated)
-! 				extra = ADD_NL;
-  			}
-  			else
-  			{
---- 1513,1519 ----
-  			     * collection, add an OR below. But not for negated
-  			     * range. */
-  			    if (!negated)
-! 				extra = NFA_ADD_NL;
-  			}
-  			else
-  			{
-***************
-*** 1537,1543 ****
-  		    EMIT(NFA_END_COLL);
-  
-  		/* \_[] also matches \n but it's not negated */
-! 		if (extra == ADD_NL)
-  		{
-  		    EMIT(reg_string ? NL : NFA_NEWL);
-  		    EMIT(NFA_OR);
---- 1546,1552 ----
-  		    EMIT(NFA_END_COLL);
-  
-  		/* \_[] also matches \n but it's not negated */
-! 		if (extra == NFA_ADD_NL)
-  		{
-  		    EMIT(reg_string ? NL : NFA_NEWL);
-  		    EMIT(NFA_OR);
-***************
-*** 2011,2017 ****
-      if (c >= NFA_FIRST_NL && c <= NFA_LAST_NL)
-      {
-  	addnl = TRUE;
-! 	c -= ADD_NL;
-      }
-  
-      STRCPY(code, "");
---- 2020,2026 ----
-      if (c >= NFA_FIRST_NL && c <= NFA_LAST_NL)
-      {
-  	addnl = TRUE;
-! 	c -= NFA_ADD_NL;
-      }
-  
-      STRCPY(code, "");
-***************
-*** 2217,2222 ****
---- 2226,2235 ----
-  	case NFA_NLOWER:STRCPY(code, "NFA_NLOWER"); break;
-  	case NFA_UPPER:	STRCPY(code, "NFA_UPPER"); break;
-  	case NFA_NUPPER:STRCPY(code, "NFA_NUPPER"); break;
-+ 	case NFA_LOWER_IC:  STRCPY(code, "NFA_LOWER_IC"); break;
-+ 	case NFA_NLOWER_IC: STRCPY(code, "NFA_NLOWER_IC"); break;
-+ 	case NFA_UPPER_IC:  STRCPY(code, "NFA_UPPER_IC"); break;
-+ 	case NFA_NUPPER_IC: STRCPY(code, "NFA_NUPPER_IC"); break;
-  
-  	default:
-  	    STRCPY(code, "CHAR(x)");
-***************
-*** 2687,2692 ****
---- 2700,2709 ----
-  	    case NFA_NLOWER:
-  	    case NFA_UPPER:
-  	    case NFA_NUPPER:
-+ 	    case NFA_LOWER_IC:
-+ 	    case NFA_NLOWER_IC:
-+ 	    case NFA_UPPER_IC:
-+ 	    case NFA_NUPPER_IC:
-  		/* possibly non-ascii */
-  #ifdef FEAT_MBYTE
-  		if (has_mbyte)
-***************
-*** 3841,3846 ****
---- 3858,3867 ----
-  	    case NFA_NLOWER:
-  	    case NFA_UPPER:
-  	    case NFA_NUPPER:
-+ 	    case NFA_LOWER_IC:
-+ 	    case NFA_NLOWER_IC:
-+ 	    case NFA_UPPER_IC:
-+ 	    case NFA_NUPPER_IC:
-  	    case NFA_START_COLL:
-  	    case NFA_START_NEG_COLL:
-  	    case NFA_NEWL:
-***************
-*** 5872,5877 ****
---- 5893,5920 ----
-  		ADD_STATE_IF_MATCH(t->state);
-  		break;
-  
-+ 	    case NFA_LOWER_IC:	/* [a-z] */
-+ 		result = ri_lower(curc) || (ireg_ic && ri_upper(curc));
-+ 		ADD_STATE_IF_MATCH(t->state);
-+ 		break;
-+ 
-+ 	    case NFA_NLOWER_IC:	/* [^a-z] */
-+ 		result = curc != NUL
-+ 			  && !(ri_lower(curc) || (ireg_ic && ri_upper(curc)));
-+ 		ADD_STATE_IF_MATCH(t->state);
-+ 		break;
-+ 
-+ 	    case NFA_UPPER_IC:	/* [A-Z] */
-+ 		result = ri_upper(curc) || (ireg_ic && ri_lower(curc));
-+ 		ADD_STATE_IF_MATCH(t->state);
-+ 		break;
-+ 
-+ 	    case NFA_NUPPER_IC:	/* ^[A-Z] */
-+ 		result = curc != NUL
-+ 			  && !(ri_upper(curc) || (ireg_ic && ri_lower(curc)));
-+ 		ADD_STATE_IF_MATCH(t->state);
-+ 		break;
-+ 
-  	    case NFA_BACKREF1:
-  	    case NFA_BACKREF2:
-  	    case NFA_BACKREF3:
-*** ../vim-7.4.000/src/testdir/test64.in	2013-08-01 17:45:33.000000000 +0200
---- src/testdir/test64.in	2013-08-14 11:50:11.000000000 +0200
-***************
-*** 289,303 ****
-  :call add(tl, [2, '.a\%$', " a\n "])
-  :call add(tl, [2, '.a\%$', " a\n_a", "_a"])
-  :"
-! :"""" Test recognition of some character classes
-! :call add(tl, [2, '[0-9]', '8', '8'])
-! :call add(tl, [2, '[^0-9]', '8'])
-! :call add(tl, [2, '[0-9a-fA-F]*', '0a7', '0a7'])
-! :call add(tl, [2, '[^0-9A-Fa-f]\+', '0a7'])
-! :call add(tl, [2, '[a-z_A-Z0-9]\+', 'aso_sfoij', 'aso_sfoij'])
-! :call add(tl, [2, '[a-z]', 'a', 'a'])
-! :call add(tl, [2, '[a-zA-Z]', 'a', 'a'])
-! :call add(tl, [2, '[A-Z]', 'a'])
-  :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
-  :"
-  :"""" Tests for \z features
---- 289,317 ----
-  :call add(tl, [2, '.a\%$', " a\n "])
-  :call add(tl, [2, '.a\%$', " a\n_a", "_a"])
-  :"
-! :"""" Test recognition of character classes
-! :call add(tl, [2, '[0-7]\+', 'x0123456789x', '01234567'])
-! :call add(tl, [2, '[^0-7]\+', '0a;X+% 897', 'a;X+% 89'])
-! :call add(tl, [2, '[0-9]\+', 'x0123456789x', '0123456789'])
-! :call add(tl, [2, '[^0-9]\+', '0a;X+% 9', 'a;X+% '])
-! :call add(tl, [2, '[0-9a-fA-F]\+', 'x0189abcdefg', '0189abcdef'])
-! :call add(tl, [2, '[^0-9A-Fa-f]\+', '0189g;X+% ab', 'g;X+% '])
-! :call add(tl, [2, '[a-z_A-Z0-9]\+', ';+aso_SfOij ', 'aso_SfOij'])
-! :call add(tl, [2, '[^a-z_A-Z0-9]\+', 'aSo_;+% sfOij', ';+% '])
-! :call add(tl, [2, '[a-z_A-Z]\+', '0abyz_ABYZ;', 'abyz_ABYZ'])
-! :call add(tl, [2, '[^a-z_A-Z]\+', 'abAB_09;+% yzYZ', '09;+% '])
-! :call add(tl, [2, '[a-z]\+', '0abcxyz1', 'abcxyz'])
-! :call add(tl, [2, '[a-z]\+', 'AabxyzZ', 'abxyz'])
-! :call add(tl, [2, '[^a-z]\+', 'a;X09+% x', ';X09+% '])
-! :call add(tl, [2, '[^a-z]\+', 'abX0;%yz', 'X0;%'])
-! :call add(tl, [2, '[a-zA-Z]\+', '0abABxzXZ9', 'abABxzXZ'])
-! :call add(tl, [2, '[^a-zA-Z]\+', 'ab09_;+ XZ', '09_;+ '])
-! :call add(tl, [2, '[A-Z]\+', 'aABXYZz', 'ABXYZ'])
-! :call add(tl, [2, '[^A-Z]\+', 'ABx0;%YZ', 'x0;%'])
-! :call add(tl, [2, '[a-z]\+\c', '0abxyzABXYZ;', 'abxyzABXYZ'])
-! :call add(tl, [2, '[A-Z]\+\c', '0abABxzXZ9', 'abABxzXZ'])
-! :call add(tl, [2, '\c[^a-z]\+', 'ab09_;+ XZ', '09_;+ '])
-! :call add(tl, [2, '\c[^A-Z]\+', 'ab09_;+ XZ', '09_;+ '])
-  :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
-  :"
-  :"""" Tests for \z features
-*** ../vim-7.4.000/src/testdir/test64.ok	2013-08-01 18:28:56.000000000 +0200
---- src/testdir/test64.ok	2013-08-14 11:50:37.000000000 +0200
-***************
-*** 650,679 ****
-  OK 0 - .a\%$
-  OK 1 - .a\%$
-  OK 2 - .a\%$
-! OK 0 - [0-9]
-! OK 1 - [0-9]
-! OK 2 - [0-9]
-! OK 0 - [^0-9]
-! OK 1 - [^0-9]
-! OK 2 - [^0-9]
-! OK 0 - [0-9a-fA-F]*
-! OK 1 - [0-9a-fA-F]*
-! OK 2 - [0-9a-fA-F]*
-  OK 0 - [^0-9A-Fa-f]\+
-  OK 1 - [^0-9A-Fa-f]\+
-  OK 2 - [^0-9A-Fa-f]\+
-  OK 0 - [a-z_A-Z0-9]\+
-  OK 1 - [a-z_A-Z0-9]\+
-  OK 2 - [a-z_A-Z0-9]\+
-! OK 0 - [a-z]
-! OK 1 - [a-z]
-! OK 2 - [a-z]
-! OK 0 - [a-zA-Z]
-! OK 1 - [a-zA-Z]
-! OK 2 - [a-zA-Z]
-! OK 0 - [A-Z]
-! OK 1 - [A-Z]
-! OK 2 - [A-Z]
-  OK 0 - \C[^A-Z]\+
-  OK 1 - \C[^A-Z]\+
-  OK 2 - \C[^A-Z]\+
---- 650,721 ----
-  OK 0 - .a\%$
-  OK 1 - .a\%$
-  OK 2 - .a\%$
-! OK 0 - [0-7]\+
-! OK 1 - [0-7]\+
-! OK 2 - [0-7]\+
-! OK 0 - [^0-7]\+
-! OK 1 - [^0-7]\+
-! OK 2 - [^0-7]\+
-! OK 0 - [0-9]\+
-! OK 1 - [0-9]\+
-! OK 2 - [0-9]\+
-! OK 0 - [^0-9]\+
-! OK 1 - [^0-9]\+
-! OK 2 - [^0-9]\+
-! OK 0 - [0-9a-fA-F]\+
-! OK 1 - [0-9a-fA-F]\+
-! OK 2 - [0-9a-fA-F]\+
-  OK 0 - [^0-9A-Fa-f]\+
-  OK 1 - [^0-9A-Fa-f]\+
-  OK 2 - [^0-9A-Fa-f]\+
-  OK 0 - [a-z_A-Z0-9]\+
-  OK 1 - [a-z_A-Z0-9]\+
-  OK 2 - [a-z_A-Z0-9]\+
-! OK 0 - [^a-z_A-Z0-9]\+
-! OK 1 - [^a-z_A-Z0-9]\+
-! OK 2 - [^a-z_A-Z0-9]\+
-! OK 0 - [a-z_A-Z]\+
-! OK 1 - [a-z_A-Z]\+
-! OK 2 - [a-z_A-Z]\+
-! OK 0 - [^a-z_A-Z]\+
-! OK 1 - [^a-z_A-Z]\+
-! OK 2 - [^a-z_A-Z]\+
-! OK 0 - [a-z]\+
-! OK 1 - [a-z]\+
-! OK 2 - [a-z]\+
-! OK 0 - [a-z]\+
-! OK 1 - [a-z]\+
-! OK 2 - [a-z]\+
-! OK 0 - [^a-z]\+
-! OK 1 - [^a-z]\+
-! OK 2 - [^a-z]\+
-! OK 0 - [^a-z]\+
-! OK 1 - [^a-z]\+
-! OK 2 - [^a-z]\+
-! OK 0 - [a-zA-Z]\+
-! OK 1 - [a-zA-Z]\+
-! OK 2 - [a-zA-Z]\+
-! OK 0 - [^a-zA-Z]\+
-! OK 1 - [^a-zA-Z]\+
-! OK 2 - [^a-zA-Z]\+
-! OK 0 - [A-Z]\+
-! OK 1 - [A-Z]\+
-! OK 2 - [A-Z]\+
-! OK 0 - [^A-Z]\+
-! OK 1 - [^A-Z]\+
-! OK 2 - [^A-Z]\+
-! OK 0 - [a-z]\+\c
-! OK 1 - [a-z]\+\c
-! OK 2 - [a-z]\+\c
-! OK 0 - [A-Z]\+\c
-! OK 1 - [A-Z]\+\c
-! OK 2 - [A-Z]\+\c
-! OK 0 - \c[^a-z]\+
-! OK 1 - \c[^a-z]\+
-! OK 2 - \c[^a-z]\+
-! OK 0 - \c[^A-Z]\+
-! OK 1 - \c[^A-Z]\+
-! OK 2 - \c[^A-Z]\+
-  OK 0 - \C[^A-Z]\+
-  OK 1 - \C[^A-Z]\+
-  OK 2 - \C[^A-Z]\+
-*** ../vim-7.4.000/src/version.c	2013-08-10 13:29:20.000000000 +0200
---- src/version.c	2013-08-14 11:54:57.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     1,
-  /**/
-
--- 
-How many light bulbs does it take to change a person?
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.002 b/pkgs/applications/editors/vim/patches/7.4.002
deleted file mode 100644
index d92f4de6c2d7..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.002
+++ /dev/null
@@ -1,77 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.002
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4b.002
-Problem:    Pattern with two alternative look-behind matches does not match.
-	    (Amadeus Demarzi)
-Solution:   When comparing PIMs also compare their state ID to see if they are
-	    different.
-Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
-
-
-*** ../vim-7.4.001/src/regexp_nfa.c	2013-08-14 12:05:54.000000000 +0200
---- src/regexp_nfa.c	2013-08-14 13:12:09.000000000 +0200
-***************
-*** 3782,3787 ****
---- 3782,3790 ----
-      if (two_unused)
-  	/* one is used and two is not: not equal */
-  	return FALSE;
-+     /* compare the state id */
-+     if (one->state->id != two->state->id)
-+ 	return FALSE;
-      /* compare the position */
-      if (REG_MULTI)
-  	return one->end.pos.lnum == two->end.pos.lnum
-*** ../vim-7.4.001/src/testdir/test64.in	2013-08-14 12:05:54.000000000 +0200
---- src/testdir/test64.in	2013-08-14 12:58:38.000000000 +0200
-***************
-*** 421,426 ****
---- 421,429 ----
-  :call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo'])
-  :call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo'])
-  :"
-+ :" complicated look-behind match
-+ :call add(tl, [2, '\(r\@<=\|\w\@<!\)\/', 'x = /word/;', '/'])
-+ :"
-  :""""" \@>
-  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
-  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
-*** ../vim-7.4.001/src/testdir/test64.ok	2013-08-14 12:05:54.000000000 +0200
---- src/testdir/test64.ok	2013-08-14 13:14:09.000000000 +0200
-***************
-*** 974,979 ****
---- 974,982 ----
-  OK 0 - \(foo\)\@<=.*
-  OK 1 - \(foo\)\@<=.*
-  OK 2 - \(foo\)\@<=.*
-+ OK 0 - \(r\@<=\|\w\@<!\)\/
-+ OK 1 - \(r\@<=\|\w\@<!\)\/
-+ OK 2 - \(r\@<=\|\w\@<!\)\/
-  OK 0 - \(a*\)\@>a
-  OK 1 - \(a*\)\@>a
-  OK 2 - \(a*\)\@>a
-*** ../vim-7.4.001/src/version.c	2013-08-14 12:05:54.000000000 +0200
---- src/version.c	2013-08-14 13:13:45.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     2,
-  /**/
-
--- 
-From "know your smileys":
- :-)-O	Smiling doctor with stethoscope
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.003 b/pkgs/applications/editors/vim/patches/7.4.003
deleted file mode 100644
index 9aad3c8c8f1c..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.003
+++ /dev/null
@@ -1,100 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.003
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.003
-Problem:    Memory access error in Ruby syntax highlighting. (Christopher Chow)
-Solution:   Refresh stale pointer. (James McCoy)
-Files:	    src/regexp_nfa.c
-
-
-*** ../vim-7.4.002/src/regexp_nfa.c	2013-08-14 13:31:03.000000000 +0200
---- src/regexp_nfa.c	2013-08-14 14:02:06.000000000 +0200
-***************
-*** 4120,4126 ****
-  		sub = &subs->norm;
-  	    }
-  #ifdef FEAT_SYN_HL
-! 	    else if (state->c >= NFA_ZOPEN)
-  	    {
-  		subidx = state->c - NFA_ZOPEN;
-  		sub = &subs->synt;
---- 4120,4126 ----
-  		sub = &subs->norm;
-  	    }
-  #ifdef FEAT_SYN_HL
-! 	    else if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
-  	    {
-  		subidx = state->c - NFA_ZOPEN;
-  		sub = &subs->synt;
-***************
-*** 4189,4194 ****
---- 4189,4201 ----
-  	    }
-  
-  	    subs = addstate(l, state->out, subs, pim, off);
-+ 	    /* "subs" may have changed, need to set "sub" again */
-+ #ifdef FEAT_SYN_HL
-+ 	    if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
-+ 		sub = &subs->synt;
-+ 	    else
-+ #endif
-+ 		sub = &subs->norm;
-  
-  	    if (save_in_use == -1)
-  	    {
-***************
-*** 4237,4243 ****
-  		sub = &subs->norm;
-  	    }
-  #ifdef FEAT_SYN_HL
-! 	    else if (state->c >= NFA_ZCLOSE)
-  	    {
-  		subidx = state->c - NFA_ZCLOSE;
-  		sub = &subs->synt;
---- 4244,4250 ----
-  		sub = &subs->norm;
-  	    }
-  #ifdef FEAT_SYN_HL
-! 	    else if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
-  	    {
-  		subidx = state->c - NFA_ZCLOSE;
-  		sub = &subs->synt;
-***************
-*** 4281,4286 ****
---- 4288,4300 ----
-  	    }
-  
-  	    subs = addstate(l, state->out, subs, pim, off);
-+ 	    /* "subs" may have changed, need to set "sub" again */
-+ #ifdef FEAT_SYN_HL
-+ 	    if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
-+ 		sub = &subs->synt;
-+ 	    else
-+ #endif
-+ 		sub = &subs->norm;
-  
-  	    if (REG_MULTI)
-  		sub->list.multi[subidx].end = save_lpos;
-*** ../vim-7.4.002/src/version.c	2013-08-14 13:31:03.000000000 +0200
---- src/version.c	2013-08-14 14:03:51.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     3,
-  /**/
-
--- 
-Where do you want to crash today?
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.004 b/pkgs/applications/editors/vim/patches/7.4.004
deleted file mode 100644
index f629d673fb8a..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.004
+++ /dev/null
@@ -1,232 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.004
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.004
-Problem:    When closing a window fails ":bwipe" may hang.
-Solution:   Let win_close() return FAIL and break out of the loop.
-Files:	    src/window.c, src/proto/window.pro, src/buffer.c
-
-
-*** ../vim-7.4.003/src/window.c	2013-07-24 17:38:29.000000000 +0200
---- src/window.c	2013-08-14 16:52:44.000000000 +0200
-***************
-*** 2172,2179 ****
-   * If "free_buf" is TRUE related buffer may be unloaded.
-   *
-   * Called by :quit, :close, :xit, :wq and findtag().
-   */
-!     void
-  win_close(win, free_buf)
-      win_T	*win;
-      int		free_buf;
---- 2172,2180 ----
-   * If "free_buf" is TRUE related buffer may be unloaded.
-   *
-   * Called by :quit, :close, :xit, :wq and findtag().
-+  * Returns FAIL when the window was not closed.
-   */
-!     int
-  win_close(win, free_buf)
-      win_T	*win;
-      int		free_buf;
-***************
-*** 2190,2210 ****
-      if (last_window())
-      {
-  	EMSG(_("E444: Cannot close last window"));
-! 	return;
-      }
-  
-  #ifdef FEAT_AUTOCMD
-      if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing))
-! 	return; /* window is already being closed */
-      if (win == aucmd_win)
-      {
-  	EMSG(_("E813: Cannot close autocmd window"));
-! 	return;
-      }
-      if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window())
-      {
-  	EMSG(_("E814: Cannot close window, only autocmd window would remain"));
-! 	return;
-      }
-  #endif
-  
---- 2191,2211 ----
-      if (last_window())
-      {
-  	EMSG(_("E444: Cannot close last window"));
-! 	return FAIL;
-      }
-  
-  #ifdef FEAT_AUTOCMD
-      if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing))
-! 	return FAIL; /* window is already being closed */
-      if (win == aucmd_win)
-      {
-  	EMSG(_("E813: Cannot close autocmd window"));
-! 	return FAIL;
-      }
-      if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window())
-      {
-  	EMSG(_("E814: Cannot close window, only autocmd window would remain"));
-! 	return FAIL;
-      }
-  #endif
-  
-***************
-*** 2212,2218 ****
-       * and then close the window and the tab page to avoid that curwin and
-       * curtab are invalid while we are freeing memory. */
-      if (close_last_window_tabpage(win, free_buf, prev_curtab))
-!       return;
-  
-      /* When closing the help window, try restoring a snapshot after closing
-       * the window.  Otherwise clear the snapshot, it's now invalid. */
---- 2213,2219 ----
-       * and then close the window and the tab page to avoid that curwin and
-       * curtab are invalid while we are freeing memory. */
-      if (close_last_window_tabpage(win, free_buf, prev_curtab))
-!       return FAIL;
-  
-      /* When closing the help window, try restoring a snapshot after closing
-       * the window.  Otherwise clear the snapshot, it's now invalid. */
-***************
-*** 2240,2261 ****
-  	    win->w_closing = TRUE;
-  	    apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
-  	    if (!win_valid(win))
-! 		return;
-  	    win->w_closing = FALSE;
-  	    if (last_window())
-! 		return;
-  	}
-  	win->w_closing = TRUE;
-  	apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
-  	if (!win_valid(win))
-! 	    return;
-  	win->w_closing = FALSE;
-  	if (last_window())
-! 	    return;
-  # ifdef FEAT_EVAL
-  	/* autocmds may abort script processing */
-  	if (aborting())
-! 	    return;
-  # endif
-      }
-  #endif
---- 2241,2262 ----
-  	    win->w_closing = TRUE;
-  	    apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
-  	    if (!win_valid(win))
-! 		return FAIL;
-  	    win->w_closing = FALSE;
-  	    if (last_window())
-! 		return FAIL;
-  	}
-  	win->w_closing = TRUE;
-  	apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
-  	if (!win_valid(win))
-! 	    return FAIL;
-  	win->w_closing = FALSE;
-  	if (last_window())
-! 	    return FAIL;
-  # ifdef FEAT_EVAL
-  	/* autocmds may abort script processing */
-  	if (aborting())
-! 	    return FAIL;
-  # endif
-      }
-  #endif
-***************
-*** 2303,2309 ****
-       * other window or moved to another tab page. */
-      else if (!win_valid(win) || last_window() || curtab != prev_curtab
-  	    || close_last_window_tabpage(win, free_buf, prev_curtab))
-! 	return;
-  
-      /* Free the memory used for the window and get the window that received
-       * the screen space. */
---- 2304,2310 ----
-       * other window or moved to another tab page. */
-      else if (!win_valid(win) || last_window() || curtab != prev_curtab
-  	    || close_last_window_tabpage(win, free_buf, prev_curtab))
-! 	return FAIL;
-  
-      /* Free the memory used for the window and get the window that received
-       * the screen space. */
-***************
-*** 2383,2388 ****
---- 2384,2390 ----
-  #endif
-  
-      redraw_all_later(NOT_VALID);
-+     return OK;
-  }
-  
-  /*
-*** ../vim-7.4.003/src/proto/window.pro	2013-08-10 13:37:30.000000000 +0200
---- src/proto/window.pro	2013-08-14 16:52:50.000000000 +0200
-***************
-*** 9,15 ****
-  void win_equal __ARGS((win_T *next_curwin, int current, int dir));
-  void close_windows __ARGS((buf_T *buf, int keep_curwin));
-  int one_window __ARGS((void));
-! void win_close __ARGS((win_T *win, int free_buf));
-  void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
-  void win_free_all __ARGS((void));
-  win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
---- 9,15 ----
-  void win_equal __ARGS((win_T *next_curwin, int current, int dir));
-  void close_windows __ARGS((buf_T *buf, int keep_curwin));
-  int one_window __ARGS((void));
-! int win_close __ARGS((win_T *win, int free_buf));
-  void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
-  void win_free_all __ARGS((void));
-  win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
-*** ../vim-7.4.003/src/buffer.c	2013-07-17 16:39:00.000000000 +0200
---- src/buffer.c	2013-08-14 16:54:34.000000000 +0200
-***************
-*** 1186,1192 ****
-  		   && !(curwin->w_closing || curwin->w_buffer->b_closing)
-  # endif
-  		   && (firstwin != lastwin || first_tabpage->tp_next != NULL))
-! 	    win_close(curwin, FALSE);
-  #endif
-  
-  	/*
---- 1186,1195 ----
-  		   && !(curwin->w_closing || curwin->w_buffer->b_closing)
-  # endif
-  		   && (firstwin != lastwin || first_tabpage->tp_next != NULL))
-! 	{
-! 	    if (win_close(curwin, FALSE) == FAIL)
-! 		break;
-! 	}
-  #endif
-  
-  	/*
-*** ../vim-7.4.003/src/version.c	2013-08-14 14:18:37.000000000 +0200
---- src/version.c	2013-08-14 17:10:23.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     4,
-  /**/
-
--- 
-From "know your smileys":
- *<|:-)	Santa Claus (Ho Ho Ho)
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.005 b/pkgs/applications/editors/vim/patches/7.4.005
deleted file mode 100644
index f85d1f0e3c81..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.005
+++ /dev/null
@@ -1,48 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.005
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.005
-Problem:    Using "vaB" while 'virtualedit' is set selects the wrong area.
-	    (Dimitar Dimitrov)
-Solution:   Reset coladd when finding a match.
-Files:	    src/search.c
-
-
-*** ../vim-7.4.004/src/search.c	2013-07-17 19:20:47.000000000 +0200
---- src/search.c	2013-08-14 17:32:38.000000000 +0200
-***************
-*** 1760,1765 ****
---- 1760,1768 ----
-  #endif
-  
-      pos = curwin->w_cursor;
-+ #ifdef FEAT_VIRTUALEDIT
-+     pos.coladd = 0;
-+ #endif
-      linep = ml_get(pos.lnum);
-  
-      cpo_match = (vim_strchr(p_cpo, CPO_MATCH) != NULL);
-*** ../vim-7.4.004/src/version.c	2013-08-14 17:11:14.000000000 +0200
---- src/version.c	2013-08-14 17:38:05.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     5,
-  /**/
-
--- 
-You can't have everything.  Where would you put it?
-		-- Steven Wright
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.006 b/pkgs/applications/editors/vim/patches/7.4.006
deleted file mode 100644
index 55d3802c4d14..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.006
+++ /dev/null
@@ -1,66 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.006
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.006
-Problem:    mkdir("foo/bar/", "p") gives an error message. (David Barnett)
-Solution:   Remove the trailing slash. (lcd)
-Files:	    src/eval.c
-
-
-*** ../vim-7.4.005/src/eval.c	2013-07-05 18:23:42.000000000 +0200
---- src/eval.c	2013-08-22 12:00:28.000000000 +0200
-***************
-*** 14292,14297 ****
---- 14292,14301 ----
-  	return;
-  
-      dir = get_tv_string_buf(&argvars[0], buf);
-+     if (*gettail(dir) == NUL)
-+ 	/* remove trailing slashes */
-+ 	*gettail_sep(dir) = NUL;
-+ 
-      if (argvars[1].v_type != VAR_UNKNOWN)
-      {
-  	if (argvars[2].v_type != VAR_UNKNOWN)
-***************
-*** 14299,14305 ****
-  	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
-  	    mkdir_recurse(dir, prot);
-      }
-!     rettv->vval.v_number = prot != -1 ? vim_mkdir_emsg(dir, prot) : 0;
-  }
-  #endif
-  
---- 14303,14309 ----
-  	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
-  	    mkdir_recurse(dir, prot);
-      }
-!     rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
-  }
-  #endif
-  
-*** ../vim-7.4.005/src/version.c	2013-08-14 17:45:25.000000000 +0200
---- src/version.c	2013-08-22 12:02:46.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     6,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-97. Your mother tells you to remember something, and you look for
-    a File/Save command.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.007 b/pkgs/applications/editors/vim/patches/7.4.007
deleted file mode 100644
index 5495ffbf9797..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.007
+++ /dev/null
@@ -1,95 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.007
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.007
-Problem:    Creating a preview window on startup leaves the screen layout in a
-	    messed up state. (Marius Gedminas)
-Solution:   Don't change firstwin. (Christian Brabandt)
-Files:	    src/main.c
-
-
-*** ../vim-7.4.006/src/main.c	2013-07-03 12:36:49.000000000 +0200
---- src/main.c	2013-08-22 14:02:39.000000000 +0200
-***************
-*** 2727,2732 ****
---- 2727,2733 ----
-      int		arg_idx;		/* index in argument list */
-      int		i;
-      int		advance = TRUE;
-+     win_T	*win;
-  
-  # ifdef FEAT_AUTOCMD
-      /*
-***************
-*** 2816,2839 ****
-  # ifdef FEAT_AUTOCMD
-      --autocmd_no_enter;
-  # endif
-  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
-!     /*
-!      * Avoid making a preview window the current window.
-!      */
-!     if (firstwin->w_p_pvw)
-      {
-!        win_T   *win;
-! 
-!        for (win = firstwin; win != NULL; win = win->w_next)
-!            if (!win->w_p_pvw)
-!            {
-!                firstwin = win;
-!                break;
-!            }
-      }
-  #endif
-!     /* make the first window the current window */
-!     win_enter(firstwin, FALSE);
-  
-  # ifdef FEAT_AUTOCMD
-      --autocmd_no_leave;
---- 2817,2838 ----
-  # ifdef FEAT_AUTOCMD
-      --autocmd_no_enter;
-  # endif
-+ 
-+     /* make the first window the current window */
-+     win = firstwin;
-  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
-!     /* Avoid making a preview window the current window. */
-!     while (win->w_p_pvw)
-      {
-! 	win = win->w_next;
-! 	if (win == NULL)
-! 	{
-! 	    win = firstwin;
-! 	    break;
-! 	}
-      }
-  #endif
-!     win_enter(win, FALSE);
-  
-  # ifdef FEAT_AUTOCMD
-      --autocmd_no_leave;
-*** ../vim-7.4.006/src/version.c	2013-08-22 12:06:50.000000000 +0200
---- src/version.c	2013-08-22 14:04:11.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     7,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-105. When someone asks you for your address, you tell them your URL.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.008 b/pkgs/applications/editors/vim/patches/7.4.008
deleted file mode 100644
index 6abd493f9145..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.008
+++ /dev/null
@@ -1,71 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.008
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.008
-Problem:    New regexp engine can't be interrupted.
-Solution:   Check for CTRL-C pressed. (Yasuhiro Matsumoto)
-Files:	    src/regexp_nfa.c, src/regexp.c
-
-
-*** ../vim-7.4.007/src/regexp_nfa.c	2013-08-14 14:18:37.000000000 +0200
---- src/regexp_nfa.c	2013-08-25 16:55:56.000000000 +0200
-***************
-*** 5089,5094 ****
---- 5089,5100 ----
-  	return FALSE;
-      }
-  #endif
-+     /* Some patterns may take a long time to match, especially when using
-+      * recursive_regmatch(). Allow interrupting them with CTRL-C. */
-+     fast_breakcheck();
-+     if (got_int)
-+ 	return FALSE;
-+ 
-      nfa_match = FALSE;
-  
-      /* Allocate memory for the lists of nodes. */
-*** ../vim-7.4.007/src/regexp.c	2013-08-01 18:31:30.000000000 +0200
---- src/regexp.c	2013-08-25 16:57:35.000000000 +0200
-***************
-*** 4311,4318 ****
-     */
-    for (;;)
-    {
-!     /* Some patterns may cause a long time to match, even though they are not
-!      * illegal.  E.g., "\([a-z]\+\)\+Q".  Allow breaking them with CTRL-C. */
-      fast_breakcheck();
-  
-  #ifdef DEBUG
---- 4311,4318 ----
-     */
-    for (;;)
-    {
-!     /* Some patterns may take a long time to match, e.g., "\([a-z]\+\)\+Q".
-!      * Allow interrupting them with CTRL-C. */
-      fast_breakcheck();
-  
-  #ifdef DEBUG
-*** ../vim-7.4.007/src/version.c	2013-08-22 14:14:23.000000000 +0200
---- src/version.c	2013-08-25 16:57:51.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     8,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-124. You begin conversations with, "Who is your internet service provider?"
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.009 b/pkgs/applications/editors/vim/patches/7.4.009
deleted file mode 100644
index f5e5fa609126..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.009
+++ /dev/null
@@ -1,64 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.009
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.009
-Problem:    When a file was not decrypted (yet), writing it may destroy the
-	    contents.
-Solution:   Mark the file as readonly until decryption was done. (Christian
-	    Brabandt)
-Files:	    src/fileio.c
-
-
-*** ../vim-7.4.008/src/fileio.c	2013-08-05 21:58:03.000000000 +0200
---- src/fileio.c	2013-08-25 17:45:27.000000000 +0200
-***************
-*** 2926,2934 ****
---- 2926,2939 ----
-      int		*did_ask;	/* flag: whether already asked for key */
-  {
-      int method = crypt_method_from_magic((char *)ptr, *sizep);
-+     int b_p_ro = curbuf->b_p_ro;
-  
-      if (method >= 0)
-      {
-+ 	/* Mark the buffer as read-only until the decryption has taken place.
-+ 	 * Avoids accidentally overwriting the file with garbage. */
-+ 	curbuf->b_p_ro = TRUE;
-+ 
-  	set_crypt_method(curbuf, method);
-  	if (method > 0)
-  	    (void)blowfish_self_test();
-***************
-*** 2977,2982 ****
---- 2982,2989 ----
-  	    *sizep -= CRYPT_MAGIC_LEN + salt_len + seed_len;
-  	    mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len,
-  							      (size_t)*sizep);
-+ 	    /* Restore the read-only flag. */
-+ 	    curbuf->b_p_ro = b_p_ro;
-  	}
-      }
-      /* When starting to edit a new file which does not have encryption, clear
-*** ../vim-7.4.008/src/version.c	2013-08-25 17:01:36.000000000 +0200
---- src/version.c	2013-08-25 17:44:30.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     9,
-  /**/
-
--- 
-I have a watch cat! Just break in and she'll watch.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.010 b/pkgs/applications/editors/vim/patches/7.4.010
deleted file mode 100644
index fee6ba5b4a84..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.010
+++ /dev/null
@@ -1,79 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.010
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.010 (after 7.4.006)
-Problem:    Crash with invalid argument to mkdir().
-Solution:   Check for empty string. (lcd47)
-Files:	    src/eval.c
-
-
-*** ../vim-7.4.009/src/eval.c	2013-08-22 12:06:50.000000000 +0200
---- src/eval.c	2013-08-30 15:47:47.000000000 +0200
-***************
-*** 14292,14309 ****
-  	return;
-  
-      dir = get_tv_string_buf(&argvars[0], buf);
-!     if (*gettail(dir) == NUL)
-! 	/* remove trailing slashes */
-! 	*gettail_sep(dir) = NUL;
-! 
-!     if (argvars[1].v_type != VAR_UNKNOWN)
-      {
-! 	if (argvars[2].v_type != VAR_UNKNOWN)
-! 	    prot = get_tv_number_chk(&argvars[2], NULL);
-! 	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
-! 	    mkdir_recurse(dir, prot);
-      }
--     rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
-  }
-  #endif
-  
---- 14292,14314 ----
-  	return;
-  
-      dir = get_tv_string_buf(&argvars[0], buf);
-!     if (*dir == NUL)
-! 	rettv->vval.v_number = FAIL;
-!     else
-      {
-! 	if (*gettail(dir) == NUL)
-! 	    /* remove trailing slashes */
-! 	    *gettail_sep(dir) = NUL;
-! 
-! 	if (argvars[1].v_type != VAR_UNKNOWN)
-! 	{
-! 	    if (argvars[2].v_type != VAR_UNKNOWN)
-! 		prot = get_tv_number_chk(&argvars[2], NULL);
-! 	    if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
-! 		mkdir_recurse(dir, prot);
-! 	}
-! 	rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
-      }
-  }
-  #endif
-  
-*** ../vim-7.4.009/src/version.c	2013-08-25 17:46:05.000000000 +0200
---- src/version.c	2013-08-30 15:48:37.000000000 +0200
-***************
-*** 729,730 ****
---- 729,732 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     10,
-  /**/
-
--- 
-I wish there was a knob on the TV to turn up the intelligence.
-There's a knob called "brightness", but it doesn't seem to work. 
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.011 b/pkgs/applications/editors/vim/patches/7.4.011
deleted file mode 100644
index efff82c5eba9..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.011
+++ /dev/null
@@ -1,100 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.011
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.011
-Problem:    Cannot find out if "acl" and "xpm" features are supported.
-Solution:   Add "acl" and "xpm" to the list of features. (Ken Takata)
-Files:	    src/eval.c, src/version.c
-
-
-*** ../vim-7.4.010/src/eval.c	2013-08-30 16:00:04.000000000 +0200
---- src/eval.c	2013-08-30 16:34:12.000000000 +0200
-***************
-*** 12135,12140 ****
---- 12135,12143 ----
-  #ifndef CASE_INSENSITIVE_FILENAME
-  	"fname_case",
-  #endif
-+ #ifdef HAVE_ACL
-+ 	"acl",
-+ #endif
-  #ifdef FEAT_ARABIC
-  	"arabic",
-  #endif
-***************
-*** 12538,12544 ****
-  	"xfontset",
-  #endif
-  #ifdef FEAT_XPM_W32
-! 	"xpm_w32",
-  #endif
-  #ifdef USE_XSMP
-  	"xsmp",
---- 12541,12552 ----
-  	"xfontset",
-  #endif
-  #ifdef FEAT_XPM_W32
-! 	"xpm",
-! 	"xpm_w32",	/* for backward compatibility */
-! #else
-! # if defined(HAVE_XPM)
-! 	"xpm",
-! # endif
-  #endif
-  #ifdef USE_XSMP
-  	"xsmp",
-*** ../vim-7.4.010/src/version.c	2013-08-30 16:00:04.000000000 +0200
---- src/version.c	2013-08-30 16:34:37.000000000 +0200
-***************
-*** 60,65 ****
---- 60,70 ----
-  
-  static char *(features[]) =
-  {
-+ #ifdef HAVE_ACL
-+ 	"+acl",
-+ #else
-+ 	"-acl",
-+ #endif
-  #ifdef AMIGA		/* only for Amiga systems */
-  # ifdef FEAT_ARP
-  	"+ARP",
-***************
-*** 721,726 ****
---- 726,737 ----
-  # else
-  	"-xpm_w32",
-  # endif
-+ #else
-+ # ifdef HAVE_XPM
-+ 	"+xpm",
-+ # else
-+ 	"-xpm",
-+ # endif
-  #endif
-  	NULL
-  };
-*** ../vim-7.4.010/src/version.c	2013-08-30 16:00:04.000000000 +0200
---- src/version.c	2013-08-30 16:34:37.000000000 +0200
-***************
-*** 729,730 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     11,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-141. You'd rather go to http://www.weather.com/ than look out your window.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.012 b/pkgs/applications/editors/vim/patches/7.4.012
deleted file mode 100644
index f831442ea569..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.012
+++ /dev/null
@@ -1,202 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.012
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.012
-Problem:    MS-Windows: resolving shortcut does not work properly with
-	    multi-byte characters.
-Solution:   Use wide system functions. (Ken Takata)
-Files:	    src/os_mswin.c
-
-
-*** ../vim-7.4.011/src/os_mswin.c	2013-06-16 16:41:11.000000000 +0200
---- src/os_mswin.c	2013-08-30 16:43:23.000000000 +0200
-***************
-*** 1761,1769 ****
-      IPersistFile	*ppf = NULL;
-      OLECHAR		wsz[MAX_PATH];
-      WIN32_FIND_DATA	ffd; // we get those free of charge
-!     TCHAR		buf[MAX_PATH]; // could have simply reused 'wsz'...
-      char_u		*rfname = NULL;
-      int			len;
-  
-      /* Check if the file name ends in ".lnk". Avoid calling
-       * CoCreateInstance(), it's quite slow. */
---- 1761,1773 ----
-      IPersistFile	*ppf = NULL;
-      OLECHAR		wsz[MAX_PATH];
-      WIN32_FIND_DATA	ffd; // we get those free of charge
-!     CHAR		buf[MAX_PATH]; // could have simply reused 'wsz'...
-      char_u		*rfname = NULL;
-      int			len;
-+ # ifdef FEAT_MBYTE
-+     IShellLinkW		*pslw = NULL;
-+     WIN32_FIND_DATAW	ffdw; // we get those free of charge
-+ # endif
-  
-      /* Check if the file name ends in ".lnk". Avoid calling
-       * CoCreateInstance(), it's quite slow. */
-***************
-*** 1775,1792 ****
-  
-      CoInitialize(NULL);
-  
-      // create a link manager object and request its interface
-      hr = CoCreateInstance(
-  	    &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
-  	    &IID_IShellLink, (void**)&psl);
-      if (hr != S_OK)
-! 	goto shortcut_error;
-  
-      // Get a pointer to the IPersistFile interface.
-      hr = psl->lpVtbl->QueryInterface(
-  	    psl, &IID_IPersistFile, (void**)&ppf);
-      if (hr != S_OK)
-! 	goto shortcut_error;
-  
-      // full path string must be in Unicode.
-      MultiByteToWideChar(CP_ACP, 0, fname, -1, wsz, MAX_PATH);
---- 1779,1840 ----
-  
-      CoInitialize(NULL);
-  
-+ # ifdef FEAT_MBYTE
-+     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
-+     {
-+ 	// create a link manager object and request its interface
-+ 	hr = CoCreateInstance(
-+ 		&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
-+ 		&IID_IShellLinkW, (void**)&pslw);
-+ 	if (hr == S_OK)
-+ 	{
-+ 	    WCHAR	*p = enc_to_utf16(fname, NULL);
-+ 
-+ 	    if (p != NULL)
-+ 	    {
-+ 		// Get a pointer to the IPersistFile interface.
-+ 		hr = pslw->lpVtbl->QueryInterface(
-+ 			pslw, &IID_IPersistFile, (void**)&ppf);
-+ 		if (hr != S_OK)
-+ 		    goto shortcut_errorw;
-+ 
-+ 		// "load" the name and resolve the link
-+ 		hr = ppf->lpVtbl->Load(ppf, p, STGM_READ);
-+ 		if (hr != S_OK)
-+ 		    goto shortcut_errorw;
-+ #  if 0  // This makes Vim wait a long time if the target does not exist.
-+ 		hr = pslw->lpVtbl->Resolve(pslw, NULL, SLR_NO_UI);
-+ 		if (hr != S_OK)
-+ 		    goto shortcut_errorw;
-+ #  endif
-+ 
-+ 		// Get the path to the link target.
-+ 		ZeroMemory(wsz, MAX_PATH * sizeof(WCHAR));
-+ 		hr = pslw->lpVtbl->GetPath(pslw, wsz, MAX_PATH, &ffdw, 0);
-+ 		if (hr == S_OK && wsz[0] != NUL)
-+ 		    rfname = utf16_to_enc(wsz, NULL);
-+ 
-+ shortcut_errorw:
-+ 		vim_free(p);
-+ 		if (hr == S_OK)
-+ 		    goto shortcut_end;
-+ 	    }
-+ 	}
-+ 	/* Retry with non-wide function (for Windows 98). */
-+     }
-+ # endif
-      // create a link manager object and request its interface
-      hr = CoCreateInstance(
-  	    &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
-  	    &IID_IShellLink, (void**)&psl);
-      if (hr != S_OK)
-! 	goto shortcut_end;
-  
-      // Get a pointer to the IPersistFile interface.
-      hr = psl->lpVtbl->QueryInterface(
-  	    psl, &IID_IPersistFile, (void**)&ppf);
-      if (hr != S_OK)
-! 	goto shortcut_end;
-  
-      // full path string must be in Unicode.
-      MultiByteToWideChar(CP_ACP, 0, fname, -1, wsz, MAX_PATH);
-***************
-*** 1794,1805 ****
-      // "load" the name and resolve the link
-      hr = ppf->lpVtbl->Load(ppf, wsz, STGM_READ);
-      if (hr != S_OK)
-! 	goto shortcut_error;
-! #if 0  // This makes Vim wait a long time if the target doesn't exist.
-      hr = psl->lpVtbl->Resolve(psl, NULL, SLR_NO_UI);
-      if (hr != S_OK)
-! 	goto shortcut_error;
-! #endif
-  
-      // Get the path to the link target.
-      ZeroMemory(buf, MAX_PATH);
---- 1842,1853 ----
-      // "load" the name and resolve the link
-      hr = ppf->lpVtbl->Load(ppf, wsz, STGM_READ);
-      if (hr != S_OK)
-! 	goto shortcut_end;
-! # if 0  // This makes Vim wait a long time if the target doesn't exist.
-      hr = psl->lpVtbl->Resolve(psl, NULL, SLR_NO_UI);
-      if (hr != S_OK)
-! 	goto shortcut_end;
-! # endif
-  
-      // Get the path to the link target.
-      ZeroMemory(buf, MAX_PATH);
-***************
-*** 1807,1818 ****
-      if (hr == S_OK && buf[0] != NUL)
-  	rfname = vim_strsave(buf);
-  
-! shortcut_error:
-      // Release all interface pointers (both belong to the same object)
-      if (ppf != NULL)
-  	ppf->lpVtbl->Release(ppf);
-      if (psl != NULL)
-  	psl->lpVtbl->Release(psl);
-  
-      CoUninitialize();
-      return rfname;
---- 1855,1870 ----
-      if (hr == S_OK && buf[0] != NUL)
-  	rfname = vim_strsave(buf);
-  
-! shortcut_end:
-      // Release all interface pointers (both belong to the same object)
-      if (ppf != NULL)
-  	ppf->lpVtbl->Release(ppf);
-      if (psl != NULL)
-  	psl->lpVtbl->Release(psl);
-+ # ifdef FEAT_MBYTE
-+     if (pslw != NULL)
-+ 	pslw->lpVtbl->Release(pslw);
-+ # endif
-  
-      CoUninitialize();
-      return rfname;
-*** ../vim-7.4.011/src/version.c	2013-08-30 16:35:41.000000000 +0200
---- src/version.c	2013-08-30 16:39:40.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     12,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-142. You dream about creating the world's greatest web site.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.013 b/pkgs/applications/editors/vim/patches/7.4.013
deleted file mode 100644
index dcbe0fb3e43d..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.013
+++ /dev/null
@@ -1,99 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.013
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.013
-Problem:    File name buffer too small for utf-8.
-Solution:   Use character count instead of byte count. (Ken Takata)
-Files:	    src/os_mswin.c
-
-
-*** ../vim-7.4.012/src/os_mswin.c	2013-08-30 16:44:15.000000000 +0200
---- src/os_mswin.c	2013-08-30 16:47:54.000000000 +0200
-***************
-*** 456,462 ****
---- 456,469 ----
-      int
-  mch_isFullName(char_u *fname)
-  {
-+ #ifdef FEAT_MBYTE
-+     /* WinNT and later can use _MAX_PATH wide characters for a pathname, which
-+      * means that the maximum pathname is _MAX_PATH * 3 bytes when 'enc' is
-+      * UTF-8. */
-+     char szName[_MAX_PATH * 3 + 1];
-+ #else
-      char szName[_MAX_PATH + 1];
-+ #endif
-  
-      /* A name like "d:/foo" and "//server/share" is absolute */
-      if ((fname[0] && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\'))
-***************
-*** 464,470 ****
-  	return TRUE;
-  
-      /* A name that can't be made absolute probably isn't absolute. */
-!     if (mch_FullName(fname, szName, _MAX_PATH, FALSE) == FAIL)
-  	return FALSE;
-  
-      return pathcmp(fname, szName, -1) == 0;
---- 471,477 ----
-  	return TRUE;
-  
-      /* A name that can't be made absolute probably isn't absolute. */
-!     if (mch_FullName(fname, szName, sizeof(szName) - 1, FALSE) == FAIL)
-  	return FALSE;
-  
-      return pathcmp(fname, szName, -1) == 0;
-***************
-*** 498,507 ****
-      int
-  vim_stat(const char *name, struct stat *stp)
-  {
-      char	buf[_MAX_PATH + 1];
-      char	*p;
-  
-!     vim_strncpy((char_u *)buf, (char_u *)name, _MAX_PATH);
-      p = buf + strlen(buf);
-      if (p > buf)
-  	mb_ptr_back(buf, p);
---- 505,521 ----
-      int
-  vim_stat(const char *name, struct stat *stp)
-  {
-+ #ifdef FEAT_MBYTE
-+     /* WinNT and later can use _MAX_PATH wide characters for a pathname, which
-+      * means that the maximum pathname is _MAX_PATH * 3 bytes when 'enc' is
-+      * UTF-8. */
-+     char	buf[_MAX_PATH * 3 + 1];
-+ #else
-      char	buf[_MAX_PATH + 1];
-+ #endif
-      char	*p;
-  
-!     vim_strncpy((char_u *)buf, (char_u *)name, sizeof(buf) - 1);
-      p = buf + strlen(buf);
-      if (p > buf)
-  	mb_ptr_back(buf, p);
-*** ../vim-7.4.012/src/version.c	2013-08-30 16:44:15.000000000 +0200
---- src/version.c	2013-08-30 16:47:36.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     13,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-143. You dream in pallettes of 216 websafe colors.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.014 b/pkgs/applications/editors/vim/patches/7.4.014
deleted file mode 100644
index f6554337f27f..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.014
+++ /dev/null
@@ -1,102 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.014
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.014
-Problem:    MS-Windows: check for writing to device does not work.
-Solution:   Fix #ifdefs. (Ken Takata)
-Files:	    src/fileio.c
-
-
-*** ../vim-7.4.013/src/fileio.c	2013-08-25 17:46:05.000000000 +0200
---- src/fileio.c	2013-08-30 16:56:46.000000000 +0200
-***************
-*** 428,440 ****
-  	}
-      }
-  
-- #ifdef UNIX
--     /*
--      * On Unix it is possible to read a directory, so we have to
--      * check for it before the mch_open().
--      */
-      if (!read_stdin && !read_buffer)
-      {
-  	perm = mch_getperm(fname);
-  	if (perm >= 0 && !S_ISREG(perm)		    /* not a regular file ... */
-  # ifdef S_ISFIFO
---- 428,440 ----
-  	}
-      }
-  
-      if (!read_stdin && !read_buffer)
-      {
-+ #ifdef UNIX
-+ 	/*
-+ 	 * On Unix it is possible to read a directory, so we have to
-+ 	 * check for it before the mch_open().
-+ 	 */
-  	perm = mch_getperm(fname);
-  	if (perm >= 0 && !S_ISREG(perm)		    /* not a regular file ... */
-  # ifdef S_ISFIFO
-***************
-*** 457,464 ****
-  	    msg_scroll = msg_save;
-  	    return FAIL;
-  	}
-! 
-! # if defined(MSDOS) || defined(MSWIN) || defined(OS2)
-  	/*
-  	 * MS-Windows allows opening a device, but we will probably get stuck
-  	 * trying to read it.
---- 457,464 ----
-  	    msg_scroll = msg_save;
-  	    return FAIL;
-  	}
-! #endif
-! #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
-  	/*
-  	 * MS-Windows allows opening a device, but we will probably get stuck
-  	 * trying to read it.
-***************
-*** 470,478 ****
-  	    msg_scroll = msg_save;
-  	    return FAIL;
-  	}
-- # endif
--     }
-  #endif
-  
-      /* Set default or forced 'fileformat' and 'binary'. */
-      set_file_options(set_options, eap);
---- 470,477 ----
-  	    msg_scroll = msg_save;
-  	    return FAIL;
-  	}
-  #endif
-+     }
-  
-      /* Set default or forced 'fileformat' and 'binary'. */
-      set_file_options(set_options, eap);
-*** ../vim-7.4.013/src/version.c	2013-08-30 16:51:15.000000000 +0200
---- src/version.c	2013-08-30 16:54:33.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     14,
-  /**/
-
--- 
-Drink wet cement and get really stoned.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.015 b/pkgs/applications/editors/vim/patches/7.4.015
deleted file mode 100644
index e8b284d12b37..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.015
+++ /dev/null
@@ -1,106 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.015
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.015
-Problem:    MS-Windows: Detecting node type does not work for multi-byte
-	    characters.
-Solution:   Use wide character function when needed. (Ken Takata)
-Files:	    src/os_win32.c
-
-
-*** ../vim-7.4.014/src/os_win32.c	2013-08-10 12:39:12.000000000 +0200
---- src/os_win32.c	2013-08-30 17:09:47.000000000 +0200
-***************
-*** 3107,3112 ****
---- 3107,3115 ----
-  {
-      HANDLE	hFile;
-      int		type;
-+ #ifdef FEAT_MBYTE
-+     WCHAR	*wn = NULL;
-+ #endif
-  
-      /* We can't open a file with a name "\\.\con" or "\\.\prn" and trying to
-       * read from it later will cause Vim to hang.  Thus return NODE_WRITABLE
-***************
-*** 3114,3127 ****
-      if (STRNCMP(name, "\\\\.\\", 4) == 0)
-  	return NODE_WRITABLE;
-  
-!     hFile = CreateFile(name,		/* file name */
-! 		GENERIC_WRITE,		/* access mode */
-! 		0,			/* share mode */
-! 		NULL,			/* security descriptor */
-! 		OPEN_EXISTING,		/* creation disposition */
-! 		0,			/* file attributes */
-! 		NULL);			/* handle to template file */
-  
-      if (hFile == INVALID_HANDLE_VALUE)
-  	return NODE_NORMAL;
-  
---- 3117,3157 ----
-      if (STRNCMP(name, "\\\\.\\", 4) == 0)
-  	return NODE_WRITABLE;
-  
-! #ifdef FEAT_MBYTE
-!     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
-!     {
-! 	wn = enc_to_utf16(name, NULL);
-! 	if (wn != NULL)
-! 	{
-! 	    hFile = CreateFileW(wn,	/* file name */
-! 			GENERIC_WRITE,	/* access mode */
-! 			0,		/* share mode */
-! 			NULL,		/* security descriptor */
-! 			OPEN_EXISTING,	/* creation disposition */
-! 			0,		/* file attributes */
-! 			NULL);		/* handle to template file */
-! 	    if (hFile == INVALID_HANDLE_VALUE
-! 			      && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
-! 	    {
-! 		/* Retry with non-wide function (for Windows 98). */
-! 		vim_free(wn);
-! 		wn = NULL;
-! 	    }
-! 	}
-!     }
-!     if (wn == NULL)
-! #endif
-! 	hFile = CreateFile(name,	/* file name */
-! 		    GENERIC_WRITE,	/* access mode */
-! 		    0,			/* share mode */
-! 		    NULL,		/* security descriptor */
-! 		    OPEN_EXISTING,	/* creation disposition */
-! 		    0,			/* file attributes */
-! 		    NULL);		/* handle to template file */
-  
-+ #ifdef FEAT_MBYTE
-+     vim_free(wn);
-+ #endif
-      if (hFile == INVALID_HANDLE_VALUE)
-  	return NODE_NORMAL;
-  
-*** ../vim-7.4.014/src/version.c	2013-08-30 17:06:56.000000000 +0200
---- src/version.c	2013-08-30 17:09:35.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     15,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-144. You eagerly await the update of the "Cool Site of the Day."
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.016 b/pkgs/applications/editors/vim/patches/7.4.016
deleted file mode 100644
index c58c605f5c15..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.016
+++ /dev/null
@@ -1,221 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.016
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.016
-Problem:    MS-Windows: File name completion doesn't work properly with
-	    Chinese characters. (Yue Wu)
-Solution:   Add fname_casew(). (Ken Takata)
-Files:	    src/os_win32.c
-
-
-*** ../vim-7.4.015/src/os_win32.c	2013-08-30 17:11:29.000000000 +0200
---- src/os_win32.c	2013-08-30 17:28:30.000000000 +0200
-***************
-*** 2500,2508 ****
---- 2500,2624 ----
-  }
-  
-  
-+ #ifdef FEAT_MBYTE
-+ /*
-+  * fname_casew(): Wide version of fname_case().  Set the case of the file name,
-+  * if it already exists.  When "len" is > 0, also expand short to long
-+  * filenames.
-+  * Return FAIL if wide functions are not available, OK otherwise.
-+  * NOTE: much of this is identical to fname_case(), keep in sync!
-+  */
-+     static int
-+ fname_casew(
-+     WCHAR	*name,
-+     int		len)
-+ {
-+     WCHAR		szTrueName[_MAX_PATH + 2];
-+     WCHAR		szTrueNameTemp[_MAX_PATH + 2];
-+     WCHAR		*ptrue, *ptruePrev;
-+     WCHAR		*porig, *porigPrev;
-+     int			flen;
-+     WIN32_FIND_DATAW	fb;
-+     HANDLE		hFind;
-+     int			c;
-+     int			slen;
-+ 
-+     flen = (int)wcslen(name);
-+     if (flen > _MAX_PATH)
-+ 	return OK;
-+ 
-+     /* slash_adjust(name) not needed, already adjusted by fname_case(). */
-+ 
-+     /* Build the new name in szTrueName[] one component at a time. */
-+     porig = name;
-+     ptrue = szTrueName;
-+ 
-+     if (iswalpha(porig[0]) && porig[1] == L':')
-+     {
-+ 	/* copy leading drive letter */
-+ 	*ptrue++ = *porig++;
-+ 	*ptrue++ = *porig++;
-+ 	*ptrue = NUL;	    /* in case nothing follows */
-+     }
-+ 
-+     while (*porig != NUL)
-+     {
-+ 	/* copy \ characters */
-+ 	while (*porig == psepc)
-+ 	    *ptrue++ = *porig++;
-+ 
-+ 	ptruePrev = ptrue;
-+ 	porigPrev = porig;
-+ 	while (*porig != NUL && *porig != psepc)
-+ 	{
-+ 	    *ptrue++ = *porig++;
-+ 	}
-+ 	*ptrue = NUL;
-+ 
-+ 	/* To avoid a slow failure append "\*" when searching a directory,
-+ 	 * server or network share. */
-+ 	wcscpy(szTrueNameTemp, szTrueName);
-+ 	slen = (int)wcslen(szTrueNameTemp);
-+ 	if (*porig == psepc && slen + 2 < _MAX_PATH)
-+ 	    wcscpy(szTrueNameTemp + slen, L"\\*");
-+ 
-+ 	/* Skip "", "." and "..". */
-+ 	if (ptrue > ptruePrev
-+ 		&& (ptruePrev[0] != L'.'
-+ 		    || (ptruePrev[1] != NUL
-+ 			&& (ptruePrev[1] != L'.' || ptruePrev[2] != NUL)))
-+ 		&& (hFind = FindFirstFileW(szTrueNameTemp, &fb))
-+ 						      != INVALID_HANDLE_VALUE)
-+ 	{
-+ 	    c = *porig;
-+ 	    *porig = NUL;
-+ 
-+ 	    /* Only use the match when it's the same name (ignoring case) or
-+ 	     * expansion is allowed and there is a match with the short name
-+ 	     * and there is enough room. */
-+ 	    if (_wcsicoll(porigPrev, fb.cFileName) == 0
-+ 		    || (len > 0
-+ 			&& (_wcsicoll(porigPrev, fb.cAlternateFileName) == 0
-+ 			    && (int)(ptruePrev - szTrueName)
-+ 					   + (int)wcslen(fb.cFileName) < len)))
-+ 	    {
-+ 		wcscpy(ptruePrev, fb.cFileName);
-+ 
-+ 		/* Look for exact match and prefer it if found.  Must be a
-+ 		 * long name, otherwise there would be only one match. */
-+ 		while (FindNextFileW(hFind, &fb))
-+ 		{
-+ 		    if (*fb.cAlternateFileName != NUL
-+ 			    && (wcscoll(porigPrev, fb.cFileName) == 0
-+ 				|| (len > 0
-+ 				    && (_wcsicoll(porigPrev,
-+ 						   fb.cAlternateFileName) == 0
-+ 				    && (int)(ptruePrev - szTrueName)
-+ 					 + (int)wcslen(fb.cFileName) < len))))
-+ 		    {
-+ 			wcscpy(ptruePrev, fb.cFileName);
-+ 			break;
-+ 		    }
-+ 		}
-+ 	    }
-+ 	    FindClose(hFind);
-+ 	    *porig = c;
-+ 	    ptrue = ptruePrev + wcslen(ptruePrev);
-+ 	}
-+ 	else if (hFind == INVALID_HANDLE_VALUE
-+ 		&& GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
-+ 	    return FAIL;
-+     }
-+ 
-+     wcscpy(name, szTrueName);
-+     return OK;
-+ }
-+ #endif
-+ 
-  /*
-   * fname_case(): Set the case of the file name, if it already exists.
-   * When "len" is > 0, also expand short to long filenames.
-+  * NOTE: much of this is identical to fname_casew(), keep in sync!
-   */
-      void
-  fname_case(
-***************
-*** 2520,2530 ****
-      int			slen;
-  
-      flen = (int)STRLEN(name);
-!     if (flen == 0 || flen > _MAX_PATH)
-  	return;
-  
-      slash_adjust(name);
-  
-      /* Build the new name in szTrueName[] one component at a time. */
-      porig = name;
-      ptrue = szTrueName;
---- 2636,2679 ----
-      int			slen;
-  
-      flen = (int)STRLEN(name);
-!     if (flen == 0)
-  	return;
-  
-      slash_adjust(name);
-  
-+ #ifdef FEAT_MBYTE
-+     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
-+     {
-+ 	WCHAR	*p = enc_to_utf16(name, NULL);
-+ 
-+ 	if (p != NULL)
-+ 	{
-+ 	    char_u	*q;
-+ 	    WCHAR	buf[_MAX_PATH + 2];
-+ 
-+ 	    wcscpy(buf, p);
-+ 	    vim_free(p);
-+ 
-+ 	    if (fname_casew(buf, (len > 0) ? _MAX_PATH : 0) == OK)
-+ 	    {
-+ 		q = utf16_to_enc(buf, NULL);
-+ 		if (q != NULL)
-+ 		{
-+ 		    vim_strncpy(name, q, (len > 0) ? len - 1 : flen);
-+ 		    vim_free(q);
-+ 		    return;
-+ 		}
-+ 	    }
-+ 	}
-+ 	/* Retry with non-wide function (for Windows 98). */
-+     }
-+ #endif
-+ 
-+     /* If 'enc' is utf-8, flen can be larger than _MAX_PATH.
-+      * So we should check this after calling wide function. */
-+     if (flen > _MAX_PATH)
-+ 	return;
-+ 
-      /* Build the new name in szTrueName[] one component at a time. */
-      porig = name;
-      ptrue = szTrueName;
-*** ../vim-7.4.015/src/version.c	2013-08-30 17:11:29.000000000 +0200
---- src/version.c	2013-08-30 17:15:06.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     16,
-  /**/
-
--- 
-Fingers not found - Pound head on keyboard to continue.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.017 b/pkgs/applications/editors/vim/patches/7.4.017
deleted file mode 100644
index 7d7fad83fe79..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.017
+++ /dev/null
@@ -1,78 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.017
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.017
-Problem:    ":help !!" does not find the "!!" tag in the help file. (Ben
-	    Fritz)
-Solution:   When reading the start of the tags file do parse lines that are
-	    not header lines.
-Files:	    src/tag.c
-
-
-*** ../vim-7.4.016/src/tag.c	2013-06-15 22:26:26.000000000 +0200
---- src/tag.c	2013-09-05 12:03:38.000000000 +0200
-***************
-*** 1797,1809 ****
-  	     */
-  	    if (state == TS_START)
-  	    {
-! 		/* The header ends when the line sorts below "!_TAG_".
-! 		 * There may be non-header items before the header though,
-! 		 * e.g. "!" itself. When case is folded lower case letters
-! 		 * sort before "_". */
-  		if (STRNCMP(lbuf, "!_TAG_", 6) <= 0
-  				|| (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1])))
-  		{
-  		    /*
-  		     * Read header line.
-  		     */
---- 1797,1812 ----
-  	     */
-  	    if (state == TS_START)
-  	    {
-! 		/* The header ends when the line sorts below "!_TAG_".  When
-! 		 * case is folded lower case letters sort before "_". */
-  		if (STRNCMP(lbuf, "!_TAG_", 6) <= 0
-  				|| (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1])))
-  		{
-+ 		    if (STRNCMP(lbuf, "!_TAG_", 6) != 0)
-+ 			/* Non-header item before the header, e.g. "!" itself.
-+ 			 */
-+ 			goto parse_line;
-+ 
-  		    /*
-  		     * Read header line.
-  		     */
-***************
-*** 1898,1903 ****
---- 1901,1907 ----
-  #endif
-  	    }
-  
-+ parse_line:
-  	    /*
-  	     * Figure out where the different strings are in this line.
-  	     * For "normal" tags: Do a quick check if the tag matches.
-*** ../vim-7.4.016/src/version.c	2013-08-30 17:29:10.000000000 +0200
---- src/version.c	2013-09-05 12:02:01.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     17,
-  /**/
-
--- 
-An error has occurred.  Hit any user to continue.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.018 b/pkgs/applications/editors/vim/patches/7.4.018
deleted file mode 100644
index 2214c30b2b8a..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.018
+++ /dev/null
@@ -1,45 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.018
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.018
-Problem:    When completing item becomes unselected. (Shougo Matsu)
-Solution:   Revert patch 7.3.1269.
-Files:	    src/edit.c
-
-
-*** ../vim-7.4.017/src/edit.c	2013-07-04 20:22:25.000000000 +0200
---- src/edit.c	2013-09-05 12:39:53.000000000 +0200
-***************
-*** 3467,3473 ****
-      }
-  
-      compl_enter_selects = !compl_used_match;
--     compl_shown_match = compl_curr_match = compl_first_match;
-  
-      /* Show the popup menu with a different set of matches. */
-      ins_compl_show_pum();
---- 3467,3472 ----
-*** ../vim-7.4.017/src/version.c	2013-09-05 12:06:26.000000000 +0200
---- src/version.c	2013-09-05 12:40:34.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     18,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-169. You hire a housekeeper for your home page.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.019 b/pkgs/applications/editors/vim/patches/7.4.019
deleted file mode 100644
index b1532c19c81c..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.019
+++ /dev/null
@@ -1,61 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.019
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.019
-Problem:    MS-Windows: File name completion doesn't work properly with
-	    Chinese characters. (Yue Wu)
-Solution:   Take care of multi-byte characters when looking for the start of
-	    the file name. (Ken Takata)
-Files:	    src/edit.c
-
-
-*** ../vim-7.4.018/src/edit.c	2013-09-05 12:49:48.000000000 +0200
---- src/edit.c	2013-09-05 13:45:27.000000000 +0200
-***************
-*** 5183,5190 ****
-  	}
-  	else if (ctrl_x_mode == CTRL_X_FILES)
-  	{
-! 	    while (--startcol >= 0 && vim_isfilec(line[startcol]))
-! 		;
-  	    compl_col += ++startcol;
-  	    compl_length = (int)curs_col - startcol;
-  	    compl_pattern = addstar(line + compl_col, compl_length,
---- 5183,5196 ----
-  	}
-  	else if (ctrl_x_mode == CTRL_X_FILES)
-  	{
-! 	    char_u	*p = line + startcol;
-! 
-! 	    /* Go back to just before the first filename character. */
-! 	    mb_ptr_back(line, p);
-! 	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
-! 		mb_ptr_back(line, p);
-! 	    startcol = p - line;
-! 
-  	    compl_col += ++startcol;
-  	    compl_length = (int)curs_col - startcol;
-  	    compl_pattern = addstar(line + compl_col, compl_length,
-*** ../vim-7.4.018/src/version.c	2013-09-05 12:49:48.000000000 +0200
---- src/version.c	2013-09-05 13:41:47.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     19,
-  /**/
-
--- 
-        Very funny, Scotty.  Now beam down my clothes.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.020 b/pkgs/applications/editors/vim/patches/7.4.020
deleted file mode 100644
index 942d82fe2554..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.020
+++ /dev/null
@@ -1,82 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.020
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.020
-Problem:    NFA engine matches too much with \@>. (John McGowan)
-Solution:   When a whole pattern match is found stop searching.
-Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
-
-
-*** ../vim-7.4.019/src/regexp_nfa.c	2013-08-25 17:01:36.000000000 +0200
---- src/regexp_nfa.c	2013-09-05 15:59:44.000000000 +0200
-***************
-*** 5322,5328 ****
-  		log_subsexpr(m);
-  #endif
-  		nfa_match = TRUE;
-! 		break;
-  
-  	    case NFA_START_INVISIBLE:
-  	    case NFA_START_INVISIBLE_FIRST:
---- 5322,5331 ----
-  		log_subsexpr(m);
-  #endif
-  		nfa_match = TRUE;
-! 		/* See comment above at "goto nextchar". */
-! 		if (nextlist->n == 0)
-! 		    clen = 0;
-! 		goto nextchar;
-  
-  	    case NFA_START_INVISIBLE:
-  	    case NFA_START_INVISIBLE_FIRST:
-*** ../vim-7.4.019/src/testdir/test64.in	2013-08-14 13:31:03.000000000 +0200
---- src/testdir/test64.in	2013-09-05 15:35:44.000000000 +0200
-***************
-*** 427,432 ****
---- 427,433 ----
-  :""""" \@>
-  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
-  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
-+ :call add(tl, [2, '^\(.\{-}b\)\@>.', '  abcbd', '  abc', '  ab'])
-  :" TODO: BT engine does not restore submatch after failure
-  :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
-  :"
-*** ../vim-7.4.019/src/testdir/test64.ok	2013-08-14 13:31:03.000000000 +0200
---- src/testdir/test64.ok	2013-09-05 16:03:34.000000000 +0200
-***************
-*** 983,988 ****
---- 983,991 ----
-  OK 0 - \(a*\)\@>b
-  OK 1 - \(a*\)\@>b
-  OK 2 - \(a*\)\@>b
-+ OK 0 - ^\(.\{-}b\)\@>.
-+ OK 1 - ^\(.\{-}b\)\@>.
-+ OK 2 - ^\(.\{-}b\)\@>.
-  OK 0 - \(a*\)\@>a\|a\+
-  OK 2 - \(a*\)\@>a\|a\+
-  OK 0 - \_[^8-9]\+
-*** ../vim-7.4.019/src/version.c	2013-09-05 13:50:49.000000000 +0200
---- src/version.c	2013-09-05 16:04:32.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     20,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-173. You keep tracking down the email addresses of all your friends
-     (even childhood friends).
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.021 b/pkgs/applications/editors/vim/patches/7.4.021
deleted file mode 100644
index 0936d9a194b6..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.021
+++ /dev/null
@@ -1,86 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.021
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.021
-Problem:    NFA regexp: Using \ze in one branch which doesn't match may cause
-	    end of another branch to be wrong. (William Fugh)
-Solution:   Set end position if it wasn't set yet.
-Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
-
-
-*** ../vim-7.4.020/src/regexp_nfa.c	2013-09-05 16:05:32.000000000 +0200
---- src/regexp_nfa.c	2013-09-05 20:56:25.000000000 +0200
-***************
-*** 4209,4218 ****
-  	    break;
-  
-  	case NFA_MCLOSE:
-! 	    if (nfa_has_zend)
-  	    {
-! 		/* Do not overwrite the position set by \ze. If no \ze
-! 		 * encountered end will be set in nfa_regtry(). */
-  		subs = addstate(l, state->out, subs, pim, off);
-  		break;
-  	    }
---- 4209,4219 ----
-  	    break;
-  
-  	case NFA_MCLOSE:
-! 	    if (nfa_has_zend && (REG_MULTI
-! 			? subs->norm.list.multi[0].end.lnum >= 0
-! 			: subs->norm.list.line[0].end != NULL))
-  	    {
-! 		/* Do not overwrite the position set by \ze. */
-  		subs = addstate(l, state->out, subs, pim, off);
-  		break;
-  	    }
-*** ../vim-7.4.020/src/testdir/test64.in	2013-09-05 16:05:32.000000000 +0200
---- src/testdir/test64.in	2013-09-05 20:55:18.000000000 +0200
-***************
-*** 328,333 ****
---- 328,334 ----
-  :call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
-  :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
-  :call add(tl, [2, '\>\zs.', 'aword. ', '.'])
-+ :call add(tl, [2, '\s\+\ze\[/\|\s\zs\s\+', 'is   [a t', '  '])
-  :"
-  :"""" Tests for \@= and \& features
-  :call add(tl, [2, 'abc\@=', 'abc', 'ab'])
-*** ../vim-7.4.020/src/testdir/test64.ok	2013-09-05 16:05:32.000000000 +0200
---- src/testdir/test64.ok	2013-09-05 21:09:56.000000000 +0200
-***************
-*** 752,757 ****
---- 752,760 ----
-  OK 0 - \>\zs.
-  OK 1 - \>\zs.
-  OK 2 - \>\zs.
-+ OK 0 - \s\+\ze\[/\|\s\zs\s\+
-+ OK 1 - \s\+\ze\[/\|\s\zs\s\+
-+ OK 2 - \s\+\ze\[/\|\s\zs\s\+
-  OK 0 - abc\@=
-  OK 1 - abc\@=
-  OK 2 - abc\@=
-*** ../vim-7.4.020/src/version.c	2013-09-05 16:05:32.000000000 +0200
---- src/version.c	2013-09-05 21:11:38.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     21,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-174. You know what a listserv is.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.022 b/pkgs/applications/editors/vim/patches/7.4.022
deleted file mode 100644
index 81a0901f5b55..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.022
+++ /dev/null
@@ -1,148 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.022
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.022
-Problem:    Deadlock while exiting, because of allocating memory.
-Solution:   Do not use gettext() in deathtrap(). (James McCoy)
-Files:	    src/os_unix.c, src/misc1.c
-
-
-*** ../vim-7.4.021/src/os_unix.c	2013-07-03 16:32:32.000000000 +0200
---- src/os_unix.c	2013-09-05 21:40:06.000000000 +0200
-***************
-*** 957,964 ****
-  
-  /*
-   * This function handles deadly signals.
-!  * It tries to preserve any swap file and exit properly.
-   * (partly from Elvis).
-   */
-      static RETSIGTYPE
-  deathtrap SIGDEFARG(sigarg)
---- 957,966 ----
-  
-  /*
-   * This function handles deadly signals.
-!  * It tries to preserve any swap files and exit properly.
-   * (partly from Elvis).
-+  * NOTE: Avoid unsafe functions, such as allocating memory, they can result in
-+  * a deadlock.
-   */
-      static RETSIGTYPE
-  deathtrap SIGDEFARG(sigarg)
-***************
-*** 1090,1107 ****
-      }
-      if (entered == 2)
-      {
-! 	OUT_STR(_("Vim: Double signal, exiting\n"));
-  	out_flush();
-  	getout(1);
-      }
-  
-  #ifdef SIGHASARG
-!     sprintf((char *)IObuff, _("Vim: Caught deadly signal %s\n"),
-  							 signal_info[i].name);
-  #else
-!     sprintf((char *)IObuff, _("Vim: Caught deadly signal\n"));
-  #endif
-!     preserve_exit();		    /* preserve files and exit */
-  
-  #ifdef NBDEBUG
-      reset_signals();
---- 1092,1114 ----
-      }
-      if (entered == 2)
-      {
-! 	/* No translation, it may call malloc(). */
-! 	OUT_STR("Vim: Double signal, exiting\n");
-  	out_flush();
-  	getout(1);
-      }
-  
-+     /* No translation, it may call malloc(). */
-  #ifdef SIGHASARG
-!     sprintf((char *)IObuff, "Vim: Caught deadly signal %s\n",
-  							 signal_info[i].name);
-  #else
-!     sprintf((char *)IObuff, "Vim: Caught deadly signal\n");
-  #endif
-! 
-!     /* Preserve files and exit.  This sets the really_exiting flag to prevent
-!      * calling free(). */
-!     preserve_exit();
-  
-  #ifdef NBDEBUG
-      reset_signals();
-*** ../vim-7.4.021/src/misc1.c	2013-08-03 17:29:33.000000000 +0200
---- src/misc1.c	2013-09-05 21:34:04.000000000 +0200
-***************
-*** 9174,9179 ****
---- 9174,9181 ----
-  /*
-   * Preserve files and exit.
-   * When called IObuff must contain a message.
-+  * NOTE: This may be called from deathtrap() in a signal handler, avoid unsafe
-+  * functions, such as allocating memory.
-   */
-      void
-  preserve_exit()
-***************
-*** 9196,9202 ****
-      {
-  	if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
-  	{
-! 	    OUT_STR(_("Vim: preserving files...\n"));
-  	    screen_start();	    /* don't know where cursor is now */
-  	    out_flush();
-  	    ml_sync_all(FALSE, FALSE);	/* preserve all swap files */
---- 9198,9204 ----
-      {
-  	if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
-  	{
-! 	    OUT_STR("Vim: preserving files...\n");
-  	    screen_start();	    /* don't know where cursor is now */
-  	    out_flush();
-  	    ml_sync_all(FALSE, FALSE);	/* preserve all swap files */
-***************
-*** 9206,9212 ****
-  
-      ml_close_all(FALSE);	    /* close all memfiles, without deleting */
-  
-!     OUT_STR(_("Vim: Finished.\n"));
-  
-      getout(1);
-  }
---- 9208,9214 ----
-  
-      ml_close_all(FALSE);	    /* close all memfiles, without deleting */
-  
-!     OUT_STR("Vim: Finished.\n");
-  
-      getout(1);
-  }
-*** ../vim-7.4.021/src/version.c	2013-09-05 21:15:38.000000000 +0200
---- src/version.c	2013-09-05 21:30:18.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     22,
-  /**/
-
--- 
-hundred-and-one symptoms of being an internet addict:
-175. You send yourself e-mail before you go to bed to remind you
-     what to do when you wake up.
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.023 b/pkgs/applications/editors/vim/patches/7.4.023
deleted file mode 100644
index 03005213ea45..000000000000
--- a/pkgs/applications/editors/vim/patches/7.4.023
+++ /dev/null
@@ -1,53 +0,0 @@
-To: vim_dev@googlegroups.com
-Subject: Patch 7.4.023
-Fcc: outbox
-From: Bram Moolenaar <Bram@moolenaar.net>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-------------
-
-Patch 7.4.023
-Problem:    Compiler warning on 64 bit windows.
-Solution:   Add type cast. (Mike Williams)
-Files:	    src/edit.c
-
-
-*** ../vim-7.4.022/src/edit.c	2013-09-05 13:50:49.000000000 +0200
---- src/edit.c	2013-09-06 17:32:55.000000000 +0200
-***************
-*** 5189,5195 ****
-  	    mb_ptr_back(line, p);
-  	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
-  		mb_ptr_back(line, p);
-! 	    startcol = p - line;
-  
-  	    compl_col += ++startcol;
-  	    compl_length = (int)curs_col - startcol;
---- 5189,5195 ----
-  	    mb_ptr_back(line, p);
-  	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
-  		mb_ptr_back(line, p);
-! 	    startcol = (int)(p - line);
-  
-  	    compl_col += ++startcol;
-  	    compl_length = (int)curs_col - startcol;
-*** ../vim-7.4.022/src/version.c	2013-09-05 21:41:35.000000000 +0200
---- src/version.c	2013-09-06 17:33:41.000000000 +0200
-***************
-*** 740,741 ****
---- 740,743 ----
-  {   /* Add new patch number below this line */
-+ /**/
-+     23,
-  /**/
-
--- 
-Wizards had always known that the act of observation changed the thing that
-was observed, and sometimes forgot that it also changed the observer too.
-			Terry Pratchett  -  Interesting times
-
- /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
-///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
-\\\  an exciting new programming language -- http://www.Zimbu.org        ///
- \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/python_framework.patch b/pkgs/applications/editors/vim/python_framework.patch
new file mode 100644
index 000000000000..b7c7cee6cd93
--- /dev/null
+++ b/pkgs/applications/editors/vim/python_framework.patch
@@ -0,0 +1,23 @@
+diff --git a/src/auto/configure b/src/auto/configure
+index a9755a0..4a0e2a4 100755
+--- a/auto/configure
++++ b/auto/configure
+@@ -5638,10 +5638,6 @@ __:
+ eof
+ 	    	    eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
+ 	    rm -f -- "${tmp_mkf}"
+-	    if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
+-		"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
+-	      vi_cv_path_python_plibs="-framework Python"
+-	    else
+ 	      if test "${vi_cv_var_python_version}" = "1.4"; then
+ 		  vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
+ 	      else
+@@ -5649,7 +5645,6 @@ eof
+ 	      fi
+ 	      vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
+ 	      	      vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
+-	    fi
+ 
+ fi
+ 
diff --git a/pkgs/applications/editors/vim/qvim.nix b/pkgs/applications/editors/vim/qvim.nix
new file mode 100644
index 000000000000..2357e23bf014
--- /dev/null
+++ b/pkgs/applications/editors/vim/qvim.nix
@@ -0,0 +1,126 @@
+args@{...}: with args;
+
+
+let inherit (args.composableDerivation) composableDerivation edf; in
+composableDerivation {
+  # use gccApple to compile on darwin
+  mkDerivation = ( if stdenv.isDarwin
+                   then stdenvAdapters.overrideGCC stdenv gccApple
+                   else stdenv ).mkDerivation;
+} (fix: {
+
+    name = "qvim-7.4";
+
+    enableParallelBuilding = true; # test this
+
+    src = fetchgit {
+      url = https://bitbucket.org/equalsraf/vim-qt.git ;
+      rev = "4160bfd5c1380e899d2f426b494fc4f1cf6ae85e";
+      sha256 = "1qa3xl1b9gqw66p71h53l7ibs4y3zfyj553jss70ybxaxchbhi5b";
+    };
+
+    # FIXME: adopt Darwin fixes from vim/default.nix, then chage meta.platforms.linux
+    # to meta.platforms.unix
+    preConfigure = assert (! stdenv.isDarwin); "";
+
+    configureFlags = [ "--with-vim-name=qvim" "--enable-gui=qt" "--with-features=${args.features}" ];
+
+    nativeBuildInputs
+      = [ ncurses pkgconfig libX11 libXext libSM libXpm libXt libXaw libXau
+          libXmu libICE qt4];
+
+    # most interpreters aren't tested yet.. (see python for example how to do it)
+    flags = {
+        ftNix = {
+          # because we cd to src in the main patch phase, we can't just add this
+          # patch to the list, we have to apply it manually
+          postPatch = ''
+            cd runtime
+            patch -p2 < ${./ft-nix-support.patch}
+            cd ..
+          '';
+        };
+      }
+      // edf { name = "darwin"; } #Disable Darwin (Mac OS X) support.
+      // edf { name = "xsmp"; } #Disable XSMP session management
+      // edf { name = "xsmp_interact"; } #Disable XSMP interaction
+      // edf { name = "mzscheme"; } #Include MzScheme interpreter.
+      // edf { name = "perl"; feat = "perlinterp"; enable = { nativeBuildInputs = [perl]; };} #Include Perl interpreter.
+
+      // edf {
+        name = "python";
+        feat = "pythoninterp";
+        enable = {
+          nativeBuildInputs = [ python ];
+        } // lib.optionalAttrs stdenv.isDarwin {
+          configureFlags
+            = [ "--enable-pythoninterp=yes"
+                "--with-python-config-dir=${python}/lib" ];
+        };
+      }
+
+      // edf { name = "tcl"; enable = { nativeBuildInputs = [tcl]; }; } #Include Tcl interpreter.
+      // edf { name = "ruby"; feat = "rubyinterp"; enable = { nativeBuildInputs = [ruby]; };} #Include Ruby interpreter.
+      // edf {
+        name = "lua";
+        feat = "luainterp";
+        enable = {
+          nativeBuildInputs = [lua];
+          configureFlags = [
+            "--with-lua-prefix=${args.lua}"
+            "--enable-luainterp"
+          ];
+        };
+      }
+      // edf { name = "cscope"; } #Include cscope interface.
+      // edf { name = "workshop"; } #Include Sun Visual Workshop support.
+      // edf { name = "netbeans"; } #Disable NetBeans integration support.
+      // edf { name = "sniff"; feat = "sniff" ; } #Include Sniff interface.
+      // edf { name = "multibyte"; } #Include multibyte editing support.
+      // edf { name = "hangulinput"; feat = "hangulinput" ;} #Include Hangul input support.
+      // edf { name = "xim"; } #Include XIM input support.
+      // edf { name = "fontset"; } #Include X fontset output support.
+      // edf { name = "acl"; } #Don't check for ACL support.
+      // edf { name = "gpm"; } #Don't use gpm (Linux mouse daemon).
+      // edf { name = "nls"; enable = {nativeBuildInputs = [gettext];}; } #Don't support NLS (gettext()).
+      ;
+
+  cfg = {
+    luaSupport       = config.vim.lua or true;
+    pythonSupport    = config.vim.python or true;
+    rubySupport      = config.vim.ruby or true;
+    nlsSupport       = config.vim.nls or false;
+    tclSupport       = config.vim.tcl or false;
+    multibyteSupport = config.vim.multibyte or false;
+    cscopeSupport    = config.vim.cscope or false;
+    netbeansSupport  = config.netbeans or true; # eg envim is using it
+
+    # by default, compile with darwin support if we're compiling on darwin, but
+    # allow this to be disabled by setting config.vim.darwin to false
+    darwinSupport    = stdenv.isDarwin && (config.vim.darwin or true);
+
+    # add .nix filetype detection and minimal syntax highlighting support
+    ftNixSupport     = config.vim.ftNix or true;
+  };
+
+  postInstall = stdenv.lib.optionalString stdenv.isLinux ''
+    rpath=`patchelf --print-rpath $out/bin/qvim`;
+    for i in $nativeBuildInputs; do
+      echo adding $i/lib
+      rpath=$rpath:$i/lib
+    done
+    echo $nativeBuildInputs
+    echo $rpath
+    patchelf --set-rpath $rpath $out/bin/qvim
+  '';
+
+  dontStrip = 1;
+
+  meta = with stdenv.lib; {
+    description = "The most popular clone of the VI editor (Qt GUI fork)";
+    homepage    = https://bitbucket.org/equalsraf/vim-qt/wiki/Home;
+    maintainers = with maintainers; [ smironov ];
+    platforms   = platforms.linux;
+  };
+})
+
diff --git a/pkgs/applications/editors/yi/yi-contrib.nix b/pkgs/applications/editors/yi/yi-contrib.nix
new file mode 100644
index 000000000000..59b6992a3692
--- /dev/null
+++ b/pkgs/applications/editors/yi/yi-contrib.nix
@@ -0,0 +1,19 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, filepath, lens, mtl, split, time, transformersBase, yi }:
+
+cabal.mkDerivation (self: {
+  pname = "yi-contrib";
+  version = "0.8.2";
+  sha256 = "17rbgrra1ghlywiraadf16n7igxp1k8jqqmb0iw8sc15y7825qqm";
+  buildDepends = [
+    filepath lens mtl split time transformersBase yi
+  ];
+  meta = {
+    homepage = "http://haskell.org/haskellwiki/Yi";
+    description = "Add-ons to Yi, the Haskell-Scriptable Editor";
+    license = "GPL";
+    platforms = self.ghc.meta.platforms;
+    maintainers = with self.stdenv.lib.maintainers; [ fuuzetsu ];
+  };
+})
diff --git a/pkgs/applications/editors/yi/yi.nix b/pkgs/applications/editors/yi/yi.nix
new file mode 100644
index 000000000000..ae5e9a83452f
--- /dev/null
+++ b/pkgs/applications/editors/yi/yi.nix
@@ -0,0 +1,63 @@
+{ cabal, alex, binary, Cabal, cautiousFile, concreteTyperep
+, dataDefault, derive, Diff, dlist, dyre, filepath, fingertree
+, glib, gtk, hashable, hint, HUnit, lens, mtl, pango, parsec
+, pointedlist, QuickCheck, random, regexBase, regexTdfa, safe
+, split, tasty, tastyHunit, tastyQuickcheck, time, transformersBase
+, uniplate, unixCompat, unorderedContainers, utf8String, vty
+, xdgBasedir
+, withPango ? true
+
+# User may need extra dependencies for their configuration file so we
+# want to specify it here to have them available when wrapping the
+# produced binary.
+, extraDepends ? [ ]
+}:
+
+cabal.mkDerivation (self: {
+  pname = "yi";
+  version = "0.8.2";
+  sha256 = "18rnyswsdzkh0jdcqfg8pr90mpm6xf11siv598svqkxg12d2qql9";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    binary Cabal cautiousFile concreteTyperep dataDefault derive Diff
+    dlist dyre filepath fingertree hashable hint lens mtl
+    parsec pointedlist QuickCheck random regexBase regexTdfa safe
+    split time transformersBase uniplate unixCompat unorderedContainers
+    utf8String vty xdgBasedir
+  ] ++ (if withPango then [ pango gtk glib ] else [ ]) ++ extraDepends;
+  testDepends = [
+    filepath HUnit QuickCheck tasty tastyHunit tastyQuickcheck
+  ];
+  buildTools = [ alex ];
+  configureFlags = if withPango then "-fpango" else "-f-pango";
+  doCheck = false;
+
+  # https://ghc.haskell.org/trac/ghc/ticket/9170
+  noHaddock = self.ghc.version == "7.6.3";
+
+  # Allows Yi to find the libraries it needs at runtime.
+  postInstall = ''
+    mv $out/bin/yi $out/bin/.yi-wrapped
+    cat - > $out/bin/yi <<EOF
+    #! ${self.stdenv.shell}
+    # Trailing : is necessary for it to pick up Prelude &c.
+    export GHC_PACKAGE_PATH=$(${self.ghc.GHCGetPackages} ${self.ghc.version} \
+                              | sed 's/-package-db\ //g' \
+                              | sed 's/^\ //g' \
+                              | sed 's/\ /:/g')\
+    :$out/lib/ghc-${self.ghc.version}/package.conf.d/yi-$version.installedconf:
+
+    eval exec $out/bin/.yi-wrapped "\$@"
+    EOF
+    chmod +x $out/bin/yi
+  '';
+
+  meta = {
+    homepage = "http://haskell.org/haskellwiki/Yi";
+    description = "The Haskell-Scriptable Editor";
+    license = self.stdenv.lib.licenses.gpl2;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.fuuzetsu ];
+  };
+})
diff --git a/pkgs/applications/editors/zed/default.nix b/pkgs/applications/editors/zed/default.nix
new file mode 100644
index 000000000000..585a3a58d5f0
--- /dev/null
+++ b/pkgs/applications/editors/zed/default.nix
@@ -0,0 +1,103 @@
+{ stdenv, buildEnv, fetchgit, xlibs, glib, gtk2, atk, pango, gdk_pixbuf,
+  cairo, freetype, fontconfig, nss, nspr, gnome, alsaLib, expat, dbus, udev,
+  makeWrapper, writeScript, fetchurl, zip, pkgs, node_webkit }:
+
+let
+  name = "zed-${version}";
+  version = "0.12";
+
+  rpath_env = buildEnv {
+    name = "rpath_env";
+    paths = [ xlibs.libX11 xlibs.libXrender glib xlibs.libXtst gtk2 atk pango
+      gdk_pixbuf cairo freetype fontconfig xlibs.libXi xlibs.libXcomposite
+      nss nspr gnome.GConf xlibs.libXext xlibs.libXfixes alsaLib
+      xlibs.libXdamage expat dbus stdenv.gcc ];
+    pathsToLink = [ "/lib" "/lib64" ];
+  };
+
+  # When upgrading node.nix / node packages:
+  #   fetch package.json from Zed's repository
+  #   run `npm2nix package.json node.nix`
+  #   and replace node.nix with new one
+  nodePackages = import ../../../../pkgs/top-level/node-packages.nix {
+    inherit pkgs;
+    inherit (pkgs) stdenv nodejs fetchurl fetchgit;
+    neededNatives = [ pkgs.python ] ++ pkgs.lib.optional pkgs.stdenv.isLinux pkgs.utillinux;
+    self = nodePackages;
+    generated = ./node.nix;
+  };
+
+  node_env = buildEnv {
+    name = "node_env";
+    paths = [ nodePackages.tar nodePackages.request ];
+    pathsToLink = [ "/lib" ];
+  };
+
+  zed = stdenv.mkDerivation rec {
+    inherit name version;
+
+    src = fetchgit {
+        url = "git://github.com/zedapp/zed";
+        rev = "refs/tags/v${version}";
+        sha256 = "1l1adj4p916km626vxg1lv0bapzay4z5nq005pxsbjbcycrhds59";
+      };
+
+    buildInputs = [ makeWrapper zip ];
+
+    dontBuild = true;
+
+    installPhase = ''
+      export NWPATH="${node_webkit}/share/node-webkit";
+
+      mkdir -p $out/zed
+
+      cd ${src}/app; zip -r $out/zed/app.nw *; cd ..
+
+      cat $NWPATH/nw $out/zed/app.nw > $out/zed/zed-bin
+      cp $NWPATH/nw.pak $out/zed/
+      cp nw/zed-linux $out/zed/zed
+      chmod +x $out/zed/zed*
+      cp Zed.desktop.tmpl Zed.svg Zed.png $out/zed
+      rm $out/zed/app.nw
+    '';
+
+    postFixup = ''
+      patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $out/zed/zed-bin
+      patchelf --set-rpath "${rpath_env}/lib:${rpath_env}/lib64" $out/zed/zed-bin
+
+      mkdir -p $out/lib
+      ln -s ${udev}/lib/libudev.so.1 $out/lib/libudev.so.0
+
+      wrapProgram $out/zed/zed-bin \
+        --prefix LD_LIBRARY_PATH : $out/lib \
+        --prefix NODE_PATH : ${node_env}/lib/node_modules
+    '';
+  };
+
+  zed_script = writeScript "zed.sh" ''
+    if [[ $1 == http://* ]] || [[ $1 == https://* ]]; then
+        PROJECT=$1
+    elif [ "" != "$1" ]; then
+       PROJECT=$(readlink -f $1)
+    fi
+    ${zed}/zed/zed-bin $PROJECT
+  '';
+
+in stdenv.mkDerivation rec {
+  inherit name version;
+
+  src = zed;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    ln -s ${zed_script} $out/bin/zed
+  '';
+
+  meta = {
+    description = "Zed is a fully offline-capable, open source, keyboard-focused, text and code editor for power users";
+    license = stdenv.lib.licenses.mit;
+    homepage = http://zedapp.org/;
+    maintainers = [ stdenv.lib.maintainers.matejc ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/editors/zed/node.nix b/pkgs/applications/editors/zed/node.nix
new file mode 100644
index 000000000000..b4a7cec4269c
--- /dev/null
+++ b/pkgs/applications/editors/zed/node.nix
@@ -0,0 +1,634 @@
+{ self, fetchurl, fetchgit ? null, lib }:
+
+{
+  by-spec."asn1"."0.1.11" =
+    self.by-version."asn1"."0.1.11";
+  by-version."asn1"."0.1.11" = lib.makeOverridable self.buildNodePackage {
+    name = "node-asn1-0.1.11";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz";
+        name = "asn1-0.1.11.tgz";
+        sha1 = "559be18376d08a4ec4dbe80877d27818639b2df7";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."asn1" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "asn1" ];
+  };
+  by-spec."assert-plus"."0.1.2" =
+    self.by-version."assert-plus"."0.1.2";
+  by-version."assert-plus"."0.1.2" = lib.makeOverridable self.buildNodePackage {
+    name = "node-assert-plus-0.1.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz";
+        name = "assert-plus-0.1.2.tgz";
+        sha1 = "d93ffdbb67ac5507779be316a7d65146417beef8";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."assert-plus" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "assert-plus" ];
+  };
+  by-spec."async"."~0.9.0" =
+    self.by-version."async"."0.9.0";
+  by-version."async"."0.9.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-async-0.9.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/async/-/async-0.9.0.tgz";
+        name = "async-0.9.0.tgz";
+        sha1 = "ac3613b1da9bed1b47510bb4651b8931e47146c7";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."async" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "async" ];
+  };
+  by-spec."aws-sign2"."~0.5.0" =
+    self.by-version."aws-sign2"."0.5.0";
+  by-version."aws-sign2"."0.5.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-aws-sign2-0.5.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz";
+        name = "aws-sign2-0.5.0.tgz";
+        sha1 = "c57103f7a17fc037f02d7c2e64b602ea223f7d63";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."aws-sign2" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "aws-sign2" ];
+  };
+  by-spec."block-stream"."*" =
+    self.by-version."block-stream"."0.0.7";
+  by-version."block-stream"."0.0.7" = lib.makeOverridable self.buildNodePackage {
+    name = "node-block-stream-0.0.7";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/block-stream/-/block-stream-0.0.7.tgz";
+        name = "block-stream-0.0.7.tgz";
+        sha1 = "9088ab5ae1e861f4d81b176b4a8046080703deed";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."block-stream" or []);
+    deps = [
+      self.by-version."inherits"."2.0.1"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "block-stream" ];
+  };
+  by-spec."boom"."0.4.x" =
+    self.by-version."boom"."0.4.2";
+  by-version."boom"."0.4.2" = lib.makeOverridable self.buildNodePackage {
+    name = "node-boom-0.4.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/boom/-/boom-0.4.2.tgz";
+        name = "boom-0.4.2.tgz";
+        sha1 = "7a636e9ded4efcefb19cef4947a3c67dfaee911b";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."boom" or []);
+    deps = [
+      self.by-version."hoek"."0.9.1"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "boom" ];
+  };
+  by-spec."combined-stream"."~0.0.4" =
+    self.by-version."combined-stream"."0.0.5";
+  by-version."combined-stream"."0.0.5" = lib.makeOverridable self.buildNodePackage {
+    name = "node-combined-stream-0.0.5";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz";
+        name = "combined-stream-0.0.5.tgz";
+        sha1 = "29ed76e5c9aad07c4acf9ca3d32601cce28697a2";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."combined-stream" or []);
+    deps = [
+      self.by-version."delayed-stream"."0.0.5"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "combined-stream" ];
+  };
+  by-spec."cryptiles"."0.2.x" =
+    self.by-version."cryptiles"."0.2.2";
+  by-version."cryptiles"."0.2.2" = lib.makeOverridable self.buildNodePackage {
+    name = "node-cryptiles-0.2.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz";
+        name = "cryptiles-0.2.2.tgz";
+        sha1 = "ed91ff1f17ad13d3748288594f8a48a0d26f325c";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."cryptiles" or []);
+    deps = [
+      self.by-version."boom"."0.4.2"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "cryptiles" ];
+  };
+  by-spec."ctype"."0.5.2" =
+    self.by-version."ctype"."0.5.2";
+  by-version."ctype"."0.5.2" = lib.makeOverridable self.buildNodePackage {
+    name = "node-ctype-0.5.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz";
+        name = "ctype-0.5.2.tgz";
+        sha1 = "fe8091d468a373a0b0c9ff8bbfb3425c00973a1d";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."ctype" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "ctype" ];
+  };
+  by-spec."delayed-stream"."0.0.5" =
+    self.by-version."delayed-stream"."0.0.5";
+  by-version."delayed-stream"."0.0.5" = lib.makeOverridable self.buildNodePackage {
+    name = "node-delayed-stream-0.0.5";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz";
+        name = "delayed-stream-0.0.5.tgz";
+        sha1 = "d4b1f43a93e8296dfe02694f4680bc37a313c73f";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."delayed-stream" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "delayed-stream" ];
+  };
+  by-spec."forever-agent"."~0.5.0" =
+    self.by-version."forever-agent"."0.5.2";
+  by-version."forever-agent"."0.5.2" = lib.makeOverridable self.buildNodePackage {
+    name = "node-forever-agent-0.5.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz";
+        name = "forever-agent-0.5.2.tgz";
+        sha1 = "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."forever-agent" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "forever-agent" ];
+  };
+  by-spec."form-data"."~0.1.0" =
+    self.by-version."form-data"."0.1.4";
+  by-version."form-data"."0.1.4" = lib.makeOverridable self.buildNodePackage {
+    name = "node-form-data-0.1.4";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz";
+        name = "form-data-0.1.4.tgz";
+        sha1 = "91abd788aba9702b1aabfa8bc01031a2ac9e3b12";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."form-data" or []);
+    deps = [
+      self.by-version."combined-stream"."0.0.5"
+      self.by-version."mime"."1.2.11"
+      self.by-version."async"."0.9.0"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "form-data" ];
+  };
+  by-spec."fstream"."~0.1.28" =
+    self.by-version."fstream"."0.1.29";
+  by-version."fstream"."0.1.29" = lib.makeOverridable self.buildNodePackage {
+    name = "node-fstream-0.1.29";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/fstream/-/fstream-0.1.29.tgz";
+        name = "fstream-0.1.29.tgz";
+        sha1 = "34d04023ebc91a9df47bd31ab97e4704b4db413f";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."fstream" or []);
+    deps = [
+      self.by-version."graceful-fs"."3.0.2"
+      self.by-version."inherits"."2.0.1"
+      self.by-version."mkdirp"."0.3.5"
+      self.by-version."rimraf"."2.2.8"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "fstream" ];
+  };
+  by-spec."graceful-fs"."~3.0.2" =
+    self.by-version."graceful-fs"."3.0.2";
+  by-version."graceful-fs"."3.0.2" = lib.makeOverridable self.buildNodePackage {
+    name = "node-graceful-fs-3.0.2";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.2.tgz";
+        name = "graceful-fs-3.0.2.tgz";
+        sha1 = "2cb5bf7f742bea8ad47c754caeee032b7e71a577";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."graceful-fs" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "graceful-fs" ];
+  };
+  by-spec."hawk"."~1.0.0" =
+    self.by-version."hawk"."1.0.0";
+  by-version."hawk"."1.0.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-hawk-1.0.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz";
+        name = "hawk-1.0.0.tgz";
+        sha1 = "b90bb169807285411da7ffcb8dd2598502d3b52d";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."hawk" or []);
+    deps = [
+      self.by-version."hoek"."0.9.1"
+      self.by-version."boom"."0.4.2"
+      self.by-version."cryptiles"."0.2.2"
+      self.by-version."sntp"."0.2.4"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "hawk" ];
+  };
+  by-spec."hoek"."0.9.x" =
+    self.by-version."hoek"."0.9.1";
+  by-version."hoek"."0.9.1" = lib.makeOverridable self.buildNodePackage {
+    name = "node-hoek-0.9.1";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz";
+        name = "hoek-0.9.1.tgz";
+        sha1 = "3d322462badf07716ea7eb85baf88079cddce505";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."hoek" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "hoek" ];
+  };
+  by-spec."http-signature"."~0.10.0" =
+    self.by-version."http-signature"."0.10.0";
+  by-version."http-signature"."0.10.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-http-signature-0.10.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz";
+        name = "http-signature-0.10.0.tgz";
+        sha1 = "1494e4f5000a83c0f11bcc12d6007c530cb99582";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."http-signature" or []);
+    deps = [
+      self.by-version."assert-plus"."0.1.2"
+      self.by-version."asn1"."0.1.11"
+      self.by-version."ctype"."0.5.2"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "http-signature" ];
+  };
+  by-spec."inherits"."2" =
+    self.by-version."inherits"."2.0.1";
+  by-version."inherits"."2.0.1" = lib.makeOverridable self.buildNodePackage {
+    name = "node-inherits-2.0.1";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz";
+        name = "inherits-2.0.1.tgz";
+        sha1 = "b17d08d326b4423e568eff719f91b0b1cbdf69f1";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."inherits" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "inherits" ];
+  };
+  by-spec."inherits"."~2.0.0" =
+    self.by-version."inherits"."2.0.1";
+  by-spec."json-stringify-safe"."~5.0.0" =
+    self.by-version."json-stringify-safe"."5.0.0";
+  by-version."json-stringify-safe"."5.0.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-json-stringify-safe-5.0.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz";
+        name = "json-stringify-safe-5.0.0.tgz";
+        sha1 = "4c1f228b5050837eba9d21f50c2e6e320624566e";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."json-stringify-safe" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "json-stringify-safe" ];
+  };
+  by-spec."mime"."~1.2.11" =
+    self.by-version."mime"."1.2.11";
+  by-version."mime"."1.2.11" = lib.makeOverridable self.buildNodePackage {
+    name = "node-mime-1.2.11";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz";
+        name = "mime-1.2.11.tgz";
+        sha1 = "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."mime" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "mime" ];
+  };
+  by-spec."mime"."~1.2.9" =
+    self.by-version."mime"."1.2.11";
+  by-spec."mkdirp"."0.3" =
+    self.by-version."mkdirp"."0.3.5";
+  by-version."mkdirp"."0.3.5" = lib.makeOverridable self.buildNodePackage {
+    name = "node-mkdirp-0.3.5";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz";
+        name = "mkdirp-0.3.5.tgz";
+        sha1 = "de3e5f8961c88c787ee1368df849ac4413eca8d7";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."mkdirp" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "mkdirp" ];
+  };
+  by-spec."node-uuid"."~1.4.0" =
+    self.by-version."node-uuid"."1.4.1";
+  by-version."node-uuid"."1.4.1" = lib.makeOverridable self.buildNodePackage {
+    name = "node-node-uuid-1.4.1";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz";
+        name = "node-uuid-1.4.1.tgz";
+        sha1 = "39aef510e5889a3dca9c895b506c73aae1bac048";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."node-uuid" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "node-uuid" ];
+  };
+  by-spec."oauth-sign"."~0.3.0" =
+    self.by-version."oauth-sign"."0.3.0";
+  by-version."oauth-sign"."0.3.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-oauth-sign-0.3.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz";
+        name = "oauth-sign-0.3.0.tgz";
+        sha1 = "cb540f93bb2b22a7d5941691a288d60e8ea9386e";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."oauth-sign" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "oauth-sign" ];
+  };
+  by-spec."punycode".">=0.2.0" =
+    self.by-version."punycode"."1.3.0";
+  by-version."punycode"."1.3.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-punycode-1.3.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/punycode/-/punycode-1.3.0.tgz";
+        name = "punycode-1.3.0.tgz";
+        sha1 = "7f5009ef539b9444be5c7a19abd2c3ca49e1731c";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."punycode" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "punycode" ];
+  };
+  by-spec."qs"."~0.6.0" =
+    self.by-version."qs"."0.6.6";
+  by-version."qs"."0.6.6" = lib.makeOverridable self.buildNodePackage {
+    name = "node-qs-0.6.6";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/qs/-/qs-0.6.6.tgz";
+        name = "qs-0.6.6.tgz";
+        sha1 = "6e015098ff51968b8a3c819001d5f2c89bc4b107";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."qs" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "qs" ];
+  };
+  by-spec."request"."~2.34.0" =
+    self.by-version."request"."2.34.0";
+  by-version."request"."2.34.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-request-2.34.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/request/-/request-2.34.0.tgz";
+        name = "request-2.34.0.tgz";
+        sha1 = "b5d8b9526add4a2d4629f4d417124573996445ae";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."request" or []);
+    deps = [
+      self.by-version."qs"."0.6.6"
+      self.by-version."json-stringify-safe"."5.0.0"
+      self.by-version."forever-agent"."0.5.2"
+      self.by-version."node-uuid"."1.4.1"
+      self.by-version."mime"."1.2.11"
+      self.by-version."tough-cookie"."0.12.1"
+      self.by-version."form-data"."0.1.4"
+      self.by-version."tunnel-agent"."0.3.0"
+      self.by-version."http-signature"."0.10.0"
+      self.by-version."oauth-sign"."0.3.0"
+      self.by-version."hawk"."1.0.0"
+      self.by-version."aws-sign2"."0.5.0"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "request" ];
+  };
+  "request" = self.by-version."request"."2.34.0";
+  by-spec."rimraf"."2" =
+    self.by-version."rimraf"."2.2.8";
+  by-version."rimraf"."2.2.8" = lib.makeOverridable self.buildNodePackage {
+    name = "rimraf-2.2.8";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz";
+        name = "rimraf-2.2.8.tgz";
+        sha1 = "e439be2aaee327321952730f99a8929e4fc50582";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."rimraf" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "rimraf" ];
+  };
+  by-spec."sntp"."0.2.x" =
+    self.by-version."sntp"."0.2.4";
+  by-version."sntp"."0.2.4" = lib.makeOverridable self.buildNodePackage {
+    name = "node-sntp-0.2.4";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz";
+        name = "sntp-0.2.4.tgz";
+        sha1 = "fb885f18b0f3aad189f824862536bceeec750900";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."sntp" or []);
+    deps = [
+      self.by-version."hoek"."0.9.1"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "sntp" ];
+  };
+  by-spec."tar"."~0.1.19" =
+    self.by-version."tar"."0.1.20";
+  by-version."tar"."0.1.20" = lib.makeOverridable self.buildNodePackage {
+    name = "node-tar-0.1.20";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/tar/-/tar-0.1.20.tgz";
+        name = "tar-0.1.20.tgz";
+        sha1 = "42940bae5b5f22c74483699126f9f3f27449cb13";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."tar" or []);
+    deps = [
+      self.by-version."block-stream"."0.0.7"
+      self.by-version."fstream"."0.1.29"
+      self.by-version."inherits"."2.0.1"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "tar" ];
+  };
+  "tar" = self.by-version."tar"."0.1.20";
+  by-spec."tough-cookie".">=0.12.0" =
+    self.by-version."tough-cookie"."0.12.1";
+  by-version."tough-cookie"."0.12.1" = lib.makeOverridable self.buildNodePackage {
+    name = "node-tough-cookie-0.12.1";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz";
+        name = "tough-cookie-0.12.1.tgz";
+        sha1 = "8220c7e21abd5b13d96804254bd5a81ebf2c7d62";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."tough-cookie" or []);
+    deps = [
+      self.by-version."punycode"."1.3.0"
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "tough-cookie" ];
+  };
+  by-spec."tunnel-agent"."~0.3.0" =
+    self.by-version."tunnel-agent"."0.3.0";
+  by-version."tunnel-agent"."0.3.0" = lib.makeOverridable self.buildNodePackage {
+    name = "node-tunnel-agent-0.3.0";
+    src = [
+      (fetchurl {
+        url = "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz";
+        name = "tunnel-agent-0.3.0.tgz";
+        sha1 = "ad681b68f5321ad2827c4cfb1b7d5df2cfe942ee";
+      })
+    ];
+    buildInputs =
+      (self.nativeDeps."tunnel-agent" or []);
+    deps = [
+    ];
+    peerDependencies = [
+    ];
+    passthru.names = [ "tunnel-agent" ];
+  };
+}
diff --git a/pkgs/applications/editors/zile/default.nix b/pkgs/applications/editors/zile/default.nix
index 87ea7ee6854e..32d30cd47450 100644
--- a/pkgs/applications/editors/zile/default.nix
+++ b/pkgs/applications/editors/zile/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   preConfigure = "export gl_cv_func_fstatat_zero_flag=yes";
 
   meta = {
-    description = "GNU Zile, a lightweight Emacs clone";
+    description = "Lightweight Emacs clone";
 
     longDescription = ''
       GNU Zile, which is a lightweight Emacs clone.  Zile is short
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://www.gnu.org/software/zile/;
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     maintainers = [ ];
   };
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index c2a661c82fdf..64b1f5b3b2c1 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -1,6 +1,8 @@
 { stdenv
 , fetchurl
+, pkgconfig
 , bzip2
+, fontconfig
 , freetype
 , ghostscript ? null
 , libjpeg
@@ -16,14 +18,14 @@
 }:
 
 let
-  version = "6.8.6-9";
+  version = "6.8.9-0";
 in
 stdenv.mkDerivation rec {
   name = "ImageMagick-${version}";
 
   src = fetchurl {
     url = "mirror://imagemagick/${name}.tar.xz";
-    sha256 = "1bpj8676mph5cvyjsdgf27i6yg2iw9iskk5c69mvpxkyawgjw1vg";
+    sha256 = "1lapn2798fkc2wn81slpms5p21kq4dsyg45khsk7n8p69cvrmw2b";
   };
 
   enableParallelBuilding = true;
@@ -33,7 +35,7 @@ stdenv.mkDerivation rec {
       export DVIDecodeDelegate=${tetex}/bin/dvips
     '' else "";
 
-  configureFlags = "" + stdenv.lib.optionalString (ghostscript != null && stdenv.system != "x86_64-darwin") ''
+  configureFlags = "" + stdenv.lib.optionalString (stdenv.system != "x86_64-darwin") ''
     --with-gs-font-dir=${ghostscript}/share/ghostscript/fonts
     --with-gslib
   '' + ''
@@ -42,17 +44,18 @@ stdenv.mkDerivation rec {
   '';
 
   propagatedBuildInputs =
-    [ bzip2 freetype libjpeg libpng libtiff libxml2 zlib librsvg
+    [ bzip2 fontconfig freetype libjpeg libpng libtiff libxml2 zlib librsvg
       libtool jasper libX11
-    ] ++ stdenv.lib.optional (ghostscript != null && stdenv.system != "x86_64-darwin") ghostscript;
+    ] ++ stdenv.lib.optional (stdenv.system != "x86_64-darwin") ghostscript;
 
-  buildInputs = [ tetex ];
+  buildInputs = [ tetex pkgconfig ];
 
   postInstall = ''(cd "$out/include" && ln -s ImageMagick* ImageMagick)'';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.imagemagick.org/;
     description = "A software suite to create, edit, compose, or convert bitmap images";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux ++ [ "x86_64-darwin" ];
+    maintainers = with maintainers; [ the-kenny ];
   };
 }
diff --git a/pkgs/applications/graphics/alchemy/default.nix b/pkgs/applications/graphics/alchemy/default.nix
index 6a212a7a931d..263c411a8dbf 100644
--- a/pkgs/applications/graphics/alchemy/default.nix
+++ b/pkgs/applications/graphics/alchemy/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   };
 
   installPhase = ''
-    ensureDir $out/bin $out/share
+    mkdir -p $out/bin $out/share
     cp -a . $out/share/alchemy
     cat >> $out/bin/alchemy << EOF
     #!/bin/sh
@@ -22,6 +22,14 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Drawing application";
+    longDescription = ''
+      Alchemy is an open drawing project aimed at exploring how we can sketch,
+      draw, and create on computers in new ways. Alchemy isn’t software for
+      creating finished artwork, but rather a sketching environment that
+      focuses on the absolute initial stage of the creation process.
+      Experimental in nature, Alchemy lets you brainstorm visually to explore
+      an expanded range of ideas and possibilities in a serendipitous way.
+    '';
     homepage = http://al.chemy.org/;
     license = stdenv.lib.licenses.gpl3Plus;
     maintainers = [stdenv.lib.maintainers.marcweber];
diff --git a/pkgs/applications/graphics/autopanosiftc/default.nix b/pkgs/applications/graphics/autopanosiftc/default.nix
index a27d982ce8b2..6d26dafae623 100644
--- a/pkgs/applications/graphics/autopanosiftc/default.nix
+++ b/pkgs/applications/graphics/autopanosiftc/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, cmake, libpng, libtiff, libjpeg, panotools, libxml2 }:
 
 stdenv.mkDerivation {
-  name = "autopano-sift-C-2.5.0";
+  name = "autopano-sift-C-2.5.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/hugin/autopano-sift-C-2.5.0.tar.gz;
-    sha256 = "0pvkapjg7qdkjg151wjc7islly9ag8fg6bj0g5nbllv981ixjql3";
+    url = mirror://sourceforge/hugin/autopano-sift-C-2.5.1.tar.gz;
+    sha256 = "0dqk8ff82gmy4v5ns5nr9gpzkc1p7c2y8c8fkid102r47wsjk44s";
   };
 
   buildInputs = [ cmake libpng libtiff libjpeg panotools libxml2 ];
@@ -13,6 +13,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://hugin.sourceforge.net/;
     description = "Implementation in C of the autopano-sift algorithm for automatically stitching panoramas";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/graphics/cinepaint/default.nix b/pkgs/applications/graphics/cinepaint/default.nix
index 8d88e570f272..41a4b102a6f3 100644
--- a/pkgs/applications/graphics/cinepaint/default.nix
+++ b/pkgs/applications/graphics/cinepaint/default.nix
@@ -5,11 +5,11 @@
   mesa, libXext, libXpm, libXau, libXxf86vm, pixman, libpthreadstubs, fltk } :
 
 stdenv.mkDerivation rec {
-  name = "cinepaint-1.0";
+  name = "cinepaint-1.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/cinepaint/${name}.tgz";
-    sha256 = "02mbpsykd7sfr9h6c6gxld6i3bdwnsgvm70b5yff01gwi69w2wi7";
+    sha256 = "0b5g4bkq62yiz1cnb2vfij0a8fw5w5z202v5dm4dh89k7cj0yq4w";
   };
 
   buildInputs = [ libpng gtk freetype fontconfig lcms flex libtiff libjpeg
diff --git a/pkgs/applications/graphics/comical/default.nix b/pkgs/applications/graphics/comical/default.nix
index 68910e67e25a..2796a5535a03 100644
--- a/pkgs/applications/graphics/comical/default.nix
+++ b/pkgs/applications/graphics/comical/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Viewer of CBR and CBZ files, often used to store scanned comics";
     homepage = http://comical.sourceforge.net/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index 766696265812..c4e2a7534af3 100644
--- a/pkgs/applications/graphics/darktable/default.nix
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -9,12 +9,12 @@
 assert stdenv ? glibc;
 
 stdenv.mkDerivation rec {
-  version = "1.2.3";
+  version = "1.4.2";
   name = "darktable-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/darktable/darktable/1.2/darktable-${version}.tar.xz";
-    sha256 = "05kkkz13a5rhb246rq1nxv7h91pcvm15filvik8n8gn143h64sv8";
+    sha256 = "02875rnabw5m9aqfls59901889iyxkmm4xk445fvh1v06dp1lcf1";
   };
 
   buildInputs =
diff --git a/pkgs/applications/graphics/dia/default.nix b/pkgs/applications/graphics/dia/default.nix
index ab421cee158a..da6838880630 100644
--- a/pkgs/applications/graphics/dia/default.nix
+++ b/pkgs/applications/graphics/dia/default.nix
@@ -1,16 +1,21 @@
-{stdenv, fetchurl_gnome, gtk, pkgconfig, perl, perlXMLParser, libxml2, gettext
+{stdenv, fetchurl, fetchurlGnome, gtk, pkgconfig, perl, perlXMLParser, libxml2, gettext
 , python, libxml2Python, docbook5, docbook_xsl, libxslt, intltool, libart_lgpl
 , withGNOME ? false, libgnomeui }:
 
 stdenv.mkDerivation rec {
   name = src.pkgname;
 
-  src = fetchurl_gnome {
+  src = fetchurlGnome {
     project = "dia";
     major = "0"; minor = "97"; patchlevel = "2"; extension = "xz";
     sha256 = "1qgawm7rrf4wd1yc0fp39ywv8gbz4ry1s16k00dzg5w6p67lfqd7";
   };
 
+  correctPersistence = fetchurl {
+    url = https://launchpadlibrarian.net/132677658/persistence;
+    sha256 = "1rv6zv9i03bna4bdp1wzn72lg7kdwi900y1izdq0imibi54nxjsk";
+  };
+
   buildInputs =
     [ gtk perlXMLParser libxml2 gettext python libxml2Python docbook5
       libxslt docbook_xsl libart_lgpl
@@ -24,7 +29,17 @@ stdenv.mkDerivation rec {
 
   # 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";
+  postInstall = ''
+    rm $out/share/icons/hicolor/icon-theme.cache
+
+    cd "$out"/bin/
+    mv dia .dia-wrapped
+    echo '#! ${stdenv.shell}' >> dia
+    echo 'test -f "$HOME/.dia/persistence" || cp ${correctPersistence} "$HOME/.dia/persistence" ' >> dia
+    echo 'chmod u+rw "$HOME/.dia/persistence" ' >> dia
+    echo "\"$out/bin/"'.dia-wrapped" "$@"' >> dia
+    chmod a+x dia
+  '';
 
   meta = {
     description = "Gnome Diagram drawing software";
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index 713adaffd063..5bc409d10e52 100644
--- a/pkgs/applications/graphics/digikam/default.nix
+++ b/pkgs/applications/graphics/digikam/default.nix
@@ -4,11 +4,11 @@ liblqr1, lensfun, pkgconfig, qjson, libkdcraw, opencv, libkexiv2, libkipi, boost
 shared_desktop_ontologies, marble, mysql }:
 
 stdenv.mkDerivation rec {
-  name = "digikam-3.2.0";
+  name = "digikam-3.5.0";
 
   src = fetchurl {
     url = "http://download.kde.org/stable/digikam/${name}.tar.bz2";
-    sha256 = "06j858d2nvbqh0bw6m60rh1bsws06fm5vfjpwwi3zxsf5ka08wmx";
+    sha256 = "0an4awlg0b8pwl6v8p5zfl3aghgnxck2pc322cyk6i6yznj2mgap";
   };
 
   nativeBuildInputs = [ cmake automoc4 pkgconfig ];
diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix
index f832513a8241..4ded807cb29a 100644
--- a/pkgs/applications/graphics/djview/default.nix
+++ b/pkgs/applications/graphics/djview/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 	meta = {
 		homepage = http://djvu.sourceforge.net/djview4.html;
 		description = "A new portable DjVu viewer and browser plugin";
-		license = "GPL2";
+		license = stdenv.lib.licenses.gpl2;
     inherit (qt4.meta) platforms;
     maintainers = [ stdenv.lib.maintainers.urkud ];
 	};
diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index 0cd340279665..d23f42fdbf99 100644
--- a/pkgs/applications/graphics/feh/default.nix
+++ b/pkgs/applications/graphics/feh/default.nix
@@ -1,20 +1,25 @@
-{ stdenv, fetchurl, x11, imlib2, libjpeg, libpng, giblib
+{ stdenv, makeWrapper, fetchurl, x11, imlib2, libjpeg, libpng
 , libXinerama, curl }:
 
 stdenv.mkDerivation rec {
-  name = "feh-2.8";
+  name = "feh-2.12";
 
   src = fetchurl {
     url = "http://feh.finalrewind.org/${name}.tar.bz2";
-    sha256 = "0zmslchnzvi9ydxj2mgci4x8zpv5mdfkf7kyny3nibbpajibqmrx";
+    sha256 = "0ckhidmsms2l5jycp0qf71jzmb3bpbhjq3bcgfpvfvszah7pmq30";
   };
 
-  buildInputs = [x11 imlib2 giblib libjpeg libpng libXinerama curl ];
+  buildInputs = [makeWrapper x11 imlib2 libjpeg libpng libXinerama curl];
 
   preBuild = ''
     makeFlags="PREFIX=$out"
   '';
 
+  postInstall = ''
+    wrapProgram "$out/bin/feh" --prefix PATH : "${libjpeg}/bin" \
+                               --add-flags '--theme=feh'
+  '';
+
   meta = {
     description = "A light-weight image viewer";
     homepage = https://derf.homelinux.org/projects/feh/;
diff --git a/pkgs/applications/graphics/freecad/default.nix b/pkgs/applications/graphics/freecad/default.nix
index 340c9d0a69e9..a7665177046b 100644
--- a/pkgs/applications/graphics/freecad/default.nix
+++ b/pkgs/applications/graphics/freecad/default.nix
@@ -1,18 +1,20 @@
-{ fetchurl, stdenv, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts,
-boost, zlib,
-python, swig, gfortran, soqt, libf2c, pyqt4, makeWrapper }:
+{ stdenv, fetchurl, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts
+, boost, zlib, python, swig, gfortran, soqt, libf2c, makeWrapper
+, matplotlib, pycollada, pyside, pysideShiboken }:
 
 stdenv.mkDerivation rec {
   name = "freecad-${version}";
-  version = "0.13.1830";
+  version = "0.14.3702";
 
   src = fetchurl {
     url = "mirror://sourceforge/free-cad/${name}.tar.gz";
-    sha256 = "04rgww5y32asn4sx5j4wh79ggvb479pq56xfcfj6gkg44mid23jm";
+    sha256 = "1jcx7d3mp2wxkd20qdvr4vlf7h5wb0jgab9dl63sicdz88swy97f";
   };
 
   buildInputs = [ cmake coin3d xercesc ode eigen qt4 opencascade gts boost
-    zlib python swig gfortran soqt libf2c pyqt4 makeWrapper ];
+    zlib python swig gfortran soqt libf2c makeWrapper matplotlib
+    pycollada pyside pysideShiboken
+  ];
 
   enableParallelBuilding = true;
 
@@ -28,11 +30,11 @@ stdenv.mkDerivation rec {
 
   patches = [ ./pythonpath.patch ];
 
-  meta = {
-    homepage = http://free-cad.sourceforge.net/;
-    license = [ "GPLv2+" "LGPLv2+" ];
+  meta = with stdenv.lib; {
     description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    homepage = http://www.freecadweb.org/;
+    license = licenses.lgpl2Plus;
+    maintainers = [ maintainers.viric ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/gcolor2/default.nix b/pkgs/applications/graphics/gcolor2/default.nix
new file mode 100644
index 000000000000..0af750ec989e
--- /dev/null
+++ b/pkgs/applications/graphics/gcolor2/default.nix
@@ -0,0 +1,31 @@
+{stdenv, fetchurl, gtk, perl, perlXMLParser, pkgconfig } :
+
+let version = "0.4"; in
+stdenv.mkDerivation {
+  name = "gcolor2-${version}";
+  arch = if stdenv.system == "x86_64-linux" then "amd64" else "386";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/gcolor2/gcolor2/${version}/gcolor2-${version}.tar.bz2";
+    sha1 = "e410a52dcff3d5c6c3d448b68a026d04ccd744be";
+
+  };
+
+  preConfigure = ''
+    sed -i 's/\[:space:\]/[&]/g' configure
+  '';
+
+  # from https://github.com/PhantomX/slackbuilds/tree/master/gcolor2/patches
+  patches = if stdenv.system == "x86_64-linux" then
+        [ ./gcolor2-amd64.patch ] else
+        [ ];
+
+buildInputs = [ gtk perl perlXMLParser pkgconfig ];
+
+  meta = {
+    description = "Simple GTK+2 color selector";
+    homepage = http://gcolor2.sourceforge.net/;
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [ notthemessiah ];
+  };
+}
diff --git a/pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch b/pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch
new file mode 100644
index 000000000000..cd06a8315f98
--- /dev/null
+++ b/pkgs/applications/graphics/gcolor2/gcolor2-amd64.patch
@@ -0,0 +1,46 @@
+diff --exclude-from=/home/dang/bin/scripts/diffrc -up -ruN gcolor2-0.4.orig/src/callbacks.c gcolor2-0.4/src/callbacks.c
+--- gcolor2-0.4.orig/src/callbacks.c	2005-07-12 14:06:12.000000000 -0400
++++ gcolor2-0.4/src/callbacks.c	2007-02-17 19:19:38.000000000 -0500
+@@ -4,6 +4,9 @@
+ 
+ #include <gtk/gtk.h>
+ #include <stdio.h>
++#include <string.h>
++#include <glib.h>
++#include <glib/gprintf.h>
+ 
+ #include "callbacks.h"
+ #include "interface.h"
+@@ -172,6 +175,9 @@ void on_copy_color_to_clipboard_activate
+ 	gtk_clipboard_set_text (cb, hex, strlen (hex));
+ }
+ 
++void add_rgb_file (gchar *filename, gchar *type);
++gchar* get_system_file (void);
++
+ void on_show_system_colors_activate (GtkMenuItem *menuitem, gpointer user_data)
+ {
+ 	if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem)))
+@@ -266,6 +272,8 @@ void on_save_button_clicked (GtkButton *
+ 	gtk_widget_destroy (savedialog);
+ }
+ 
++void add_list_color (gchar *spec, gchar *name, gchar *type, gboolean is_new_color);
++
+ void add_color_to_treeview ()
+ {
+ 	GtkTreeView      *treeview;
+diff --exclude-from=/home/dang/bin/scripts/diffrc -up -ruN gcolor2-0.4.orig/src/main.c gcolor2-0.4/src/main.c
+--- gcolor2-0.4.orig/src/main.c	2005-07-11 10:55:49.000000000 -0400
++++ gcolor2-0.4/src/main.c	2007-02-17 19:18:23.000000000 -0500
+@@ -4,6 +4,10 @@
+ 
+ #include <gtk/gtk.h>
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <glib.h>
++#include <glib/gprintf.h>
+ 
+ #include "interface.h"
+ #include "support.h"
diff --git a/pkgs/applications/graphics/geeqie/default.nix b/pkgs/applications/graphics/geeqie/default.nix
index ff1e5052054d..b170b784aaa4 100644
--- a/pkgs/applications/graphics/geeqie/default.nix
+++ b/pkgs/applications/graphics/geeqie/default.nix
@@ -35,16 +35,17 @@ stdenv.mkDerivation rec {
     description = "Geeqie, a lightweight GTK+ based image viewer";
 
     longDescription =
-      '' Geeqie is a lightweight GTK+ based image viewer for Unix like
-         operating systems.  It features: EXIF, IPTC and XMP metadata
-         browsing and editing interoperability; easy integration with other
-         software; geeqie works on files and directories, there is no need to
-         import images; fast preview for many raw image formats; tools for
-         image comparison, sorting and managing photo collection.  Geeqie was
-         initially based on GQview.
+      ''
+        Geeqie is a lightweight GTK+ based image viewer for Unix like
+        operating systems.  It features: EXIF, IPTC and XMP metadata
+        browsing and editing interoperability; easy integration with other
+        software; geeqie works on files and directories, there is no need to
+        import images; fast preview for many raw image formats; tools for
+        image comparison, sorting and managing photo collection.  Geeqie was
+        initially based on GQview.
       '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     homepage = http://geeqie.sourceforge.net;
 
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix
index 4e12e2320815..aca4d822c820 100644
--- a/pkgs/applications/graphics/gimp/2.8.nix
+++ b/pkgs/applications/graphics/gimp/2.8.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, pkgconfig, intltool, babl, gegl, gtk, glib, gdk_pixbuf
 , pango, cairo, freetype, fontconfig, lcms, libpng, libjpeg, poppler, libtiff
 , webkit, libmng, librsvg, libwmf, zlib, libzip, ghostscript, aalib, jasper
-, python, pygtk, libart_lgpl, libexif, gettext, xlibs }:
+, python, pygtk, libart_lgpl, libexif, gettext, xlibs, wrapPython }:
 
 stdenv.mkDerivation rec {
-  name = "gimp-2.8.6";
+  name = "gimp-2.8.10";
 
   src = fetchurl {
-    url = "ftp://ftp.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
-    md5 = "12b3fdf33d1f07ae79b412a9e38b9693";
+    url = "http://download.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
+    sha256 = "1rha8yx0pplfjziqczjrxxp16vsvpmb5ziq3c218s4w9z4cqpzg7";
   };
 
   buildInputs =
@@ -16,8 +16,13 @@ stdenv.mkDerivation rec {
       freetype fontconfig lcms libpng libjpeg poppler libtiff webkit
       libmng librsvg libwmf zlib libzip ghostscript aalib jasper
       python pygtk libart_lgpl libexif gettext xlibs.libXpm
+      wrapPython
     ];
 
+  pythonPath = [ pygtk ];
+
+  postInstall = ''wrapPythonPrograms'';
+
   passthru = { inherit gtk; }; # probably its a good idea to use the same gtk in plugins ?
 
   #configureFlags = [ "--disable-print" ];
@@ -29,5 +34,6 @@ stdenv.mkDerivation rec {
     description = "The GNU Image Manipulation Program";
     homepage = http://www.gimp.org/;
     license = "GPL";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix
deleted file mode 100644
index 33d52c6645be..000000000000
--- a/pkgs/applications/graphics/gimp/default.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, gtk, freetype
-, fontconfig, libart_lgpl, libtiff, libjpeg, libpng, libexif, zlib, perl
-, perlXMLParser, python, pygtk, gettext, xlibs, intltool, babl_0_0_22, gegl_0_0_22
-}:
-
-stdenv.mkDerivation rec {
-  name = "gimp-2.6.12";
-
-  src = fetchurl {
-    url = "ftp://ftp.gtk.org/pub/gimp/v2.6/${name}.tar.bz2";
-    sha256 = "0qpcgaa4pdqqhyyy8vjvzfflxgsrrs25zk79gixzlnbzq3qwjlym";
-  };
-
-  buildInputs = [
-    pkgconfig gtk freetype fontconfig
-    libart_lgpl libtiff libjpeg libpng libexif zlib perl
-    perlXMLParser python pygtk gettext intltool babl_0_0_22 gegl_0_0_22
-  ];
-
-  passthru = { inherit gtk; }; # probably its a good idea to use the same gtk in plugins ?
-
-  configureFlags = [ "--disable-print" ];
-
-  # "screenshot" needs this.
-  NIX_LDFLAGS = "-rpath ${xlibs.libX11}/lib";
-
-  meta = {
-    description = "The GNU Image Manipulation Program";
-    homepage = http://www.gimp.org/;
-    license = "GPL";
-  };
-}
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index d314d93ea4c3..7139bc71f3c1 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -68,18 +68,33 @@ rec {
     };
   };
 
-  fourier = pluginDerivation {
+  fourier = pluginDerivation rec {
     /* menu:
        Filters/Generic/FFT Forward
        Filters/Generic/FFT Inverse
     */
-    name = "fourier-0.3.3";
-    buildInputs = [ gimp pkgs.fftwSinglePrec  pkgconfig glib] ++ gimp.nativeBuildInputs;
+    name = "fourier-0.4.1";
+    buildInputs = [ gimp pkgs.fftw  pkgconfig glib] ++ gimp.nativeBuildInputs;
     postInstall = "fail";
     installPhase = "installPlugins fourier";
     src = fetchurl {
-      url = http://people.via.ecp.fr/~remi/soft/gimp/fourier-0.3.3.tar.gz;
-      sha256 = "0xxgp0lrjxsj54sgygi31c7q41jkqzn0v18qyznrviv8r099v29p";
+      url = "http://registry.gimp.org/files/${name}.tar.gz";
+      sha256 = "1pr3y3zl9w8xs1circdrxpr98myz9m8wfzy022al79z4pdanwvs1";
+    };
+  };
+
+  focusblur = pluginDerivation rec {
+    /* menu:
+       Blur/Focus Blur
+    */
+    name = "focusblur-3.2.6";
+    buildInputs = [ gimp pkgconfig pkgs.fftwSinglePrec ] ++ gimp.nativeBuildInputs;
+    patches = [ ./patches/focusblur-glib.patch ];
+    postInstall = "fail";
+    installPhase = "installPlugins src/focusblur";
+    src = fetchurl {
+      url = "http://registry.gimp.org/files/${name}.tar.bz2";
+      sha256 = "1gqf3hchz7n7v5kpqkhqh8kwnxbsvlb5cr2w2n7ngrvl56f5xs1h";
     };
   };
 
@@ -110,6 +125,9 @@ rec {
       url = mirror://sourceforge/gimp-texturize/texturize-2.1_src.tgz;
       sha256 = "0cdjq25g3yfxx6bzx6nid21kq659s1vl9id4wxyjs2dhcv229cg3";
     };
+    patchPhase = ''
+      sed -i '/.*gimpimage_pdb.h.*/ d' src/*.c*
+    '';
     installPhase = "installPlugins src/texturize";
   };
 
@@ -140,21 +158,22 @@ rec {
     installPhase = "installPlugins src/gimp-lqr-plugin";
   };
 
-  # this is more than a gimp plugin !
-  # it can be made to compile the gimp plugin only though..
   gmic =
-  let imagemagick = pkgs.imagemagickBig; # maybe the non big version is enough?
-  in pluginDerivation {
-      name = "gmic-1.3.2.0";
-      buildInputs = [ imagemagick pkgconfig gimp pkgs.fftwSinglePrec ] ++ gimp.nativeBuildInputs;
+  let
+    imagemagick = pkgs.imagemagickBig; # maybe the non big version is enough?
+  in pluginDerivation rec {
+      name = "gmic-1.5.7.2";
+      buildInputs = [imagemagick pkgconfig pkgs.fftw gimp] ++ gimp.nativeBuildInputs;
       src = fetchurl {
-        url = mirror://sourceforge/gmic/gmic_1.3.2.0.tar.gz;
-        sha256 = "0mxq664vzzc2l6k6sqm9syp34mihhi262i6fixk1g12lmc28797h";
+        url = mirror://sourceforge/gmic/gmic_1.5.7.2.tar.gz;
+        sha256 = "1cpbxb3p2c8bcv2cbr150whapzjc7w09i3jza0z9x3xj8c0vdyv1";
       };
       preConfigure = ''
         export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${imagemagick}/include/ImageMagick"
       '';
-      installPhase = "installPlugins src/gmic4gimp";
+      sourceRoot = "${name}/src";
+      buildPhase = "make gimp";
+      installPhase = "installPlugins gmic_gimp";
       meta = { 
         description = "script language for image processing which comes with its open-source interpreter";
         homepage = http://gmic.sourceforge.net/repository.shtml;
@@ -170,9 +189,9 @@ rec {
   # this is more than a gimp plugin !
   # either load the raw image with gimp (and the import dialog will popup)
   # or use the binary
-  ufraw = pluginDerivation {
-    name = "ufraw-0.15";
-    buildInputs = [pkgs.lcms gimp] ++ gimp.nativeBuildInputs;
+  ufraw = pluginDerivation rec {
+    name = "ufraw-0.19.2";
+    buildInputs = [pkgs.gtkimageview pkgs.lcms gimp] ++ gimp.nativeBuildInputs;
       # --enable-mime - install mime files, see README for more information
       # --enable-extras - build extra (dcraw, nikon-curve) executables
       # --enable-dst-correction - enable DST correction for file timestamps.
@@ -184,8 +203,8 @@ rec {
     configureFlags = "--enable-extras --enable-dst-correction --enable-contrast";
 
     src = fetchurl {
-      url = mirror://sourceforge/ufraw/ufraw-0.15.tar.gz;
-      sha256 = "0cf3csksjkyl91zxhjnn74vc31l14nm6n1i02s76xdvvkk9ics8k";
+      url = "mirror://sourceforge/ufraw/${name}.tar.gz";
+      sha256 = "1lxba7pb3vcsq94dwapg9bk9mb3ww6r3pvvcyb0ah5gh2sgzxgkk";
     };
     installPhase = "
       installPlugins ufraw-gimp
@@ -217,7 +236,7 @@ rec {
 
       homepage = http://lensfun.sebastiankraft.net/;
 
-      license = "GPLv3+";
+      license = stdenv.lib.licenses.gpl3Plus;
       maintainers = [ stdenv.lib.maintainers.ludo ];
       platforms = stdenv.lib.platforms.gnu;
     };
diff --git a/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch b/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch
new file mode 100644
index 000000000000..b1079ab36604
--- /dev/null
+++ b/pkgs/applications/graphics/gimp/plugins/patches/focusblur-glib.patch
@@ -0,0 +1,200 @@
+ls diff --git focusblur-3.2.6/src/aaa.h focusblur-3.2.6/src/aaa.h
+index 4a6d90b..c74cab2 100644
+--- focusblur-3.2.6/src/aaa.h
++++ focusblur-3.2.6/src/aaa.h
+@@ -19,8 +19,7 @@
+ #ifndef __AAA_H__
+ #define __AAA_H__
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/brush.h focusblur-3.2.6/src/brush.h
+index 685b253..8778fec 100644
+--- focusblur-3.2.6/src/brush.h
++++ focusblur-3.2.6/src/brush.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_BRUSH_H__
+ #define __FOCUSBLUR_BRUSH_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include "focusblurtypes.h"
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/depthmap.h focusblur-3.2.6/src/depthmap.h
+index 78f5e99..baee540 100644
+--- focusblur-3.2.6/src/depthmap.h
++++ focusblur-3.2.6/src/depthmap.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_DEPTHMAP_H__
+ #define __FOCUSBLUR_DEPTHMAP_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ #include "focusblurenums.h"
+diff --git focusblur-3.2.6/src/diffusion.h focusblur-3.2.6/src/diffusion.h
+index 07ffe4b..3c1e4b9 100644
+--- focusblur-3.2.6/src/diffusion.h
++++ focusblur-3.2.6/src/diffusion.h
+@@ -23,7 +23,7 @@
+ #define __FOCUSBLUR_DIFFUSION_H__
+ 
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblur.h"
+ #include "focusblurtypes.h"
+diff --git focusblur-3.2.6/src/fftblur.h focusblur-3.2.6/src/fftblur.h
+index 124bcba..cd809fa 100644
+--- focusblur-3.2.6/src/fftblur.h
++++ focusblur-3.2.6/src/fftblur.h
+@@ -23,8 +23,7 @@
+ #define __FOCUSBLUR_FFTBLUR_H__
+ 
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimpwidgets/gimpwidgetstypes.h>
+ 
+ #include "focusblurparam.h"
+diff --git focusblur-3.2.6/src/fftblurbuffer.h focusblur-3.2.6/src/fftblurbuffer.h
+index b34d682..42e6380 100644
+--- focusblur-3.2.6/src/fftblurbuffer.h
++++ focusblur-3.2.6/src/fftblurbuffer.h
+@@ -28,8 +28,7 @@
+ #endif
+ #include <fftw3.h>
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <gtk/gtkstyle.h>
+ #include <libgimp/gimptypes.h>
+ #include <libgimpwidgets/gimpwidgetstypes.h>
+diff --git focusblur-3.2.6/src/fftblurproc.h focusblur-3.2.6/src/fftblurproc.h
+index 495572d..10a34f4 100644
+--- focusblur-3.2.6/src/fftblurproc.h
++++ focusblur-3.2.6/src/fftblurproc.h
+@@ -23,8 +23,7 @@
+ #define __FOCUSBLUR_FFTBLUR_PROC_H__
+ 
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ 
+diff --git focusblur-3.2.6/src/focusblur.h focusblur-3.2.6/src/focusblur.h
+index 54ca40a..d7e13a6 100644
+--- focusblur-3.2.6/src/focusblur.h
++++ focusblur-3.2.6/src/focusblur.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_H__
+ #define __FOCUSBLUR_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+diff --git focusblur-3.2.6/src/focusblurparam.h focusblur-3.2.6/src/focusblurparam.h
+index 64c887b..32865b4 100644
+--- focusblur-3.2.6/src/focusblurparam.h
++++ focusblur-3.2.6/src/focusblurparam.h
+@@ -22,8 +22,7 @@
+ #ifndef __FOCUSBLUR_PARAM_H__
+ #define __FOCUSBLUR_PARAM_H__
+ 
+-#include <glib/gmacros.h>
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <gtk/gtkstyle.h>
+ #include <libgimp/gimptypes.h>
+ 
+diff --git focusblur-3.2.6/src/focusblurstock.h focusblur-3.2.6/src/focusblurstock.h
+index 15f3603..cfc0567 100644
+--- focusblur-3.2.6/src/focusblurstock.h
++++ focusblur-3.2.6/src/focusblurstock.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_STOCK_H__
+ #define __FOCUSBLUR_STOCK_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+diff --git focusblur-3.2.6/src/focusblurtypes.h focusblur-3.2.6/src/focusblurtypes.h
+index 0954c60..1531c84 100644
+--- focusblur-3.2.6/src/focusblurtypes.h
++++ focusblur-3.2.6/src/focusblurtypes.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_TYPES_H__
+ #define __FOCUSBLUR_TYPES_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ 
+ G_BEGIN_DECLS
+diff --git focusblur-3.2.6/src/interface.h focusblur-3.2.6/src/interface.h
+index 6defd27..e819c60 100644
+--- focusblur-3.2.6/src/interface.h
++++ focusblur-3.2.6/src/interface.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_INTERFACE_H__
+ #define __FOCUSBLUR_INTERFACE_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ 
+ #include "focusblurtypes.h"
+ 
+diff --git focusblur-3.2.6/src/render.h focusblur-3.2.6/src/render.h
+index febbd24..a501f1e 100644
+--- focusblur-3.2.6/src/render.h
++++ focusblur-3.2.6/src/render.h
+@@ -24,7 +24,7 @@
+ 
+ #include "config.h"
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ //#include <libgimp/gimp.h>
+ #include <libgimp/gimpui.h>
+ 
+diff --git focusblur-3.2.6/src/shine.h focusblur-3.2.6/src/shine.h
+index c5a3621..86b4c09 100644
+--- focusblur-3.2.6/src/shine.h
++++ focusblur-3.2.6/src/shine.h
+@@ -22,7 +22,7 @@
+ #ifndef __FOCUSBLUR_SHINE_H__
+ #define __FOCUSBLUR_SHINE_H__
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimp/gimptypes.h>
+ 
+ #include "focusblurtypes.h"
+diff --git focusblur-3.2.6/src/source.h focusblur-3.2.6/src/source.h
+index 50d34ca..8eec35c 100644
+--- focusblur-3.2.6/src/source.h
++++ focusblur-3.2.6/src/source.h
+@@ -24,7 +24,7 @@
+ 
+ #include "config.h"
+ 
+-#include <glib/gtypes.h>
++#include <glib.h>
+ #include <libgimp/gimptypes.h>
+ 
+ #include "focusblurtypes.h"
diff --git a/pkgs/applications/graphics/giv/default.nix b/pkgs/applications/graphics/giv/default.nix
index 8b2c45398d9e..2e9d55a3f3f2 100644
--- a/pkgs/applications/graphics/giv/default.nix
+++ b/pkgs/applications/graphics/giv/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Cross platform image and hierarchical vector viewer based";
     homepage = http://giv.sourceforge.net/giv/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/graphics/gocr/default.nix b/pkgs/applications/graphics/gocr/default.nix
index 0f42ac7743e3..919b9fcc4c3c 100644
--- a/pkgs/applications/graphics/gocr/default.nix
+++ b/pkgs/applications/graphics/gocr/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, tk }:
 
 stdenv.mkDerivation rec {
-  name = "gocr-0.49";
+  name = "gocr-0.50";
 
   src = fetchurl {
-    url = http://www-e.uni-magdeburg.de/jschulen/ocr/gocr-0.49.tar.gz;
-    sha256 = "06hpzp7rkkwfr1fvmc8kcfz9v490i9yir7f7imh13gmka0fr6afc";
+    url = "http://www-e.uni-magdeburg.de/jschulen/ocr/${name}.tar.gz";
+    sha256 = "1dgmcpapy7h68d53q2c5d0bpgzgfb2nw2blndnx9qhc7z12149mw";
   };
 
   postInstall = ''
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://jocr.sourceforge.net/";
     description = "GPL Optical Character Recognition";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
 
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/applications/graphics/grafx2/default.nix b/pkgs/applications/graphics/grafx2/default.nix
new file mode 100644
index 000000000000..6b7c9a27694a
--- /dev/null
+++ b/pkgs/applications/graphics/grafx2/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, SDL, SDL_image, SDL_ttf, zlib, libpng, pkgconfig, lua5 }:
+
+stdenv.mkDerivation rec {
+
+  version = "2.4.2035";
+  name = "grafx2-${version}";
+
+  src = fetchurl {
+    url = "https://grafx2.googlecode.com/files/${name}-src.tgz";
+    sha256 = "0svsy6rqmdj11b400c242i2ixihyz0hds0dgicqz6g6dcgmcl62q";
+  };
+
+  buildInputs = [ SDL SDL_image SDL_ttf libpng zlib lua5 pkgconfig ];
+
+  preBuild = "cd src";
+
+  preInstall = '' mkdir -p "$out" '';
+
+  installPhase = ''make install prefix="$out"'';
+
+  meta = {
+    description = "GrafX2 is a bitmap paint program inspired by the Amiga programs Deluxe Paint and Brilliance.";
+    homepage = http://code.google.co/p/grafx2/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = [ stdenv.lib.maintainers.zoomulator ];
+  };
+}
diff --git a/pkgs/applications/graphics/graphicsmagick/1.3.7.nix b/pkgs/applications/graphics/graphicsmagick/1.3.7.nix
index 291d61d5f6f5..8b780647dfae 100644
--- a/pkgs/applications/graphics/graphicsmagick/1.3.7.nix
+++ b/pkgs/applications/graphics/graphicsmagick/1.3.7.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   configureFlags = "--enable-shared";
 
   buildInputs =
-    [ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
+    [ libpng bzip2 freetype ghostscript graphviz libjpeg libtiff libX11 libxml2
       zlib libtool
     ];
 
diff --git a/pkgs/applications/graphics/graphicsmagick/default.nix b/pkgs/applications/graphics/graphicsmagick/default.nix
index c02bc6024df1..536249e70a60 100644
--- a/pkgs/applications/graphics/graphicsmagick/default.nix
+++ b/pkgs/applications/graphics/graphicsmagick/default.nix
@@ -1,18 +1,18 @@
 {stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
 , libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz
-, libX11}:
+, libX11, quantumdepth ? 8}:
 
-let version = "1.3.13"; in
+let version = "1.3.18"; in
 
 stdenv.mkDerivation {
   name = "graphicsmagick-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/graphicsmagick/GraphicsMagick-${version}.tar.xz";
-    sha256 = "08lgjvhvhw3by5h4kfpl7072dbvkcpsajy5f6izq69cv61vadqs5";
+    sha256 = "1axh4j2jr3l92dan15b2nmx9da4l7i0rcz9b5bvfd4q742zfwj7x";
   };
 
-  configureFlags = "--enable-shared";
+  configureFlags = "--enable-shared --with-quantum-depth=" + toString quantumdepth;
 
   buildInputs =
     [ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
diff --git a/pkgs/applications/graphics/hoodle/default.nix b/pkgs/applications/graphics/hoodle/default.nix
new file mode 100644
index 000000000000..afa3a8ca0c7c
--- /dev/null
+++ b/pkgs/applications/graphics/hoodle/default.nix
@@ -0,0 +1,22 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, cmdargs, configurator, dyre, filepath, hoodleCore, mtl }:
+
+cabal.mkDerivation (self: {
+  pname = "hoodle";
+  version = "0.3";
+  sha256 = "01wz7bwdr3i43ikaiaq8vpn6b0clxjnjyaw6nl6zaq489dhj6fv5";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    cmdargs configurator dyre filepath hoodleCore mtl
+  ];
+  meta = {
+    homepage = "http://ianwookim.org/hoodle";
+    description = "Executable for hoodle";
+    license = self.stdenv.lib.licenses.gpl3;
+    platforms = self.ghc.meta.platforms;
+    hydraPlatforms = self.stdenv.lib.platforms.none;
+    maintainers = with self.stdenv.lib.maintainers; [ ianwookim ];
+  };
+})
diff --git a/pkgs/applications/graphics/hugin/default.nix b/pkgs/applications/graphics/hugin/default.nix
index a9ff7ef25c32..88912cbda55d 100644
--- a/pkgs/applications/graphics/hugin/default.nix
+++ b/pkgs/applications/graphics/hugin/default.nix
@@ -1,25 +1,37 @@
-{stdenv, fetchurl, panotools, cmake, wxGTK, libtiff, libpng, openexr, boost
-, pkgconfig, exiv2, gettext, ilmbase, enblendenfuse, autopanosiftc, mesa
-, freeglut, glew, libXmu, libXi, tclap }:
+{ stdenv, cmake, fetchurl, gnumake, pkgconfig
+, boost, gettext, tclap, wxGTK
+, freeglut, glew, libXi, libXmu, mesa
+, autopanosiftc, enblendenfuse, exiv2, ilmbase, lensfun, libpng, libtiff
+, openexr, panotools, perlPackages
+}:
 
 stdenv.mkDerivation rec {
-  name = "hugin-2011.4.0";
+  name = "hugin-2013.0.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/hugin/${name}.tar.bz2";
-    sha256 = "1bnxljgqxzfdz14l7y29wzi52x1a38mghsjavnr28fr4vfmqwjrf";
+    sha256 = "1mgbvg09xvf0zcm9jfv5lb65nd292l86ffa23yp4pzm6izaiwkj8";
   };
 
   NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
 
-#NIX_LDFLAGS = "-lrt";
+  buildInputs = [ boost gettext tclap wxGTK
+                  freeglut glew libXi libXmu mesa
+                  exiv2 ilmbase lensfun libtiff libpng openexr panotools
+                ];
 
-  buildInputs = [ panotools wxGTK libtiff libpng openexr boost tclap
-    exiv2 gettext ilmbase mesa freeglut glew libXmu libXi ];
+  # disable installation of the python scripting interface
+  cmakeFlags = [ "-DBUILD_HSI:BOOl=OFF" ];
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  propagatedUserEnvPackages = [ enblendenfuse autopanosiftc ];
+  enableParallelBuilding = true;
+
+  # commandline tools needed by the hugin batch processor
+  # you may have to tell hugin (in the preferences) where these binaries reside
+  propagatedUserEnvPackages = [ autopanosiftc enblendenfuse gnumake
+                                perlPackages.ImageExifTool
+                              ];
 
   postInstall = ''
     mkdir -p "$out/nix-support"
@@ -29,7 +41,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://hugin.sourceforge.net/;
     description = "Toolkit for stitching photographs and assembling panoramas, together with an easy to use graphical front end";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix
index 37905f8a73f6..38ceefa45230 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -4,15 +4,18 @@
 , gsl, python, pyxml, lxml, poppler, imagemagick, libwpg }:
 
 stdenv.mkDerivation rec {
-  name = "inkscape-0.48.4";
+  name = "inkscape-0.48.5";
 
   src = fetchurl {
     url = "mirror://sourceforge/inkscape/${name}.tar.bz2";
-    sha256 = "17aiibgdwjqpjc38f0yr2sdlgwngg5ac9srlybjcx9aspf6ashc7";
+    sha256 = "0sfr7a1vr1066rrkkqbqvcqs3gawalj68ralnhd6k87jz62fcv1b";
   };
 
   patches = [ ./configure-python-libs.patch ];
 
+  postPatch = stdenv.lib.optionalString doCheck
+    ''sed -i 's:#include "../../src:#include "src:' src/cxxtests.cpp'';
+
   propagatedBuildInputs = [
     # Python is used at run-time to execute scripts, e.g., those from
     # the "Effects" menu.
@@ -27,12 +30,17 @@ stdenv.mkDerivation rec {
 
   configureFlags = "--with-python";
 
+  enableParallelBuilding = true;
+  doCheck = true;
+  checkFlags = "-j1";
+
   postInstall = ''
     # Make sure PyXML modules can be found at run-time.
     for i in "$out/bin/"*
     do
       wrapProgram "$i" --prefix PYTHONPATH :      \
-       "$(toPythonPath ${pyxml}):$(toPythonPath ${lxml})" ||  \
+       "$(toPythonPath ${pyxml}):$(toPythonPath ${lxml})"  \
+       --prefix PATH : ${python}/bin ||  \
         exit 2
     done
     rm $out/share/icons/hicolor/icon-theme.cache
@@ -40,9 +48,11 @@ stdenv.mkDerivation rec {
 
   NIX_LDFLAGS = "-lX11";
 
-  meta = {
+  meta = with stdenv.lib; {
     license = "GPL";
     homepage = http://www.inkscape.org;
+    description = "Vector graphics editor";
+    platforms = platforms.all;
     longDescription = ''
       Inkscape is a feature-rich vector graphics editor that edits
       files in the W3C SVG (Scalable Vector Graphics) file format.
diff --git a/pkgs/applications/graphics/inkscape/libpng-1.5.patch b/pkgs/applications/graphics/inkscape/libpng-1.5.patch
deleted file mode 100644
index 4c8a7ee5f9b6..000000000000
--- a/pkgs/applications/graphics/inkscape/libpng-1.5.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Source: upstream revisions 10061 and 10707
-
---- a/src/sp-image.cpp	2011-02-21 07:59:34 +0000
-+++ b/src/sp-image.cpp	2011-02-21 08:57:28 +0000
-@@ -387,9 +387,13 @@
- 
- #if defined(PNG_iCCP_SUPPORTED)
-                 {
--                    char* name = 0;
-+                    png_charp name = 0;
-                     int compression_type = 0;
--                    char* profile = 0;
-+#if (PNG_LIBPNG_VER < 10500)
-+                    png_charp profile = 0;
-+#else
-+                    png_bytep profile = 0;
-+#endif
-                     png_uint_32 proflen = 0;
-                     if ( png_get_iCCP(pngPtr, infoPtr, &name, &compression_type, &profile, &proflen) ) {
- //                                         g_message("Found an iCCP chunk named [%s] with %d bytes and comp %d", name, proflen, compression_type);
-
---- a/src/extension/internal/pdfinput/svg-builder.cpp	2011-10-27 04:55:51 +0000
-+++ b/src/extension/internal/pdfinput/svg-builder.cpp	2011-10-29 20:34:00 +0000
-@@ -1481,7 +1481,7 @@
-         return NULL;
-     }
-     // Set error handler
--    if (setjmp(png_ptr->jmpbuf)) {
-+    if (setjmp(png_jmpbuf(png_ptr))) {
-         png_destroy_write_struct(&png_ptr, &info_ptr);
-         return NULL;
-     }
-
---- a/src/helper/png-write.cpp	2011-08-07 10:53:12 +0000
-+++ b/src/helper/png-write.cpp	2011-10-29 20:34:00 +0000
-@@ -166,8 +166,8 @@
-     /* Set error handling.  REQUIRED if you aren't supplying your own
-      * error hadnling functions in the png_create_write_struct() call.
-      */
--    if (setjmp(png_ptr->jmpbuf)) {
--        /* If we get here, we had a problem reading the file */
-+    if (setjmp(png_jmpbuf(png_ptr))) {
-+        // If we get here, we had a problem reading the file
-         fclose(fp);
-         png_destroy_write_struct(&png_ptr, &info_ptr);
-         return false;
-
diff --git a/pkgs/applications/graphics/ipe/default.nix b/pkgs/applications/graphics/ipe/default.nix
index df50dd5bd793..53df14f8704f 100644
--- a/pkgs/applications/graphics/ipe/default.nix
+++ b/pkgs/applications/graphics/ipe/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An editor for drawing figures";
     homepage = http://ipe7.sourceforge.net;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     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
diff --git a/pkgs/applications/graphics/k3d/debian-patches.nix b/pkgs/applications/graphics/k3d/debian-patches.nix
index fe1289f14413..cf6b47ee9597 100644
--- a/pkgs/applications/graphics/k3d/debian-patches.nix
+++ b/pkgs/applications/graphics/k3d/debian-patches.nix
@@ -1,6 +1,6 @@
 # Generated by debian-patches.sh from debian-patches.txt
 let
-  prefix = "http://patch-tracker.debian.org/patch/series/dl/k3d/0.8.0.2-15";
+  prefix = "http://patch-tracker.debian.org/patch/series/dl/k3d/0.8.0.2-18";
 in
 [
   {
@@ -9,6 +9,6 @@ in
   }
   {
     url = "${prefix}/k3d_gtkmm224.patch";
-    sha256 = "0a81fg96zby6kidqwj6n8mhbrh0j5fpnmfh7lr6havz5r2is9ks5";
+    sha256 = "1c7z2zkqs9qw185q7bhz6vvzl6vlf1zpg9vlhc1f0cz9rgak3gji";
   }
 ]
diff --git a/pkgs/applications/graphics/k3d/default.nix b/pkgs/applications/graphics/k3d/default.nix
index 8920d243dbf0..9f31d94ac7fb 100644
--- a/pkgs/applications/graphics/k3d/default.nix
+++ b/pkgs/applications/graphics/k3d/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = ''
     export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/build/lib"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${gtkglext}/include/gtkglext-*) -I$(echo ${gtkglext}/lib/gtkglext-*/include)"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fpermissive -I$(echo ${gtkglext}/include/gtkglext-*) -I$(echo ${gtkglext}/lib/gtkglext-*/include)"
   '';
 
   buildInputs = [
diff --git a/pkgs/applications/graphics/kipi-plugins/default.nix b/pkgs/applications/graphics/kipi-plugins/default.nix
index 61a8380b1c58..6a38698370d8 100644
--- a/pkgs/applications/graphics/kipi-plugins/default.nix
+++ b/pkgs/applications/graphics/kipi-plugins/default.nix
@@ -25,5 +25,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.kipi-plugins.org;
     inherit (kdelibs.meta) platforms;
     maintainers = with stdenv.lib.maintainers; [ viric urkud ];
+    broken = true; # it should be build from digikam sources, perhaps together
   };
 }
diff --git a/pkgs/applications/graphics/luminance-hdr/default.nix b/pkgs/applications/graphics/luminance-hdr/default.nix
new file mode 100644
index 000000000000..7558b0aef4b6
--- /dev/null
+++ b/pkgs/applications/graphics/luminance-hdr/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, cmake, fetchurl, pkgconfig, qt5, boost, exiv2, fftwFloat, gsl
+, ilmbase, lcms2, libraw, libtiff, openexr
+}:
+
+stdenv.mkDerivation rec {
+  name = "luminance-hdr-2.4.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qtpfsgui/${name}.tar.bz2";
+    sha256 = "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
+
+  buildInputs = [ qt5 boost exiv2 fftwFloat gsl ilmbase lcms2 libraw libtiff openexr ];
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  meta = with stdenv.lib; {
+    homepage = http://qtpfsgui.sourceforge.net/;
+    description = "A complete open source solution for HDR photography";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.hrdinka ];
+  };
+}
diff --git a/pkgs/applications/graphics/mcomix/default.nix b/pkgs/applications/graphics/mcomix/default.nix
index 7629c57a2b86..cc1fe8c3a220 100644
--- a/pkgs/applications/graphics/mcomix/default.nix
+++ b/pkgs/applications/graphics/mcomix/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, buildPythonPackage, pygtk, pil }:
+{ stdenv, fetchurl, buildPythonPackage, pygtk, pil, python27Packages }:
 
 buildPythonPackage rec {
     namePrefix = "";
@@ -11,7 +11,7 @@ buildPythonPackage rec {
 
     doCheck = false;
 
-    pythonPath = [ pygtk pil ];
+    pythonPath = [ pygtk pil python27Packages.sqlite3 ];
 
     meta = {
       description = "Image viewer designed to handle comic books";
@@ -29,6 +29,6 @@ buildPythonPackage rec {
 
       homepage = http://mcomix.sourceforge.net/;
 
-      license = "GPLv2";
+      license = stdenv.lib.licenses.gpl2;
     };
 }
diff --git a/pkgs/applications/graphics/meshlab/default.nix b/pkgs/applications/graphics/meshlab/default.nix
index 7151fc7af5c4..9352ae092be4 100644
--- a/pkgs/applications/graphics/meshlab/default.nix
+++ b/pkgs/applications/graphics/meshlab/default.nix
@@ -12,6 +12,12 @@ stdenv.mkDerivation rec {
   # buildPhase gets removed from the 'meshlab' binary
   dontPatchELF = true;
 
+  # Patches are from the Arch Linux package
+  patchPhase = ''
+    patch -Np0 -i "${./qt-4.8.patch}"
+    patch -Np1 -i "${./gcc-4.7.patch}"
+  '';
+
   buildPhase = ''
     mkdir -p "$out/include"
     cp -r vcglib "$out/include"
@@ -41,7 +47,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "System for the processing and editing of unstructured 3D triangular meshes";
     homepage = http://meshlab.sourceforge.net/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/graphics/meshlab/gcc-4.7.patch b/pkgs/applications/graphics/meshlab/gcc-4.7.patch
new file mode 100644
index 000000000000..07dc1a08aff5
--- /dev/null
+++ b/pkgs/applications/graphics/meshlab/gcc-4.7.patch
@@ -0,0 +1,38 @@
+diff --git a/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h b/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
+index 2351b2a..90c6d76 100644
+--- a/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
++++ b/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
+@@ -40,7 +40,7 @@ public:
+ 
+   //! Reset histogram data.
+   void Clear() {
+-    this->::Clear();
++    Histogram<ScalarType>::Clear();
+     CV.clear();
+   }
+   /*
+diff --git a/vcglib/wrap/gl/trimesh.h b/vcglib/wrap/gl/trimesh.h
+index 5d40404..ab9d0aa 100644
+--- a/vcglib/wrap/gl/trimesh.h
++++ b/vcglib/wrap/gl/trimesh.h
+@@ -1003,7 +1003,7 @@ void Crease(MESH_TYPE &m, typename MESH_TYPE::scalar_type angleRad)
+ 			}
+ 		}
+ 
+-	m.vert.math::Swap(newvert);
++	m.vert.math.Swap(newvert);
+ 	m.vn=m.vert.size();
+ }
+ 
+diff --git a/vcglib/wrap/ply/plystuff.h b/vcglib/wrap/ply/plystuff.h
+index 3e41e63..4af9508 100644
+--- a/vcglib/wrap/ply/plystuff.h
++++ b/vcglib/wrap/ply/plystuff.h
+@@ -75,6 +75,7 @@ using namespace vcg;
+ #define pb_close  _close
+ #define DIR_SEP "\\"
+ #else
++#include <unistd.h>
+ #define pb_mkdir(n)  mkdir(n,0755)
+ #define pb_access access
+ #define pb_stat   stat
diff --git a/pkgs/applications/graphics/meshlab/qt-4.8.patch b/pkgs/applications/graphics/meshlab/qt-4.8.patch
new file mode 100644
index 000000000000..abfd77d6f25d
--- /dev/null
+++ b/pkgs/applications/graphics/meshlab/qt-4.8.patch
@@ -0,0 +1,54 @@
+diff -Nur meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp
+--- meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp	2011-01-25 18:51:28.000000000 +1100
++++ meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp	2012-01-07 11:47:12.836800072 +1100
+@@ -7,6 +7,12 @@
+ #include "SyntopiaCore/Logging/Logging.h"

+ #include "SyntopiaCore/Misc/MiniParser.h"

+ 

++#ifdef Q_WS_MAC

++#include <OpenGL/glu.h>

++#else

++#include <GL/glu.h>

++#endif

++

+ using namespace SyntopiaCore::Math;

+ using namespace SyntopiaCore::Misc;

+ 

+diff -Nur meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h
+--- meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h	2011-01-25 18:51:28.000000000 +1100
++++ meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h	2012-01-07 11:45:26.795586149 +1100
+@@ -3,6 +3,12 @@
+ #include "SyntopiaCore/Math/Vector3.h"

+ #include "Object3D.h"

+ 

++#ifdef Q_WS_MAC

++#include <OpenGL/glu.h>

++#else

++#include <GL/glu.h>

++#endif

++

+ namespace SyntopiaCore {

+ 	namespace GLEngine {	

+ 

+diff -Nur meshlab.orig/src/external/structuresynth/structuresynth.pro meshlab/src/external/structuresynth/structuresynth.pro
+--- meshlab.orig/src/external/structuresynth/structuresynth.pro	2011-01-25 18:49:34.000000000 +1100
++++ meshlab/src/external/structuresynth/structuresynth.pro	2012-01-07 11:51:46.695981995 +1100
+@@ -113,6 +113,7 @@
+            ssynth/StructureSynth/Model/Rendering/TemplateRenderer.cpp

+ CONFIG+=opengl

+ QT+=xml opengl script

++unix:LIBS += -lGLU

+ macx:DESTDIR       = ../lib/macx

+ win32-g++:DESTDIR       = ../lib/win32-gcc

+ win32-msvc2005:DESTDIR       = ../lib/win32-msvc2005

+diff -Nur meshlab.orig/src/meshlab/meshlab.pro meshlab/src/meshlab/meshlab.pro
+--- meshlab.orig/src/meshlab/meshlab.pro	2011-02-15 20:39:47.000000000 +1100
++++ meshlab/src/meshlab/meshlab.pro	2012-01-07 11:57:18.055586086 +1100
+@@ -85,6 +85,7 @@
+ QT += xmlpatterns
+ QT += network
+ QT += script
++unix:LIBS += -lGLU
+ 
+ 
+ # the following line is needed to avoid mismatch between
diff --git a/pkgs/applications/graphics/minidjvu/default.nix b/pkgs/applications/graphics/minidjvu/default.nix
index e3c6deddb295..e354837f4b87 100644
--- a/pkgs/applications/graphics/minidjvu/default.nix
+++ b/pkgs/applications/graphics/minidjvu/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://djvu.sourceforge.net/djview4.html;
     description = "Black-and-white djvu page encoder and decoder that use interpage information";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ stdenv.lib.maintainers.viric ];
   };
 }
diff --git a/pkgs/applications/graphics/mirage/default.nix b/pkgs/applications/graphics/mirage/default.nix
index dd1fbcc7e073..20f7460f7a16 100644
--- a/pkgs/applications/graphics/mirage/default.nix
+++ b/pkgs/applications/graphics/mirage/default.nix
@@ -5,25 +5,25 @@ buildPythonPackage rec {
     name = "mirage-0.9.5.2";
 
     src = fetchurl {
-      url = "http://download.berlios.de/mirageiv/${name}.tar.bz2";
+      url = "mirror://sourceforge/mirageiv/${name}.tar.bz2";
       sha256 = "d214a1b6d99d1d1e83da5848a2cef181f6781e0990e93f7ebff5880b0c43f43c";
     };
 
-    postInstall = ''
-      mv $out/lib/${python.libPrefix}/site-packages/*.egg/share $out
-    '';
-
     doCheck = false;
 
     buildInputs = [ stdenv libX11 gettext ];
 
+    patchPhase = ''
+      sed -i "s@/usr/local/share/locale@$out/share/locale@" mirage.py
+    '';
+
     pythonPath = [ pygtk pil ];
 
     meta = {
       description = "Simple image viewer written in PyGTK";
 
-      homepage = http://mirageiv.berlios.de/;
+      homepage = http://mirageiv.sourceforge.net/;
 
-      license = "GPLv2";
+      license = stdenv.lib.licenses.gpl2;
     };
 }
diff --git a/pkgs/applications/graphics/mypaint/default.nix b/pkgs/applications/graphics/mypaint/default.nix
index a59498b8f141..be8df8ef16dc 100644
--- a/pkgs/applications/graphics/mypaint/default.nix
+++ b/pkgs/applications/graphics/mypaint/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchurl, gettext, glib, gtk, json_c, lcms2, libpng
-, makeWrapper, pkgconfig, pygtk, python, pythonPackages, scons, swig
+{ stdenv, fetchurl, gettext, glib, gtk, hicolor_icon_theme, json_c
+, lcms2, libpng , makeWrapper, pkgconfig, pygtk, python, pythonPackages
+, scons, swig
 }:
 
 stdenv.mkDerivation rec {
@@ -11,18 +12,21 @@ stdenv.mkDerivation rec {
     sha256 = "0f7848hr65h909c0jkcx616flc0r4qh53g3kd1cgs2nr1pjmf3bq";
   };
 
-  buildInputs = [ 
+  buildInputs = [
     gettext glib gtk json_c lcms2 libpng makeWrapper pkgconfig pygtk
     python scons swig
   ];
- 
-  propagatedBuildInputs = [ pythonPackages.numpy ];
+
+  propagatedBuildInputs = [ hicolor_icon_theme pythonPackages.numpy ];
 
   buildPhase = "scons prefix=$out";
 
   installPhase = ''
     scons prefix=$out install
-    wrapProgram $out/bin/mypaint --prefix PYTHONPATH : $PYTHONPATH
+    sed -i -e 's|/usr/bin/env python2.7|${python}/bin/python|' $out/bin/mypaint
+    wrapProgram $out/bin/mypaint \
+      --prefix PYTHONPATH : $PYTHONPATH \
+      --prefix XDG_DATA_DIRS ":" "${hicolor_icon_theme}/share"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/graphics/ocrad/default.nix b/pkgs/applications/graphics/ocrad/default.nix
index 482b57d03d2d..4c20a41061ae 100644
--- a/pkgs/applications/graphics/ocrad/default.nix
+++ b/pkgs/applications/graphics/ocrad/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
          backend to other programs.
       '';
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
diff --git a/pkgs/applications/graphics/openimageio/default.nix b/pkgs/applications/graphics/openimageio/default.nix
index f8160e4d6885..d0a1fb38e0c3 100644
--- a/pkgs/applications/graphics/openimageio/default.nix
+++ b/pkgs/applications/graphics/openimageio/default.nix
@@ -4,26 +4,26 @@
 
 stdenv.mkDerivation rec {
   name = "oiio-${version}";
-  version = "1.1.12";
+  version = "1.4";
 
   src = fetchurl {
-    url = "https://github.com/OpenImageIO/oiio/archive/Release-${version}.zip";
-    sha256 = "196iq15waa2yyryiwhf6ynlpqnpknm4cc4azakg01xs70yiphsfl";
+    url = "https://github.com/OpenImageIO/oiio/archive/RB-${version}.zip";
+    sha256 = "0ldj3hwpz363l1zyzf6c62wc5d2cpbiszlpjvv5w6rrsx2ddbbn1";
   };
 
-  buildInputs = [ 
+  buildInputs = [
     boost cmake ilmbase libjpeg libpng libtiff opencolorio openexr unzip
   ];
 
-  configurePhase = "";
+  cmakeFlags = [
+    "-DUSE_PYTHON=OFF"
+  ];
 
   buildPhase = ''
     make ILMBASE_HOME=${ilmbase} OPENEXR_HOME=${openexr} USE_PYTHON=0 \
       INSTALLDIR=$out dist_dir=
   '';
 
-  installPhase = ":";
-
   meta = with stdenv.lib; {
     homepage = http://www.openimageio.org;
     description = "A library and tools for reading and writing images";
diff --git a/pkgs/applications/graphics/openscad/default.nix b/pkgs/applications/graphics/openscad/default.nix
index d34eeba207ce..d831df5d7b66 100644
--- a/pkgs/applications/graphics/openscad/default.nix
+++ b/pkgs/applications/graphics/openscad/default.nix
@@ -1,16 +1,19 @@
 { stdenv, fetchurl, qt4, bison, flex, eigen, boost, mesa, glew, opencsg, cgal
-, mpfr, gmp }:
+, mpfr, gmp, glib, pkgconfig
+}:
 
 stdenv.mkDerivation rec {
-  version = "2013.06";
+  version = "2014.03";
   name = "openscad-${version}";
 
   src = fetchurl {
-    url = "https://openscad.googlecode.com/files/${name}.src.tar.gz";
-    sha256 = "01r013l8zyfkgmqn05axh3rlfsjwd6j403w5ffl7nby4i2spiw1f";
+    url = "http://files.openscad.org/${name}.src.tar.gz";
+    sha256 = "1hv1lmq1ayhlvrz5sqipg650xryq25a9k22ysdw0dsrwg9ixqpw6";
   };
 
-  buildInputs = [ qt4 bison flex eigen boost mesa glew opencsg cgal gmp mpfr ];
+  buildInputs = [
+    qt4 bison flex eigen boost mesa glew opencsg cgal mpfr gmp glib pkgconfig
+  ];
 
   configurePhase = ''
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${eigen}/include/eigen*) "
diff --git a/pkgs/applications/graphics/panotools/default.nix b/pkgs/applications/graphics/panotools/default.nix
index 17e1b2e8b146..8e5204ac6382 100644
--- a/pkgs/applications/graphics/panotools/default.nix
+++ b/pkgs/applications/graphics/panotools/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://panotools.sourceforge.net/;
     description = "Free software suite for authoring and displaying virtual reality panoramas";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
diff --git a/pkgs/applications/graphics/pencil/default.nix b/pkgs/applications/graphics/pencil/default.nix
new file mode 100644
index 000000000000..737baf375d1a
--- /dev/null
+++ b/pkgs/applications/graphics/pencil/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, xulrunner }:
+
+stdenv.mkDerivation rec {
+  name = "pencil-2.0.5";
+
+  src = fetchurl {
+    url = "http://evoluspencil.googlecode.com/files/${name}.tar.gz";
+    sha256 = "0rn5nb08p8wph5s5gajkil6y06zgrm86p4gnjdgv76czx1fqazm0";
+  };
+
+  # Pre-built package
+  buildPhase = "true";
+
+  installPhase = ''
+    mkdir -p "$out"
+    cp -r usr/* "$out"
+    cp COPYING "$out/share/pencil"
+    sed -e "s|/usr/bin/xulrunner|${xulrunner}/bin/xulrunner|" \
+        -e "s|/usr/share/pencil|$out/share/pencil|" \
+        -i "$out/bin/pencil"
+    sed -e "s|/usr/bin/pencil|$out/bin/pencil|" \
+        -e "s|Icon=.*|Icon=$out/share/pencil/skin/classic/icon.svg|" \
+        -i "$out/share/applications/pencil.desktop"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GUI prototyping/mockup tool";
+    homepage = http://pencil.evolus.vn/;
+    license = licenses.gpl2; # Commercial license is also available
+    maintainers = [ maintainers.bjornfor ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/photivo/default.nix b/pkgs/applications/graphics/photivo/default.nix
new file mode 100644
index 000000000000..156966ac46c1
--- /dev/null
+++ b/pkgs/applications/graphics/photivo/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchhg, cmake, qt4, fftw, graphicsmagick_q16,
+  lcms2, lensfun, pkgconfig, libjpeg, exiv2, liblqr1 }:
+
+stdenv.mkDerivation rec {
+  name = "photivo-2014-01-25";
+
+  src = fetchhg {
+    url = "http://code.google.com/p/photivo/";
+    rev = "d687864489da";
+    sha256 = "0f6y18k7db2ci6xn664zcwm1g1k04sdv7gg1yd5jk41bndjb7z8h";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  buildInputs = [ qt4 fftw graphicsmagick_q16 lcms2 lensfun libjpeg exiv2 liblqr1 ];
+  patchPhase = '' # kinda icky
+    sed -e '/("@INSTALL@")/d' \
+        -e s,@INSTALL@,$out/share/photivo, \
+        -i Sources/ptSettings.cpp
+  '';
+
+  meta = with stdenv.lib; {
+      platforms = platforms.linux;
+      maintainers = maintainers.mornfall;
+  };
+}
diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix
index b54d73b4964f..6958c94f7e18 100644
--- a/pkgs/applications/graphics/pinta/default.nix
+++ b/pkgs/applications/graphics/pinta/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://www.pinta-project.com/;
     description = "Drawing/editing program modeled after Paint.NET";
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/graphics/potrace/default.nix b/pkgs/applications/graphics/potrace/default.nix
new file mode 100644
index 000000000000..f58fe0e28c1d
--- /dev/null
+++ b/pkgs/applications/graphics/potrace/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, zlib }:
+
+let version = "1.11"; in
+
+stdenv.mkDerivation {
+  name = "potrace-${version}";
+
+  src = fetchurl {
+    url = "http://potrace.sourceforge.net/download/potrace-${version}.tar.gz";
+    sha256 = "1bbyl7jgigawmwc8r14znv8lb6lrcxh8zpvynrl6s800dr4yp9as";
+  };
+
+  configureFlags = ["--with-libpotrace"];
+
+  buildInputs = [ zlib ];
+
+  meta = {
+    homepage = http://potrace.sourceforge.net/;
+    description = "A tool for tracing a bitmap, which means, transforming a bitmap into a smooth, scalable image";
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.pSub ];
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/applications/graphics/qiv/default.nix b/pkgs/applications/graphics/qiv/default.nix
index df18c6d1520c..86891f2cb937 100644
--- a/pkgs/applications/graphics/qiv/default.nix
+++ b/pkgs/applications/graphics/qiv/default.nix
@@ -1,14 +1,15 @@
-{ stdenv, fetchurl, pkgconfig, gtk, imlib2, file } :
+{ stdenv, fetchurl, pkgconfig, gtk, imlib2, file, lcms2, libexif } :
 
 stdenv.mkDerivation (rec {
-  name = "qiv-2.2.4";
+  version = "2.3.1";
+  name = "qiv-${version}";
 
   src = fetchurl {
     url = "http://spiegl.de/qiv/download/${name}.tgz";
-    sha256 = "ed6078dc550c1dc2fe35c1e0f46463c13589a24b83d4f7101b71a7485e51abb7";
+    sha256 = "1rlf5h67vhj7n1y7jqkm9k115nfnzpwngj3kzqsi2lg676srclv7";
   };
 
-  buildInputs = [ pkgconfig gtk imlib2 file ];
+  buildInputs = [ pkgconfig gtk imlib2 file lcms2 libexif ];
 
   preBuild=''
     substituteInPlace Makefile --replace /usr/local "$out"
@@ -18,5 +19,6 @@ stdenv.mkDerivation (rec {
   meta = {
     description = "qiv (quick image viewer)";
     homepage = http://spiegl.de/qiv/;
+    inherit version;
   };
 })
diff --git a/pkgs/applications/graphics/qiv/default.upstream b/pkgs/applications/graphics/qiv/default.upstream
new file mode 100644
index 000000000000..e6c7ef2408e8
--- /dev/null
+++ b/pkgs/applications/graphics/qiv/default.upstream
@@ -0,0 +1,3 @@
+url http://spiegl.de/qiv/download/
+version_link '[.]tgz$'
+do_overwrite() { do_overwrite_just_version; }
diff --git a/pkgs/applications/graphics/qtpfsgui/default.nix b/pkgs/applications/graphics/qtpfsgui/default.nix
index 95d7acca36c5..cd8c76dc42cf 100644
--- a/pkgs/applications/graphics/qtpfsgui/default.nix
+++ b/pkgs/applications/graphics/qtpfsgui/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
          aims to provide a workflow for high dynamic range (HDR) imaging.
       '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.gnu;
diff --git a/pkgs/applications/graphics/sane/backends-git.nix b/pkgs/applications/graphics/sane/backends-git.nix
index c9cea4109dc4..67b733dda7ae 100644
--- a/pkgs/applications/graphics/sane/backends-git.nix
+++ b/pkgs/applications/graphics/sane/backends-git.nix
@@ -1,16 +1,18 @@
-{ stdenv, fetchurl, fetchgit, hotplugSupport ? true, libusb ? null, gt68xxFirmware ? null }:
+{ stdenv, fetchurl, fetchgit, hotplugSupport ? true, libusb ? null
+, gt68xxFirmware ? null, snapscanFirmware ? 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.23.296-gf139120";
+  name = "sane-backends-1.0.24.73-g6c4f6bc";
 
   src = fetchgit {
-    url = "http://git.debian.org/git/sane/sane-backends.git";
-    rev = "f139120c72db6de98be95b52c206c2a4d8071e92";
-    sha256 = "1b2fv19c8ijh9l0jjilli3j70n17wvcgpqq1nxmiby3ai6nrzk8d";
+    url = "git://alioth.debian.org/git/sane/sane-backends.git";
+    rev = "6c4f6bc58615755dc734281703b594cea3ebf848";
+    sha256 = "0f7lbv1rnr53n4rpihcd8dkfm01xvwfnx9i1nqaadrzbpvgkjrfa";
   };
 
   udevSupport = hotplugSupport;
@@ -29,6 +31,11 @@ stdenv.mkDerivation {
     if gt68xxFirmware != null then
       "mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
       " \${out}/share/sane/gt68xx/" + firmware.name
+    else if snapscanFirmware != null then
+      "mkdir -p \${out}/share/sane/snapscan ; ln -s " + snapscanFirmware +
+      " \${out}/share/sane/snapscan/your-firmwarefile.bin ;" +
+      "mkdir -p \${out}/etc/sane.d ; " +
+      "echo epson2 > \${out}/etc/sane.d/dll.conf"
     else "";
 
   meta = {
diff --git a/pkgs/applications/graphics/sane/backends.nix b/pkgs/applications/graphics/sane/backends.nix
index a53466ae8188..28d2f1e200b2 100644
--- a/pkgs/applications/graphics/sane/backends.nix
+++ b/pkgs/applications/graphics/sane/backends.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null, pkgconfig ? null , gt68xxFirmware ? null }:
+{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null
+, pkgconfig ? null, gt68xxFirmware ? null, snapscanFirmware ? null
+}:
 
 assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
 
@@ -6,12 +8,16 @@ let
   firmware = gt68xxFirmware { inherit fetchurl; };
 in
 stdenv.mkDerivation rec {
-  version = "1.0.23";
+  version = "1.0.24";
   name = "sane-backends-${version}";
 
   src = fetchurl {
-    url = "https://launchpad.net/ubuntu/+archive/primary/+files/sane-backends_${version}.orig.tar.gz";
-    sha256 = "4d4f5b2881615af7fc0ed75fdde7dc623a749e80e40f3f792fe4010163cbb029";
+    urls = [
+      "http://pkgs.fedoraproject.org/repo/pkgs/sane-backends/sane-backends-1.0.24.tar.gz/1ca68e536cd7c1852322822f5f6ac3a4/${name}.tar.gz"
+      "https://alioth.debian.org/frs/download.php/file/3958/${name}.tar.gz"
+    ];
+    curlOpts = "--insecure";
+    sha256 = "0ba68m6bzni54axjk15i51rya7hfsdliwvqyan5msl7iaid0iir7";
   };
 
   udevSupport = hotplugSupport;
@@ -36,12 +42,15 @@ stdenv.mkDerivation rec {
     if gt68xxFirmware != null then
       "mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
       " \${out}/share/sane/gt68xx/" + firmware.name
+    else if snapscanFirmware != null then
+      "mkdir -p \${out}/share/sane/snapscan ; ln -s " + snapscanFirmware +
+      " \${out}/share/sane/snapscan/your-firmwarefile.bin"
     else "";
 
   meta = {
     homepage = "http://www.sane-project.org/";
     description = "Scanner Access Now Easy";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ stdenv.lib.maintainers.simons ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/graphics/sane/config.nix b/pkgs/applications/graphics/sane/config.nix
new file mode 100644
index 000000000000..fc1cd81ebc6e
--- /dev/null
+++ b/pkgs/applications/graphics/sane/config.nix
@@ -0,0 +1,27 @@
+{ stdenv }:
+
+{ paths }:
+
+with stdenv.lib;
+let installSanePath = path: ''
+      find "${path}/lib/sane" -not -type d -maxdepth 1 | while read backend; do
+        ln -s $backend $out/lib/sane/$(basename $backend)
+      done
+
+      find "${path}/etc/sane.d" -not -type d -maxdepth 1 | while read conf; do
+        ln -s $conf $out/etc/sane.d/$(basename $conf)
+      done
+
+      find "${path}/etc/sane.d/dll.d" -not -type d -maxdepth 1 | while read conf; do
+        ln -s $conf $out/etc/sane.d/dll.d/$(basename $conf)
+      done
+    '';
+in
+stdenv.mkDerivation {
+  name = "sane-config";
+  phases = "installPhase";
+
+  installPhase = ''
+    mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane
+  '' + concatMapStrings installSanePath paths;
+}
diff --git a/pkgs/applications/graphics/sane/frontends.nix b/pkgs/applications/graphics/sane/frontends.nix
index 9e73a08e0967..a0f6e5bac509 100644
--- a/pkgs/applications/graphics/sane/frontends.nix
+++ b/pkgs/applications/graphics/sane/frontends.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.sane-project.org/";
     description = "Scanner Access Now Easy";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ stdenv.lib.maintainers.simons ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/graphics/sane/xsane.nix b/pkgs/applications/graphics/sane/xsane.nix
index de8d4c336521..221a4340dce2 100644
--- a/pkgs/applications/graphics/sane/xsane.nix
+++ b/pkgs/applications/graphics/sane/xsane.nix
@@ -1,24 +1,30 @@
-{ stdenv, fetchurl, saneBackends, saneFrontends, libX11, gtk, pkgconfig, libpng, libusb ? null }:
+{ stdenv, fetchurl, saneBackends, saneFrontends, libX11, gtk, pkgconfig, libpng
+, libusb ? null
+, gimpSupport ? false, gimp_2_8 ? null
+}:
+
+assert gimpSupport -> gimp_2_8 != null;
 
 stdenv.mkDerivation rec {
-  name = "xsane-0.998";
+  name = "xsane-0.999";
 
   src = fetchurl {
     url = "http://www.xsane.org/download/${name}.tar.gz";
-    sha256 = "0vn2cj85ijgp2v2j2h9xpqmg2jwlbxmwyb88kxhjjakqay02ybm3";
+    sha256 = "0jrb918sfb9jw3vmrz0z7np4q55hgsqqffpixs0ir5nwcwzd50jp";
   };
 
   preConfigure = ''
     sed -e '/SANE_CAP_ALWAYS_SETTABLE/d' -i src/xsane-back-gtk.c
   '';
 
-  buildInputs = [libpng saneBackends saneFrontends libX11 gtk pkgconfig ] ++
-	(if libusb != null then [libusb] else []);
+  buildInputs = [libpng saneBackends saneFrontends libX11 gtk pkgconfig ]
+    ++ (if libusb != null then [libusb] else [])
+    ++ stdenv.lib.optional gimpSupport gimp_2_8;
 
   meta = {
     homepage = http://www.sane-project.org/;
     description = "Graphical scanning frontend for sane";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric simons];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/graphics/shotwell/default.nix b/pkgs/applications/graphics/shotwell/default.nix
new file mode 100644
index 000000000000..1953f951d169
--- /dev/null
+++ b/pkgs/applications/graphics/shotwell/default.nix
@@ -0,0 +1,62 @@
+{ fetchurl, stdenv, m4, glibc, gtk3, libexif, libgphoto2, libsoup, libxml2, vala, sqlite, webkit
+, pkgconfig, gnome3, gst_all_1, which, udev, libraw, glib, json_glib, gettext, desktop_file_utils
+, lcms2, gdk_pixbuf, librsvg, makeWrapper, gnome_doc_utils }:
+
+# for dependencies see http://www.yorba.org/projects/shotwell/install/
+
+let
+  rest = stdenv.mkDerivation rec {
+    name = "rest-0.7.12";
+
+    src = fetchurl {
+      url = "mirror://gnome/sources/rest/0.7/${name}.tar.xz";
+      sha256 = "0fmg7fq5fx0jg3ryk71kwdkspsvj42acxy9imk7vznkqj29a9zqn";
+    };
+    
+    configureFlags = "--with-ca-certificates=/etc/ssl/certs/ca-bundle.crt";
+    
+    buildInputs = [ pkgconfig glib libsoup ];
+  };
+in stdenv.mkDerivation rec {
+  version = "0.18.0";
+  name = "shotwell-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/shotwell/0.18/${name}.tar.xz";
+    sha256 = "0cq0zs13f3f4xyz46yvj4qfpm5nh4ypds7r53pkqm4a3n8ybf5v7";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${glib}/include/glib-2.0 -I${glib}/lib/glib-2.0/include";
+  
+  configureFlags = [ "--disable-gsettings-convert-install" ];
+  
+  preConfigure = ''
+    patchShebangs .
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/gsettings-schemas/$name
+    mv $out/share/glib-2.0 $out/share/gsettings-schemas/$name/
+  '';
+
+  preFixup = ''
+    wrapProgram "$out/bin/shotwell" \
+     --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+     --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gtk3}/share:$out/share:$GSETTINGS_SCHEMAS_PATH"
+    rm $out/share/icons/hicolor/icon-theme.cache
+  '';
+
+
+  buildInputs = [ m4 glibc gtk3 libexif libgphoto2 libsoup libxml2 vala sqlite webkit pkgconfig
+                  gst_all_1.gstreamer gst_all_1.gst-plugins-base gnome3.libgee which udev gnome3.gexiv2
+                  libraw rest json_glib gettext desktop_file_utils glib lcms2 gdk_pixbuf librsvg
+                  makeWrapper gnome_doc_utils ];
+
+  meta = with stdenv.lib; {
+    description = "Popular photo organizer for the GNOME desktop";
+    homepage = http://www.yorba.org/projects/shotwell/;
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [iElectric];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/smartdeblur/default.nix b/pkgs/applications/graphics/smartdeblur/default.nix
new file mode 100644
index 000000000000..083fde359029
--- /dev/null
+++ b/pkgs/applications/graphics/smartdeblur/default.nix
@@ -0,0 +1,32 @@
+{ fetchurl, stdenv, cmake, qt4, fftw }:
+
+let
+  rev = "9895036d26";
+in
+stdenv.mkDerivation rec {
+  name = "smartdeblur-git-${rev}";
+
+  src = fetchurl {
+    url = "https://github.com/Y-Vladimir/SmartDeblur/tarball/${rev}";
+    name = "${name}.tar.gz";
+    sha256 = "126x9x1zhqdarjz9in0p1qhmqg3jwz7frizadjvx723g2ppi33s4";
+  };
+
+  preConfigure = ''
+    cd src
+  '';
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ cmake qt4 fftw ];
+
+  cmakeFlags = "-DUSE_SYSTEM_FFTW=ON";
+
+  meta = {
+    homepage = "https://github.com/Y-Vladimir/SmartDeblur";
+    description = "Tool for restoring blurry and defocused images";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ viric ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/graphics/sxiv/default.nix b/pkgs/applications/graphics/sxiv/default.nix
index 26d910943efa..30513577d04b 100644
--- a/pkgs/applications/graphics/sxiv/default.nix
+++ b/pkgs/applications/graphics/sxiv/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, libX11, imlib2, giflib }:
 
 stdenv.mkDerivation {
-  name = "sxiv-1.1";
+  name = "sxiv-1.1.1";
 
   src = fetchurl {
-    url = "https://github.com/muennich/sxiv/archive/v1.1.tar.gz";
+    url = "https://github.com/muennich/sxiv/archive/v1.1.1.tar.gz";
     name = "sxiv-1.1.tar.gz";
-    sha256 = "0gsqwa1yacsig7ycjrw0sjyrsa9mynfzzbwm1vp2bgk4s9hb08kx";
+    sha256 = "07r8125xa8d5q71ql71s4i1dx4swy8hypxh2s5h7z2jnn5y9nmih";
   };
 
   buildInputs = [ libX11 imlib2 giflib ];
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Simple X Image Viewer";
     homepage = "https://github.com/muennich/sxiv";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/synfigstudio/default.nix b/pkgs/applications/graphics/synfigstudio/default.nix
new file mode 100644
index 000000000000..034a147b7874
--- /dev/null
+++ b/pkgs/applications/graphics/synfigstudio/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, boost, cairo, gettext, glibmm, gtk, gtkmm
+, libsigcxx, libtool, libxmlxx, pango, pkgconfig, imagemagick
+, intltool
+}:
+
+let
+  version = "0.64.1";
+
+  ETL = stdenv.mkDerivation rec {
+    name = "ETL-0.04.17";
+
+    src = fetchurl {
+       url = "mirror://sourceforge/synfig/${name}.tar.gz";
+       sha256 = "13kpiswgcpsif9fwcplqr0405aqavqn390cjnivkn3pxv0d2q8iy";
+    };
+  };
+
+  synfig = stdenv.mkDerivation rec {
+    name = "synfig-${version}";
+
+    src = fetchurl {
+       url = "mirror://sourceforge/synfig/synfig-${version}.tar.gz";
+       sha256 = "1b4ksxnqbaq4rxlvasmrvk7z4jvjbsg4ns3cns2qcnz64dyvbgda";
+    };
+
+    patches = [ ./synfig-cstring.patch ];
+
+    buildInputs = [
+      ETL boost cairo gettext glibmm libsigcxx libtool libxmlxx pango
+      pkgconfig
+    ];
+
+    configureFlags = [ "--with-boost-libdir=${boost}/lib" ];
+  };
+in
+stdenv.mkDerivation rec {
+  name = "synfigstudio-${version}";
+
+  src = fetchurl {
+       url = "mirror://sourceforge/synfig/${name}.tar.gz";
+       sha256 = "0nl6vpsn5dcjd5qhbrmd0j4mr3wddvymkg9414m77cdpz4l8b9v2";
+    };
+
+  buildInputs = [
+    ETL boost cairo gettext glibmm gtk gtkmm imagemagick intltool
+    intltool libsigcxx libtool libxmlxx pkgconfig synfig
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A 2D animation program";
+    homepage = http://www.synfig.org;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/synfigstudio/synfig-cstring.patch b/pkgs/applications/graphics/synfigstudio/synfig-cstring.patch
new file mode 100644
index 000000000000..51eb77042161
--- /dev/null
+++ b/pkgs/applications/graphics/synfigstudio/synfig-cstring.patch
@@ -0,0 +1,12 @@
+http://www.synfig.org/issues/thebuggenie/synfig/issues/438
+--- a/src/modules/mod_png/trgt_png.cpp
++++ b/src/modules/mod_png/trgt_png.cpp
+@@ -39,6 +39,7 @@
+ #include <algorithm>
+ #include <functional>
+ #include <ETL/misc>
++#include <cstring>
+ 
+ #endif
+ 
+
diff --git a/pkgs/applications/graphics/tesseract/default.nix b/pkgs/applications/graphics/tesseract/default.nix
index e67d202dcae6..83aff09e2aae 100644
--- a/pkgs/applications/graphics/tesseract/default.nix
+++ b/pkgs/applications/graphics/tesseract/default.nix
@@ -9,7 +9,7 @@ let
         url = "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-${majVersion}.${lang}.tar.gz";
         inherit sha256;
       };
-    in 
+    in
       "tar xfvz ${src} -C $out/share/ --strip=1";
 
   extraLanguages = ''
@@ -19,6 +19,7 @@ let
     ${f "nld" "162acxp1yb6gyki2is3ay2msalmfcsnrlsd9wml2ja05k94m6bjy"}
     ${f "eng" "1y5xf794n832s3lymzlsdm2s9nlrd2v27jjjp0fd9xp7c2ah4461"}
     ${f "slv" "0rqng43435cly32idxm1lvxkcippvc3xpxbfizwq5j0155ym00dr"}
+    ${f "jpn" "07v8pymd0iwyzh946lxylybda20gsw7p4fsb09jw147955x49gq9"}
   '';
 in
 
@@ -44,7 +45,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "OCR engine";
     homepage = http://code.google.com/p/tesseract-ocr/;
-    license = "Apache2.0";
+    license = stdenv.lib.licenses.asl20;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/graphics/ufraw/default.nix b/pkgs/applications/graphics/ufraw/default.nix
index 6ec1c5fafdc7..783832abd003 100644
--- a/pkgs/applications/graphics/ufraw/default.nix
+++ b/pkgs/applications/graphics/ufraw/default.nix
@@ -1,18 +1,18 @@
 { fetchurl, stdenv, pkgconfig, gtk, gettext, bzip2, zlib
-, libjpeg, libtiff, cfitsio, exiv2, lcms, gtkimageview }:
+, libjpeg, libtiff, cfitsio, exiv2, lcms, gtkimageview, lensfun }:
 
 stdenv.mkDerivation rec {
-  name = "ufraw-0.18";
+  name = "ufraw-0.19.2";
 
   src = fetchurl {
     # XXX: These guys appear to mutate uploaded tarballs!
     url = "mirror://sourceforge/ufraw/${name}.tar.gz";
-    sha256 = "01cjdc748vamjpaw2sbm8a9kwmb2hry4f200j3hlvqg9c6f77zi4";
+    sha256 = "1lxba7pb3vcsq94dwapg9bk9mb3ww6r3pvvcyb0ah5gh2sgzxgkk";
   };
 
   buildInputs =
     [ pkgconfig gtk gtkimageview gettext bzip2 zlib
-      libjpeg libtiff cfitsio exiv2 lcms
+      libjpeg libtiff cfitsio exiv2 lcms lensfun
     ];
 
   meta = {
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
          the camera's tone curves.
       '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;  # needs GTK+
diff --git a/pkgs/applications/graphics/viewnior/default.nix b/pkgs/applications/graphics/viewnior/default.nix
index 99e1ec1c169b..dd8e01298ff4 100644
--- a/pkgs/applications/graphics/viewnior/default.nix
+++ b/pkgs/applications/graphics/viewnior/default.nix
@@ -2,11 +2,11 @@
 , intltool, gettext, shared_mime_info, glib, gdk_pixbuf, perl}:
 
 stdenv.mkDerivation rec {
-  name = "viewnior-1.3";
+  name = "viewnior-1.4";
 
   src = fetchurl {
-    url = "http://cloud.github.com/downloads/xsisqox/Viewnior/${name}.tar.gz";
-    sha256 = "46c97c1a85361519b42fe008cfb8911e66f709f3a3a988c11047ab3726889f10";
+    url = "https://www.dropbox.com/s/zytq0suabesv933/${name}.tar.gz";
+    sha256 = "0vv1133phgfzm92md6bbccmcvfiqb4kz28z1572c0qj971yz457a";
   };
 
   buildInputs =
@@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
       shared_mime_info glib gdk_pixbuf perl
     ];
 
+  preFixup = ''
+    rm $out/share/icons/*/icon-theme.cache
+  '';
+
   meta = {
     description = "Viewnior is a fast and simple image viewer for GNU/Linux";
     longDescription =
@@ -24,7 +28,7 @@ stdenv.mkDerivation rec {
          in mind (follows Gnome HIG2).
       '';
 
-    license = "GPLv3";
+    license = stdenv.lib.licenses.gpl3;
 
     homepage = http://xsisqox.github.com/Viewnior;
 
diff --git a/pkgs/applications/graphics/xaos/default.nix b/pkgs/applications/graphics/xaos/default.nix
index 307c94779296..8387b3486d4d 100644
--- a/pkgs/applications/graphics/xaos/default.nix
+++ b/pkgs/applications/graphics/xaos/default.nix
@@ -1,17 +1,17 @@
-a :  
-let 
+a :
+let
   fetchurl = a.fetchurl;
 
-  version = a.lib.attrByPath ["version"] "3.5" a; 
+  version = a.lib.attrByPath ["version"] "3.6" a;
   buildInputs = with a; [
-    aalib gsl libpng libX11 xproto libXext xextproto 
+    aalib gsl libpng libX11 xproto libXext xextproto
     libXt zlib gettext intltool perl
   ];
 in
 rec {
   src = fetchurl {
     url = "mirror://sourceforge/xaos/xaos-${version}.tar.gz";
-    sha256 = "0hj8sxya4s9rc1m4xvxj00jgiczi3ljf2zvrhx34r3ja2m9af7s7";
+    sha256 = "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq";
   };
 
   inherit buildInputs;
@@ -24,11 +24,11 @@ rec {
     sed -e s@/usr/@"$out/"@g -i configure $(find . -name 'Makefile*')
     mkdir -p $out/share/locale
   '') ["doUnpack" "minInit" "defEnsureDir"];
-      
+
   name = "xaos-" + version;
   meta = {
     homepage = http://xaos.sourceforge.net/;
     description = "XaoS - fractal viewer";
-    license = "GPLv2+";
+    license = a.stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/graphics/zgrviewer/default.nix b/pkgs/applications/graphics/zgrviewer/default.nix
index 5fe30bd7a03d..4eefd5749b65 100644
--- a/pkgs/applications/graphics/zgrviewer/default.nix
+++ b/pkgs/applications/graphics/zgrviewer/default.nix
@@ -10,19 +10,19 @@ stdenv.mkDerivation rec {
   buildInputs = [jre unzip];
   buildPhase = "";
   installPhase = ''
-    mkdir -p "$out"/{bin,lib/java/zvtm/plugins,share/doc/zvtm}
+    mkdir -p "$out"/{bin,share/java/zvtm/plugins,share/doc/zvtm}
 
     cp overview.html *.license.* "$out/share/doc/zvtm"
 
-    cp -r target/* "$out/lib/java/zvtm/"
+    cp -r target/* "$out/share/java/zvtm/"
 
     echo '#!/bin/sh' > "$out/bin/zgrviewer"
-    echo "java -jar '$out/lib/java/zvtm/zgrviewer-${version}.jar'" >> "$out/bin/zgrviewer"
+    echo "java -jar '$out/share/java/zvtm/zgrviewer-${version}.jar'" >> "$out/bin/zgrviewer"
     chmod a+x "$out/bin/zgrviewer"
   '';
   meta = {
     # Quicker to unpack locally than load Hydra
-    platforms = [];
+    hydraPlatforms = [];
     maintainers = with stdenv.lib.maintainers; [raskin];
     license = with stdenv.lib.licenses; lgpl21Plus;
     description = "GraphViz graph viewer/navigator";
diff --git a/pkgs/applications/ike/default.nix b/pkgs/applications/ike/default.nix
index 52330b57b8fa..1414310ebf33 100644
--- a/pkgs/applications/ike/default.nix
+++ b/pkgs/applications/ike/default.nix
@@ -1,8 +1,12 @@
-{ stdenv, fetchurl, cmake, openssl, libedit, flex, bison, qt4, makeWrapper, gcc }:
+{ stdenv, fetchurl, cmake, openssl, libedit, flex, bison, qt4, makeWrapper
+, gcc, nettools, iproute, linuxHeaders }:
 
 # NOTE: use $out/etc/iked.conf as sample configuration and also set: dhcp_file "/etc/iked.dhcp";
 # launch with "iked -f /etc/iked.conf"
 
+# NOTE: my testings reveal that kernels 3.11.10 and 3.12.6 won't let the traffic through the tunnel,
+# so I'm sticking with 3.4
+
 stdenv.mkDerivation rec {
   name = "ike-2.2.1";
 
@@ -11,11 +15,13 @@ stdenv.mkDerivation rec {
     sha256 = "0fhyr2psd93b0zf7yfb72q3nqnh65mymgq5jpjcsj9jv5kfr6l8y";
   };
 
-  buildInputs = [ cmake openssl libedit flex bison qt4 makeWrapper ];
+  buildInputs = [ cmake openssl libedit flex bison qt4 makeWrapper nettools iproute ];
 
   configurePhase = ''
     mkdir -p $out/{bin,sbin,lib}
-    cmake -DQTGUI=YES -DETCDIR=$out/etc -DLIBDIR=$out/lib -DSBINDIR=$out/sbin -DBINDIR=$out/bin -DMANDIR=$out/man -DNATT=YES -DCMAKE_INSTALL_PREFIX:BOOL=$out
+    cmake -DQTGUI=YES -DETCDIR=$out/etc -DLIBDIR=$out/lib -DSBINDIR=$out/sbin -DBINDIR=$out/bin \
+          -DKRNINC="${linuxHeaders}/include/" -DTESTS=YES \
+          -DMANDIR=$out/man -DNATT=YES -DCMAKE_INSTALL_PREFIX:BOOL=$out
   '';
 
   buildPhase = ''
@@ -25,7 +31,7 @@ stdenv.mkDerivation rec {
   installPhase = ''
     make install
     for file in "$out"/bin/* "$out"/sbin/*; do
-        wrapProgram $file --prefix LD_LIBRARY_PATH ":" "$out/lib:${openssl}/lib:${gcc.gcc}/lib:${libedit}/lib:${qt4}/lib"
+        wrapProgram $file --prefix LD_LIBRARY_PATH ":" "$out/lib:${openssl}/lib:${gcc.gcc}/lib:${stdenv.glibc}/lib::${gcc.gcc}/lib64:${stdenv.glibc}/lib64:${libedit}/lib:${qt4}/lib"
     done
   '';
 
@@ -34,6 +40,6 @@ stdenv.mkDerivation rec {
     description = "IPsec Client for FreeBSD, NetBSD and many Linux based operating systems";
     platforms = platforms.unix;
     maintainers = [ maintainers.iElectric ];
-    license = "sleepycat";
+    license = licenses.sleepycat;
   };
 }
diff --git a/pkgs/applications/inferno/default.nix b/pkgs/applications/inferno/default.nix
new file mode 100644
index 000000000000..c5a40fcbf5b3
--- /dev/null
+++ b/pkgs/applications/inferno/default.nix
@@ -0,0 +1,64 @@
+{ fetchurl, fetchhg, stdenv, xlibs, gcc46, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  # Inferno is a rolling release from a mercurial repository. For the verison number
+  # of the package I'm using the mercurial commit number.
+  version = "645";
+  name = "inferno-${version}";
+
+  # The mercurial repository does not contain all the components needed for the
+  # runtime system. The 'base' package contains these. For this package I download
+  # the base, extract the elements required from that, and add them to the source
+  # pulled from the mercurial repository.
+  srcBase = fetchurl {
+    url = "http://www.vitanuova.com/dist/4e/inferno-20100120.tgz";
+    sha256 = "0msvy3iwl4n5k0ry0xiyysjkq0qsawmwn3hvg67hbi5y8g7f7l88";
+  };
+
+  src = fetchhg {
+    url    = "https://inferno-os.googlecode.com/hg";
+    rev    = "7ab390b860ca";
+    sha256 = "09y0iclb3yy10gw1p0182sddg64xh60q2fx4ai7lxyfb65i76qbh";
+  };
+
+  # Fails with gcc48 due to inferno triggering an optimisation issue with floating point.
+  buildInputs = [ gcc46 xlibs.libX11 xlibs.libXpm xlibs.libXext xlibs.xextproto makeWrapper ];
+
+  infernoWrapper = ./inferno;
+
+  configurePhase = ''
+    tar --strip-components=1 -xvf $srcBase inferno/fonts inferno/Mkdirs inferno/empties
+    sed -e 's@^ROOT=.*$@ROOT='"$out"'/share/inferno@g' -e 's@^OBJTYPE=.*$@OBJTYPE=386@g' -e 's@^SYSHOST=.*$@SYSHOST=Linux@g' -i mkconfig
+    mkdir prof
+    sh Mkdirs
+  '';
+
+  buildPhase = ''
+    export PATH=$PATH:$out/share/inferno/Linux/386/bin
+    mkdir -p $out/share/inferno
+    cp -r . $out/share/inferno
+    ./makemk.sh
+    mk nuke
+    mk
+  '';
+
+  installPhase = ''
+    mk install
+    mkdir -p $out/bin
+    makeWrapper $out/share/inferno/Linux/386/bin/emu $out/bin/emu \
+      --suffix LD_LIBRARY_PATH ':' "${gcc46.gcc}/lib" \
+      --suffix PATH ':' "$out/share/inferno/Linux/386/bin"
+    makeWrapper $infernoWrapper $out/bin/inferno \
+      --suffix LD_LIBRARY_PATH ':' "${gcc46.gcc}/lib" \
+      --suffix PATH ':' "$out/share/inferno/Linux/386/bin" \
+      --set INFERNO_ROOT "$out/share/inferno"
+  '';
+
+  meta = {
+    description = "A compact distributed operating system for building cross-platform distributed systems";
+    homepage = "http://inferno-os.org/";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ "Chris Double <chris.double@double.co.nz>" ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/inferno/inferno b/pkgs/applications/inferno/inferno
new file mode 100755
index 000000000000..6eb6da8861a5
--- /dev/null
+++ b/pkgs/applications/inferno/inferno
@@ -0,0 +1,31 @@
+#! /usr/bin/env bash
+
+
+export INFERNO_HOME="$HOME/.local/share/inferno"
+if [ -n "$XDG_DATA_HOME" ]
+  then export INFERNO_HOME="$XDG_DATA_HOME/inferno"
+fi
+
+if [ ! -d $INFERNO_HOME ]; then
+  mkdir -p $INFERNO_HOME
+fi
+
+if [ ! -d $INFERNO_HOME/tmp ]; then
+  mkdir -p $INFERNO_HOME/tmp
+fi
+
+for d in $INFERNO_HOME/{acme,appl,dis,lib,man,module,usr/inferno}; do
+  if [ ! -d $d ]; then
+    mkdir -p $d
+    cp --no-preserve=all -r $INFERNO_ROOT/${d#$INFERNO_HOME/}/* $d/
+    chmod -R +w $d
+  fi
+done
+
+if [ ! -d $INFERNO_HOME/usr/$USER ]; then
+  mkdir -p $INFERNO_HOME/usr/$USER
+  cp -r $INFERNO_ROOT/usr/inferno/* $INFERNO_HOME/usr/$USER/
+  chmod -R +w $INFERNO_HOME/usr/$USER
+fi
+
+exec emu "$@" /dis/sh.dis -c "bind -b -c '#U*$INFERNO_HOME/' /; /dis/sh.dis"
diff --git a/pkgs/applications/misc/abook/default.nix b/pkgs/applications/misc/abook/default.nix
index 3d187d92f5c6..77e48e49dd89 100644
--- a/pkgs/applications/misc/abook/default.nix
+++ b/pkgs/applications/misc/abook/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://abook.sourceforge.net/";
     description = "Text-based addressbook program designed to use with mutt mail client";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.edwtjo ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/adobe-reader/default.nix b/pkgs/applications/misc/adobe-reader/default.nix
index 46ccdb399467..85bc89f77559 100644
--- a/pkgs/applications/misc/adobe-reader/default.nix
+++ b/pkgs/applications/misc/adobe-reader/default.nix
@@ -3,7 +3,7 @@
 
 assert stdenv.system == "i686-linux";
 
-let version = "9.5.1"; in
+let version = "9.5.5"; in
 
 stdenv.mkDerivation {
   name = "adobe-reader-${version}-1";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/${version}/enu/AdbeRdr${version}-1_i486linux_enu.tar.bz2";
-    sha256 = "19mwhbfsivb21zmrz2hllf0kh4i225ac697y026bakyysn0vig56";
+    sha256 = "0h35misxrqkl5zlmmvray1bqf4ywczkm89n9qw7d9arqbg3aj3pf";
   };
 
   # !!! Adobe Reader contains copies of OpenSSL, libcurl, and libicu.
@@ -25,6 +25,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Adobe Reader, a viewer for PDF documents";
     homepage = http://www.adobe.com/products/reader;
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
   };
 }
diff --git a/pkgs/applications/misc/arbtt/default.nix b/pkgs/applications/misc/arbtt/default.nix
index 92b8cb4f295c..0c3939b5c256 100644
--- a/pkgs/applications/misc/arbtt/default.nix
+++ b/pkgs/applications/misc/arbtt/default.nix
@@ -1,21 +1,29 @@
-{ cabal, binary, bytestringProgress, deepseq, filepath
-, libXScrnSaver, parsec, pcreLight, strict, terminalProgressBar
-, time, transformers, utf8String, X11
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, aeson, binary, bytestringProgress, deepseq, filepath
+, HUnit, libXScrnSaver, parsec, pcreLight, processExtras, strict
+, tasty, tastyGolden, tastyHunit, terminalProgressBar, time
+, transformers, utf8String, X11
 }:
 
 cabal.mkDerivation (self: {
   pname = "arbtt";
-  version = "0.7";
-  sha256 = "05q31fsyrbkcx0mlf2r91zgmpma5sl2a7100h7qsa882sijc2ybn";
+  version = "0.8.1";
+  sha256 = "1qzmqjm8pfj59h0hrm28pp6qhzz2am5xq81mirnnchsgg52wrfn0";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    binary bytestringProgress deepseq filepath parsec pcreLight strict
-    terminalProgressBar time transformers utf8String X11
+    aeson binary bytestringProgress deepseq filepath parsec pcreLight
+    strict terminalProgressBar time transformers utf8String X11
+  ];
+  testDepends = [
+    binary deepseq HUnit parsec pcreLight processExtras tasty
+    tastyGolden tastyHunit time transformers utf8String
   ];
   extraLibraries = [ libXScrnSaver ];
+  jailbreak = true;
   meta = {
-    homepage = "http://www.joachim-breitner.de/projects#arbtt";
+    homepage = "http://arbtt.nomeata.de/";
     description = "Automatic Rule-Based Time Tracker";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/applications/misc/audio/sox/default.nix b/pkgs/applications/misc/audio/sox/default.nix
index 50aa92f8d293..0663937c4795 100644
--- a/pkgs/applications/misc/audio/sox/default.nix
+++ b/pkgs/applications/misc/audio/sox/default.nix
@@ -1,53 +1,33 @@
-{ composableDerivation, lib, fetchurl, alsaLib, libao, lame, libmad }:
+{ lib, stdenv, fetchurl
+, enableAlsa ? true, alsaLib ? null
+, enableLibao ? true, libao ? null
+, enableLame ? false, lame ? null
+, enableLibmad ? true, libmad ? null
+, enableLibogg ? true, libogg ? null, libvorbis ? null
+}:
 
-let inherit (composableDerivation) edf; in
+with stdenv.lib;
 
-composableDerivation.composableDerivation {} {
-  name = "sox-14.3.0";
+stdenv.mkDerivation rec {
+  name = "sox-14.4.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/sox/sox-14.3.0.tar.gz;
-    sha256 = "15r39dq9nlwrypm0vpxmbxyqqv0bd6284djbi1fdfrlkjhf43gws";
+    url = "mirror://sourceforge/sox/${name}.tar.gz";
+    sha256 = "16x8gykfjdhxg0kdxwzcwgwpm5caa08y2mx18siqsq0ywmpjr34s";
   };
 
-  flags =
-    # are these options of interest? We'll see
-    #--disable-fftw          disable usage of FFTW
-    #--enable-debug          enable debugging
-    #--disable-cpu-clip      disable tricky cpu specific clipper
-    edf { name = "alsa"; enable = { buildInputs = [alsaLib]; }; }
-    // edf { name = "libao"; enable = { buildInputs = [libao]; }; }
-    // edf { name = "oss"; }
-    // edf { name = "sun_audio"; }
-    // edf { name = "dl-lame"; enable.buildInputs = [ lame ]; } # use shared library
-    // edf { name = "lame";    enable.buildInputs = [ lame ]; }
-    // edf { name = "dl-mad"; enable.buildInputs = [ libmad ]; } # use shared library
-    // edf { name = "mad";    enable.buildInputs =[ libmad ]; }
-    ;
-
-  cfg = {
-    ossSupport = false;
-    sun_audioSupport = false;
-  } // lib.listToAttrs
-    [ { name = "dl-lameSupport"; value = true; }
-      { name = "dl-madSupport"; value = true; }
-    ];
-
-  configureFlags = ["-enable-dl-lame"];
-
-  optionals = [ "libsndfile" "libogg" "flac" "ffmpeg" "libmad" "lame"
-                 /* "amr-wb" "amr-nb" */
-                "libsamplerate" /* "ladspa" */ ];
+  buildInputs =
+    optional (enableAlsa && stdenv.isLinux) alsaLib ++
+    optional enableLibao libao ++
+    optional enableLame lame ++
+    optional enableLibmad libmad ++
+    optionals enableLibogg [ libogg libvorbis ];
 
   meta = {
     description = "Sample Rate Converter for audio";
     homepage = http://www.mega-nerd.com/SRC/index.html;
-    maintainers = [lib.maintainers.marcweber];
-    # you can choose one of the following licenses:
-    license = [
-      "GPL"
-      # http://www.mega-nerd.com/SRC/libsamplerate-cul.pdf
-      "libsamplerate Commercial Use License"
-    ];
+    maintainers = [ lib.maintainers.marcweber lib.maintainers.shlevy ];
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/applications/misc/audio/soxr/default.nix b/pkgs/applications/misc/audio/soxr/default.nix
index a8dd26ab6095..73cdbb37616a 100644
--- a/pkgs/applications/misc/audio/soxr/default.nix
+++ b/pkgs/applications/misc/audio/soxr/default.nix
@@ -15,6 +15,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An audio resampling library";
     homepage = http://soxr.sourceforge.net;
-    license = "LGPLv2.1+";
+    license = stdenv.lib.licenses.lgpl21Plus;
   };
 }
diff --git a/pkgs/applications/misc/avrdudess/default.nix b/pkgs/applications/misc/avrdudess/default.nix
new file mode 100644
index 000000000000..64bca952ff58
--- /dev/null
+++ b/pkgs/applications/misc/avrdudess/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, unzip, mono, avrgcclibc, avrdude, gtk, xdg_utils }:
+
+stdenv.mkDerivation rec {
+  name = "avrdudess-2.2.20140102";
+
+  src = fetchurl {
+    url = "http://blog.zakkemble.co.uk/download/avrdudess_20140102.zip";
+    sha256 = "18llpvjsfhypzijrvfbzmcg3g141f307mzsrg11wcdxh9syxqak6";
+  };
+
+  buildInputs = [ unzip ];
+
+  phases = [ "buildPhase" ];
+
+  buildPhase = ''
+    mkdir -p "$out/avrdudess"
+    mkdir -p "$out/bin"
+
+    unzip "$src" -d "$out/avrdudess"
+
+    cat >> "$out/bin/avrdudess" << __EOF__
+    #!${stdenv.shell}
+    export LD_LIBRARY_PATH="${gtk}/lib:${mono}/lib"
+    # We need PATH from user env for xdg-open to find its tools, which
+    # typically depend on the currently running desktop environment.
+    export PATH="${avrgcclibc}/bin:${avrdude}/bin:${xdg_utils}/bin:\$PATH"
+
+    # avrdudess must have its resource files in its current working directory
+    cd $out/avrdudess && exec ${mono}/bin/mono "$out/avrdudess/avrdudess.exe" "\$@"
+    __EOF__
+
+    chmod a+x "$out/bin/"*
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GUI for AVRDUDE (AVR microcontroller programmer)";
+    homepage = https://github.com/zkemble/AVRDUDESS;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/misc/bibletime/default.nix b/pkgs/applications/misc/bibletime/default.nix
index 36366d6ee724..41184d6e9492 100644
--- a/pkgs/applications/misc/bibletime/default.nix
+++ b/pkgs/applications/misc/bibletime/default.nix
@@ -1,14 +1,14 @@
-{stdenv, fetchurl, cmake, sword, qt4, boost, cluceneCore}:
+{stdenv, fetchurl, cmake, sword, qt4, boost, clucene_core}:
 
 stdenv.mkDerivation rec {
 
-  version = "2.9.1";
+  version = "2.10.1";
 
   name = "bibletime-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/bibletime/${name}.tar.bz2";
-    sha256 = "1d8kh213rpx4d63sxl5mk1s94xv363l5prrq2kh06cpnl7a8d2ih";
+    url = "mirror://sourceforge/bibletime/${name}.tar.xz";
+    sha256 = "14fayy5h1ffjxin669q56fflxn4ij1irgn60cygwx2y02cwxbll6";
   };
 
   prePatch = ''
@@ -16,11 +16,11 @@ stdenv.mkDerivation rec {
   '';
 
   preConfigure =  ''
-    export CLUCENE_HOME=${cluceneCore};
+    export CLUCENE_HOME=${clucene_core};
     export SWORD_HOME=${sword};
   '';
 
-  buildInputs = [ cmake sword qt4 boost cluceneCore ];
+  buildInputs = [ cmake sword qt4 boost clucene_core ];
 
   cmakeFlags = "-DUSE_QT_WEBKIT=ON -DCMAKE_BUILD_TYPE=Debug";
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     description = "A Qt4 Bible study tool";
     homepage = http://www.bibletime.info/;
     platforms = stdenv.lib.platforms.linux;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.piotr ];
   };
 }
diff --git a/pkgs/applications/misc/bitcoin/default.nix b/pkgs/applications/misc/bitcoin/default.nix
index a6a289168c4a..e38d427be8d5 100644
--- a/pkgs/applications/misc/bitcoin/default.nix
+++ b/pkgs/applications/misc/bitcoin/default.nix
@@ -1,26 +1,39 @@
-{ fetchurl, stdenv, openssl, db4, boost, zlib, miniupnpc, qt4 }:
+{ fetchurl, stdenv, openssl, db48, boost, zlib, miniupnpc, qt4, utillinux
+, pkgconfig, protobuf, qrencode }:
 
 stdenv.mkDerivation rec {
-  version = "0.8.5";
+  version = "0.9.2.1";
   name = "bitcoin-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/bitcoin/${name}-linux.tar.gz";
-    sha256 = "0qqzwx1lihlrj7r08alsyznjfqvwncfm0nnxi1pcx0jyvq83ym44";
+    url = "https://bitcoin.org/bin/${version}/${name}-linux.tar.gz";
+    sha256 = "0060f7d38b98113ab912d4c184000291d7f026eaf77ca5830deec15059678f54";
   };
 
-  buildInputs = [ openssl db4 boost zlib miniupnpc qt4 ];
+  # hexdump from utillinux is required for tests
+  buildInputs = [
+    openssl db48 boost zlib miniupnpc qt4 utillinux pkgconfig protobuf qrencode
+  ];
 
-  configurePhase = ''
-    cd src
-    qmake
+  unpackPhase = ''
+    mkdir tmp-extract && (cd tmp-extract && tar xf $src)
+    tar xf tmp-extract/bitcoin*/src/bitcoin*.tar*
+    cd bitcoin*
   '';
 
-  installPhase = ''
-    mkdir -p $out/bin
-    cp bitcoin-qt $out/bin
+  configureFlags = [
+    "--with-boost=${boost}"
+  ];
+
+  preCheck = ''
+    # At least one test requires writing in $HOME
+    HOME=$TMPDIR
   '';
 
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
   meta = {
       description = "Bitcoin is a peer-to-peer currency";
       longDescription= ''
@@ -31,6 +44,6 @@ stdenv.mkDerivation rec {
       '';
       homepage = "http://www.bitcoin.org/";
       maintainers = [ stdenv.lib.maintainers.roconnor ];
-      license = "MIT";
+      license = stdenv.lib.licenses.mit;
   };
 }
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index 0951340ee945..24a3fcd4cea9 100644
--- a/pkgs/applications/misc/blender/default.nix
+++ b/pkgs/applications/misc/blender/default.nix
@@ -1,45 +1,60 @@
-{ stdenv, fetchurl, SDL, boost, cmake, ffmpeg, gettext, glew
-, ilmbase, jackaudio, libXi, libjpeg, libpng, libsamplerate, libsndfile
+{ stdenv, lib, fetchurl, fetchpatch, SDL, boost, cmake, ffmpeg, gettext, glew
+, ilmbase, libXi, libjpeg, libpng, libsamplerate, libsndfile
 , libtiff, mesa, openal, opencolorio, openexr, openimageio, openjpeg, python
-, zlib
+, zlib, fftw
+, jackaudioSupport ? false, jack2
+, cudaSupport ? false, cudatoolkit6
 }:
 
+with lib;
+
 stdenv.mkDerivation rec {
-  name = "blender-2.67";
+  name = "blender-2.71";
 
   src = fetchurl {
     url = "http://download.blender.org/source/${name}.tar.gz";
-    sha256 = "066lwrm85455gs187bxr3jhqidc2f6f0791b4216jkagbszd9a8l";
+    sha256 = "12aqdrpl86xjk2xdwj2nbfcmdzyv61n443gw6j2japffm1kmlz8x";
   };
 
-  buildInputs = [
-    SDL boost cmake ffmpeg gettext glew ilmbase jackaudio libXi
-    libjpeg libpng libsamplerate libsndfile libtiff mesa openal
-    opencolorio openexr openimageio openjpeg python zlib
-  ];
-
-
-  cmakeFlags = [
-    "-DOPENEXR_INC=${openexr}/include/OpenEXR"
-    "-DWITH_OPENCOLLADA=OFF"
-    "-DWITH_CODEC_FFMPEG=ON"
-    "-DWITH_CODEC_SNDFILE=ON"
-    "-DWITH_JACK=ON"
-    "-DWITH_INSTALL_PORTABLE=OFF"
-    "-DPYTHON_LIBRARY=python${python.majorVersion}m"    
-    "-DPYTHON_LIBPATH=${python}/lib"
-    "-DPYTHON_INCLUDE_DIR=${python}/include/python${python.majorVersion}m"
-  ];
+  buildInputs =
+    [ SDL boost cmake ffmpeg gettext glew ilmbase libXi
+      libjpeg libpng libsamplerate libsndfile libtiff mesa openal
+      opencolorio openexr openimageio /* openjpeg */ python zlib fftw
+    ]
+    ++ optional jackaudioSupport jack2
+    ++ optional cudaSupport cudatoolkit6;
+
+  postUnpack =
+    ''
+      substituteInPlace */doc/manpage/blender.1.py --replace /usr/bin/python ${python}/bin/python3
+    '';
+
+  cmakeFlags =
+    [ "-DOPENEXR_INC=${openexr}/include/OpenEXR"
+      "-DWITH_OPENCOLLADA=OFF"
+      "-DWITH_MOD_OCEANSIM=ON"
+      "-DWITH_CODEC_FFMPEG=ON"
+      "-DWITH_CODEC_SNDFILE=ON"
+      "-DWITH_INSTALL_PORTABLE=OFF"
+      "-DPYTHON_LIBRARY=python${python.majorVersion}m"
+      "-DPYTHON_LIBPATH=${python}/lib"
+      "-DPYTHON_INCLUDE_DIR=${python}/include/python${python.majorVersion}m"
+      "-DPYTHON_VERSION=${python.majorVersion}"
+    ]
+    ++ optional jackaudioSupport "-DWITH_JACK=ON"
+    ++ optional cudaSupport "-DWITH_CYCLES_CUDA_BINARIES=ON";
 
   NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR -I${python}/include/${python.libPrefix}m";
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "3D Creation/Animation/Publishing System";
     homepage = http://www.blender.org;
     # They comment two licenses: GPLv2 and Blender License, but they
     # say: "We've decided to cancel the BL offering for an indefinite period."
-    license = "GPLv2+";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
   };
 }
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index 10d92e4d517a..3d814bf6a304 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -4,11 +4,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "calibre-1.8.0";
+  name = "calibre-1.48.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/calibre/${name}.tar.xz";
-    sha256 = "0awh24n5bvypmiylngmz0w0126yz1jxlrjfy9b4w5aflg7vgr0qq";
+    sha256 = "0wplmf3p4s5zwn9ri8ry18bx7k3pw1c1ngrc4msf7i8icq7hj177";
   };
 
   inherit python;
diff --git a/pkgs/applications/misc/camlistore/default.nix b/pkgs/applications/misc/camlistore/default.nix
new file mode 100644
index 000000000000..56131425ab4b
--- /dev/null
+++ b/pkgs/applications/misc/camlistore/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, go, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "0.7";
+  name = "camlistore-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/bradfitz/camlistore/archive/0.7.tar.gz";
+    sha256 = "0lc35x2b9llrnma0m5czivly0c3l4lh3ldw9hwn83lkh8n0bzn11";
+  };
+
+  buildInputs = [ go ];
+
+  buildPhase = ''
+    go run make.go
+    rm bin/README
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/* $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Camlistore is a way of storing, syncing, sharing, modelling and backing up content";
+    homepage = https://camlistore.org;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/applications/misc/cdrtools/default.nix b/pkgs/applications/misc/cdrtools/default.nix
index 94af2ee58f55..d1b3b2840526 100644
--- a/pkgs/applications/misc/cdrtools/default.nix
+++ b/pkgs/applications/misc/cdrtools/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl}:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "cdrtools-2.01";
-  
-  configurePhase = "prefix=$out";  
-  
+
+  configurePhase = "prefix=$out";
+
   #hack, I'm getting "chown: invalid user: `bin" error, so replace chown by a nop dummy script
   preInstall = ''
     mkdir "$TMP/bin"
@@ -14,16 +14,18 @@ stdenv.mkDerivation {
       PATH="$TMP/bin:$PATH"
     done
   '';
-  
+
   src = fetchurl {
-    url = ftp://ftp.berlios.de/pub/cdrecord/cdrtools-2.01.tar.bz2;
+    url = "mirror://sourceforge/cdrtools/${name}.tar.bz2";
     md5 = "d44a81460e97ae02931c31188fe8d3fd";
   };
-  
+
   patches = [./cdrtools-2.01-install.patch];
 
   meta = {
-    description = "Highly portable CD/DVD/BluRay command line recording software (deprecated; use cdrkit instead)";
-    homepage = http://cdrecord.berlios.de/old/private/cdrecord.html;
+    homepage = http://sourceforge.net/projects/cdrtools/;
+    description = "Highly portable CD/DVD/BluRay command line recording software";
+    broken = true;              # Build errors, probably because the source
+                                # can't deal with recent versions of gcc.
   };
 }
diff --git a/pkgs/applications/misc/cgminer/default.nix b/pkgs/applications/misc/cgminer/default.nix
index 4ae404a002f1..3247cb609fa6 100644
--- a/pkgs/applications/misc/cgminer/default.nix
+++ b/pkgs/applications/misc/cgminer/default.nix
@@ -1,19 +1,22 @@
-{ fetchgit, stdenv, pkgconfig, libtool, autoconf, automake,
-  curl, ncurses, amdappsdk, amdadlsdk, xorg }:
+{ fetchgit, stdenv, pkgconfig, libtool, autoconf, automake
+, curl, ncurses, amdappsdk, amdadlsdk, xorg, jansson }:
 
 stdenv.mkDerivation rec {
-  version = "2.11.4";
+  version = "3.7.2";
   name = "cgminer-${version}";
 
   src = fetchgit {
     url = "https://github.com/ckolivas/cgminer.git";
-    rev = "96c8ff5f10f2d8f0cf4d1bd889e8eeac2e4aa715";
-    sha256  = "1vf9agy4vw50cap03qig2y65hdrsdy7cknkzyagv89w5xb230r9a";
+    rev = "refs/tags/v3.7.2";
+    sha256  = "0hl71328l19rlclajb6k9xsqybm2ln8g44p788gijpw4laj9yli6";
   };
 
-  buildInputs = [ autoconf automake pkgconfig libtool curl ncurses amdappsdk amdadlsdk xorg.libX11 xorg.libXext xorg.libXinerama ];
+  buildInputs = [
+    autoconf automake pkgconfig libtool curl ncurses amdappsdk amdadlsdk
+    xorg.libX11 xorg.libXext xorg.libXinerama jansson
+  ];
   configureScript = "./autogen.sh";
-  configureFlags = "--enable-scrypt";
+  configureFlags = "--enable-scrypt --enable-opencl";
   NIX_LDFLAGS = "-lgcc_s -lX11 -lXext -lXinerama";
 
   preConfigure = ''
@@ -21,7 +24,7 @@ stdenv.mkDerivation rec {
   '';
 
   postBuild = ''
-    gcc api-example.c -I compat/jansson -o cgminer-api
+    gcc api-example.c -o cgminer-api
   '';
 
   postInstall = ''
@@ -39,6 +42,7 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/ckolivas/cgminer";
     license = licenses.gpl3;
     maintainers = [ maintainers.offline ];
-    platforms = [ "i686-linux" "x86_64-linux" ];
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/misc/cura/default.nix b/pkgs/applications/misc/cura/default.nix
new file mode 100644
index 000000000000..937025c08403
--- /dev/null
+++ b/pkgs/applications/misc/cura/default.nix
@@ -0,0 +1,71 @@
+{ stdenv, python27Packages, curaengine, makeDesktopItem, fetchgit }:
+let
+    py = python27Packages;
+in
+stdenv.mkDerivation rec {
+  name = "cura";
+
+  src = fetchgit {
+    url = "https://github.com/daid/Cura";
+    rev = "58414695269d60ca9b165e8cbc3424933ed79403";
+    sha256 = "1nxrrz8sjjx9i9cyvz15vay6yarnywp3vlk7qzr65sw88lzxgq23";
+    fetchSubmodules = false;
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "Cura";
+    exec = "cura";
+    icon = "cura";
+    comment = "Cura";
+    desktopName = "Cura";
+    genericName = "3D printing host software";
+    categories = "GNOME;GTK;Utility;";
+  };
+
+  python_deps = [ py.pyopengl py.pyserial py.numpy py.wxPython30 py.power py.setuptools ];
+
+  pythonPath = python_deps;
+
+  propagatedBuildInputs = python_deps;
+
+  buildInputs = [ curaengine py.wrapPython ];
+
+  configurePhase = "";
+  buildPhase = "";
+
+  installPhase = ''
+    # Install Python code.
+    site_packages=$out/lib/python2.7/site-packages
+    mkdir -p $site_packages
+    cp -r Cura $site_packages/
+
+    # Install resources.
+    resources=$out/share/cura
+    mkdir -p $resources
+    cp -r resources/* $resources/
+    sed -i 's|os.path.join(os.path.dirname(__file__), "../../resources")|"'$resources'"|g' $site_packages/Cura/util/resources.py
+
+    # Install executable.
+    mkdir -p $out/bin
+    cp Cura/cura.py $out/bin/cura
+    chmod +x $out/bin/cura
+    sed -i 's|#!/usr/bin/python|#!/usr/bin/env python|' $out/bin/cura
+    wrapPythonPrograms
+
+    # Make it find CuraEngine.
+    echo "def getEngineFilename(): return '${curaengine}/bin/CuraEngine'" >> $site_packages/Cura/util/sliceEngine.py
+
+    # Install desktop item.
+    mkdir -p "$out"/share/applications
+    cp "$desktopItem"/share/applications/* "$out"/share/applications/
+    mkdir -p "$out"/share/icons
+    ln -s "$resources/images/c.png" "$out"/share/icons/cura.png
+  '';
+
+  meta = with stdenv.lib; {
+    description = "3D printing host software";
+    homepage = https://github.com/daid/Cura;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/curaengine/default.nix b/pkgs/applications/misc/curaengine/default.nix
new file mode 100644
index 000000000000..256d337f679e
--- /dev/null
+++ b/pkgs/applications/misc/curaengine/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchgit }:
+stdenv.mkDerivation {
+    name = "curaengine";
+
+    src = fetchgit {
+        url = "https://github.com/Ultimaker/CuraEngine";
+        rev = "62667ff2e7479b55d75e3d1dc9136242adf4a6a0";
+        sha256 = "0c68xmnq4c49vzg2cyqb375kc72rcnghj21wp3919w8sfwil00vr";
+    };
+
+    installPhase = ''
+        mkdir -p $out/bin
+        cp CuraEngine $out/bin/
+    '';
+
+    meta = with stdenv.lib; {
+        description = "Engine for processing 3D models into 3D printing instructions";
+        homepage = https://github.com/Ultimaker/CuraEngine;
+        license = licenses.agpl3;
+        platforms = platforms.linux;
+    };
+}
diff --git a/pkgs/applications/misc/d4x/default.nix b/pkgs/applications/misc/d4x/default.nix
index 4eb4c441c99d..d6ca3939d137 100644
--- a/pkgs/applications/misc/d4x/default.nix
+++ b/pkgs/applications/misc/d4x/default.nix
@@ -19,6 +19,6 @@ stdenv.mkDerivation {
   meta = { 
     description = "Graphical download manager";
     homepage = http://www.krasu.ru/soft/chuchelo/;
-    license = "Artistic";
+    license = "perl";
   };
 }
diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix
index 048514ad4aa2..1ba3ee5268f7 100644
--- a/pkgs/applications/misc/dmenu/default.nix
+++ b/pkgs/applications/misc/dmenu/default.nix
@@ -19,14 +19,17 @@ stdenv.mkDerivation rec {
 
   patches = optional enableXft xftPatch;
 
+  postPatch = ''
+    sed -ri -e 's!\<(dmenu|stest)\>!'"$out/bin"'/&!g' dmenu_run
+  '';
+
   preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
 
   meta = { 
       description = "a generic, highly customizable, and efficient menu for the X Window System";
       homepage = http://tools.suckless.org/dmenu;
-      license = "MIT";
+      license = stdenv.lib.licenses.mit;
       maintainers = with stdenv.lib.maintainers; [viric];
       platforms = with stdenv.lib.platforms; all;
   };
 }
-
diff --git a/pkgs/applications/misc/dunst/default.nix b/pkgs/applications/misc/dunst/default.nix
index cb594e494dba..039b4ac688bf 100644
--- a/pkgs/applications/misc/dunst/default.nix
+++ b/pkgs/applications/misc/dunst/default.nix
@@ -1,18 +1,15 @@
-{ stdenv, fetchgit, coreutils , unzip, which, pkgconfig , dbus
+{ stdenv, fetchurl, coreutils , unzip, which, pkgconfig , dbus
 , freetype, xdg_utils , libXext, glib, pango , cairo, libX11, libnotify
 , libxdg_basedir , libXScrnSaver, xproto, libXinerama , perl, gdk_pixbuf
 }:
 
 stdenv.mkDerivation rec {
-  rev = "6a3a855b48a3db64821d1cf8a91c5ee2815a2b2d";
-  name = "dunst-${rev}";
+  name = "dunst-1.1.0";
+  version = "1.1.0";
 
-  # 1.0.0 release doesn't include 100% CPU fix
-  # https://github.com/knopwob/dunst/issues/98
-  src = fetchgit {
-    inherit rev;
-    url = "https://github.com/knopwob/dunst.git";
-    sha256 = "0m7yki16d72xm9n2m2fjszd8phqpn5b95q894cz75pmd0sv1j6bj";
+  src = fetchurl {
+    url = "https://github.com/knopwob/dunst/archive/v${version}.tar.gz";
+    sha256 = "0x95f57s0a96c4lifxdpf73v706iggwmdw8742mabbjnxq55l1qs";
   };
 
   patchPhase = ''
@@ -26,7 +23,7 @@ stdenv.mkDerivation rec {
     libXScrnSaver xproto libXinerama perl];
 
   buildPhase = ''
-    export VERSION=${rev};
+    export VERSION=${version};
     export PREFIX=$out;
     make dunst;
   '';
diff --git a/pkgs/applications/misc/electrum/default.nix b/pkgs/applications/misc/electrum/default.nix
new file mode 100644
index 000000000000..c35a2c7ff821
--- /dev/null
+++ b/pkgs/applications/misc/electrum/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pythonPackages, slowaes, ecdsa, pyqt4 }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "electrum-${version}";
+  version = "1.9.8";
+
+  src = fetchurl {
+    url = "https://download.electrum.org/Electrum-${version}.tar.gz";
+    sha256 = "8fc144a32013e4a747fea27fff981762a6b9e14cde9ffb405c4c721975d846ff";
+  };
+
+  buildInputs = [ slowaes ecdsa ];
+
+  propagatedBuildInputs = [ 
+    slowaes
+    ecdsa
+    pyqt4
+  ];
+
+  postPatch = ''
+    mkdir -p $out/share
+    sed -i 's@usr_share = .*@usr_share = os.getenv("out")+"/share"@' setup.py
+  '';
+
+  meta = {
+    description = "Bitcoin thin-wallet";
+    long-description = "Electrum is an easy to use Bitcoin client. It protects you from losing coins in a backup mistake or computer failure, because your wallet can be recovered from a secret phrase that you can write on paper or learn by heart. There is no waiting time when you start the client, because it does not download the Bitcoin blockchain.";
+    homepage = "https://electrum.org";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ "emery@vfemail.net" ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/misc/epdfview/default.nix b/pkgs/applications/misc/epdfview/default.nix
index 6941e8df626a..d79162289c3c 100644
--- a/pkgs/applications/misc/epdfview/default.nix
+++ b/pkgs/applications/misc/epdfview/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
         GTK+ libraries. The aim of ePDFView is to make a simple PDF document
         viewer, in the lines of Evince but without using the Gnome libraries. 
     '';
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [ astsmtl ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/evopedia/default.nix b/pkgs/applications/misc/evopedia/default.nix
index b070b629282c..5ad82c9239c8 100644
--- a/pkgs/applications/misc/evopedia/default.nix
+++ b/pkgs/applications/misc/evopedia/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Offline Wikipedia Viewer";
     homepage = http://www.evopedia.info;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/evtest/default.nix b/pkgs/applications/misc/evtest/default.nix
index 635775e75ac7..638f254364e8 100644
--- a/pkgs/applications/misc/evtest/default.nix
+++ b/pkgs/applications/misc/evtest/default.nix
@@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Simple tool for input event debugging";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     platforms = platforms.linux;
-    maintainers = [maintainers.bjornfor];
+    maintainers = [ maintainers.bjornfor ];
   };
 }
diff --git a/pkgs/applications/misc/fbreader/default.nix b/pkgs/applications/misc/fbreader/default.nix
index fa361308ff1a..2b193ef42cd2 100644
--- a/pkgs/applications/misc/fbreader/default.nix
+++ b/pkgs/applications/misc/fbreader/default.nix
@@ -25,10 +25,11 @@ stdenv.mkDerivation {
       --replace "/usr/share" "$out/share"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "An e-book reader for Linux";
     homepage = http://www.fbreader.org/;
-    license = "GPL";
-    maintainer = [ stdenv.lib.maintainers.coroa ];
+    license = licenses.gpl3;
+    platforms = platforms.linux; # possibly also on unix general
+    maintainers = [ maintainers.coroa ];
   }; 
 }
diff --git a/pkgs/applications/misc/fetchmail/default.nix b/pkgs/applications/misc/fetchmail/default.nix
index 79d27eea8487..57d677395b41 100644
--- a/pkgs/applications/misc/fetchmail/default.nix
+++ b/pkgs/applications/misc/fetchmail/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, openssl }:
 
 let
-  version = "6.3.20";
+  version = "6.3.26";
 in
 stdenv.mkDerivation {
   name="fetchmail-${version}";
 
   src = fetchurl {
-    url = "http://download.berlios.de/fetchmail/fetchmail-${version}.tar.bz2";
-    sha256 = "22e94f11d885cb9330a197fd80217d44f65e6b087e4d4b4d83e573adfc24aa7b";
+    url = "mirror://sourceforge/fetchmail.berlios/fetchmail-${version}.tar.bz2";
+    sha256 = "08rafrs1dlr11myr0p99kg4k80qyy0fa63gg3ac88zn49174lwhw";
   };
 
   buildInputs = [ openssl ];
diff --git a/pkgs/applications/misc/finalterm/default.nix b/pkgs/applications/misc/finalterm/default.nix
new file mode 100644
index 000000000000..0c084f9d018c
--- /dev/null
+++ b/pkgs/applications/misc/finalterm/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, lib, fetchFromGitHub, makeWrapper
+, pkgconfig, cmake, libxml2, vala, intltool, libmx, gnome3, gtk3, gtk_doc
+, keybinder3, clutter_gtk, libnotify
+, libxkbcommon, xlibs, udev
+, bashInteractive
+}:
+
+let rev = "5ccde4e8f2c02a398f9172e07c25262ecf954626";
+in stdenv.mkDerivation {
+  name = "finalterm-git-${builtins.substring 0 8 rev}";
+
+  src = fetchFromGitHub {
+    owner = "p-e-w";
+    repo = "finalterm";
+    inherit rev;
+    sha256 = "1gw6nc19whfjd4xj0lc0fmjypn8d7nasif79671859ymnfizyq4f";
+  };
+
+  buildInputs = [
+    pkgconfig cmake vala intltool gtk3 gnome3.gnome_common gnome3.libgee
+    gtk_doc clutter_gtk libmx keybinder3 libxml2 libnotify makeWrapper
+    xlibs.libpthreadstubs xlibs.libXdmcp xlibs.libxshmfence
+    libxkbcommon
+  ] ++ lib.optionals stdenv.isLinux [
+    udev
+  ];
+
+  preConfigure = ''
+    substituteInPlace data/org.gnome.finalterm.gschema.xml \
+      --replace "/bin/bash" "${bashInteractive}/bin/bash"
+
+    cmakeFlagsArray=(
+      -DMINIMAL_FLAGS=ON
+    )
+  '';
+
+  postFixup = ''
+    wrapProgram "$out/bin/finalterm" \
+      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
+      --prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules" \
+      --prefix XDG_DATA_DIRS : "${gnome3.gnome_icon_theme}/share:${gnome3.gtk}/share:$out/share:$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = with lib; {
+    homepage = "http://finalterm.org";
+    description = "A new breed of terminal emulator";
+    longDescription = ''
+      Final Term is a new breed of terminal emulator.
+
+      It goes beyond mere emulation and understands what is happening inside the shell it is hosting. This allows it to offer features no other terminal can, including:
+
+      - Semantic text menus
+      - Smart command completion
+      - GUI terminal controls
+    '';
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/pkgs/applications/misc/freicoin/default.nix b/pkgs/applications/misc/freicoin/default.nix
index d5ed057f56b8..65265fc07a5a 100644
--- a/pkgs/applications/misc/freicoin/default.nix
+++ b/pkgs/applications/misc/freicoin/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, db4, boost, gmp, mpfr, miniupnpc, qt4, unzip }:
+{ fetchurl, stdenv, db, boost, gmp, mpfr, miniupnpc, qt4, unzip }:
 
 stdenv.mkDerivation rec {
   version = "0.8.3-1";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   # I think that openssl and zlib are required, but come through other
   # packages
-  buildInputs = [ db4 boost gmp mpfr miniupnpc qt4 unzip ];
+  buildInputs = [ db boost gmp mpfr miniupnpc qt4 unzip ];
 
   configurePhase = "qmake";
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Peer-to-peer currency with demurrage fee";
     homepage = "http://freicoi.in/";
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/galculator/default.nix b/pkgs/applications/misc/galculator/default.nix
new file mode 100644
index 000000000000..010f75a575e6
--- /dev/null
+++ b/pkgs/applications/misc/galculator/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl
+, intltool, pkgconfig, gtk
+ }:
+
+stdenv.mkDerivation rec {
+  
+  name = "galculator-${version}";
+  version = "2.1.3";
+
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/galculator/${name}.tar.gz";
+    sha256 = "12m7dldjk10lpkdxk7zpk98n32ci65zmxidghihb7n1m3rhp3q17";
+  };
+
+  buildInputs = [ intltool pkgconfig gtk ];
+
+  meta = {
+    description = "A GTK 2/3 algebraic and RPN calculator";
+    longDescription = ''
+      galculator is a GTK 2 / GTK 3 based calculator. Its main features include:
+
+      - Algebraic, RPN (Reverse Polish Notation), Formula Entry and Paper modes;
+      - Basic and Scientific Modes
+      - Decimal, hexadecimal, octal and binary number base
+      - Radiant, degree and grad support
+      - User defined constants and functions
+      - A bunch of common functions
+      - Binary arithmetic of configurable bit length and signedness
+      - Quad-precision floating point arithmetic, and 112-bit binary arithmetic
+    '';
+    homepage = http://galculator.sourceforge.net/;
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.AndersonTorres ];
+  };
+}
diff --git a/pkgs/applications/misc/gammu/bashcomp-dir.patch b/pkgs/applications/misc/gammu/bashcomp-dir.patch
new file mode 100644
index 000000000000..94cc2929c1ee
--- /dev/null
+++ b/pkgs/applications/misc/gammu/bashcomp-dir.patch
@@ -0,0 +1,12 @@
+diff -Naur gammu-1.33.0.orig/contrib/CMakeLists.txt gammu-1.33.0/contrib/CMakeLists.txt
+--- gammu-1.33.0.orig/contrib/CMakeLists.txt	2013-12-26 20:56:22.887772110 +0100
++++ gammu-1.33.0/contrib/CMakeLists.txt	2013-12-26 20:57:04.386276037 +0100
+@@ -85,7 +85,7 @@
+ if (INSTALL_BASH_COMPLETION)
+     install (
+         FILES bash-completion/gammu
+-        DESTINATION "/etc/bash_completion.d"
++        DESTINATION "${CMAKE_INSTALL_PREFIX}/etc/bash_completion.d"
+         COMPONENT "bash"
+         )
+ endif (INSTALL_BASH_COMPLETION)
diff --git a/pkgs/applications/misc/gammu/default.nix b/pkgs/applications/misc/gammu/default.nix
new file mode 100644
index 000000000000..56e45b11c706
--- /dev/null
+++ b/pkgs/applications/misc/gammu/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, python, pkgconfig, cmake, bluez, libusb1, curl
+, libiconv, gettext, sqlite }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "gammu-${version}";
+  version = "1.33.0";
+
+  src = fetchurl {
+    url = "http://sourceforge.net/projects/gammu/files/gammu/${version}/gammu-${version}.tar.xz";
+    sha256 = "18gplx1v9d70k1q86d5i4n4dfpx367g34pj3zscppx126vwhv112";
+  };
+
+  patches = [ ./bashcomp-dir.patch ];
+
+  buildInputs = [ python pkgconfig cmake bluez libusb1 curl libiconv
+    gettext sqlite ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://wammu.eu/gammu/";
+    description = "Command line utility and library to control mobil phones";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.coroa ];
+  };
+}
diff --git a/pkgs/applications/misc/get_iplayer/default.nix b/pkgs/applications/misc/get_iplayer/default.nix
index 308b181fe88c..08fad5a021d0 100644
--- a/pkgs/applications/misc/get_iplayer/default.nix
+++ b/pkgs/applications/misc/get_iplayer/default.nix
@@ -1,6 +1,6 @@
 {stdenv, fetchurl, flvstreamer, ffmpeg, makeWrapper, perl, buildPerlPackage, perlPackages, vlc, rtmpdump}:
 buildPerlPackage {
-  name = "get_iplayer-2.83";
+  name = "get_iplayer-2.86";
 
   buildInputs = [makeWrapper perl];
   propagatedBuildInputs = with perlPackages; [HTMLParser HTTPCookies LWP];
@@ -12,12 +12,12 @@ buildPerlPackage {
     mkdir -p $out/bin
     cp get_iplayer $out/bin
     sed -i 's|^update_script|#update_script|' $out/bin/get_iplayer
-    wrapProgram $out/bin/get_iplayer --suffix PATH : ${ffmpeg}/bin:${flvstreamer}/bin:${vlc}/bin:${rtmpdump}/bin
+    wrapProgram $out/bin/get_iplayer --suffix PATH : ${ffmpeg}/bin:${flvstreamer}/bin:${vlc}/bin:${rtmpdump}/bin --prefix PERL5LIB : $PERL5LIB
   '';  
   
   src = fetchurl {
-    url = ftp://ftp.infradead.org/pub/get_iplayer/get_iplayer-2.83.tar.gz;
-    sha256 = "169zji0rr3z5ng6r4cyzvs89779m4iklln9gsqpryvm81ipalfga";
+    url = ftp://ftp.infradead.org/pub/get_iplayer/get_iplayer-2.86.tar.gz;
+    sha256 = "0zhcw0ikxrrz1jayx7jjgxmdf7gzk4pmzfvpraxmv64xwzgc1sc1";
   };
   
 }
diff --git a/pkgs/applications/misc/girara/default.nix b/pkgs/applications/misc/girara/default.nix
index e112427126ab..b25d347ec873 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.5";
+  name = "girara-0.2.2";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/girara/download/${name}.tar.gz";
-    sha256 = "1hfi3jmx8ydvrqm3h6p6py2csavh7xx0223vxyca51kjl9mfnbld";
+    sha256 = "0lv6wqhx2avdxj6yx111jfs4j32r0xzmmkhy7pgzxpf73kgxz0k3";
   };
 
   buildInputs = [ pkgconfig gtk gettext ];
diff --git a/pkgs/applications/misc/gkrellm/default.nix b/pkgs/applications/misc/gkrellm/default.nix
index af10ca9800d0..81f74847c2f0 100644
--- a/pkgs/applications/misc/gkrellm/default.nix
+++ b/pkgs/applications/misc/gkrellm/default.nix
@@ -1,10 +1,10 @@
 { fetchurl, stdenv, gettext, pkgconfig, glib, gtk, libX11, libSM, libICE }:
 
 stdenv.mkDerivation rec {
-  name = "gkrellm-2.3.4";
+  name = "gkrellm-2.3.5";
   src = fetchurl {
     url = "http://members.dslextreme.com/users/billw/gkrellm/${name}.tar.bz2";
-    sha256 = "0mjg2pxpiqms7d6dvxzxvpa420cakhpjxvrclhq0y8jd2dlv2irl";
+    sha256 = "12rc6zaa7kb60b9744lbrlfkxxfniprm6x0mispv63h4kh75navh";
   };
 
   buildInputs = [gettext pkgconfig glib gtk libX11 libSM libICE];
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
       '';
 
     homepage = http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/applications/misc/gksu/default.nix b/pkgs/applications/misc/gksu/default.nix
new file mode 100644
index 000000000000..61fd44925b71
--- /dev/null
+++ b/pkgs/applications/misc/gksu/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, pkgconfig, makeWrapper, gtk, gnome3, libgksu,
+  intltool, libstartup_notification, gtk_doc
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.0.2";
+  pname = "gksu";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://people.debian.org/~kov/gksu/${name}.tar.gz";
+    sha256 = "0npfanlh28daapkg25q4fncxd89rjhvid5fwzjaw324x0g53vpm1";
+  };
+
+  patches = [
+    # https://savannah.nongnu.org/bugs/index.php?36127
+    ./gksu-2.0.2-glib-2.31.patch
+  ];
+
+  postPatch = ''
+    sed -i -e 's|/usr/bin/x-terminal-emulator|-l gnome-terminal|g' gksu.desktop
+  '';
+
+  configureFlags = "--disable-nautilus-extension";
+
+  buildInputs = [
+    pkgconfig makeWrapper gtk gnome3.gconf intltool
+    libstartup_notification gnome3.libgnome_keyring gtk_doc
+  ];
+
+  propagatedBuildInputs = [
+    libgksu
+  ];
+
+  meta = {
+    description = "A graphical frontend for libgksu";
+    longDescription = ''
+      GKSu is a library that provides a Gtk+ frontend to su and sudo.
+      It supports login shells and preserving environment when acting as
+      a su frontend. It is useful to menu items or other graphical
+      programs that need to ask a user's password to run another program
+      as another user.
+    '';
+    homepage = "http://www.nongnu.org/gksu/";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+  };
+}
diff --git a/pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch b/pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch
new file mode 100644
index 000000000000..fd711a321acf
--- /dev/null
+++ b/pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch
@@ -0,0 +1,29 @@
+From 10c7e67e11a56e2fe1acf9b085772bc995d35bc0 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Sat, 7 Apr 2012 17:57:36 -0400
+Subject: [PATCH] Fix glib includes for building with >=glib-2.31
+
+glib-2.31 and newer no longer allow most glib subheaders to be included
+directly.
+
+https://savannah.nongnu.org/bugs/index.php?36127
+---
+ nautilus-gksu/libnautilus-gksu.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/nautilus-gksu/libnautilus-gksu.c b/nautilus-gksu/libnautilus-gksu.c
+index 8e44d29..4acf3f8 100644
+--- a/nautilus-gksu/libnautilus-gksu.c
++++ b/nautilus-gksu/libnautilus-gksu.c
+@@ -5,7 +5,7 @@
+ #include <string.h>
+ #include <pthread.h>
+ 
+-#include <glib/gkeyfile.h>
++#include <glib.h>
+ #include <gtk/gtk.h>
+ #include <gio/gio.h>
+ #include <libnautilus-extension/nautilus-extension-types.h>
+-- 
+1.7.8.5
+
diff --git a/pkgs/applications/misc/gnome_terminator/default.nix b/pkgs/applications/misc/gnome_terminator/default.nix
deleted file mode 100644
index b394719611de..000000000000
--- a/pkgs/applications/misc/gnome_terminator/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ stdenv, fetchurl, python, pygtk, vte, gettext, intltool, makeWrapper }:
-
-stdenv.mkDerivation rec {
-  name = "gnome-terminator-0.96";
-  
-  src = fetchurl {
-    url = "https://launchpad.net/terminator/trunk/0.96/+download/terminator_0.96.tar.gz";
-    sha256 = "d708c783c36233fcafbd0139a91462478ae40f5cf696ef4acfcaf5891a843201";
-  };
-  
-  buildInputs =
-    [ python pygtk vte gettext intltool makeWrapper
-    ];
-
-  phases = "unpackPhase installPhase";
-
-  installPhase = ''
-    python setup.py --without-icon-cache install --prefix=$out
-    for i in $(cd $out/bin && ls); do
-        wrapProgram $out/bin/$i \
-            --prefix PYTHONPATH : "$(toPythonPath $out):$PYTHONPATH"
-    done
-  '';
-
-  meta = {
-    description = "Gnome terminal emulator with support for tiling and tabs";
-    homepage = http://www.tenshu.net/p/terminator.html;
-    license = "GPLv2";
-  };
-}
diff --git a/pkgs/applications/misc/gnuradio-osmosdr/default.nix b/pkgs/applications/misc/gnuradio-osmosdr/default.nix
new file mode 100644
index 000000000000..2e9d74c2441d
--- /dev/null
+++ b/pkgs/applications/misc/gnuradio-osmosdr/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchgit, cmake, pkgconfig, boost, gnuradio, rtl-sdr, uhd
+, makeWrapper
+, pythonSupport ? true, python, swig
+}:
+
+assert pythonSupport -> python != null && swig != null;
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-osmosdr-${version}";
+  version = "0.1.0";
+
+  src = fetchgit {
+    url = "git://git.osmocom.org/gr-osmosdr";
+    rev = "refs/tags/v${version}";
+    sha256 = "112zfvnr6fjvhdc06ihi2sb0dp441qy7jq8rvr81nbyv3r8jspj4";
+  };
+
+  buildInputs = [
+    cmake pkgconfig boost gnuradio rtl-sdr uhd makeWrapper
+  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+        wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Gnuradio block for OsmoSDR and rtl-sdr";
+    homepage = http://sdr.osmocom.org/trac/wiki/GrOsmoSDR;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/misc/gnuradio/default.nix b/pkgs/applications/misc/gnuradio/default.nix
new file mode 100644
index 000000000000..1a0dea586d0e
--- /dev/null
+++ b/pkgs/applications/misc/gnuradio/default.nix
@@ -0,0 +1,77 @@
+{ stdenv, fetchurl
+# core dependencies
+, cmake, pkgconfig, git, boost, cppunit, fftw
+# python wrappers
+, python, swig2, numpy, scipy, matplotlib
+# grc - the gnu radio companion
+, cheetahTemplate, pygtk
+# gr-wavelet: collection of wavelet blocks
+, gsl
+# gr-qtgui: the Qt-based GUI
+, qt4, qwt, pyqt4 #, pyqwt
+# gr-wxgui: the Wx-based GUI
+, wxPython, lxml
+# gr-audio: audio subsystems (system/OS dependent)
+, alsaLib
+# uhd: the Ettus USRP Hardware Driver Interface
+, uhd
+# gr-video-sdl: PAL and NTSC display
+, SDL
+, libusb1, orc, pyopengl
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-${version}";
+  version = "3.7.3";
+
+  src = fetchurl {
+    url = "http://gnuradio.org/releases/gnuradio/${name}.tar.gz";
+    sha256 = "0caj7dqppav53nhn0ima106hpsn0sakw57v1ihac9fk7ka0x2w8w";
+  };
+
+  buildInputs = [
+    cmake pkgconfig git boost cppunit fftw python swig2 orc lxml qt4 qwt
+    alsaLib SDL libusb1 uhd gsl makeWrapper
+  ];
+
+  propagatedBuildInputs = [
+    cheetahTemplate numpy scipy matplotlib pyqt4 pygtk wxPython pyopengl
+  ];
+
+  preConfigure = ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-unused-variable"
+  '';
+
+  # - Ensure we get an interactive backend for matplotlib. If not the gr_plot_*
+  #   programs will not display anything. Yes, $MATPLOTLIBRC must point to the
+  #   *dirname* where matplotlibrc is located, not the file itself.
+  # - GNU Radio core is C++ but the user interface (GUI and API) is Python, so
+  #   we must wrap the stuff in bin/.
+  postInstall = ''
+    printf "backend : Qt4Agg\n" > "$out/share/gnuradio/matplotlibrc"
+
+    for file in "$out"/bin/* "$out"/share/gnuradio/examples/*/*.py; do
+        wrapProgram "$file" \
+            --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") \
+            --set MATPLOTLIBRC "$out/share/gnuradio"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Software Defined Radio (SDR) software";
+    longDescription = ''
+      GNU Radio is a free & open-source software development toolkit that
+      provides signal processing blocks to implement software radios. It can be
+      used with readily-available low-cost external RF hardware to create
+      software-defined radios, or without hardware in a simulation-like
+      environment. It is widely used in hobbyist, academic and commercial
+      environments to support both wireless communications research and
+      real-world radio systems.
+    '';
+    homepage = http://www.gnuradio.org;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix
index f7b8a511bc66..717d0a012a2c 100644
--- a/pkgs/applications/misc/goldendict/default.nix
+++ b/pkgs/applications/misc/goldendict/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     cd ${name}-src
     tar xf ${src}
   '';
-  patches = [ ./goldendict-paths.diff ];
+  patches = [ ./goldendict-paths.diff ./gcc47.patch ];
   patchFlags = "-p 0";
   configurePhase = ''
     qmake
diff --git a/pkgs/applications/misc/goldendict/gcc47.patch b/pkgs/applications/misc/goldendict/gcc47.patch
new file mode 100644
index 000000000000..311dad4f6487
--- /dev/null
+++ b/pkgs/applications/misc/goldendict/gcc47.patch
@@ -0,0 +1,40 @@
+From b00d081da20b9a6b257573c6b23a6bc640c4dab1 Mon Sep 17 00:00:00 2001
+From: Michael Palimaka <kensington@gentoo.org>
+Date: Fri, 20 Jul 2012 03:27:38 +1000
+Subject: [PATCH] Fix build with GCC 4.7 by adding missing includes.
+
+---
+ processwrapper.cc                       | 4 ++++
+ qtsingleapplication/src/qtlocalpeer.cpp | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git processwrapper.cc processwrapper.cc
+index f7f3f19..86b985d 100644
+--- processwrapper.cc
++++ processwrapper.cc
+@@ -2,6 +2,10 @@
+ 

+ #include <QtCore>

+ 

++#if defined(Q_OS_UNIX)

++#include <unistd.h>

++#endif

++

+ #ifdef Q_OS_WIN32

+ 

+ #include <windows.h>

+diff --git qtsingleapplication/src/qtlocalpeer.cpp qtsingleapplication/src/qtlocalpeer.cpp
+index 382d182..506c142 100644
+--- qtsingleapplication/src/qtlocalpeer.cpp
++++ qtsingleapplication/src/qtlocalpeer.cpp
+@@ -50,6 +50,7 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0;
+ #endif
+ #if defined(Q_OS_UNIX)
+ #include <time.h>
++#include <unistd.h>
+ #endif
+ 
+ namespace QtLP_Private {
+-- 
+1.7.11.1
+
diff --git a/pkgs/applications/misc/googleearth/default.nix b/pkgs/applications/misc/googleearth/default.nix
index 08b868bca926..ea577beb5929 100644
--- a/pkgs/applications/misc/googleearth/default.nix
+++ b/pkgs/applications/misc/googleearth/default.nix
@@ -71,7 +71,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A world sphere viewer";
     homepage = http://earth.google.com;
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.viric ];
   };
 }
diff --git a/pkgs/applications/misc/gphoto2/default.nix b/pkgs/applications/misc/gphoto2/default.nix
index cba54bf8013c..7ff253fd4e8d 100644
--- a/pkgs/applications/misc/gphoto2/default.nix
+++ b/pkgs/applications/misc/gphoto2/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gphoto2-2.5.2";
+  name = "gphoto2-2.5.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
-    sha256 = "16c8k1cxfypg7v5h8xi87grclw7a5ayaamn548ys3zkj727r5fcf";
+    sha256 = "0i6qjyvgn3aaspiblmiwv51mfy92gm73xpbd3z41ki8mw7plg53i";
   };
 
   nativeBuildInputs = [ pkgconfig gettext ];
diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix
index 29d5b1ee7cc8..bf44f91056d7 100644
--- a/pkgs/applications/misc/gpsbabel/default.nix
+++ b/pkgs/applications/misc/gpsbabel/default.nix
@@ -50,7 +50,7 @@ stdenv.mkDerivation {
 
     homepage = http://www.gpsbabel.org/;
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.gnu;         # arbitrary choice
diff --git a/pkgs/applications/misc/gpscorrelate/default.nix b/pkgs/applications/misc/gpscorrelate/default.nix
index 141476a6b406..9a59329871e6 100644
--- a/pkgs/applications/misc/gpscorrelate/default.nix
+++ b/pkgs/applications/misc/gpscorrelate/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
       one takes the GPS data in a different format.
     '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     homepage = http://freefoote.dview.net/linux_gpscorr.html;
   };
diff --git a/pkgs/applications/misc/gqrx/default.nix b/pkgs/applications/misc/gqrx/default.nix
new file mode 100644
index 000000000000..a52081077509
--- /dev/null
+++ b/pkgs/applications/misc/gqrx/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, qt4, gnuradio, boost, gnuradio-osmosdr
+# drivers (optional):
+, rtl-sdr
+, pulseaudioSupport ? true, pulseaudio
+}:
+
+assert pulseaudioSupport -> pulseaudio != null;
+
+stdenv.mkDerivation rec {
+  name = "gqrx-${version}";
+  version = "2.2.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/gqrx/${version}/${name}-src.tar.gz";
+    sha256 = "15ncx2shh43skph7sj3jvmkls9cbbbysld49c8xd23fhdsxanj9x";
+  };
+
+  buildInputs = [
+    qt4 gnuradio boost gnuradio-osmosdr rtl-sdr
+  ] ++ stdenv.lib.optionals pulseaudioSupport [ pulseaudio ];
+
+  configurePhase = ''qmake PREFIX="$out"'';
+
+  meta = with stdenv.lib; {
+    description = "Software defined radio (SDR) receiver";
+    longDescription = ''
+      Gqrx is a software defined radio receiver powered by GNU Radio and the Qt
+      GUI toolkit. It can process I/Q data from many types of input devices,
+      including Funcube Dongle Pro/Pro+, rtl-sdr, HackRF, and Universal
+      Software Radio Peripheral (USRP) devices.
+    '';
+    homepage = http://gqrx.dk/;
+    # Some of the code comes from the Cutesdr project, with a BSD license, but
+    # it's currently unknown which version of the BSD license that is.
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;  # should work on Darwin / OS X too
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/misc/grip/default.nix b/pkgs/applications/misc/grip/default.nix
index 0c2b957bc7ca..39621536e688 100644
--- a/pkgs/applications/misc/grip/default.nix
+++ b/pkgs/applications/misc/grip/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "GTK+-based audio CD player/ripper";
     homepage = "http://nostatic.org/grip";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
 
     maintainers = [ stdenv.lib.maintainers.marcweber stdenv.lib.maintainers.simons ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/misc/gv/default.nix b/pkgs/applications/misc/gv/default.nix
index efd9cf263e7c..4867bef1f719 100644
--- a/pkgs/applications/misc/gv/default.nix
+++ b/pkgs/applications/misc/gv/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
       interface for the Ghostscript interpreter.
     '';
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
diff --git a/pkgs/applications/misc/hello/ex-2/default.nix b/pkgs/applications/misc/hello/ex-2/default.nix
index 80a3fb702c02..71c9777ff9b7 100644
--- a/pkgs/applications/misc/hello/ex-2/default.nix
+++ b/pkgs/applications/misc/hello/ex-2/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "hello-2.8";
+  name = "hello-2.9";
 
   src = fetchurl {
     url = "mirror://gnu/hello/${name}.tar.gz";
-    sha256 = "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6";
+    sha256 = "19qy37gkasc4csb1d3bdiz9snn8mir2p3aj0jgzmfv0r2hi7mfzc";
   };
 
   doCheck = true;
@@ -17,8 +17,7 @@ stdenv.mkDerivation rec {
       It is fully customizable.
     '';
     homepage = http://www.gnu.org/software/hello/manual/;
-    license = "GPLv3+";
-
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/misc/htmldoc/default.nix b/pkgs/applications/misc/htmldoc/default.nix
index befa8d252100..e8274418ae16 100644
--- a/pkgs/applications/misc/htmldoc/default.nix
+++ b/pkgs/applications/misc/htmldoc/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.htmldoc.org/;
     description = "Converts HTML files to indexed HTML, PS or PDF";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [ viric ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/ikiwiki/default.nix b/pkgs/applications/misc/ikiwiki/default.nix
index baf97e7a8247..fab492d5c099 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.20130518";
+  version = "3.20140227";
 
   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 = "00mmxxlbzv6bz3cz3746r5lqwby6liwsg7m3jfba8258y52w13qp";
+    sha256 = "1bbpqs4c1la1yqcxcxj3xip3wadjnjq0wawv19j6d6baymm66cr3";
   };
 
   buildInputs = [ perl TextMarkdown URI HTMLParser HTMLScrubber HTMLTemplate
@@ -83,7 +83,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Wiki compiler, storing pages and history in a RCS";
     homepage = "http://ikiwiki.info/";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/applications/misc/jigdo/default.nix b/pkgs/applications/misc/jigdo/default.nix
index 6ceca2ea871f..d722367d1b49 100644
--- a/pkgs/applications/misc/jigdo/default.nix
+++ b/pkgs/applications/misc/jigdo/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, db45, gtk, bzip2 }:
+{ stdenv, fetchurl, db, gtk, bzip2 }:
 
 stdenv.mkDerivation {
   name = "jigdo-0.7.3";
 
-  # Debian sources 
+  # Debian sources
   src = fetchurl {
     url = http://ftp.de.debian.org/debian/pool/main/j/jigdo/jigdo_0.7.3.orig.tar.gz;
     sha256 = "1qvqzgzb0dzq82fa1ffs6hyij655rajnfwkljk1y0mnkygnha1xv";
@@ -13,14 +13,14 @@ stdenv.mkDerivation {
     url = http://ftp.de.debian.org/debian/pool/main/j/jigdo/jigdo_0.7.3-2.diff.gz;
     sha256 = "0jnlzm9m2hjlnw0zs2fv456ml5r2jj2q1lncqbrgg52lq18f6fa3";
   };
-  
-  buildInputs = [ db45 gtk bzip2 ];
+
+  buildInputs = [ db gtk bzip2 ];
 
   configureFlags = "--without-libdb";
 
-  meta = { 
+  meta = {
     description = "Download utility that can fetch files from several sources simultaneously";
     homepage = http://atterer.net/jigdo/;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/misc/kde-wacomtablet/default.nix b/pkgs/applications/misc/kde-wacomtablet/default.nix
index 22587a1bae04..ee93f57eafcd 100644
--- a/pkgs/applications/misc/kde-wacomtablet/default.nix
+++ b/pkgs/applications/misc/kde-wacomtablet/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, kdelibs, gettext }:
+{ stdenv, fetchurl, kdelibs, gettext, xf86_input_wacom }:
 
 stdenv.mkDerivation rec {
-  name = "wacomtablet-1.3.5";
+  name = "wacomtablet-2.0.2";
 
   src = fetchurl {
-    url = "http://kde-apps.org/CONTENT/content-files/114856-wacomtablet-v1.3.5.tar.bz2";
-    sha256 = "0dgsp3izx2v44f6j8mhxc6zybjn5sj9038w6b4v2fgix47fri0ja";
+    url = "http://kde-apps.org/CONTENT/content-files/114856-wacomtablet-2.0.2.tar.xz";
+    sha256 = "13k5f5xpka5cbgl24a3j9khqcmp96x1vhynn9v558ag6dg9ch2hw";
   };
 
-  buildInputs = [ kdelibs ];
+  buildInputs = [ kdelibs xf86_input_wacom ];
 
   nativeBuildInputs = [ gettext ];
 
diff --git a/pkgs/applications/misc/kdeconnect/default.nix b/pkgs/applications/misc/kdeconnect/default.nix
new file mode 100644
index 000000000000..663ce872e222
--- /dev/null
+++ b/pkgs/applications/misc/kdeconnect/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, gettext, kdelibs, libXtst, makeWrapper, qca2, qca2_ossl, qjson }:
+
+stdenv.mkDerivation rec {
+  name = "kdeconnect-${version}";
+  version = "0.7.2";
+
+  src = fetchurl {
+    url = "http://download.kde.org/unstable/kdeconnect/${version}/src/kdeconnect-kde-${version}.tar.xz";
+    sha256 = "1v7sicgy39n8pn7nzq9f7lkmwbcvavhy3b66agyhxwmyzz6mcd4g";
+  };
+
+  buildInputs = [ gettext kdelibs libXtst makeWrapper qca2 qca2_ossl qjson ];
+
+  postInstall = ''
+    wrapProgram $out/lib/kde4/libexec/kdeconnectd --prefix QT_PLUGIN_PATH : ${qca2_ossl}/lib/qt4/plugins
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A tool to connect and sync your devices with KDE";
+    longDescription = ''
+        The corresponding Android app, "KDE Connect", is available in
+        F-Droid and Google play and has the following features:
+
+        - Share files and URLs to KDE from any app
+        - Clipboard share: copy from or to your desktop
+        - Notifications sync (4.3+): Read your Android notifications from KDE
+        - Multimedia remote control: Use your phone as a remote control
+        - WiFi connection: no usb wire or bluetooth needed
+        - RSA Encryption: your information is safe 
+    '';
+    license = licenses.gpl2;
+    homepage = https://projects.kde.org/projects/playground/base/kdeconnect-kde;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/misc/keepass/default.nix b/pkgs/applications/misc/keepass/default.nix
index 0098e626b424..89f794850d27 100644
--- a/pkgs/applications/misc/keepass/default.nix
+++ b/pkgs/applications/misc/keepass/default.nix
@@ -24,12 +24,12 @@ stdenv.mkDerivation rec {
 
 
   installPhase = ''
-    ensureDir "$out/bin"
+    mkdir -p "$out/bin"
     echo "${mono}/bin/mono $out/KeePass.exe" > $out/bin/keepass
     chmod +x $out/bin/keepass
     echo $out
     cp -r ./* $out/
-    ensureDir "$out/share/applications"
+    mkdir -p "$out/share/applications"
     cp ${desktopItem}/share/applications/* $out/share/applications
   '';
 
diff --git a/pkgs/applications/misc/keepassx/2.0.nix b/pkgs/applications/misc/keepassx/2.0.nix
new file mode 100644
index 000000000000..1a79af7cb577
--- /dev/null
+++ b/pkgs/applications/misc/keepassx/2.0.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, cmake, libgcrypt, qt4, xlibs, ... }:
+
+stdenv.mkDerivation {
+  name = "keepassx2-2.0alpha5";
+  src = fetchurl {
+    url = "https://github.com/keepassx/keepassx/archive/2.0-alpha5.tar.gz";
+    sha256 = "1vxj306zhrr38mvsy3vpjlg6d0xwlcvsi3l69nhhwzkccsc4smfm";
+  };
+
+  buildInputs = [ cmake libgcrypt qt4 xlibs.libXtst ];
+
+  meta = {
+    description = "Qt password manager compatible with its Win32 and Pocket PC versions";
+    homepage = http://www.keepassx.org/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [qknight];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/misc/keepassx/default.nix b/pkgs/applications/misc/keepassx/default.nix
index 375a1ae2419a..fc089f4fa5b7 100644
--- a/pkgs/applications/misc/keepassx/default.nix
+++ b/pkgs/applications/misc/keepassx/default.nix
@@ -12,6 +12,8 @@ stdenv.mkDerivation rec {
     qmake PREFIX=$out 
   '';
 
+  patches = [ ./random.patch ];
+
   buildInputs = [ bzip2 qt4 libX11 xextproto libXtst ];
 
   meta = {
diff --git a/pkgs/applications/misc/keepassx/random.patch b/pkgs/applications/misc/keepassx/random.patch
new file mode 100644
index 000000000000..0a0b26f6e8c9
--- /dev/null
+++ b/pkgs/applications/misc/keepassx/random.patch
@@ -0,0 +1,13 @@
+--- a/src/lib/random.cpp	2014-01-21 21:15:55.829312723 +0000
++++ b/src/lib/random.cpp	2014-01-21 21:16:36.752535839 +0000
+@@ -28,6 +28,10 @@
+ 	#include <wincrypt.h>
+ 	#include <QSysInfo>
+ #endif
++#ifndef Q_WS_WIN
++	#include <sys/types.h>
++	#include <unistd.h>
++#endif
+ 
+ #include <QCryptographicHash>
+ #include <QCursor>
diff --git a/pkgs/applications/misc/krename/default.nix b/pkgs/applications/misc/krename/default.nix
index e5af706d41c9..75d8e5ecb89b 100644
--- a/pkgs/applications/misc/krename/default.nix
+++ b/pkgs/applications/misc/krename/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, automoc4, kdelibs, taglib, exiv2, podofo, gettext, qt4, phonon }:
 
 stdenv.mkDerivation rec {
-  name = "krename-4.0.4";
+  name = "krename-4.0.9";
 
   src = fetchurl {
     url = "mirror://sourceforge/krename/${name}.tar.bz2";
-    sha256 = "12qhclw1vbg5bv6619qd4408y8d1w26499gcr8gwhgfzk0v83hic";
+    sha256 = "11bdg5vdcs393n0aibhm3jh3wxlk5kz78jhkwf7cj9086qkg9wds";
   };
 
   buildInputs = [ cmake automoc4 kdelibs taglib exiv2 podofo gettext qt4 phonon ];
diff --git a/pkgs/applications/misc/krusader/default.nix b/pkgs/applications/misc/krusader/default.nix
index bd86501c30e2..83c21da0e542 100644
--- a/pkgs/applications/misc/krusader/default.nix
+++ b/pkgs/applications/misc/krusader/default.nix
@@ -7,6 +7,7 @@ stdenv.mkDerivation rec {
     sha256 = "1q1m4cjzz2m41pdpxnwrsiczc7990785b700lv64midjjgjnr7j6";
   };
   buildInputs = [ gettext kdelibs kde_baseapps ];
+  NIX_CFLAGS_COMPILE = "-fpermissive"; # fix build with newer gcc versions
   meta = {
     description = "Norton/Total Commander clone for KDE";
     license = "GPL";
diff --git a/pkgs/applications/misc/librecad/2.0.nix b/pkgs/applications/misc/librecad/2.0.nix
index 2394d116314e..8b7a9a40c872 100644
--- a/pkgs/applications/misc/librecad/2.0.nix
+++ b/pkgs/applications/misc/librecad/2.0.nix
@@ -1,12 +1,12 @@
-{ stdenv, fetchurl, qt4, muparser, which, boost}:
+{ stdenv, fetchurl, qt4, muparser, which, boost, pkgconfig }:
 
 stdenv.mkDerivation {
-  name = "librecad-2.0.0beta1";
+  name = "librecad-2.0.2";
 
   src = fetchurl {
-    url = https://github.com/LibreCAD/LibreCAD/tarball/2.0.0beta1;
-    name = "librecad-2.0.0beta1.tar.gz";
-    sha256 = "8bf969b79be115f3b3ff72cc030a4c21fe93164dd0cb19ddfb78a7d66b8bc770";
+    url = https://github.com/LibreCAD/LibreCAD/tarball/2.0.2;
+    name = "librecad-2.0.2.tar.gz";
+    sha256 = "0a5rs1h4n74d4bnrj91ij6y6wzc8d6nbrg9lfwjx8icjjl6hqikm";
   };
 
   patchPhase = ''
@@ -19,19 +19,21 @@ stdenv.mkDerivation {
   '';
 
   installPhase = ''
-    ensureDir $out/bin $out/share
+    mkdir -p $out/bin $out/share
     cp -R unix/librecad $out/bin
     cp -R unix/resources $out/share/librecad
   '';
 
   buildInputs = [ qt4 muparser which boost ];
+  nativeBuildInputs = [ pkgconfig ];
 
   enableParallelBuilding = true;
 
   meta = {
     description = "A 2D CAD package based upon Qt";
     homepage = http://librecad.org;
-    license = "GPLv2";
+    repositories.git = git://github.com/LibreCAD/LibreCAD.git;
+    license = stdenv.lib.licenses.gpl2;
     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 59bd4888e4a6..b2960e9f47d4 100644
--- a/pkgs/applications/misc/librecad/default.nix
+++ b/pkgs/applications/misc/librecad/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, qt4, muparser, which}:
 
 stdenv.mkDerivation {
-  name = "librecad-1.0.2";
+  name = "librecad-1.0.4";
 
   src = fetchurl {
-    url = https://github.com/LibreCAD/LibreCAD/tarball/v1.0.2;
-    name = "librecad-1.0.2.tar.gz";
-    sha256 = "13ee7e401e4f5fbc68c2e017b7189bec788038f4f6e77f559861ceb8cfb1907d";
+    url = https://github.com/LibreCAD/LibreCAD/tarball/v1.0.4;
+    name = "librecad-1.0.4.tar.gz";
+    sha256 = "00nzbijw7pn1zkj4256da501xcm6rkcvycpa79y6dr2p6c43yc6m";
   };
 
   patchPhase = ''
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   configurePhase = "qmake PREFIX=$out";
 
   installPhase = ''
-    ensureDir $out/bin $out/share
+    mkdir -p $out/bin $out/share
     cp -R unix/librecad $out/bin
     cp -R unix/resources $out/share/librecad
   '';
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A 2D CAD package based upon Qt";
     homepage = http://librecad.org;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/llpp/default.nix b/pkgs/applications/misc/llpp/default.nix
new file mode 100644
index 000000000000..e04898fba29f
--- /dev/null
+++ b/pkgs/applications/misc/llpp/default.nix
@@ -0,0 +1,75 @@
+{ stdenv, fetchgit, ocaml, mupdf, lablgl, mesa
+, libX11, libXext, gtk3, freetype, zlib, openjpeg
+, jbig2dec, libjpeg, ncurses }:
+
+stdenv.mkDerivation {
+  name = "llpp-2014-05-26";
+
+  src = fetchgit {
+    url = "git://repo.or.cz/llpp.git";
+    rev  = "902143de64d86b5714b3a59d2cc7085083b87249";
+    sha256 = "038xl4gbvm57na2lz1fw36sf43zaxq407zi2d53985vc33677j9s";
+  };
+
+  buildInputs = [ ocaml mupdf lablgl mesa libX11 libXext gtk3
+                  freetype jbig2dec libjpeg openjpeg zlib ncurses ];
+
+  # The build phase was extracted from buildall.sh, because that script
+  # fetched the dependencies on its own.
+  buildPhase = ''
+    ccopt="-O"
+    ccopt="$ccopt -I ${jbig2dec}/include"
+    ccopt="$ccopt -I ${libjpeg}/include"
+    ccopt="$ccopt -I ${freetype}/include/freetype2"
+    ccopt="$ccopt -I ${openjpeg}/include"
+    ccopt="$ccopt -I ${zlib}/include"
+    ccopt="$ccopt -I ${mupdf}/include"
+    ccopt="$ccopt -include ft2build.h"
+    ccopt="$ccopt -D_GNU_SOURCE"
+
+    cclib="$cclib -lmupdf"
+    cclib="$cclib -lz -ljpeg -lopenjp2 -ljbig2dec -lfreetype -lpthread"
+    cclib="$cclib -lX11"
+    cclib="$cclib -lfreetype"
+
+    comp=ocamlc.opt
+    cmsuf=cmo
+
+    sh mkhelp.sh keystoml.ml KEYS > help.ml
+
+    $comp -c -o link.o -ccopt "$ccopt" link.c
+    $comp -c -o help.$cmsuf help.ml
+    $comp -c -o utils.$cmsuf utils.ml
+    $comp -c -o wsi.cmi wsi.mli
+    $comp -c -o wsi.$cmsuf wsi.ml
+    $comp -c -o parser.$cmsuf parser.ml
+    $comp -c -o main.$cmsuf -I ${lablgl}/lib/ocaml/4.01.0/site-lib/lablgl main.ml
+
+    $comp -custom -o llpp           \
+          -I ${lablgl}/lib/ocaml/4.01.0/site-lib/lablgl \
+          str.cma unix.cma lablgl.cma \
+          link.o                      \
+          -cclib "$cclib"             \
+          help.cmo                    \
+          utils.cmo                   \
+          parser.cmo                  \
+          wsi.cmo                     \
+          main.cmo
+  '';
+
+  # Binary fails with 'No bytecode file specified.' if stripped.
+  dontStrip = true;
+
+  installPhase = ''
+    install -d $out/bin
+    install llpp llppac $out/bin
+  '';
+
+  meta = {
+    homepage = http://repo.or.cz/w/llpp.git;
+    description = "A MuPDF based PDF pager written in OCaml";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.pSub ];
+    license = "GPL";
+  };
+}
diff --git a/pkgs/applications/misc/lxappearance/default.nix b/pkgs/applications/misc/lxappearance/default.nix
new file mode 100644
index 000000000000..9295eaabf322
--- /dev/null
+++ b/pkgs/applications/misc/lxappearance/default.nix
@@ -0,0 +1,17 @@
+{ stdenv, fetchurl, intltool, pkgconfig, libX11, gtk }:
+
+stdenv.mkDerivation rec {
+  name = "lxappearance-0.5.5";
+  src = fetchurl{
+    url = "http://downloads.sourceforge.net/project/lxde/LXAppearance/${name}.tar.xz";
+    sha256 = "8cae82e6425ba8a0267774e4d10096df2d91b0597520058331684a5ece068b4c";
+  };
+  buildInputs = [ intltool libX11 pkgconfig gtk ];
+  meta = {
+    description = "A lightweight program for configuring the theme and fonts of gtk applications";
+    maintainers = [ stdenv.lib.maintainers.hinton ];
+    platforms = stdenv.lib.platforms.all;
+    license = stdenv.lib.licenses.gpl2;
+    homepage = "http://lxappearance.sourceforce.net/";
+  };
+}
diff --git a/pkgs/applications/misc/lyx/default.nix b/pkgs/applications/misc/lyx/default.nix
index fd2e7c3ac426..da7be68be54f 100644
--- a/pkgs/applications/misc/lyx/default.nix
+++ b/pkgs/applications/misc/lyx/default.nix
@@ -1,14 +1,14 @@
-{ fetchurl, stdenv, texLive, python, makeWrapper, pkgconfig
-, libX11, qt4, enchant #, mythes, boost
+{ fetchurl, stdenv, pkgconfig, python, file, bc
+, qt4, hunspell, makeWrapper #, mythes, boost
 }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.6";
+  version = "2.1.1";
   name = "lyx-${version}";
 
   src = fetchurl {
-    url = "ftp://ftp.lyx.org/pub/lyx/stable/2.0.x/${name}.tar.xz";
-    sha256 = "1llah9d9ymvdk8asmqslcwnicycxrwb27k8si184n5bfxvnjpjx5";
+    url = "ftp://ftp.lyx.org/pub/lyx/stable/2.1.x/${name}.tar.xz";
+    sha256 = "1fir1dzzy7c92jf3a3psnd10c6widslk0852xk4svpl6phcg4nya";
   };
 
   configureFlags = [
@@ -18,18 +18,29 @@ stdenv.mkDerivation rec {
     #"--without-included-mythes" # such a small library isn't worth a separate package
   ];
 
+  # LaTeX is used from $PATH, as people often want to have it with extra pkgs
   buildInputs = [
-    texLive qt4 python makeWrapper pkgconfig
-    enchant # mythes boost
+    pkgconfig qt4 python file/*for libmagic*/ bc
+    hunspell makeWrapper # enchant
   ];
 
+  enableParallelBuilding = true;
   doCheck = true;
 
-  meta = {
+  # python is run during runtime to do various tasks
+  postFixup = ''
+    sed '1s:/usr/bin/python:${python}/bin/python:'
+
+    wrapProgram "$out/bin/lyx" \
+      --prefix PATH : '${python}/bin'
+  '';
+
+  meta = with stdenv.lib; {
     description = "WYSIWYM frontend for LaTeX, DocBook";
     homepage = "http://www.lyx.org";
-    license = "GPL2";
-    maintainers = [ stdenv.lib.maintainers.vcunat ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.vcunat ];
+    platforms = platforms.linux;
   };
 }
+
diff --git a/pkgs/applications/misc/makeself/default.nix b/pkgs/applications/misc/makeself/default.nix
index 9ea5f18ee629..3ba0faef9682 100644
--- a/pkgs/applications/misc/makeself/default.nix
+++ b/pkgs/applications/misc/makeself/default.nix
@@ -1,23 +1,25 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchgit }:
 
 stdenv.mkDerivation rec {
-  name = "makeself-2.1.5";
-  src = fetchurl {
-    url = "http://megastep.org/makeself/makeself.run";
-    sha256 = "0khs19xpid4ng0igrjyz3vsi6a5xyixrrrhgdxpdhd2wnf5nc9w2";
+  name = "makeself-2.2.0";
+  src = fetchgit {
+    url = "https://github.com/megastep/makeself.git";
+    rev = "b836b9281ae99abe1865608b065551da56c80719";
+    sha256 = "f7c97f0f8ad8128f2f1b54383319f2cc44cbb05b60ced222784debdf326f23ad";
   };
-  unpackPhase = "sh ${src}";
   installPhase = ''
-    cd ${name}
     mkdir -p $out/{bin,share/{${name},man/man1}}
-    mv makeself.lsm README $out/share/${name}
+    mv makeself.lsm README.md $out/share/${name}
     mv makeself.sh $out/bin/makeself
     mv makeself.1  $out/share/man/man1/
     mv makeself-header.sh $out/share/${name}
     sed -e 's|HEADER=`dirname $0`/makeself-header.sh|HEADER=`dirname $0`/../share/${name}/makeself-header.sh|' -i $out/bin/makeself
   '';
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://megastep.org/makeself;
     description = "Utility to create self-extracting packages";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.wmertens ];
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/misc/merkaartor/default.nix b/pkgs/applications/misc/merkaartor/default.nix
index 6d10cbb8c21f..932e5bb48300 100644
--- a/pkgs/applications/misc/merkaartor/default.nix
+++ b/pkgs/applications/misc/merkaartor/default.nix
@@ -1,22 +1,22 @@
-{stdenv, fetchurl, qt4, boost}:
+{stdenv, fetchurl, qt4, boost, proj, gdal}:
 
 stdenv.mkDerivation rec {
-  name = "merkaartor-0.17.2";
+  name = "merkaartor-0.18.1";
   src = fetchurl {
-    url = "http://merkaartor.be/attachments/download/253/merkaartor-0.17.2.tar.bz2";
-    sha256 = "0akhp9czzn39132mgj9h38nlh4l9ibzn3vh93bfs685zxyn4yps2";
+    url = "http://merkaartor.be/attachments/download/301/merkaartor-0.18.1.tar.bz2";
+    sha256 = "17qk45pmlxqigla1915dvn9pp91y85d2bkcaap4g3m8mk1crcsix";
   };
 
   configurePhase = ''
     qmake -makefile PREFIX=$out
   '';
 
-  buildInputs = [ qt4 boost ];
+  buildInputs = [ qt4 boost proj gdal ];
 
   meta = {
     description = "An openstreetmap editor";
     homepage = http://merkaartor.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric urkud];
     inherit (qt4.meta) platforms;
   };
diff --git a/pkgs/applications/misc/mupdf/default.nix b/pkgs/applications/misc/mupdf/default.nix
index 220309a8e221..aa7c14634d13 100644
--- a/pkgs/applications/misc/mupdf/default.nix
+++ b/pkgs/applications/misc/mupdf/default.nix
@@ -1,21 +1,54 @@
-{ stdenv, fetchurl, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg
+{ stdenv, fetchurl, fetchpatch, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg
 , libX11, libXext }:
 stdenv.mkDerivation rec {
-  name = "mupdf-1.3";
+  version = "1.5";
+  name = "mupdf-${version}";
 
   src = fetchurl {
     url = "http://mupdf.com/download/archive/${name}-source.tar.gz";
-    sha256 = "0y247nka5gkr1ajn47jrlp5rcnf6h4ff7dfsprma3h4wxqdv7a5b";
+    sha256 = "0sl47zqf4c9fhs4h5zg046vixjmwgy4vhljhr5g4md733nash7z4";
   };
 
   buildInputs = [ pkgconfig zlib freetype libjpeg jbig2dec openjpeg libX11 libXext ];
 
+  enableParallelBuilding = true;
+
+  my_soname = "libmupdf.so.1.3";
+  my_soname_js_none = "libmupdf-js-none.so.1.3";
   preBuild = ''
-    export makeFlags="prefix=$out"
+    export makeFlags="prefix=$out build=release XCFLAGS=-fpic"
     export NIX_CFLAGS_COMPILE=" $NIX_CFLAGS_COMPILE -I$(echo ${openjpeg}/include/openjpeg-*) "
+
+    # Copied from Gentoo ebuild
+    rm -rf thirdparty
+    sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
+     -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
+     -e "/^MUPDF_LIB :=/s:=.*:= \$(OUT)/${my_soname}:" \
+     -e "\$a\$(MUPDF_JS_NONE_LIB):" \
+     -e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
+     -e "/^MUPDF_JS_NONE_LIB :=/s:=.*:= \$(OUT)/${my_soname_js_none}:" \
+     -i Makefile
+
+    sed -e "s/libopenjpeg1/libopenjp2/" -i Makerules
   '';
 
   postInstall = ''
+    ln -s ${my_soname} $out/lib/libmupdf.so
+
+    mkdir -p "$out/lib/pkgconfig"
+    cat >"$out/lib/pkgconfig/mupdf.pc" <<EOF
+    prefix=$out
+    libdir=$out/lib
+    includedir=$out/include
+
+    Name: mupdf
+    Description: Library for rendering PDF documents
+    Requires: freetype2 libopenjp2 libcrypto
+    Version: 1.3
+    Libs: -L$out/lib -lmupdf
+    Cflags: -I$out/include
+    EOF
+
     mkdir -p $out/share/applications
     cat > $out/share/applications/mupdf.desktop <<EOF
     [Desktop Entry]
@@ -30,9 +63,11 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://mupdf.com/;
+    repositories.git = git://git.ghostscript.com/mupdf.git;
     description = "Lightweight PDF viewer and toolkit written in portable C";
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = with stdenv.lib.maintainers; [ viric ];
     platforms = with stdenv.lib.platforms; linux;
+    inherit version;
   };
 }
diff --git a/pkgs/applications/misc/mupdf/default.upstream b/pkgs/applications/misc/mupdf/default.upstream
new file mode 100644
index 000000000000..07cafdb0c2a4
--- /dev/null
+++ b/pkgs/applications/misc/mupdf/default.upstream
@@ -0,0 +1,7 @@
+url http://mupdf.com/downloads/archive/
+do_overwrite(){
+  ensure_hash
+  ensure_version
+  set_var_value version $CURRENT_VERSION
+  set_var_value sha256 $CURRENT_HASH
+}
diff --git a/pkgs/applications/misc/navipowm/default.nix b/pkgs/applications/misc/navipowm/default.nix
index a526774d48ec..6d990831a369 100644
--- a/pkgs/applications/misc/navipowm/default.nix
+++ b/pkgs/applications/misc/navipowm/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://navipowm.sourceforge.net/;
     description = "Car navigation system";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [ viric ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/navit/default.nix b/pkgs/applications/misc/navit/default.nix
index ef1e777f55fd..1be39c666421 100644
--- a/pkgs/applications/misc/navit/default.nix
+++ b/pkgs/applications/misc/navit/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.navit-project.org/;
     description = "Car navigation system with routing engine using OSM maps";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [ viric ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/nc-indicators/default.nix b/pkgs/applications/misc/nc-indicators/default.nix
new file mode 100644
index 000000000000..3198333cce25
--- /dev/null
+++ b/pkgs/applications/misc/nc-indicators/default.nix
@@ -0,0 +1,18 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, attoparsec, gtk, hflags, lens, pipes, stm }:
+
+cabal.mkDerivation (self: {
+  pname = "nc-indicators";
+  version = "0.3";
+  sha256 = "0w5nddirsib9vz96dpan9bgdg1mag9gaz7w7ix51l44ls9r8yn3m";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ attoparsec gtk hflags lens pipes stm ];
+  meta = {
+    homepage = "https://github.com/nilcons/nc-indicators";
+    description = "CPU load and memory usage indicators for i3bar";
+    license = self.stdenv.lib.licenses.asl20;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/applications/misc/nut/default.nix b/pkgs/applications/misc/nut/default.nix
index 078ea7fcbd8f..3e972f672cc2 100644
--- a/pkgs/applications/misc/nut/default.nix
+++ b/pkgs/applications/misc/nut/default.nix
@@ -1,17 +1,17 @@
 { stdenv, fetchurl, pkgconfig, neon, libusb, openssl, udev, avahi, freeipmi
-, libtool }:
+, libtool, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "nut-2.6.5";
+  name = "nut-2.7.1";
 
   src = fetchurl {
-    url = "http://www.networkupstools.org/source/2.6/${name}.tar.gz";
-    sha256 = "0gxrzsblx0jc4g9w0903ybwqbv1d79vq5hnks403fvnay4fgg3b1";
+    url = "http://www.networkupstools.org/source/2.7/${name}.tar.gz";
+    sha256 = "1667n9h8jcz7k6h24fn615khqahlq5z22zxs4s0q046rsqxdg9ki";
   };
 
   buildInputs = [ neon libusb openssl udev avahi freeipmi libtool ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig makeWrapper ];
 
   configureFlags =
     [ "--with-all"
@@ -20,11 +20,18 @@ stdenv.mkDerivation rec {
       "--without-powerman" # Until we have it ...
       "--without-cgi"
       "--without-hal"
-      "--with-systemdsystemunitdir=$(out)/etc/systemd/systemd"
+      "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+      "--with-udev-dir=$(out)/etc/udev"
     ];
 
   enableParallelBuilding = true;
 
+  
+  postInstall = ''
+    wrapProgram $out/bin/nut-scanner --prefix LD_LIBRARY_PATH : \
+      "$out/lib:${neon}/lib:${libusb}/lib:${avahi}/lib:${freeipmi}/lib"
+  '';
+
   meta = {
     description = "Network UPS Tools";
     longDescription = ''
@@ -33,6 +40,7 @@ stdenv.mkDerivation rec {
       It uses a layered approach to connect all of the parts.
     '';
     homepage = http://www.networkupstools.org/;
+    repositories.git = https://github.com/networkupstools/nut.git;
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [ pierron ];
     priority = 10;
diff --git a/pkgs/applications/misc/ocropus/default.nix b/pkgs/applications/misc/ocropus/default.nix
new file mode 100644
index 000000000000..240a975e611e
--- /dev/null
+++ b/pkgs/applications/misc/ocropus/default.nix
@@ -0,0 +1,69 @@
+{ stdenv, fetchhg, fetchurl, pythonPackages, curl }:
+
+let
+  getmodel = name: sha256: {
+    src = fetchurl {
+      url = "http://iupr1.cs.uni-kl.de/~tmb/ocropus-models/${name}";
+      inherit sha256;
+    };
+    inherit name;
+  };
+
+  models = [
+    (getmodel "en-default.pyrnn.gz"
+      "1xyi3k3p81mfw0491gb1haisazfyi2i18f1wjs1m34ak39qfqjdp")
+    (getmodel "en-uw3-linerel-2.cmodel.gz"
+      "0zdw0db2znxxd4h7aa09506nkbxd1cfqacxzyzlx42bjn951wcpw")
+    (getmodel "en-mixed-3.ngraphs.gz"
+      "1fqw7pxmjwapirp9xv3b0gn9pk53q4740qn5dw4wxfxk9dpp9lr4")
+    (getmodel "en-space.model.gz"
+      "0w5hnjm6rz5iiw1p2yixj147ifq11s9jfzrxk4v4xxmcyn365096")
+    (getmodel "en-mixed.lineest.gz"
+      "0skrziksn3zb3g8588y7jd10pnl2pzrby0119ac0awapzzg9vkvw")
+    (getmodel "uw3unlv.pyrnn.gz"
+      "0g08q9cjxxx3mg1jn4654nalxr56y2jq1h33pwxrj5lrckr7grb9")
+    (getmodel "en-uw3unlv-perchar.cmodel.gz"
+      "1izvm0wkb2vh58hjp59fw97drv17zdzrw6mz3aanrg5ax6fnfadk")
+    (getmodel "gradient.lineest.gz"
+      "1bw9hj9byjxi31rjh2xiysnx8c72jz0npxa54xgjwsqg7ihl8jzw")
+    (getmodel "en-mixed-round1.lineest.gz"
+      "1fjkygyrg4ng7kx4iqa4yhgvmw1zq72p3q5p0hcb2xxhqc04vx7c")
+    (getmodel "frakant.pyrnn.gz"
+      "0i1k95f2a8qlc6m7qq11pmjfcimyrjsfjvv20nrs2ygp9pwskmxp")
+    (getmodel "fraktur.pyrnn.gz"
+      "1wlwvxn91ilgmlri1hj81arl3mbzxc24ycdnkf5icq4hdi4c6y8b")
+  ];
+in
+pythonPackages.buildPythonPackage rec {
+  name = "ocropus-${version}";
+  version = "20130905";
+
+  src = fetchhg {
+    url = "https://code.google.com/p/ocropus.ocropy";
+    rev = "a6e0fbd820ce";
+    sha256 = "1s0v0gd6psfjp6lghwl2dj49h18mgf2n2z8hqzw8430nzhglnlvr";
+  };
+
+  patches = [ ./display.patch ];
+
+  propagatedBuildInputs = with pythonPackages; [ curl numpy scipy pillow
+    matplotlib beautifulsoup4 pygtk lxml ];
+
+  enableParallelBuilding = true;
+  
+  preConfigure = with stdenv.lib; ''
+    ${concatStrings (map (x: "ln -s ${x.src} models/${x.name};") models)}
+
+    sed -i 's|/usr/local|'$out'|' ocrolib/common.py
+    sed -i 's|/usr/local|'$out'|' ocrolib/default.py
+    ${pythonPackages.python}/bin/${pythonPackages.python.executable} setup.py download_models
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Open source document analysis and OCR system";
+    license = licenses.asl20;
+    homepage = https://code.google.com/p/ocropus/;
+    maintainers = with maintainers; [ iElectric viric ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/ocropus/display.patch b/pkgs/applications/misc/ocropus/display.patch
new file mode 100644
index 000000000000..2b4e63652b7b
--- /dev/null
+++ b/pkgs/applications/misc/ocropus/display.patch
@@ -0,0 +1,17 @@
+http://code.google.com/p/ocropus/issues/detail?id=365
+
+diff --git a/setup.py b/setup.py
+index c6ade25..a2ad6bf 100644
+--- a/setup.py
++++ b/setup.py
+@@ -8,7 +8,10 @@ assert sys.version_info[0]==2 and sys.version_info[1]>=7,\
+ from distutils.core import setup, Extension, Command
+ from distutils.command.install_data import install_data
+ 
++import matplotlib
++matplotlib.use('Agg')
+ from ocrolib import default
++
+ modeldir = "models/"
+ modelfiles = default.installable
+ modelprefix = "http://iupr1.cs.uni-kl.de/~tmb/ocropus-models/"
diff --git a/pkgs/applications/misc/openjump/default.nix b/pkgs/applications/misc/openjump/default.nix
index 74f657ee02a7..8a68bd7ccfb9 100644
--- a/pkgs/applications/misc/openjump/default.nix
+++ b/pkgs/applications/misc/openjump/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
   meta = {
     description = "open source Geographic Information System (GIS) written in the Java programming language";
     homepage = http://www.openjump.org/index.html;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [stdenv.lib.maintainers.marcweber];
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/applications/misc/pcmanfm/default.nix b/pkgs/applications/misc/pcmanfm/default.nix
new file mode 100644
index 000000000000..f71800979619
--- /dev/null
+++ b/pkgs/applications/misc/pcmanfm/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, glib, gtk, intltool, libfm, libX11, pango, pkgconfig }:
+
+stdenv.mkDerivation {
+  name = "pcmanfm-1.2.0";
+  src = fetchurl {
+    url = "mirror://sourceforge/pcmanfm/pcmanfm-1.2.0.tar.xz";
+    sha256 = "1cmskj7dpjgrrn89z7cc1h1nsmd6qq3bakf207ldrhrxxv3fxl2j";
+  };
+
+  buildInputs = [ glib gtk intltool libfm libX11 pango pkgconfig ];
+
+  meta = with stdenv.lib; {
+    homepage = "http://blog.lxde.org/?cat=28/";
+    license = licenses.gpl2Plus;
+    description = "File manager with GTK+ interface";
+    maintainers = [ maintainers.ttuegel ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/pgadmin/default.nix b/pkgs/applications/misc/pgadmin/default.nix
index aac15789a2db..f26326f4d4e4 100644
--- a/pkgs/applications/misc/pgadmin/default.nix
+++ b/pkgs/applications/misc/pgadmin/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "pgadmin3-${version}";
-  version = "1.16.1";
+  version = "1.18.1";
 
   src = fetchurl {
     url = "http://ftp.postgresql.org/pub/pgadmin3/release/v${version}/src/pgadmin3-${version}.tar.gz";
-    sha256 = "13n2nyjnbmjbz9n0xp6627n3pavkqfp4n45l1mnqxhjdq8yj9fnl";
+    sha256 = "1h6bqslw53q44vy7z1q7wmxkgqdzxacfs8pfm2fxm8vcd8lkxb17";
   };
 
   buildInputs = [ postgresql wxGTK libxml2 libxslt openssl ];
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     description = "PostgreSQL administration GUI tool";
     homepage = http://www.pgadmin.org;
     license = licenses.gpl2;
-    maintainers = [ maintainers.iElectric ];
+    maintainers = with maintainers; [ iElectric wmertens ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/applications/misc/pitz/default.nix b/pkgs/applications/misc/pitz/default.nix
index 355ea9b2033d..e4f097469a49 100644
--- a/pkgs/applications/misc/pitz/default.nix
+++ b/pkgs/applications/misc/pitz/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, buildPythonPackage, tempita, jinja2, pyyaml, clepy, mock
-, nose, decorator, docutils }:
+, nose, decorator, docutils
+}:
 
 # TODO: pitz has a pitz-shell utility that depends on ipython, but it just
 # errors out and dies (it probably depends on an old ipython version):
@@ -28,6 +29,6 @@ buildPythonPackage rec {
     license = licenses.bsd3;
     homepage = http://pitz.tplus1.com/;
     platforms = platforms.linux;
-    maintainers = [maintainers.bjornfor];
+    maintainers = [ maintainers.bjornfor ];
   };
 }
diff --git a/pkgs/applications/misc/posterazor/default.nix b/pkgs/applications/misc/posterazor/default.nix
new file mode 100644
index 000000000000..0cad2fbd2cd3
--- /dev/null
+++ b/pkgs/applications/misc/posterazor/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, cmake, unzip, pkgconfig, libXpm, fltk13, freeimage }:
+
+stdenv.mkDerivation rec {
+  name = "posterazor-1.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/posterazor/1.5/PosteRazor-1.5-Source.zip";
+    sha256 = "0xy313d2j57s4wy2y3hjapbjr5zfaki0lhkfz6nw2p9gylcmwmjy";
+  };
+
+  buildInputs = [ cmake unzip pkgconfig libXpm fltk13 freeimage ];
+
+  unpackPhase = ''
+    unzip $src -d posterazor
+    cd posterazor/src
+  '';
+
+  # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667328
+  patchPhase = ''
+    sed "s/\(#define CASESENSITIVESTRCMP strcasecmp\)/#include <unistd.h>\n\1/" -i FlPosteRazorDialog.cpp
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp PosteRazor $out/bin
+  '';
+
+  meta = {
+    homepage = "http://posterazor.sourceforge.net/";
+    description = "The PosteRazor cuts a raster image into pieces which can afterwards be printed out and assembled to a poster";
+    maintainers = [ stdenv.lib.maintainers.madjar ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/misc/printrun/default.nix b/pkgs/applications/misc/printrun/default.nix
new file mode 100644
index 000000000000..dc258d653280
--- /dev/null
+++ b/pkgs/applications/misc/printrun/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, python27Packages, fetchgit }:
+let
+  py = python27Packages;
+in
+py.buildPythonPackage rec {
+  name = "printrun";
+
+  src = fetchgit {
+    url = "https://github.com/kliment/Printrun";
+    rev = "0a7f2335d0c02c3cc283200867b41f8b337b1387";
+    sha256 = "1zvh5ih89isv51sraljm29z9k00srrdnklwkyp27ymxzlbcwq6gv";
+  };
+
+  propagatedBuildInputs = [ py.wxPython py.pyserial py.dbus py.psutil ];
+
+  doCheck = false;
+
+  postPatch = ''
+    sed -i -r "s|/usr(/local)?/share/|$out/share/|g" printrun/utils.py
+    sed -i "s|distutils.core|setuptools|" setup.py
+    sed -i "s|distutils.command.install |setuptools.command.install |" setup.py
+  '';
+
+  postInstall = ''
+    for f in $out/share/applications/*.desktop; do
+      sed -i -e "s|/usr/|$out/|g" "$f"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software";
+    homepage = https://github.com/kliment/Printrun;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/pstree/default.nix b/pkgs/applications/misc/pstree/default.nix
index 0d61d3d74cfb..d4ffe2a4afd7 100644
--- a/pkgs/applications/misc/pstree/default.nix
+++ b/pkgs/applications/misc/pstree/default.nix
@@ -16,5 +16,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Show the set of running processes as a tree";
     license = "GPL";
+    maintainers = stdenv.lib.maintainers.mornfall;
   };
 }
diff --git a/pkgs/applications/misc/qgis/default.nix b/pkgs/applications/misc/qgis/default.nix
index d6711c82968e..cc26a74802b4 100644
--- a/pkgs/applications/misc/qgis/default.nix
+++ b/pkgs/applications/misc/qgis/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "User friendly Open Source Geographic Information System";
     homepage = http://www.qgis.org;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [viric];
   };
diff --git a/pkgs/applications/misc/qtbitcointrader/default.nix b/pkgs/applications/misc/qtbitcointrader/default.nix
new file mode 100644
index 000000000000..38606d798731
--- /dev/null
+++ b/pkgs/applications/misc/qtbitcointrader/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, qt4 }:
+
+let
+  version = "1.07.98";
+in
+stdenv.mkDerivation {
+  name = "qtbitcointrader-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/bitcointrader/SRC/QtBitcoinTrader-${version}.tar.gz";
+    sha256 = "1irz17q71fx64dfkmgajlyva7d1wifv4bxgb2iwz7d69rvhzaqzx";
+  };
+
+  buildInputs = [ qt4 ];
+
+  postUnpack = "sourceRoot=\${sourceRoot}/src";
+
+  configurePhase = ''
+    qmake \
+      PREFIX=$out \
+      DESKTOPDIR=$out/share/applications \
+      ICONDIR=$out/share/pixmaps \
+        QtBitcoinTrader_Desktop.pro
+  '';
+
+  meta = {
+    description = "Secure bitcoin trading client";
+    homepage = http://qtopentrader.com;
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.linux;  # arbitrary choice
+    maintainers = [ stdenv.lib.maintainers.emery ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/misc/ranger/default.nix b/pkgs/applications/misc/ranger/default.nix
new file mode 100644
index 000000000000..5f75c05a68f3
--- /dev/null
+++ b/pkgs/applications/misc/ranger/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, buildPythonPackage, python, fetchurl }:
+
+buildPythonPackage {
+  name = "ranger-1.6.1";
+
+  meta = {
+    description = "File manager with minimalistic curses interface";
+    homepage = "http://ranger.nongnu.org/";
+    license = stdenv.lib.licenses.gpl3;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ iyzsong ];
+  };
+
+  src = fetchurl {
+    url = "http://ranger.nongnu.org/ranger-1.6.1.tar.gz";
+    sha256 = "0pnvfwk2a1p35246fihm3fsr1m7r2njirbxm28ba276psajk1cnc";
+  };
+
+  doCheck = false;
+
+  propagatedBuildInputs = with python.modules; [ curses ];
+}
diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix
index 3bed6e1a2d76..abf55aa22b97 100644
--- a/pkgs/applications/misc/redshift/default.nix
+++ b/pkgs/applications/misc/redshift/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     wrapProgram "$out/bin/redshift-gtk" --prefix PYTHONPATH : $PYTHONPATH:${pygtk}/lib/${python.libPrefix}/site-packages/gtk-2.0:${pyxdg}/lib/${python.libPrefix}/site-packages/pyxdg:$out/lib/${python.libPrefix}/site-packages
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "changes the color temperature of your screen gradually";
     longDescription = ''
       The color temperature is set according to the position of the
@@ -37,7 +37,9 @@ stdenv.mkDerivation rec {
       temperature transitions smoothly from night to daytime
       temperature to allow your eyes to slowly adapt.
       '';
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     homepage = "http://jonls.dk/redshift";
+    platforms = platforms.linux;
+    maintainers = maintainers.mornfall;
   }; 
 }
diff --git a/pkgs/applications/misc/robomongo/default.nix b/pkgs/applications/misc/robomongo/default.nix
new file mode 100644
index 000000000000..ab8a803b7cb4
--- /dev/null
+++ b/pkgs/applications/misc/robomongo/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, qt5, openssl, boost, cmake, scons, python, pcre, bzip2 }:
+
+stdenv.mkDerivation {
+  name = "robomongo-0.8.3";
+
+  src = fetchurl {
+    url = https://github.com/paralect/robomongo/archive/v0.8.3.tar.gz;
+    sha256 = "1x8vpmqvjscjcw30hf0i5vsrg3rldlwx6z52i1hymlck2jfzkank";
+  };
+
+  patches = [ ./robomongo.patch ];
+  
+  NIX_CFLAGS_COMPILE = "-fno-stack-protector";
+
+  buildInputs = [ cmake boost scons qt5 openssl python pcre bzip2 ];
+
+  meta = {
+    homepage = "http://robomongo.org/";
+    description = "Query GUI for mongodb";
+    platforms = stdenv.lib.platforms.unix;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.amorsillo ];
+    broken = true;
+  };
+}
diff --git a/pkgs/applications/misc/robomongo/robomongo.patch b/pkgs/applications/misc/robomongo/robomongo.patch
new file mode 100644
index 000000000000..2305ca732eae
--- /dev/null
+++ b/pkgs/applications/misc/robomongo/robomongo.patch
@@ -0,0 +1,48 @@
+Remove check for QT_NO_STYLE_GTK to avoid building with QCleanlooksStyle which results in error due to missing QCleanlooksStyle
+Ensure environment is preserved for scons build -- scons clears the env but we want to keep the nix build environment
+Fix typo in cmakelists
+diff -rupN robomongo-0.8.3/CMakeLists.txt robomongo-0.8.3-patched/CMakeLists.txt
+--- robomongo-0.8.3/CMakeLists.txt	2013-10-01 10:55:00.000000000 -0400
++++ robomongo-0.8.3-patched/CMakeLists.txt	2013-12-06 12:22:06.070659856 -0500
+@@ -133,7 +133,7 @@ ELSE()
+ ENDIF()
+ 
+ ##################################DEFAULT VALUES##########################################
+-IF(NOT CMAKE_INSTALL_PREFIX})
++IF(NOT CMAKE_INSTALL_PREFIX)
+     SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install")
+ ENDIF()
+ 
+diff -rupN robomongo-0.8.3/src/robomongo/gui/AppStyle.h robomongo-0.8.3-patched/src/robomongo/gui/AppStyle.h
+--- robomongo-0.8.3/src/robomongo/gui/AppStyle.h	2013-10-01 10:55:00.000000000 -0400
++++ robomongo-0.8.3-patched/src/robomongo/gui/AppStyle.h	2013-12-06 12:20:57.417297186 -0500
+@@ -8,13 +8,8 @@
+     #include <QProxyStyle>
+     typedef QProxyStyle OsStyle;
+ #elif defined OS_LINUX
+-    #if !defined(QT_NO_STYLE_GTK)
+-        #include <QProxyStyle>
+-        typedef QProxyStyle OsStyle;
+-    #else
+-        #include <QCleanlooksStyle>
+-        typedef QCleanlooksStyle OsStyle;
+-    #endif
++    #include <QProxyStyle>
++    typedef QProxyStyle OsStyle;
+ #endif
+ 
+ namespace Robomongo
+
+diff -rupN robomongo-0.8.3/src/third-party/mongodb/SConstruct robomongo-0.8.3-patched/src/third-party/mongodb/SConstruct
+--- robomongo-0.8.3/src/third-party/mongodb/SConstruct	2013-10-01 10:55:00.000000000 -0400
++++ robomongo-0.8.3-patched/src/third-party/mongodb/SConstruct	2013-12-06 12:21:45.705255731 -0500
+@@ -283,7 +283,8 @@ usePCH = has_option( "usePCH" )
+ 
+ justClientLib = (COMMAND_LINE_TARGETS == ['mongoclient'])
+ 
+-env = Environment( BUILD_DIR=variantDir,
++env = Environment( ENV=os.environ,
++                   BUILD_DIR=variantDir,
+                    CLIENT_ARCHIVE='${CLIENT_DIST_BASENAME}${DIST_ARCHIVE_SUFFIX}',
+                    CLIENT_DIST_BASENAME=get_option('client-dist-basename'),
+                    CLIENT_LICENSE='#distsrc/client/LICENSE.txt',
diff --git a/pkgs/applications/misc/rtl-sdr/default.nix b/pkgs/applications/misc/rtl-sdr/default.nix
new file mode 100644
index 000000000000..e6e762493883
--- /dev/null
+++ b/pkgs/applications/misc/rtl-sdr/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchgit, cmake, pkgconfig, libusb1 }:
+
+stdenv.mkDerivation rec {
+  name = "rtl-sdr-${version}";
+  version = "0.5.3";
+
+  src = fetchgit {
+    url = "git://git.osmocom.org/rtl-sdr.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "00r5d08r12zzkd0xggd7l7p4r2278rzdhqdaihwjlajmr9qd3hs1";
+  };
+
+  buildInputs = [ cmake pkgconfig libusb1 ];
+
+  # Building with -DINSTALL_UDEV_RULES=ON tries to install udev rules to
+  # /etc/udev/rules.d/, and there is no option to install elsewhere. So install
+  # rules manually.
+  postInstall = ''
+    mkdir -p "$out/etc/udev/rules.d/"
+    cp ../rtl-sdr.rules "$out/etc/udev/rules.d/99-rtl-sdr.rules"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Turns your Realtek RTL2832 based DVB dongle into a SDR receiver";
+    homepage = http://sdr.osmocom.org/trac/wiki/rtl-sdr;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/misc/rxvt_unicode/default.nix b/pkgs/applications/misc/rxvt_unicode/default.nix
index c05dd028eb34..7392123673ad 100644
--- a/pkgs/applications/misc/rxvt_unicode/default.nix
+++ b/pkgs/applications/misc/rxvt_unicode/default.nix
@@ -1,19 +1,20 @@
 { stdenv, fetchurl, perlSupport, libX11, libXt, libXft, ncurses, perl,
-  fontconfig, freetype, pkgconfig, libXrender, gdkPixbufSupport, gdk_pixbuf }:
+  fontconfig, freetype, pkgconfig, libXrender, gdkPixbufSupport, gdk_pixbuf,
+  unicode3Support }:
 
 let
   name = "rxvt-unicode";
-  version = "9.16";
+  version = "9.20";
   n = "${name}-${version}";
 in
 
 stdenv.mkDerivation (rec {
 
-  name = "${n}${if perlSupport then "-with-perl" else ""}";
+  name = "${n}${if perlSupport then "-with-perl" else ""}${if unicode3Support then "-with-unicode3" else ""}";
 
   src = fetchurl {
     url = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${version}.tar.bz2";
-    sha256 = "0x28wyslqnhn2q11y4hncqdl07wgh5ypywl92fq0jxycr36ibfvn";
+    sha256 = "e73e13fe64b59fd3c8e6e20c00f149d388741f141b8155e4700d3ed40aa94b4e";
   };
 
   buildInputs =
@@ -24,10 +25,15 @@ stdenv.mkDerivation (rec {
 
   outputs = [ "out" "terminfo" ];
 
+  patches = [
+    ./rxvt-unicode-9.06-font-width.patch
+    ./rxvt-unicode-256-color-resources.patch
+  ];
+
   preConfigure =
     ''
       mkdir -p $terminfo/share/terminfo
-      configureFlags="--with-terminfo=$terminfo/share/terminfo --enable-256-color ${if perlSupport then "--enable-perl" else "--disable-perl"}";
+      configureFlags="--with-terminfo=$terminfo/share/terminfo --enable-256-color ${if perlSupport then "--enable-perl" else "--disable-perl"} ${if unicode3Support then "--enable-unicode3" else "--disable-unicode3"}";
       export TERMINFO=$terminfo/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 "
@@ -38,15 +44,9 @@ stdenv.mkDerivation (rec {
       ln -s $out/{lib/urxvt,lib/perl5/site_perl}
     '';
 
-  # we link the separate terminfo output to the main output
-  # as I don't think there's a usecase for wanting urxvt without its terminfo files
-  # and we don't want users to install them separately
-  postInstall = ''
-    ln -s $terminfo/share/terminfo $out/share
-  '';
-
   meta = {
     description = "A clone of the well-known terminal emulator rxvt";
     homepage = "http://software.schmorp.de/pkg/rxvt-unicode.html";
+    maintainers = stdenv.lib.maintainers.mornfall;
   };
 })
diff --git a/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch b/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch
new file mode 100644
index 000000000000..c8d2acfbdc51
--- /dev/null
+++ b/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-256-color-resources.patch
@@ -0,0 +1,255 @@
+diff --git a/src/xdefaults.C b/src/xdefaults.C
+index 23b6822..382f3b1 100644
+--- a/src/xdefaults.C
++++ b/src/xdefaults.C
+@@ -155,6 +155,250 @@ optList[] = {
+               RSTRG (Rs_color + minCOLOR + 5, "color5", "color"),
+               RSTRG (Rs_color + minCOLOR + 6, "color6", "color"),
+               RSTRG (Rs_color + minCOLOR + 7, "color7", "color"),
++              // 88 xterm colors
++              RSTRG (Rs_color + minCOLOR + 16, "color16", "color"),
++              RSTRG (Rs_color + minCOLOR + 17, "color17", "color"),
++              RSTRG (Rs_color + minCOLOR + 18, "color18", "color"),
++              RSTRG (Rs_color + minCOLOR + 19, "color19", "color"),
++              RSTRG (Rs_color + minCOLOR + 20, "color20", "color"),
++              RSTRG (Rs_color + minCOLOR + 21, "color21", "color"),
++              RSTRG (Rs_color + minCOLOR + 22, "color22", "color"),
++              RSTRG (Rs_color + minCOLOR + 23, "color23", "color"),
++              RSTRG (Rs_color + minCOLOR + 24, "color24", "color"),
++              RSTRG (Rs_color + minCOLOR + 25, "color25", "color"),
++              RSTRG (Rs_color + minCOLOR + 26, "color26", "color"),
++              RSTRG (Rs_color + minCOLOR + 27, "color27", "color"),
++              RSTRG (Rs_color + minCOLOR + 28, "color28", "color"),
++              RSTRG (Rs_color + minCOLOR + 29, "color29", "color"),
++              RSTRG (Rs_color + minCOLOR + 30, "color30", "color"),
++              RSTRG (Rs_color + minCOLOR + 31, "color31", "color"),
++              RSTRG (Rs_color + minCOLOR + 32, "color32", "color"),
++              RSTRG (Rs_color + minCOLOR + 33, "color33", "color"),
++              RSTRG (Rs_color + minCOLOR + 34, "color34", "color"),
++              RSTRG (Rs_color + minCOLOR + 35, "color35", "color"),
++              RSTRG (Rs_color + minCOLOR + 36, "color36", "color"),
++              RSTRG (Rs_color + minCOLOR + 37, "color37", "color"),
++              RSTRG (Rs_color + minCOLOR + 38, "color38", "color"),
++              RSTRG (Rs_color + minCOLOR + 39, "color39", "color"),
++              RSTRG (Rs_color + minCOLOR + 40, "color40", "color"),
++              RSTRG (Rs_color + minCOLOR + 41, "color41", "color"),
++              RSTRG (Rs_color + minCOLOR + 42, "color42", "color"),
++              RSTRG (Rs_color + minCOLOR + 43, "color43", "color"),
++              RSTRG (Rs_color + minCOLOR + 44, "color44", "color"),
++              RSTRG (Rs_color + minCOLOR + 45, "color45", "color"),
++              RSTRG (Rs_color + minCOLOR + 46, "color46", "color"),
++              RSTRG (Rs_color + minCOLOR + 47, "color47", "color"),
++              RSTRG (Rs_color + minCOLOR + 48, "color48", "color"),
++              RSTRG (Rs_color + minCOLOR + 49, "color49", "color"),
++              RSTRG (Rs_color + minCOLOR + 50, "color50", "color"),
++              RSTRG (Rs_color + minCOLOR + 51, "color51", "color"),
++              RSTRG (Rs_color + minCOLOR + 52, "color52", "color"),
++              RSTRG (Rs_color + minCOLOR + 53, "color53", "color"),
++              RSTRG (Rs_color + minCOLOR + 54, "color54", "color"),
++              RSTRG (Rs_color + minCOLOR + 55, "color55", "color"),
++              RSTRG (Rs_color + minCOLOR + 56, "color56", "color"),
++              RSTRG (Rs_color + minCOLOR + 57, "color57", "color"),
++              RSTRG (Rs_color + minCOLOR + 58, "color58", "color"),
++              RSTRG (Rs_color + minCOLOR + 59, "color59", "color"),
++              RSTRG (Rs_color + minCOLOR + 60, "color60", "color"),
++              RSTRG (Rs_color + minCOLOR + 61, "color61", "color"),
++              RSTRG (Rs_color + minCOLOR + 62, "color62", "color"),
++              RSTRG (Rs_color + minCOLOR + 63, "color63", "color"),
++              RSTRG (Rs_color + minCOLOR + 64, "color64", "color"),
++              RSTRG (Rs_color + minCOLOR + 65, "color65", "color"),
++              RSTRG (Rs_color + minCOLOR + 66, "color66", "color"),
++              RSTRG (Rs_color + minCOLOR + 67, "color67", "color"),
++              RSTRG (Rs_color + minCOLOR + 68, "color68", "color"),
++              RSTRG (Rs_color + minCOLOR + 69, "color69", "color"),
++              RSTRG (Rs_color + minCOLOR + 70, "color70", "color"),
++              RSTRG (Rs_color + minCOLOR + 71, "color71", "color"),
++              RSTRG (Rs_color + minCOLOR + 72, "color72", "color"),
++              RSTRG (Rs_color + minCOLOR + 73, "color73", "color"),
++              RSTRG (Rs_color + minCOLOR + 74, "color74", "color"),
++              RSTRG (Rs_color + minCOLOR + 75, "color75", "color"),
++              RSTRG (Rs_color + minCOLOR + 76, "color76", "color"),
++              RSTRG (Rs_color + minCOLOR + 77, "color77", "color"),
++              RSTRG (Rs_color + minCOLOR + 78, "color78", "color"),
++              RSTRG (Rs_color + minCOLOR + 79, "color79", "color"),
++              RSTRG (Rs_color + minCOLOR + 80, "color80", "color"),
++              RSTRG (Rs_color + minCOLOR + 81, "color81", "color"),
++              RSTRG (Rs_color + minCOLOR + 82, "color82", "color"),
++              RSTRG (Rs_color + minCOLOR + 83, "color83", "color"),
++              RSTRG (Rs_color + minCOLOR + 84, "color84", "color"),
++              RSTRG (Rs_color + minCOLOR + 85, "color85", "color"),
++              RSTRG (Rs_color + minCOLOR + 86, "color86", "color"),
++              RSTRG (Rs_color + minCOLOR + 87, "color87", "color"),
++#if USE_256_COLORS
++              // 256 xterm colors
++              RSTRG (Rs_color + minCOLOR + 88, "color88", "color"),
++              RSTRG (Rs_color + minCOLOR + 89, "color89", "color"),
++              RSTRG (Rs_color + minCOLOR + 90, "color90", "color"),
++              RSTRG (Rs_color + minCOLOR + 91, "color91", "color"),
++              RSTRG (Rs_color + minCOLOR + 92, "color92", "color"),
++              RSTRG (Rs_color + minCOLOR + 93, "color93", "color"),
++              RSTRG (Rs_color + minCOLOR + 94, "color94", "color"),
++              RSTRG (Rs_color + minCOLOR + 95, "color95", "color"),
++              RSTRG (Rs_color + minCOLOR + 96, "color96", "color"),
++              RSTRG (Rs_color + minCOLOR + 97, "color97", "color"),
++              RSTRG (Rs_color + minCOLOR + 98, "color98", "color"),
++              RSTRG (Rs_color + minCOLOR + 99, "color99", "color"),
++              RSTRG (Rs_color + minCOLOR + 100, "color100", "color"),
++              RSTRG (Rs_color + minCOLOR + 101, "color101", "color"),
++              RSTRG (Rs_color + minCOLOR + 102, "color102", "color"),
++              RSTRG (Rs_color + minCOLOR + 103, "color103", "color"),
++              RSTRG (Rs_color + minCOLOR + 104, "color104", "color"),
++              RSTRG (Rs_color + minCOLOR + 105, "color105", "color"),
++              RSTRG (Rs_color + minCOLOR + 106, "color106", "color"),
++              RSTRG (Rs_color + minCOLOR + 107, "color107", "color"),
++              RSTRG (Rs_color + minCOLOR + 108, "color108", "color"),
++              RSTRG (Rs_color + minCOLOR + 109, "color109", "color"),
++              RSTRG (Rs_color + minCOLOR + 110, "color110", "color"),
++              RSTRG (Rs_color + minCOLOR + 111, "color111", "color"),
++              RSTRG (Rs_color + minCOLOR + 112, "color112", "color"),
++              RSTRG (Rs_color + minCOLOR + 113, "color113", "color"),
++              RSTRG (Rs_color + minCOLOR + 114, "color114", "color"),
++              RSTRG (Rs_color + minCOLOR + 115, "color115", "color"),
++              RSTRG (Rs_color + minCOLOR + 116, "color116", "color"),
++              RSTRG (Rs_color + minCOLOR + 117, "color117", "color"),
++              RSTRG (Rs_color + minCOLOR + 118, "color118", "color"),
++              RSTRG (Rs_color + minCOLOR + 119, "color119", "color"),
++              RSTRG (Rs_color + minCOLOR + 120, "color120", "color"),
++              RSTRG (Rs_color + minCOLOR + 121, "color121", "color"),
++              RSTRG (Rs_color + minCOLOR + 122, "color122", "color"),
++              RSTRG (Rs_color + minCOLOR + 123, "color123", "color"),
++              RSTRG (Rs_color + minCOLOR + 124, "color124", "color"),
++              RSTRG (Rs_color + minCOLOR + 125, "color125", "color"),
++              RSTRG (Rs_color + minCOLOR + 126, "color126", "color"),
++              RSTRG (Rs_color + minCOLOR + 127, "color127", "color"),
++              RSTRG (Rs_color + minCOLOR + 128, "color128", "color"),
++              RSTRG (Rs_color + minCOLOR + 129, "color129", "color"),
++              RSTRG (Rs_color + minCOLOR + 130, "color130", "color"),
++              RSTRG (Rs_color + minCOLOR + 131, "color131", "color"),
++              RSTRG (Rs_color + minCOLOR + 132, "color132", "color"),
++              RSTRG (Rs_color + minCOLOR + 133, "color133", "color"),
++              RSTRG (Rs_color + minCOLOR + 134, "color134", "color"),
++              RSTRG (Rs_color + minCOLOR + 135, "color135", "color"),
++              RSTRG (Rs_color + minCOLOR + 136, "color136", "color"),
++              RSTRG (Rs_color + minCOLOR + 137, "color137", "color"),
++              RSTRG (Rs_color + minCOLOR + 138, "color138", "color"),
++              RSTRG (Rs_color + minCOLOR + 139, "color139", "color"),
++              RSTRG (Rs_color + minCOLOR + 140, "color140", "color"),
++              RSTRG (Rs_color + minCOLOR + 141, "color141", "color"),
++              RSTRG (Rs_color + minCOLOR + 142, "color142", "color"),
++              RSTRG (Rs_color + minCOLOR + 143, "color143", "color"),
++              RSTRG (Rs_color + minCOLOR + 144, "color144", "color"),
++              RSTRG (Rs_color + minCOLOR + 145, "color145", "color"),
++              RSTRG (Rs_color + minCOLOR + 146, "color146", "color"),
++              RSTRG (Rs_color + minCOLOR + 147, "color147", "color"),
++              RSTRG (Rs_color + minCOLOR + 148, "color148", "color"),
++              RSTRG (Rs_color + minCOLOR + 149, "color149", "color"),
++              RSTRG (Rs_color + minCOLOR + 150, "color150", "color"),
++              RSTRG (Rs_color + minCOLOR + 151, "color151", "color"),
++              RSTRG (Rs_color + minCOLOR + 152, "color152", "color"),
++              RSTRG (Rs_color + minCOLOR + 153, "color153", "color"),
++              RSTRG (Rs_color + minCOLOR + 154, "color154", "color"),
++              RSTRG (Rs_color + minCOLOR + 155, "color155", "color"),
++              RSTRG (Rs_color + minCOLOR + 156, "color156", "color"),
++              RSTRG (Rs_color + minCOLOR + 157, "color157", "color"),
++              RSTRG (Rs_color + minCOLOR + 158, "color158", "color"),
++              RSTRG (Rs_color + minCOLOR + 159, "color159", "color"),
++              RSTRG (Rs_color + minCOLOR + 160, "color160", "color"),
++              RSTRG (Rs_color + minCOLOR + 161, "color161", "color"),
++              RSTRG (Rs_color + minCOLOR + 162, "color162", "color"),
++              RSTRG (Rs_color + minCOLOR + 163, "color163", "color"),
++              RSTRG (Rs_color + minCOLOR + 164, "color164", "color"),
++              RSTRG (Rs_color + minCOLOR + 165, "color165", "color"),
++              RSTRG (Rs_color + minCOLOR + 166, "color166", "color"),
++              RSTRG (Rs_color + minCOLOR + 167, "color167", "color"),
++              RSTRG (Rs_color + minCOLOR + 168, "color168", "color"),
++              RSTRG (Rs_color + minCOLOR + 169, "color169", "color"),
++              RSTRG (Rs_color + minCOLOR + 170, "color170", "color"),
++              RSTRG (Rs_color + minCOLOR + 171, "color171", "color"),
++              RSTRG (Rs_color + minCOLOR + 172, "color172", "color"),
++              RSTRG (Rs_color + minCOLOR + 173, "color173", "color"),
++              RSTRG (Rs_color + minCOLOR + 174, "color174", "color"),
++              RSTRG (Rs_color + minCOLOR + 175, "color175", "color"),
++              RSTRG (Rs_color + minCOLOR + 176, "color176", "color"),
++              RSTRG (Rs_color + minCOLOR + 177, "color177", "color"),
++              RSTRG (Rs_color + minCOLOR + 178, "color178", "color"),
++              RSTRG (Rs_color + minCOLOR + 179, "color179", "color"),
++              RSTRG (Rs_color + minCOLOR + 180, "color180", "color"),
++              RSTRG (Rs_color + minCOLOR + 181, "color181", "color"),
++              RSTRG (Rs_color + minCOLOR + 182, "color182", "color"),
++              RSTRG (Rs_color + minCOLOR + 183, "color183", "color"),
++              RSTRG (Rs_color + minCOLOR + 184, "color184", "color"),
++              RSTRG (Rs_color + minCOLOR + 185, "color185", "color"),
++              RSTRG (Rs_color + minCOLOR + 186, "color186", "color"),
++              RSTRG (Rs_color + minCOLOR + 187, "color187", "color"),
++              RSTRG (Rs_color + minCOLOR + 188, "color188", "color"),
++              RSTRG (Rs_color + minCOLOR + 189, "color189", "color"),
++              RSTRG (Rs_color + minCOLOR + 190, "color190", "color"),
++              RSTRG (Rs_color + minCOLOR + 191, "color191", "color"),
++              RSTRG (Rs_color + minCOLOR + 192, "color192", "color"),
++              RSTRG (Rs_color + minCOLOR + 193, "color193", "color"),
++              RSTRG (Rs_color + minCOLOR + 194, "color194", "color"),
++              RSTRG (Rs_color + minCOLOR + 195, "color195", "color"),
++              RSTRG (Rs_color + minCOLOR + 196, "color196", "color"),
++              RSTRG (Rs_color + minCOLOR + 197, "color197", "color"),
++              RSTRG (Rs_color + minCOLOR + 198, "color198", "color"),
++              RSTRG (Rs_color + minCOLOR + 199, "color199", "color"),
++              RSTRG (Rs_color + minCOLOR + 200, "color200", "color"),
++              RSTRG (Rs_color + minCOLOR + 201, "color201", "color"),
++              RSTRG (Rs_color + minCOLOR + 202, "color202", "color"),
++              RSTRG (Rs_color + minCOLOR + 203, "color203", "color"),
++              RSTRG (Rs_color + minCOLOR + 204, "color204", "color"),
++              RSTRG (Rs_color + minCOLOR + 205, "color205", "color"),
++              RSTRG (Rs_color + minCOLOR + 206, "color206", "color"),
++              RSTRG (Rs_color + minCOLOR + 207, "color207", "color"),
++              RSTRG (Rs_color + minCOLOR + 208, "color208", "color"),
++              RSTRG (Rs_color + minCOLOR + 209, "color209", "color"),
++              RSTRG (Rs_color + minCOLOR + 210, "color210", "color"),
++              RSTRG (Rs_color + minCOLOR + 211, "color211", "color"),
++              RSTRG (Rs_color + minCOLOR + 212, "color212", "color"),
++              RSTRG (Rs_color + minCOLOR + 213, "color213", "color"),
++              RSTRG (Rs_color + minCOLOR + 214, "color214", "color"),
++              RSTRG (Rs_color + minCOLOR + 215, "color215", "color"),
++              RSTRG (Rs_color + minCOLOR + 216, "color216", "color"),
++              RSTRG (Rs_color + minCOLOR + 217, "color217", "color"),
++              RSTRG (Rs_color + minCOLOR + 218, "color218", "color"),
++              RSTRG (Rs_color + minCOLOR + 219, "color219", "color"),
++              RSTRG (Rs_color + minCOLOR + 220, "color220", "color"),
++              RSTRG (Rs_color + minCOLOR + 221, "color221", "color"),
++              RSTRG (Rs_color + minCOLOR + 222, "color222", "color"),
++              RSTRG (Rs_color + minCOLOR + 223, "color223", "color"),
++              RSTRG (Rs_color + minCOLOR + 224, "color224", "color"),
++              RSTRG (Rs_color + minCOLOR + 225, "color225", "color"),
++              RSTRG (Rs_color + minCOLOR + 226, "color226", "color"),
++              RSTRG (Rs_color + minCOLOR + 227, "color227", "color"),
++              RSTRG (Rs_color + minCOLOR + 228, "color228", "color"),
++              RSTRG (Rs_color + minCOLOR + 229, "color229", "color"),
++              RSTRG (Rs_color + minCOLOR + 230, "color230", "color"),
++              RSTRG (Rs_color + minCOLOR + 231, "color231", "color"),
++              RSTRG (Rs_color + minCOLOR + 232, "color232", "color"),
++              RSTRG (Rs_color + minCOLOR + 233, "color233", "color"),
++              RSTRG (Rs_color + minCOLOR + 234, "color234", "color"),
++              RSTRG (Rs_color + minCOLOR + 235, "color235", "color"),
++              RSTRG (Rs_color + minCOLOR + 236, "color236", "color"),
++              RSTRG (Rs_color + minCOLOR + 237, "color237", "color"),
++              RSTRG (Rs_color + minCOLOR + 238, "color238", "color"),
++              RSTRG (Rs_color + minCOLOR + 239, "color239", "color"),
++              RSTRG (Rs_color + minCOLOR + 240, "color240", "color"),
++              RSTRG (Rs_color + minCOLOR + 241, "color241", "color"),
++              RSTRG (Rs_color + minCOLOR + 242, "color242", "color"),
++              RSTRG (Rs_color + minCOLOR + 243, "color243", "color"),
++              RSTRG (Rs_color + minCOLOR + 244, "color244", "color"),
++              RSTRG (Rs_color + minCOLOR + 245, "color245", "color"),
++              RSTRG (Rs_color + minCOLOR + 246, "color246", "color"),
++              RSTRG (Rs_color + minCOLOR + 247, "color247", "color"),
++              RSTRG (Rs_color + minCOLOR + 248, "color248", "color"),
++              RSTRG (Rs_color + minCOLOR + 249, "color249", "color"),
++              RSTRG (Rs_color + minCOLOR + 250, "color250", "color"),
++              RSTRG (Rs_color + minCOLOR + 251, "color251", "color"),
++              RSTRG (Rs_color + minCOLOR + 252, "color252", "color"),
++              RSTRG (Rs_color + minCOLOR + 253, "color253", "color"),
++              RSTRG (Rs_color + minCOLOR + 254, "color254", "color"),
++              RSTRG (Rs_color + minCOLOR + 255, "color255", "color"),
++#endif
+               RSTRG (Rs_color + minBrightCOLOR + 0, "color8", "color"),
+               RSTRG (Rs_color + minBrightCOLOR + 1, "color9", "color"),
+               RSTRG (Rs_color + minBrightCOLOR + 2, "color10", "color"),
diff --git a/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch b/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch
new file mode 100644
index 000000000000..636083218fa5
--- /dev/null
+++ b/pkgs/applications/misc/rxvt_unicode/rxvt-unicode-9.06-font-width.patch
@@ -0,0 +1,21 @@
+--- a/src/rxvtfont.C	2008-07-09 12:21:45.000000000 +0400
++++ b/src/rxvtfont.C	2009-10-30 14:32:53.000000000 +0300
+@@ -1195,12 +1195,14 @@
+           XGlyphInfo g;
+           XftTextExtents16 (disp, f, &ch, 1, &g);
+ 
+-          g.width -= g.x;
+-
++/*
++ * bukind: don't use g.width as a width of a character!
++ * instead use g.xOff, see e.g.: http://keithp.com/~keithp/render/Xft.tutorial
++ */
+           int wcw = WCWIDTH (ch);
+-          if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
++          if (wcw > 1) g.xOff = g.xOff / wcw;
++          if (width < g.xOff) width = g.xOff;
+ 
+-          if (width    < g.width       ) width    = g.width;
+           if (height   < g.height      ) height   = g.height;
+           if (glheight < g.height - g.y) glheight = g.height - g.y;
+         }
\ No newline at end of file
diff --git a/pkgs/applications/misc/sakura/default.nix b/pkgs/applications/misc/sakura/default.nix
index e1492a476914..151b8a077d5d 100644
--- a/pkgs/applications/misc/sakura/default.nix
+++ b/pkgs/applications/misc/sakura/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
       terminals in one window and adds a contextual menu with some basic
       options. No more no less.
     '';
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [ astsmtl ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/misc/slic3r/default.nix b/pkgs/applications/misc/slic3r/default.nix
index aa2ceb08e809..06a5cca94a8d 100644
--- a/pkgs/applications/misc/slic3r/default.nix
+++ b/pkgs/applications/misc/slic3r/default.nix
@@ -1,24 +1,23 @@
 { stdenv, fetchgit, perl, makeWrapper, makeDesktopItem
-# Perl modules:
-, EncodeLocale, MathClipper, ExtUtilsXSpp, BoostGeometryUtils
-, MathConvexHullMonotoneChain, MathGeometryVoronoi, MathPlanePath, Moo
-, IOStringy, ClassXSAccessor, Wx, GrowlGNTP, NetDBus }:
+, which, perlPackages
+}:
 
 stdenv.mkDerivation rec {
-  version = "0.9.10b";
+  version = "1.1.7";
   name = "slic3r-${version}";
 
   # Slic3r doesn't put out tarballs, only a git repository is available
   src = fetchgit {
     url = "git://github.com/alexrj/Slic3r";
     rev = "refs/tags/${version}";
-    sha256 = "0j06h0z65qn4kyb2b7pnq6bcn4al60q227iz9jlrin0ffx3l0ra7";
+    sha256 = "0hss90iw4xwca08d03wrz0fds5nqwb9zjqii2n6rgpcl4km69fka";
   };
 
-  buildInputs = [ perl makeWrapper
+  buildInputs = with perlPackages; [ perl makeWrapper which
     EncodeLocale MathClipper ExtUtilsXSpp BoostGeometryUtils
     MathConvexHullMonotoneChain MathGeometryVoronoi MathPlanePath Moo
-    IOStringy ClassXSAccessor Wx GrowlGNTP NetDBus
+    IOStringy ClassXSAccessor Wx GrowlGNTP NetDBus ImportInto XMLSAX
+    ExtUtilsMakeMaker
   ];
 
   desktopItem = makeDesktopItem {
@@ -31,13 +30,23 @@ stdenv.mkDerivation rec {
     categories = "Application;Development;";
   };
 
-  # Nothing to do here
-  buildPhase = "true";
+  buildPhase = ''
+    export SLIC3R_NO_AUTO=true
+    export PERL5LIB="./xs/blib/arch/:./xs/blib/lib:$PERL5LIB"
+
+    pushd xs
+      perl Build.PL
+      perl Build
+    popd
+
+    perl Build.PL
+  '';
 
   installPhase = ''
     mkdir -p "$out/share/slic3r/"
     cp -r * "$out/share/slic3r/"
-    wrapProgram "$out/share/slic3r/slic3r.pl" --prefix PERL5LIB : $PERL5LIB
+    wrapProgram "$out/share/slic3r/slic3r.pl" \
+      --prefix PERL5LIB : "$out/share/slic3r/xs/blib/arch:$out/share/slic3r/xs/blib/lib:$PERL5LIB"
     mkdir -p "$out/bin"
     ln -s "$out/share/slic3r/slic3r.pl" "$out/bin/slic3r"
     mkdir -p "$out/share/pixmaps/"
@@ -56,6 +65,6 @@ stdenv.mkDerivation rec {
     homepage = http://slic3r.org/;
     license = licenses.agpl3;
     platforms = platforms.linux;
-    maintainers = [ maintainers.bjornfor ];
+    maintainers = with maintainers; [ bjornfor the-kenny ];
   };
 }
diff --git a/pkgs/applications/misc/spacefm/default.nix b/pkgs/applications/misc/spacefm/default.nix
new file mode 100644
index 000000000000..7dbe723d9eb2
--- /dev/null
+++ b/pkgs/applications/misc/spacefm/default.nix
@@ -0,0 +1,30 @@
+{ pkgs, fetchurl, stdenv, gtk3, udev, desktop_file_utils, shared_mime_info
+, intltool, pkgconfig, makeWrapper
+}:
+
+let
+  version = "0.9.4";
+
+in stdenv.mkDerivation rec {
+  name = "spacefm-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/IgnorantGuru/spacefm/blob/pkg/${version}/${name}.tar.xz?raw=true";
+    sha256 = "0marwa031jk24q8hy90dr7yw6rv5hn1shar404zpb1k57v4nr23m";
+  };
+
+  buildInputs = [ gtk3 udev desktop_file_utils shared_mime_info intltool pkgconfig makeWrapper ];
+
+  preFixup = ''
+    wrapProgram "$out/bin/spacefm" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = {
+    description = "Multi-panel tabbed file and desktop manager for Linux with built-in VFS, udev- or HAL-based device manager, customizable menu system, and bash integration.";
+    platforms = pkgs.lib.platforms.linux;
+    license = pkgs.lib.licenses.gpl3;
+  };
+
+}
+
diff --git a/pkgs/applications/misc/st/default.nix b/pkgs/applications/misc/st/default.nix
index 41575ce35a69..1dcdf78456d2 100644
--- a/pkgs/applications/misc/st/default.nix
+++ b/pkgs/applications/misc/st/default.nix
@@ -1,20 +1,20 @@
-{ stdenv, fetchurl, writeText, libX11, ncurses, libXext, libXft, fontconfig
+{ stdenv, fetchurl, pkgconfig, writeText, libX11, ncurses, libXext, libXft, fontconfig
 , conf? null}:
 
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "st-0.4.1";
+  name = "st-0.5";
   
   src = fetchurl {
     url = "http://dl.suckless.org/st/${name}.tar.gz";
-    sha256 = "0cdzwbm5fxrwz8ryxkh90d3vwx54wjyywgj28ymsb5fdv3396bzf";
+    sha256 = "0knxpzaa86pprng6hak8hx8bw22yw22rpz1ffxjpcvqlz3xdv05f";
   };
 
   configFile = optionalString (conf!=null) (writeText "config.def.h" conf);
   preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h";
   
-  buildInputs = [ libX11 ncurses libXext libXft fontconfig ];
+  buildInputs = [ pkgconfig libX11 ncurses libXext libXft fontconfig ];
 
   NIX_LDFLAGS = "-lfontconfig";
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     
   meta = {
     homepage = http://st.suckless.org/;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = with maintainers; [viric];
     platforms = with platforms; linux;
   };
diff --git a/pkgs/applications/misc/stardict/stardict.nix b/pkgs/applications/misc/stardict/stardict.nix
index 9eb3e1123421..1ca8ec045d61 100644
--- a/pkgs/applications/misc/stardict/stardict.nix
+++ b/pkgs/applications/misc/stardict/stardict.nix
@@ -39,8 +39,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "stardict";
     homepage = "A international dictionary supporting fuzzy and glob style matching";
-    license = "LGPL3";
+    license = stdenv.lib.licenses.lgpl3;
     maintainers = with stdenv.lib.maintainers; [qknight];
   };
 }
-
diff --git a/pkgs/applications/misc/surf/default.nix b/pkgs/applications/misc/surf/default.nix
index 42792ba8f91d..983fbde0c459 100644
--- a/pkgs/applications/misc/surf/default.nix
+++ b/pkgs/applications/misc/surf/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "01b8hq8z2wd7ssym5bypx2b15mrs1lhgkrcgxf700kswxvxcrhgx";
   };
 
-  buildInputs = [ gtk makeWrapper webkit pkgconfig glib libsoup ];
+  buildInputs = [ gtk makeWrapper webkit gsettings_desktop_schemas pkgconfig glib libsoup ];
 
   # Allow users set their own list of patches
   inherit patches;
@@ -21,9 +21,12 @@ stdenv.mkDerivation rec {
   preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
   installPhase = ''
     make PREFIX=/ DESTDIR=$out install
+  '';
+
+  preFixup = ''
     wrapProgram "$out/bin/surf" \
       --prefix GIO_EXTRA_MODULES : ${glib_networking}/lib/gio/modules \
-      --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share"
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
   '';
 
   meta = {
@@ -35,7 +38,7 @@ stdenv.mkDerivation rec {
       surf to another URI by setting its XProperties.
       '';
     homepage = http://surf.suckless.org;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/misc/sweethome3d/default.nix b/pkgs/applications/misc/sweethome3d/default.nix
new file mode 100644
index 000000000000..ab7a8240ebfb
--- /dev/null
+++ b/pkgs/applications/misc/sweethome3d/default.nix
@@ -0,0 +1,66 @@
+{ stdenv, fetchurl, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant
+, p7zip }:
+
+let
+
+  mkSweetHome3D =
+  { name, module, version, src, license, description }:
+
+  stdenv.mkDerivation rec {
+    inherit name version src description;
+    exec = stdenv.lib.toLower module;
+    sweethome3dItem = makeDesktopItem {
+      inherit name exec;
+      comment =  description;
+      desktopName = name;
+      genericName = "Computer Aided (Interior) Design";
+      categories = "Application;CAD;";
+    };
+
+    buildInputs = [ ant jdk jre makeWrapper p7zip ];
+
+    buildPhase = ''
+      ant furniture textures help
+      mkdir -p $out/share/{java,applications}
+      mv build/*.jar $out/share/java/.
+      ant
+    '';
+
+    installPhase = ''
+      mkdir -p $out/bin
+      cp install/${module}-${version}.jar $out/share/java/.
+      cp ${sweethome3dItem}/share/applications/* $out/share/applications
+      makeWrapper ${jre}/bin/java $out/bin/$exec \
+        --add-flags "-jar $out/share/java/${module}-${version}.jar -cp $out/share/java/Furniture.jar:$out/share/java/Textures.jar:$out/share/java/Help.jar ${if stdenv.system == "x86_64-linux" then "-d64" else "-d32"}"
+    '';
+
+    dontStrip = true;
+
+    meta = {
+      homepage = "http://www.sweethome3d.com/index.jsp";
+      inherit description;
+      inherit license;
+      maintainers = [ stdenv.lib.maintainers.edwtjo ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  };
+
+  d2u = stdenv.lib.replaceChars ["."] ["_"];
+
+in rec {
+
+  application = mkSweetHome3D rec {
+    version = "4.3.1";
+    module = "SweetHome3D";
+    name = stdenv.lib.toLower module + "-application-" + version;
+    description = "Design and visualize your future home";
+    license = stdenv.lib.licenses.gpl2Plus;
+    src = fetchcvs {
+      cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
+      sha256 = "0jn3xamghz8rsmzvpd57cvz32yk8mni8dyx15xizjcki0450bp3f";
+      module = module;
+      tag = "V_" + d2u version;
+    };
+  };
+
+}
diff --git a/pkgs/applications/misc/sweethome3d/editors.nix b/pkgs/applications/misc/sweethome3d/editors.nix
new file mode 100644
index 000000000000..9eca1df59f5d
--- /dev/null
+++ b/pkgs/applications/misc/sweethome3d/editors.nix
@@ -0,0 +1,90 @@
+{ stdenv, fetchurl, fetchcvs, makeWrapper, makeDesktopItem, jdk, jre, ant
+, p7zip, sweethome3dApp }:
+
+let
+
+  sweetExec = with stdenv.lib;
+    m: "sweethome3d-"
+    + removeSuffix "libraryeditor" (toLower m)
+    + "-editor";
+  sweetName = m: v: sweetExec m + "-" + v;
+
+  mkEditorProject =
+  { name, module, version, src, license, description }:
+
+  stdenv.mkDerivation rec {
+    application = sweethome3dApp;
+    inherit name module version src description;
+    exec = sweetExec module;
+    editorItem = makeDesktopItem {
+      inherit name exec;
+      comment =  description;
+      desktopName = name;
+      genericName = "Computer Aided (Interior) Design";
+      categories = "Application;CAD;";
+    };
+
+    buildInputs = [ ant jre jdk makeWrapper ];
+
+    patchPhase = ''
+      sed -i -e 's,../SweetHome3D,${application.src},g' build.xml
+    '';
+
+    buildPhase = ''
+      ant -lib ${application.src}/libtest -lib ${application.src}/lib -lib ${jdk}/lib
+    '';
+
+    installPhase = ''
+      mkdir -p $out/bin
+      mkdir -p $out/share/{java,applications}
+      cp ${module}-${version}.jar $out/share/java/.
+      cp ${editorItem}/share/applications/* $out/share/applications
+      makeWrapper ${jre}/bin/java $out/bin/$exec \
+        --add-flags "-jar $out/share/java/${module}-${version}.jar ${if stdenv.system == "x86_64-linux" then "-d64" else "-d32"}"
+    '';
+
+    dontStrip = true;
+
+    meta = {
+      homepage = "http://www.sweethome3d.com/index.jsp";
+      inherit description;
+      inherit license;
+      maintainers = [ stdenv.lib.maintainers.edwtjo ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+
+  };
+
+  d2u = stdenv.lib.replaceChars ["."] ["_"];
+
+in rec {
+
+  textures-editor = mkEditorProject rec {
+    version = "1.3";
+    module = "TexturesLibraryEditor";
+    name = sweetName module version;
+    description = "Easily create SH3T files and edit the properties of the texture images it contain";
+    license = stdenv.lib.licenses.gpl2Plus;
+    src = fetchcvs {
+      cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
+      sha256 = "1caf1hmf87bj5dr7w2swnlbvkb3q1jdjr1zgjn1k07d0fxh0ikbx";
+      module = module;
+      tag = "V_" + d2u version;
+    };
+  };
+
+  furniture-editor = mkEditorProject rec {
+    version = "1.13";
+    module = "FurnitureLibraryEditor";
+    name = sweetName module version;
+    description = "Quickly create SH3F files and edit the properties of the 3D models it contain";
+    license = stdenv.lib.licenses.gpl2;
+    src = fetchcvs {
+      cvsRoot = ":pserver:anonymous@sweethome3d.cvs.sourceforge.net:/cvsroot/sweethome3d";
+      sha256 = "1nll5589rc0g71zd86cwmzl4p2icynykj106schmxric9v17jbv5";
+      module = module;
+      tag = "V_" + d2u version;
+    };
+  };
+
+}
diff --git a/pkgs/applications/misc/synergy/cryptopp.patch b/pkgs/applications/misc/synergy/cryptopp.patch
index d0aebb872610..1c296423acd6 100644
--- a/pkgs/applications/misc/synergy/cryptopp.patch
+++ b/pkgs/applications/misc/synergy/cryptopp.patch
@@ -1,32 +1,30 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 3b61fc0..2206646 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -133,6 +133,9 @@ if (UNIX)
+diff -urN synergy-1.4.17-Source/CMakeLists.txt synergy-1.4.17-Source-fix/CMakeLists.txt
+--- synergy-1.4.17-Source/CMakeLists.txt	2014-03-14 21:34:19.000000000 +0100
++++ synergy-1.4.17-Source-fix/CMakeLists.txt	2014-04-11 13:37:18.839338710 +0200
+@@ -145,6 +145,9 @@
  	check_type_size(long SIZEOF_LONG)
  	check_type_size(short SIZEOF_SHORT)
  
-+    # let's just assume cryptopp exists (provided by the Nix expression)
-+    list(APPEND libs cryptopp)
++	# let's just assume cryptopp exists (provided by the Nix expression)
++	list(APPEND libs cryptopp)
 +
  	# pthread is used on both Linux and Mac
  	check_library_exists("pthread" pthread_create "" HAVE_PTHREAD)
  	if (HAVE_PTHREAD)
-@@ -303,7 +306,6 @@ if (VNC_SUPPORT)
+@@ -317,7 +320,6 @@
  endif()
  
  add_subdirectory(src)
--add_subdirectory(tools)
+-add_subdirectory(ext)
  
  if (WIN32)
- 	# add /analyze in order to unconver potential bugs in the source code
-diff --git a/src/lib/io/CCryptoMode.h b/src/lib/io/CCryptoMode.h
-index 9b7e8ad..0d659ac 100644
---- a/src/lib/io/CCryptoMode.h
-+++ b/src/lib/io/CCryptoMode.h
-@@ -17,9 +17,9 @@
- 
- #pragma once
+ 	# TODO:	consider using /analyze to uncover potential bugs in the source code.
+diff -urN synergy-1.4.17-Source/src/lib/io/CryptoMode_cryptopp.h synergy-1.4.17-Source-fix/src/lib/io/CryptoMode_cryptopp.h
+--- synergy-1.4.17-Source/src/lib/io/CryptoMode_cryptopp.h	2014-02-28 13:36:45.000000000 +0100
++++ synergy-1.4.17-Source-fix/src/lib/io/CryptoMode_cryptopp.h	2014-04-11 13:36:01.111985556 +0200
+@@ -25,6 +25,6 @@
+ #	pragma GCC system_header
+ #endif 
  
 -#include <cryptopp562/gcm.h>
 -#include <cryptopp562/modes.h>
@@ -34,21 +32,14 @@ index 9b7e8ad..0d659ac 100644
 +#include <cryptopp/gcm.h>
 +#include <cryptopp/modes.h>
 +#include <cryptopp/aes.h>
- #include "ECryptoMode.h"
- #include "CString.h"
+diff -urN synergy-1.4.17-Source/src/lib/io/CryptoStream_cryptopp.h synergy-1.4.17-Source-fix/src/lib/io/CryptoStream_cryptopp.h
+--- synergy-1.4.17-Source/src/lib/io/CryptoStream_cryptopp.h	2014-02-28 13:36:45.000000000 +0100
++++ synergy-1.4.17-Source-fix/src/lib/io/CryptoStream_cryptopp.h	2014-04-11 13:36:07.173013005 +0200
+@@ -25,5 +25,5 @@
+ #	pragma GCC system_header
+ #endif
  
-diff --git a/src/lib/io/CCryptoStream.h b/src/lib/io/CCryptoStream.h
-index 104b1f6..09c4dc4 100644
---- a/src/lib/io/CCryptoStream.h
-+++ b/src/lib/io/CCryptoStream.h
-@@ -20,8 +20,8 @@
- #include "BasicTypes.h"
- #include "CStreamFilter.h"
- #include "CCryptoMode.h"
 -#include <cryptopp562/osrng.h>
 -#include <cryptopp562/sha.h>
 +#include <cryptopp/osrng.h>
 +#include <cryptopp/sha.h>
- 
- class CCryptoOptions;
- 
diff --git a/pkgs/applications/misc/synergy/default.nix b/pkgs/applications/misc/synergy/default.nix
index c01d67943e57..8d914c262212 100644
--- a/pkgs/applications/misc/synergy/default.nix
+++ b/pkgs/applications/misc/synergy/default.nix
@@ -1,36 +1,38 @@
-{ stdenv, fetchurl, cmake, x11, libX11, libXi, libXtst, libXrandr, xinput
-, cryptopp ? null, unzip ? null }:
+{ stdenv, fetchurl, cmake, x11, libX11, libXi, libXtst, libXrandr, xinput, curl
+, cryptopp ? null, unzip }:
 
 assert stdenv.isLinux -> cryptopp != null;
-assert !stdenv.isLinux -> unzip != null;
 
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "synergy-1.4.15";
+  name = "synergy-1.5.0";
 
   src = fetchurl {
-    url = "http://synergy.googlecode.com/files/${name}-Source.tar.gz";
-    sha256 = "0l1mxxky9hacyva0npzkgkwg4wkmihzq3abdrds0w5f6is44adv4";
+    url = "http://synergy-project.org/files/packages/synergy-1.5.0-r2278-Source.tar.gz";
+    sha256 = "097hk9v01lwzs7ly6ynadxmjh7ad68l5si7w4qmjn6z7l8b61gv6";
   };
 
   patches = optional stdenv.isLinux ./cryptopp.patch;
 
-  postPatch = if stdenv.isLinux then ''
+  postPatch = (if stdenv.isLinux then ''
     sed -i -e '/HAVE_X11_EXTENSIONS_XRANDR_H/c \
       set(HAVE_X11_EXTENSIONS_XRANDR_H true)' CMakeLists.txt
   '' else ''
-    ${unzip}/bin/unzip -d tools/cryptopp562 tools/cryptopp562.zip
+    ${unzip}/bin/unzip -d ext/cryptopp562 ext/cryptopp562.zip
+  '') + ''
+    ${unzip}/bin/unzip -d ext/gmock-1.6.0 ext/gmock-1.6.0.zip
+    ${unzip}/bin/unzip -d ext/gtest-1.6.0 ext/gtest-1.6.0.zip
   '';
 
-  buildInputs = [ cmake x11 libX11 libXi libXtst libXrandr xinput ]
+  buildInputs = [ cmake x11 libX11 libXi libXtst libXrandr xinput curl ]
              ++ optional stdenv.isLinux cryptopp;
 
   # At this moment make install doesn't work for synergy
   # http://synergy-foss.org/spit/issues/details/3317/
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp ../bin/synergyc $out/bin
     cp ../bin/synergys $out/bin
     cp ../bin/synergyd $out/bin
diff --git a/pkgs/applications/misc/taffybar/default.nix b/pkgs/applications/misc/taffybar/default.nix
new file mode 100644
index 000000000000..6b282116343d
--- /dev/null
+++ b/pkgs/applications/misc/taffybar/default.nix
@@ -0,0 +1,27 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, cairo, dbus, dyre, enclosedExceptions, filepath, gtk
+, gtkTraymanager, HStringTemplate, HTTP, mtl, network, parsec, safe
+, split, stm, text, time, transformers, utf8String, X11, xdgBasedir
+, xmonad, xmonadContrib
+}:
+
+cabal.mkDerivation (self: {
+  pname = "taffybar";
+  version = "0.4.0";
+  sha256 = "1l6zl5mlpkdsvs3id6ivh4b74p65n6jr17k23y2cdwj2fr9prvr8";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    cairo dbus dyre enclosedExceptions filepath gtk gtkTraymanager
+    HStringTemplate HTTP mtl network parsec safe split stm text time
+    transformers utf8String X11 xdgBasedir xmonad xmonadContrib
+  ];
+  pkgconfigDepends = [ gtk ];
+  meta = {
+    homepage = "http://github.com/travitch/taffybar";
+    description = "A desktop bar similar to xmobar, but with more GUI";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/applications/misc/tangogps/default.nix b/pkgs/applications/misc/tangogps/default.nix
index 609849166d16..aa1df2c9d1a6 100644
--- a/pkgs/applications/misc/tangogps/default.nix
+++ b/pkgs/applications/misc/tangogps/default.nix
@@ -38,6 +38,6 @@ stdenv.mkDerivation rec {
 
     #homepage = http://www.tangogps.org/; # no longer valid, I couldn't find any other
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/misc/taskjuggler/default.nix b/pkgs/applications/misc/taskjuggler/default.nix
index 77acc511fe42..e1e047714603 100644
--- a/pkgs/applications/misc/taskjuggler/default.nix
+++ b/pkgs/applications/misc/taskjuggler/default.nix
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://www.taskjuggler.org";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     description = "Project management tool";
     longDescription = ''
       TaskJuggler is a modern and powerful, Open Source project management
diff --git a/pkgs/applications/misc/taskwarrior/default.nix b/pkgs/applications/misc/taskwarrior/default.nix
index dc1fce1d64ca..998c34e56102 100644
--- a/pkgs/applications/misc/taskwarrior/default.nix
+++ b/pkgs/applications/misc/taskwarrior/default.nix
@@ -1,17 +1,17 @@
-{stdenv, fetchurl, cmake}:
+{ stdenv, fetchurl, cmake, libuuid }:
 
 stdenv.mkDerivation rec {
   name = "taskwarrior-${version}";
-  version = "2.2.0";
+  version = "2.3.0";
 
   enableParallelBuilding = true;
 
   src = fetchurl {
     url = "http://www.taskwarrior.org/download/task-${version}.tar.gz";
-    sha256 = "057fh50qp9bd5s08rw51iybpamn55v5nhn3s6ds89g76hp95vqir";
+    sha256 = "0wxcfq0n96vmcbwrlk2x377k8cc5k4i64ca6p02y74g6168ji6ib";
   };
 
-  nativeBuildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake libuuid ];
 
   meta = {
     description = "GTD (getting things done) implementation";
diff --git a/pkgs/applications/misc/terminator/default.nix b/pkgs/applications/misc/terminator/default.nix
new file mode 100644
index 000000000000..c337cd329c92
--- /dev/null
+++ b/pkgs/applications/misc/terminator/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, python, pygtk, notify, keybinder, vte, gettext, intltool
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  name = "terminator-${version}";
+  version = "0.97";
+  
+  src = fetchurl {
+    url = "https://launchpad.net/terminator/trunk/${version}/+download/${name}.tar.gz";
+    sha256 = "1xykpx10g2zssx0ss6351ca6vmmma7zwxxhjz0fg28ps4dq88cci";
+  };
+  
+  buildInputs = [
+    python pygtk notify keybinder vte gettext intltool makeWrapper
+  ];
+
+  installPhase = ''
+    python setup.py --without-icon-cache install --prefix="$out"
+
+    for file in "$out"/bin/*; do
+        wrapProgram "$file" \
+            --prefix PYTHONPATH : "$(toPythonPath $out):$PYTHONPATH"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Terminal emulator with support for tiling and tabs";
+    longDescription = ''
+      The goal of this project is to produce a useful tool for arranging
+      terminals. It is inspired by programs such as gnome-multi-term,
+      quadkonsole, etc. in that the main focus is arranging terminals in grids
+      (tabs is the most common default method, which Terminator also supports).
+    '';
+    homepage = http://gnometerminator.blogspot.no/p/introduction.html;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.bjornfor ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/tint2/default.nix b/pkgs/applications/misc/tint2/default.nix
new file mode 100644
index 000000000000..9eb3ed13af58
--- /dev/null
+++ b/pkgs/applications/misc/tint2/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pkgconfig, cmake, pango, cairo, glib, imlib2, libXinerama
+, libXrender, libXcomposite, libXdamage, libX11, libXrandr, gtk, libpthreadstubs
+, libXdmcp
+}:
+
+stdenv.mkDerivation rec {
+  name = "tint2-${version}";
+  version = "0.11";
+
+  src = fetchurl {
+    url = "http://tint2.googlecode.com/files/${name}.tar.bz2";
+    sha256 = "07a74ag7lhc6706z34zvqj2ikyyl7wnzisfxpld67ljpc1m6w47y";
+  };
+        
+  buildInputs = [ pkgconfig cmake pango cairo glib imlib2 libXinerama
+    libXrender libXcomposite libXdamage libX11 libXrandr gtk libpthreadstubs
+    libXdmcp
+  ];
+
+  preConfigure = "substituteInPlace CMakeLists.txt --replace /etc $out/etc";
+
+  cmakeFlags = [
+    "-DENABLE_TINT2CONF=0"
+  ];
+
+  meta = {
+    homepage = http://code.google.com/p/tint2;
+    license = stdenv.lib.licenses.gpl2;
+    description = "A simple panel/taskbar unintrusive and light (memory / cpu / aestetic)";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/twmn/default.nix b/pkgs/applications/misc/twmn/default.nix
new file mode 100644
index 000000000000..65c2ccb5ff0b
--- /dev/null
+++ b/pkgs/applications/misc/twmn/default.nix
@@ -0,0 +1,29 @@
+{ fetchurl, stdenv, fetchgit, qt4, pkgconfig, boost, dbus }:
+
+stdenv.mkDerivation rec {
+  rev = "9f52882688ba03d7aaab2e3fd83cb05cfbf1a374";
+  name = "twmn-${rev}";
+
+  src = fetchgit {
+    inherit rev;
+    url = "https://github.com/sboli/twmn.git";
+    sha256 = "1jd2y0ydcpjdmjbx77lw35710sqfwbgyrnpv66mi3gwvrbyiwpf3";
+  };
+
+  buildInputs = [ qt4 pkgconfig boost ];
+  propagatedBuildInputs = [ dbus ];
+
+  configurePhase = "qmake";
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    cp bin/* "$out/bin"
+  '';
+
+  meta = {
+    description = "A notification system for tiling window managers";
+    homepage = "https://github.com/sboli/twmn";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = [ stdenv.lib.maintainers.matejc ];
+  };
+}
diff --git a/pkgs/applications/misc/vanitygen/default.nix b/pkgs/applications/misc/vanitygen/default.nix
index e16767d4c261..6be2dc394cc4 100644
--- a/pkgs/applications/misc/vanitygen/default.nix
+++ b/pkgs/applications/misc/vanitygen/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ openssl pcre ];
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp vanitygen $out/bin
     cp keyconv $out/bin/vanitygen-keyconv
   '';
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
         and will run about 30% faster.
       '';
       homepage = "https://github.com/samr7/vanitygen";
-      license = "AGPLv3";
+      license = stdenv.lib.licenses.agpl3;
       platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/misc/vifm/default.nix b/pkgs/applications/misc/vifm/default.nix
index 7230e84601e4..5abf57ae1fc4 100644
--- a/pkgs/applications/misc/vifm/default.nix
+++ b/pkgs/applications/misc/vifm/default.nix
@@ -2,17 +2,16 @@
 
 let
   name = "vifm-${version}";
-  version = "0.7.5";
+  version = "0.7.7";
 
 in stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url="mirror://sourceforge/project/vifm/vifm/${name}.tar.bz2";
-    sha256 ="1r1d92zrff94rfx011dw2qsgdwd2ksqlz15la74d6h7sfcsnyd01";
+    url = "mirror://sourceforge/project/vifm/vifm/${name}.tar.bz2";
+    sha256 = "1lflmkd5q7qqi9d44py0y41pcx5bsadkihn3gc0x5cka04f2gh0d";
   };
 
-  #phaseNames = ["doConfigure" "doMakeInstall"];
   buildInputs = [ utillinux ncurses file libX11 ];
 
   meta = {
diff --git a/pkgs/applications/misc/viking/default.nix b/pkgs/applications/misc/viking/default.nix
index 70ac055db098..6508b12e1de8 100644
--- a/pkgs/applications/misc/viking/default.nix
+++ b/pkgs/applications/misc/viking/default.nix
@@ -38,6 +38,6 @@ stdenv.mkDerivation {
 
     homepage = http://viking.sourceforge.net/;
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/misc/vue/default.nix b/pkgs/applications/misc/vue/default.nix
index c90e4d24f37a..542f11f6e671 100644
--- a/pkgs/applications/misc/vue/default.nix
+++ b/pkgs/applications/misc/vue/default.nix
@@ -11,10 +11,10 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="vue";
-    version="3.1.2";
+    version="3.2.2";
     name="${baseName}-${version}";
-    url="http://releases.atech.tufts.edu/vue/v${version}/VUE_3_1_2.zip";
-    hash="0ga98gnp4qhcrb31cb8j0mwbrh6ym6hr4k5y4blxvyfff9c0vq47";
+    url="releases.atech.tufts.edu/jenkins/job/VUE/64/deployedArtifacts/download/artifact.2";
+    hash="0sb1kgan8fvph2cqfxk3906cwx5wy83zni2vlz4zzi6yg4zvfxld";
   };
 in
 rec {
@@ -30,9 +30,8 @@ rec {
   phaseNames = ["doDeploy"];
 
   doDeploy = a.fullDepEntry ''
-    unzip ${src}
     mkdir -p "$out"/{share/vue,bin}
-    cp VUE.jar "$out/share/vue/vue.jar"
+    cp ${src} "$out/share/vue/vue.jar"
     echo '#!${a.stdenv.shell}' >> "$out/bin/vue" 
     echo '${a.jre}/bin/java -jar "'"$out/share/vue/vue.jar"'" "$@"' >> "$out/bin/vue" 
     chmod a+x "$out/bin/vue"
diff --git a/pkgs/applications/misc/wmname/default.nix b/pkgs/applications/misc/wmname/default.nix
index 417d4a5ae683..0f71a53075f9 100644
--- a/pkgs/applications/misc/wmname/default.nix
+++ b/pkgs/applications/misc/wmname/default.nix
@@ -15,6 +15,6 @@ stdenv.mkDerivation rec {
   meta = {
       description = "Prints or set the window manager name property of the root window";
       homepage = "http://tools.suckless.org/wmname";
-      license = "MIT";
+      license = stdenv.lib.licenses.mit;
   };
 }
diff --git a/pkgs/applications/misc/xca/default.nix b/pkgs/applications/misc/xca/default.nix
index fb6b011f30a4..0bc2170340c8 100644
--- a/pkgs/applications/misc/xca/default.nix
+++ b/pkgs/applications/misc/xca/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, which, openssl, qt4, libtool }:
+{ stdenv, fetchurl, pkgconfig, which, openssl, qt4, libtool, gcc, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "xca-${version}";
@@ -15,7 +15,12 @@ stdenv.mkDerivation rec {
     prefix=$out ./configure ${openssl} ${libtool}
   '';
 
-  buildInputs = [ openssl qt4 libtool ];
+  postInstall = ''
+    wrapProgram "$out/bin/xca" \
+      --prefix LD_LIBRARY_PATH : "${qt4}/lib:${gcc.gcc}/lib:${gcc.gcc}/lib64:${openssl}/lib:${libtool}/lib"
+  '';
+
+  buildInputs = [ openssl qt4 libtool gcc makeWrapper ];
   nativeBuildInputs = [ pkgconfig ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/misc/xchm/default.nix b/pkgs/applications/misc/xchm/default.nix
index aed55c67c100..c6bfa07cb885 100644
--- a/pkgs/applications/misc/xchm/default.nix
+++ b/pkgs/applications/misc/xchm/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, wxGTK, chmlib}:
 
 stdenv.mkDerivation {
-  name = "xchm-1.18";
+  name = "xchm-1.23";
   src = fetchurl {
-    url = mirror://sourceforge/xchm/xchm-1.18.tar.gz;
-    sha256 = "1wvvyzqbmj3c6i46x4vpxkawjwmmp276r84ifvlzaj5q4b52g5gw";
+    url = mirror://sourceforge/xchm/xchm-1.23.tar.gz;
+    sha256 = "0qn0fyxcrn30ndq2asx31k0qkx3grbm16fb1y580wd2gjmh5r3wg";
   };
   buildInputs = [wxGTK chmlib];
 
diff --git a/pkgs/applications/misc/xcruiser/default.nix b/pkgs/applications/misc/xcruiser/default.nix
new file mode 100644
index 000000000000..15202a1e90c6
--- /dev/null
+++ b/pkgs/applications/misc/xcruiser/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, gccmakedep, xlibs }:
+
+stdenv.mkDerivation {
+  name = "xcruiser-0.30";
+
+  src = fetchurl {
+      url = mirror://sourceforge/xcruiser/xcruiser/xcruiser-0.30/xcruiser-0.30.tar.gz;
+      sha256 = "1r8whva38xizqdh7jmn6wcmfmsndc67pkw22wzfzr6rq0vf6hywi";
+    };
+
+  buildInputs = with xlibs; [ gccmakedep imake libXt libXaw libXpm libXext ];
+
+  configurePhase = "xmkmf -a";
+
+  preBuild = ''
+    makeFlagsArray=( BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults)
+  '';
+
+  meta = with stdenv.lib;
+    { description = "Filesystem visualization utility";
+      longDescription = ''
+        XCruiser, formerly known as XCruise, is a filesystem visualization utility.
+        It constructs a virtually 3-D formed universe from a directory
+        tree and allows you to "cruise" within a visualized filesystem.
+      '';
+      homepage = http://xcruiser.sourceforge.net/;
+      license = licenses.gpl2;
+      maintainers = with maintainers; [ emery ];
+    };
+}
diff --git a/pkgs/applications/misc/xfe/default.nix b/pkgs/applications/misc/xfe/default.nix
index 9b1385d9d6ad..d09a899b897f 100644
--- a/pkgs/applications/misc/xfe/default.nix
+++ b/pkgs/applications/misc/xfe/default.nix
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
       Xfe aims to be the filemanager of choice for all the Unix addicts!
     '';
     homepage = "http://sourceforge.net/projects/xfe/";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.bbenoist ];
-    platforms = stdenv.lib.platforms.mesaPlatforms;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/misc/xfontsel/default.nix b/pkgs/applications/misc/xfontsel/default.nix
index b159dd282e23..2bb05fe44e07 100644
--- a/pkgs/applications/misc/xfontsel/default.nix
+++ b/pkgs/applications/misc/xfontsel/default.nix
@@ -4,11 +4,11 @@
 
 {stdenv, fetchurl, makeWrapper, libX11, pkgconfig, libXaw}:
 stdenv.mkDerivation rec {
-  name = "xfontsel-1.0.2";
+  name = "xfontsel-1.0.5";
 
   src = fetchurl {
     url = "mirror://xorg/individual/app/${name}.tar.bz2";
-    sha256 = "1a86a08sf0wjrki9ydh7hr5qf6hrixc4ljlxizakjzmx20wvlrks";
+    sha256 = "1grir464hy52a71r3mpm9mzvkf7nwr3vk0b1vc27pd3gp588a38p";
   };
 
   buildInputs = [libX11 makeWrapper pkgconfig libXaw];
@@ -28,8 +28,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.x.org/;
     description = "Allows testing the fonts available in an X server";
-    licesnse = "free";
+    license = "free";
     maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/applications/misc/xlsfonts/default.nix b/pkgs/applications/misc/xlsfonts/default.nix
index 879f5ae568cc..06b09154ba55 100644
--- a/pkgs/applications/misc/xlsfonts/default.nix
+++ b/pkgs/applications/misc/xlsfonts/default.nix
@@ -4,11 +4,11 @@
 
 {stdenv, fetchurl, libX11, pkgconfig}:
 stdenv.mkDerivation rec {
-  name = "xlsfonts-1.0.2";
+  name = "xlsfonts-1.0.4";
 
   src = fetchurl {
     url = "mirror://xorg/individual/app/${name}.tar.bz2";
-    sha256 = "070iym754g3mf9x6xczl4gdnpvlk6rdyl1ndwhpjl21vg2dm2vnc";
+    sha256 = "1lhcx600z9v65nk93xaxfzi79bm4naynabb52gz1vy1bxj2r25r8";
   };
 
   buildInputs = [libX11 pkgconfig];
@@ -16,8 +16,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.x.org/;
     description = "Lists the fonts available in the X server";
-    licesnse = "free";
+    license = "free";
     maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/applications/misc/xmobar/add-freeration-variable.patch b/pkgs/applications/misc/xmobar/add-freeration-variable.patch
deleted file mode 100644
index a8c10e1a30d6..000000000000
--- a/pkgs/applications/misc/xmobar/add-freeration-variable.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/readme.md b/readme.md
-index f4f07e8..de679c7 100644
---- a/readme.md
-+++ b/readme.md
-@@ -645,7 +645,7 @@ something like:
- - Args: default monitor arguments
- - Variables that can be used with the `-t`/`--template` argument:
-              `total`, `free`, `buffer`, `cache`, `rest`, `used`,
--             `usedratio`, `usedbar`, `freebar`
-+             `usedratio`, `usedbar`, `freeratio`, `freebar`
- - Default template: `Mem: <usedratio>% (<cache>M)`
- 
- ### `Swap Args RefreshRate`
-diff --git a/src/Plugins/Monitors/Mem.hs b/src/Plugins/Monitors/Mem.hs
-index 5c55ee2..3cf46c7 100644
---- a/src/Plugins/Monitors/Mem.hs
-+++ b/src/Plugins/Monitors/Mem.hs
-@@ -19,8 +19,8 @@ import Plugins.Monitors.Common
- memConfig :: IO MConfig
- memConfig = mkMConfig
-        "Mem: <usedratio>% (<cache>M)" -- template
--       ["usedbar", "freebar", "usedratio", "total",
--        "free", "buffer", "cache", "rest", "used"]  -- available replacements
-+       ["usedbar", "freebar", "usedratio", "freeratio", "total",
-+        "free", "buffer", "cache", "rest", "used"] -- available replacements
- 
- fileMEM :: IO String
- fileMEM = readFile "/proc/meminfo"
-@@ -33,7 +33,8 @@ parseMEM =
-            rest = free + buffer + cache
-            used = total - rest
-            usedratio = used / total
--       return [usedratio, total, free, buffer, cache, rest, used]
-+           freeratio = free / total
-+       return [usedratio, freeratio, total, free, buffer, cache, rest, used, freeratio]
- 
- totalMem :: IO Float
- totalMem = fmap ((*1024) . (!!1)) parseMEM
-@@ -42,15 +43,16 @@ usedMem :: IO Float
- usedMem = fmap ((*1024) . (!!6)) parseMEM
- 
- formatMem :: [Float] -> Monitor [String]
--formatMem (r:xs) =
-+formatMem (r:fr:xs) =
-     do let f = showDigits 0
-            rr = 100 * r
-        ub <- showPercentBar rr r
-        fb <- showPercentBar (100 - rr) (1 - r)
-        rs <- showPercentWithColors r
-+       fs <- showPercentWithColors fr
-        s <- mapM (showWithColors f) xs
--       return (ub:fb:rs:s)
--formatMem _ = return $ replicate 9 "N/A"
-+       return (ub:fb:rs:fs:s)
-+formatMem _ = return $ replicate 10 "N/A"
- 
- runMem :: [String] -> Monitor String
- runMem _ =
diff --git a/pkgs/applications/misc/xmobar/default.nix b/pkgs/applications/misc/xmobar/default.nix
index 273998dde5d1..8d73dfebb188 100644
--- a/pkgs/applications/misc/xmobar/default.nix
+++ b/pkgs/applications/misc/xmobar/default.nix
@@ -1,23 +1,28 @@
-{ cabal, filepath, libXrandr, mtl, parsec, regexCompat, stm, time
-, utf8String, X11, X11Xft
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, alsaCore, alsaMixer, dbus, filepath, hinotify, HTTP
+, libmpd, libXrandr, mtl, parsec, regexCompat, stm, time
+, timezoneOlson, timezoneSeries, utf8String, wirelesstools, X11
+, X11Xft
 }:
 
 cabal.mkDerivation (self: {
   pname = "xmobar";
-  version = "0.19";
-  sha256 = "1lwbww9vpqscip16lqiax2qvfyksxms5xx4n0s61mzw7v61hyxq2";
+  version = "0.21";
+  sha256 = "1h0gsb808zm4j4kmw7fl4339wllc16ldy1ki96l8w3fvj30bcxpm";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    filepath mtl parsec regexCompat stm time utf8String X11 X11Xft
+    alsaCore alsaMixer dbus filepath hinotify HTTP libmpd mtl parsec
+    regexCompat stm time timezoneOlson timezoneSeries utf8String X11
+    X11Xft
   ];
-  extraLibraries = [ libXrandr ];
-  configureFlags = "-fwith_xft";
+  extraLibraries = [ libXrandr wirelesstools ];
+  configureFlags = "-fall_extensions";
   meta = {
-    homepage = "http://projects.haskell.org/xmobar/";
+    homepage = "http://xmobar.org";
     description = "A Minimalistic Text Based Status Bar";
     license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    platforms = self.stdenv.lib.platforms.linux;
   };
 })
diff --git a/pkgs/applications/misc/xneur/default.nix b/pkgs/applications/misc/xneur/default.nix
index 4f6e3342f588..cc08436fa033 100644
--- a/pkgs/applications/misc/xneur/default.nix
+++ b/pkgs/applications/misc/xneur/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Utility for switching between keyboard layouts";
     homepage = http://xneur.ru;
-    license = "GPL2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ stdenv.lib.maintainers.raskin ];
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/applications/misc/xterm/default.nix b/pkgs/applications/misc/xterm/default.nix
index ef2d846dd2e4..00e9ab0c810c 100644
--- a/pkgs/applications/misc/xterm/default.nix
+++ b/pkgs/applications/misc/xterm/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, xorg, ncurses, freetype, fontconfig, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "xterm-281";
+  name = "xterm-303";
 
   src = fetchurl {
     url = "ftp://invisible-island.net/xterm/${name}.tgz";
-    sha256 = "1yrjjya7z5s3fi0iiaxgna35jh0ib2zx1yafyng35jma6qbwhxx7";
+    sha256 = "0n7hay16aam9kfn642ri0wj5yzilbjm3l8znxc2p5dx9pn3rkwla";
   };
 
   buildInputs =
@@ -36,6 +36,6 @@ stdenv.mkDerivation rec {
     homepage = http://invisible-island.net/xterm;
     license = "BSD";
     maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/applications/misc/yeganesh/default.nix b/pkgs/applications/misc/yeganesh/default.nix
index 36a5817772d5..f26d315fce2c 100644
--- a/pkgs/applications/misc/yeganesh/default.nix
+++ b/pkgs/applications/misc/yeganesh/default.nix
@@ -1,3 +1,5 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, filepath, strict, time, xdgBasedir }:
 
 cabal.mkDerivation (self: {
diff --git a/pkgs/applications/misc/ykpers/default.nix b/pkgs/applications/misc/ykpers/default.nix
new file mode 100644
index 000000000000..e7bfa8ded50e
--- /dev/null
+++ b/pkgs/applications/misc/ykpers/default.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchurl, pkgconfig, libusb1, libyubikey}:
+
+stdenv.mkDerivation rec
+{
+  version = "1.15.0";
+  name = "ykpers-${version}";
+
+  src = fetchurl
+  {
+    url = "http://opensource.yubico.com/yubikey-personalization/releases/${name}.tar.gz";
+    sha256 = "1n4s8kk31q5zh2rm7sj9qmv86yl8ibimdnpvk9ny391a88qlypyd";
+  };
+
+  buildInputs = [pkgconfig libusb1 libyubikey];
+
+  meta =
+  {
+    homepage = "http://opensource.yubico.com/yubikey-personalization/";
+    description = "YubiKey Personalization cross-platform library and tool";
+    license = "bsd";
+    maintainers = [ stdenv.lib.maintainers.calrama ];
+  };
+}
diff --git a/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix
index e5eae771d8b3..5f44f79ebcdd 100644
--- a/pkgs/applications/misc/zathura/core/default.nix
+++ b/pkgs/applications/misc/zathura/core/default.nix
@@ -1,29 +1,25 @@
-{ stdenv, fetchurl, pkgconfig, gtk, girara, gettext, docutils, file, makeWrapper }:
+{ stdenv, fetchurl, pkgconfig, gtk, girara, gettext, docutils, file, makeWrapper, zathura_icon }:
 
 stdenv.mkDerivation rec {
-
-  version = "0.2.2";
-
+  version = "0.2.9";
   name = "zathura-core-${version}";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/download/zathura-${version}.tar.gz";
-    sha256 = "1ja2j9ygymr259fxf02j1vkvalypac48gpadq8fn3qbclxxj61k5";
+    sha256 = "17z05skjk95115ajp6459k1djadza1w8kck7jn1qnd697r01s1rc";
   };
 
-  buildInputs = [ pkgconfig gtk girara gettext makeWrapper ];
-
-  # Bug in zathura build system: we should remove empty manfiles in order them
-  # to be compiled properly
-  preBuild = ''
-    rm zathura.1
-    rm zathurarc.5
-  '';
+  buildInputs = [ pkgconfig file gtk girara gettext makeWrapper ];
 
   makeFlags = [ "PREFIX=$(out)" "RSTTOMAN=${docutils}/bin/rst2man.py" "VERBOSE=1" ];
 
   postInstall = ''
-    wrapProgram "$out/bin/zathura" --prefix PATH ":" "${file}/bin"
+    wrapProgram "$out/bin/zathura" \
+      --prefix PATH ":" "${file}/bin" \
+      --prefix XDG_CONFIG_DIRS ":" "$out/etc"
+
+    mkdir -pv $out/etc
+    echo "set window-icon ${zathura_icon}" > $out/etc/zathurarc
   '';
 
   meta = {
diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix
index 8bdc7865832d..1a4ab3d772c5 100644
--- a/pkgs/applications/misc/zathura/default.nix
+++ b/pkgs/applications/misc/zathura/default.nix
@@ -1,32 +1,45 @@
-{ callPackage, pkgs, fetchurl }:
+{ callPackage, pkgs, fetchurl, useMupdf }:
 
 rec {
   inherit (pkgs) stdenv;
 
-  zathura_core = callPackage ./core { };
+  icon = ./icon.xpm;
+
+  zathura_core = callPackage ./core {
+    gtk = pkgs.gtk3;
+    zathura_icon = icon;
+  };
 
   zathura_pdf_poppler = callPackage ./pdf-poppler { };
 
-  zathura_djvu = callPackage ./djvu { };
+  zathura_pdf_mupdf = callPackage ./pdf-mupdf {
+    gtk = pkgs.gtk3;
+  };
+
+  zathura_djvu = callPackage ./djvu {
+    gtk = pkgs.gtk3;
+  };
 
-  zathura_ps = callPackage ./ps { };
+  zathura_ps = callPackage ./ps {
+    gtk = pkgs.gtk3;
+  };
 
   zathuraWrapper = stdenv.mkDerivation {
 
-    inherit zathura_core;
+    inherit zathura_core icon;
 
     name = "zathura-${zathura_core.version}";
 
     plugins_path = stdenv.lib.makeSearchPath "lib" [
-      zathura_pdf_poppler
       zathura_djvu
       zathura_ps
+      (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler)
     ];
 
-    icon = ./icon.xpm;
-
     builder = ./builder.sh;
 
+    preferLocalBuild = true;
+
     meta = {
       homepage = http://pwmt.org/projects/zathura/;
       description = "A highly customizable and functional PDF viewer";
diff --git a/pkgs/applications/misc/zathura/djvu/default.nix b/pkgs/applications/misc/zathura/djvu/default.nix
index 9486acfef656..1a2347f27277 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.2.1";
+  name = "zathura-djvu-0.2.3";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
-    sha256 = "d8bb3c9e30244a0733e49740ee2dd099ce39fa16f2c320af27a0c09d9a25bcc3";
+    sha256 = "12gd8kb0al5mknh4rlvxzgzwz3vhjggqjh8ws27phaq14paq4vn1";
   };
 
   buildInputs = [ pkgconfig djvulibre gettext zathura_core gtk girara ];
diff --git a/pkgs/applications/misc/zathura/pdf-mupdf/config.patch b/pkgs/applications/misc/zathura/pdf-mupdf/config.patch
new file mode 100644
index 000000000000..c7d172c92634
--- /dev/null
+++ b/pkgs/applications/misc/zathura/pdf-mupdf/config.patch
@@ -0,0 +1,17 @@
+--- zathura-pdf-mupdf-0.2.6/config.mk
++++ zathura-pdf-mupdf-0.2.6/config.mk
+@@ -32,10 +32,11 @@
+ OPENSSL_INC ?= $(shell pkg-config --cflags libcrypto)
+ OPENSSL_LIB ?= $(shell pkg-config --libs libcrypto)
+ 
+-MUPDF_LIB ?= -lmupdf -lmupdf-js-none
++MUPDF_INC ?= $(shell pkg-config --cflags mupdf)
++MUPDF_LIB ?= $(shell pkg-config --libs mupdf)
+ 
+-INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC}
+-LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} -ljbig2dec -lopenjp2 -ljpeg
++INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC} ${MUPDF_INC}
++LIBS = ${GTK_LIB} ${GIRARA_LIB} ${OPENSSL_LIB} ${MUPDF_LIB} -ljbig2dec -ljpeg
+ 
+ # flags
+ CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
diff --git a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix
new file mode 100644
index 000000000000..4e585d852a2a
--- /dev/null
+++ b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, pkgconfig, zathura_core, gtk, girara, mupdf, openssl, openjpeg, libjpeg, jbig2dec }:
+
+stdenv.mkDerivation rec {
+  version = "0.2.6";
+  name = "zathura-pdf-mupdf-${version}";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
+    sha256 = "5df94b6f906008b5f3bca770a552da6d2917d6b8d3e4b3049cb7001302041b20";
+  };
+
+  buildInputs = [ pkgconfig zathura_core gtk girara openssl mupdf openjpeg libjpeg jbig2dec ];
+
+  makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
+
+  preConfigure = "patch -p1 < ${./config.patch}";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A zathura PDF plugin (mupdf)";
+    longDescription = ''
+      The zathura-pdf-mupdf plugin adds PDF support to zathura by
+      using the mupdf rendering library.
+    '';
+    license = stdenv.lib.licenses.zlib;
+    platforms = stdenv.lib.platforms.linux;
+#    maintainers = [ ];
+  };
+}
diff --git a/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
index faf4e49b968b..6625bf471942 100644
--- a/pkgs/applications/misc/zathura/pdf-poppler/default.nix
+++ b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
@@ -1,24 +1,24 @@
-{ stdenv, fetchurl, pkgconfig, zathura_core, girara, poppler, gettext }:
+{ stdenv, fetchurl, pkgconfig, zathura_core, girara, poppler }:
 
 stdenv.mkDerivation rec {
-  version = "0.2.2";
+  version = "0.2.5";
   name = "zathura-pdf-poppler-${version}";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
-    sha256 = "0px59f0bnmb9992n3c9iyzcwd6w7vg8ga069vc8qj4726ljml4c7";
+    sha256 = "1b0chsds8iwjm4g629p6a67nb6wgra65pw2vvngd7g35dmcjgcv0";
   };
 
-  buildInputs = [ pkgconfig poppler gettext zathura_core girara ];
+  buildInputs = [ pkgconfig poppler zathura_core girara ];
 
   makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
 
   meta = {
     homepage = http://pwmt.org/projects/zathura/;
-    description = "A zathura PDF plugin";
+    description = "A zathura PDF plugin (poppler)";
     longDescription = ''
       The zathura-pdf-poppler plugin adds PDF support to zathura by 
-      using the poppler rendering engine.
+      using the poppler rendering library.
     '';
     license = stdenv.lib.licenses.zlib;
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/misc/zathura/ps/default.nix b/pkgs/applications/misc/zathura/ps/default.nix
index 7c0dd552a66c..eef020016015 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.2.0";
+  name = "zathura-ps-0.2.2";
 
   src = fetchurl {
     url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
-    sha256 = "717eda01213b162421b6b52f29d6b981edc302fddf351ccb2c093b6842751414";
+    sha256 = "1a6ps5v1wk18qvslbkjln6w8wfzzr6fi13ls96vbdc03vdhn4m76";
   };
 
   buildInputs = [ pkgconfig libspectre gettext zathura_core gtk girara ];
diff --git a/pkgs/applications/networking/bittorrentsync/default.nix b/pkgs/applications/networking/bittorrentsync/default.nix
index c2d2f28751a7..989ceb235b02 100644
--- a/pkgs/applications/networking/bittorrentsync/default.nix
+++ b/pkgs/applications/networking/bittorrentsync/default.nix
@@ -1,47 +1,42 @@
 { stdenv, fetchurl, patchelf }:
 
-# this package contains the daemon version of bittorrent sync
-# it's unfortunately closed source.
-
 let
-  # TODO: arm, ppc, osx
-
   arch = if stdenv.system == "x86_64-linux" then "x64"
     else if stdenv.system == "i686-linux" then "i386"
     else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
-    
-  interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
-    else if stdenv.system == "i686-linux" then "ld-linux.so.2"
-    else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
 
-  version = "1.1.70";
-  sha256 = if stdenv.system == "x86_64-linux" then "1hnyncq5439fxn1q8dkzcg2alxjkanr4q4pgqqf3nngz4cdar5vi"
-    else if stdenv.system == "i686-linux" then "1ijdmzl8bnb4k99vrjn5gd31hy64p9wiyxw5wc5gbpgap191h5i5"
+  sha256 = if stdenv.system == "x86_64-linux" then "1xba0wv45w4kg84i5sywkfk44vj9wxkr7f1vga2mpz86j8vq25iy"
+    else if stdenv.system == "i686-linux" then "10ml1wclix9236zcb4mh60hdm9vvfaarlb62z7fdrwk6ikqbm7fk"
     else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
 
-in stdenv.mkDerivation {
-  name = "btsync-bin-${version}";
-  src = fetchurl {
-    url = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz";
+  libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.libc ];
+in
+stdenv.mkDerivation rec {
+  name = "btsync-${version}";
+  version = "1.3.94";
+
+  src  = fetchurl {
+    url  = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz";
     inherit sha256;
   };
 
-  sourceRoot = ".";
+  dontStrip   = true; # Don't strip, otherwise patching the rpaths breaks
+  sourceRoot  = ".";
+  buildInputs = [ patchelf ];
 
   installPhase = ''
-    ensureDir "$out/bin/"
+    mkdir -p "$out/bin/"
     cp -r "btsync" "$out/bin/"
 
-    patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
-      "$out/bin/btsync"
+    patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath} "$out/bin/btsync"
   '';
 
-  buildInputs = [ patchelf ];
-
   meta = {
-    homepage = "http://labs.bittorrent.com/experiments/sync.html";
     description = "Automatically sync files via secure, distributed technology";
-    license = stdenv.lib.licenses.unfree;
-    maintainers = [ stdenv.lib.maintainers.iElectric ];
+    homepage    = "http://www.bittorrent.com/sync";
+    license     = stdenv.lib.licenses.unfreeRedistributable;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ iElectric thoughtpolice ];
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix
new file mode 100644
index 000000000000..daab75c74ff9
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/browser.nix
@@ -0,0 +1,42 @@
+{ stdenv, mkChromiumDerivation }:
+
+with stdenv.lib;
+
+mkChromiumDerivation (base: rec {
+  name = "chromium-browser";
+  packageName = "chromium";
+  buildTargets = [ "mksnapshot" "chrome" ];
+
+  installPhase = ''
+    mkdir -p "$libExecPath"
+    cp -v "$buildPath/"*.pak "$libExecPath/"
+    cp -v "$buildPath/icudtl.dat" "$libExecPath/"
+    cp -vLR "$buildPath/locales" "$buildPath/resources" "$libExecPath/"
+    cp -v $buildPath/libffmpegsumo.so "$libExecPath/"
+
+    cp -v "$buildPath/chrome" "$libExecPath/$packageName"
+
+    mkdir -vp "$out/share/man/man1"
+    cp -v "$buildPath/chrome.1" "$out/share/man/man1/$packageName.1"
+
+    for icon_file in chrome/app/theme/chromium/product_logo_*[0-9].png; do
+      num_and_suffix="''${icon_file##*logo_}"
+      icon_size="''${num_and_suffix%.*}"
+      expr "$icon_size" : "^[0-9][0-9]*$" || continue
+      logo_output_prefix="$out/share/icons/hicolor"
+      logo_output_path="$logo_output_prefix/''${icon_size}x''${icon_size}/apps"
+      mkdir -vp "$logo_output_path"
+      cp -v "$icon_file" "$logo_output_path/$packageName.png"
+    done
+  '';
+
+  preHook = "unset NIX_ENFORCE_PURITY";
+
+  meta = {
+    description = "An open source web browser from Google";
+    homepage = http://www.chromium.org/;
+    maintainers = with maintainers; [ goibhniu chaoflow aszlig wizeman ];
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+  };
+})
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix
new file mode 100644
index 000000000000..b9011c0236f3
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/common.nix
@@ -0,0 +1,220 @@
+{ stdenv, fetchurl, ninja, which
+
+# default dependencies
+, bzip2, flac, speex, icu, libopus
+, libevent, expat, libjpeg, snappy
+, libpng, libxml2, libxslt
+, xdg_utils, yasm, minizip, libwebp
+, libusb1, libexif, pciutils
+
+, python, pythonPackages, perl, pkgconfig
+, nspr, udev, krb5
+, utillinux, alsaLib
+, gcc, bison, gperf
+, glib, gtk, dbus_glib
+, libXScrnSaver, libXcursor, libXtst, mesa
+, protobuf, speechd, libXdamage
+
+# optional dependencies
+, libgcrypt ? null # gnomeSupport || cupsSupport
+
+# package customization
+, enableSELinux ? false, libselinux ? null
+, enableNaCl ? false
+, useOpenSSL ? false, nss ? null, openssl ? null
+, gnomeSupport ? false, gnome ? null
+, gnomeKeyringSupport ? false, libgnome_keyring3 ? null
+, proprietaryCodecs ? true
+, cupsSupport ? false
+, pulseSupport ? false, pulseaudio ? null
+
+, source
+, plugins
+}:
+
+buildFun:
+
+with stdenv.lib;
+
+let
+  # The additional attributes for creating derivations based on the chromium
+  # source tree.
+  extraAttrs = buildFun base;
+
+  mkGypFlags =
+    let
+      sanitize = value:
+        if value == true then "1"
+        else if value == false then "0"
+        else "${value}";
+      toFlag = key: value: "-D${key}=${sanitize value}";
+    in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
+
+  gypFlagsUseSystemLibs = {
+    use_system_bzip2 = true;
+    use_system_flac = true;
+    use_system_libevent = true;
+    use_system_libexpat = true;
+    use_system_libexif = true;
+    use_system_libjpeg = true;
+    use_system_libpng = true;
+    use_system_libwebp = true;
+    use_system_libxml = true;
+    use_system_opus = true;
+    use_system_snappy = true;
+    use_system_speex = true;
+    use_system_ssl = useOpenSSL;
+    use_system_stlport = true;
+    use_system_xdg_utils = true;
+    use_system_yasm = true;
+    use_system_zlib = false;
+    use_system_protobuf = true;
+
+    use_system_harfbuzz = false;
+    use_system_icu = false; # Doesn't support ICU 52 yet.
+    use_system_libusb = false; # http://crbug.com/266149
+    use_system_skia = false;
+    use_system_sqlite = false; # http://crbug.com/22208
+    use_system_v8 = false;
+  };
+
+  opusWithCustomModes = libopus.override {
+    withCustomModes = true;
+  };
+
+  defaultDependencies = [
+    bzip2 flac speex icu opusWithCustomModes
+    libevent expat libjpeg snappy
+    libpng libxml2 libxslt
+    xdg_utils yasm minizip libwebp
+    libusb1 libexif
+  ];
+
+  # build paths and release info
+  packageName = extraAttrs.packageName or extraAttrs.name;
+  buildType = "Release";
+  buildPath = "out/${buildType}";
+  libExecPath = "$out/libexec/${packageName}";
+
+  base = rec {
+    name = "${packageName}-${version}";
+    inherit (source) version;
+    inherit packageName buildType buildPath;
+    src = source;
+
+    buildInputs = defaultDependencies ++ [
+      which
+      python perl pkgconfig
+      nspr udev
+      (if useOpenSSL then openssl else nss)
+      utillinux alsaLib
+      bison gperf krb5
+      glib gtk dbus_glib
+      libXScrnSaver libXcursor libXtst mesa
+      pciutils protobuf speechd libXdamage
+      pythonPackages.gyp pythonPackages.ply pythonPackages.jinja2
+    ] ++ optional gnomeKeyringSupport libgnome_keyring3
+      ++ optionals gnomeSupport [ gnome.GConf libgcrypt ]
+      ++ optional enableSELinux libselinux
+      ++ optional cupsSupport libgcrypt
+      ++ optional pulseSupport pulseaudio;
+
+    # XXX: Wait for https://crbug.com/239107 and https://crbug.com/239181 to
+    #      be fixed, then try again to unbundle everything into separate
+    #      derivations.
+    prePatch = ''
+      cp -dsr --no-preserve=mode "${source.main}"/* .
+      cp -dsr --no-preserve=mode "${source.sandbox}" sandbox
+      cp -dr "${source.bundled}" third_party
+      chmod -R u+w third_party
+
+      # Hardcode source tree root in all gyp files
+      find -iname '*.gyp*' \( -type f -o -type l \) \
+        -exec sed -i -e 's|<(DEPTH)|'"$(pwd)"'|g' {} + \
+        -exec chmod u+w {} +
+    '';
+
+    postPatch = ''
+      sed -i -e '/base::FilePath exe_dir/,/^ *} *$/c \
+        sandbox_binary = base::FilePath(getenv("CHROMIUM_SANDBOX_BINARY_PATH"));
+      ' sandbox/linux/suid/client/setuid_sandbox_client.cc
+
+      sed -i -e '/module_path *=.*libexif.so/ {
+        s|= [^;]*|= base::FilePath().AppendASCII("${libexif}/lib/libexif.so")|
+      }' chrome/utility/media_galleries/image_metadata_extractor.cc
+    '';
+
+    gypFlags = mkGypFlags (gypFlagsUseSystemLibs // {
+      linux_use_gold_binary = false;
+      linux_use_gold_flags = false;
+      proprietary_codecs = false;
+      use_gnome_keyring = gnomeKeyringSupport;
+      use_gconf = gnomeSupport;
+      use_gio = gnomeSupport;
+      use_pulseaudio = pulseSupport;
+      linux_link_pulseaudio = pulseSupport;
+      disable_nacl = !enableNaCl;
+      use_openssl = useOpenSSL;
+      selinux = enableSELinux;
+      use_cups = cupsSupport;
+      linux_sandbox_chrome_path="${libExecPath}/${packageName}";
+      werror = "";
+      clang = false;
+
+      # FIXME: In version 37, omnibox.mojom.js doesn't seem to be generated.
+      use_mojo = versionOlder source.version "37.0.0.0";
+
+      # Google API keys, see:
+      #   http://www.chromium.org/developers/how-tos/api-keys
+      # Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
+      # please get your own set of keys.
+      google_api_key = "AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI";
+      google_default_client_id = "404761575300.apps.googleusercontent.com";
+      google_default_client_secret = "9rIFQjfnkykEmqb6FfjJQD1D";
+
+    } // optionalAttrs proprietaryCodecs {
+      # enable support for the H.264 codec
+      proprietary_codecs = true;
+      ffmpeg_branding = "Chrome";
+    } // optionalAttrs (stdenv.system == "x86_64-linux") {
+      target_arch = "x64";
+      python_arch = "x86-64";
+    } // optionalAttrs (stdenv.system == "i686-linux") {
+      target_arch = "ia32";
+      python_arch = "ia32";
+    } // (extraAttrs.gypFlags or {}));
+
+    configurePhase = ''
+      # This is to ensure expansion of $out.
+      libExecPath="${libExecPath}"
+      python build/linux/unbundle/replace_gyp_files.py ${gypFlags}
+      python build/gyp_chromium -f ninja --depth "$(pwd)" ${gypFlags}
+    '';
+
+    buildPhase = let
+      CC = "${gcc}/bin/gcc";
+      CXX = "${gcc}/bin/g++";
+      buildCommand = target: let
+        # XXX: Only needed for version 36 and older!
+        targetSuffix = optionalString
+          (versionOlder source.version "37.0.0.0" && target == "mksnapshot")
+          (if stdenv.is64bit then ".x64" else ".ia32");
+      in ''
+        CC="${CC}" CC_host="${CC}"     \
+        CXX="${CXX}" CXX_host="${CXX}" \
+        LINK_host="${CXX}"             \
+          "${ninja}/bin/ninja" -C "${buildPath}"  \
+            -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
+            "${target}${targetSuffix}"
+      '' + optionalString (target == "mksnapshot" || target == "chrome") ''
+        paxmark m "${buildPath}/${target}${targetSuffix}"
+      '';
+      targets = extraAttrs.buildTargets or [];
+      commands = map buildCommand targets;
+    in concatStringsSep "\n" commands;
+  };
+
+# Remove some extraAttrs we supplied to the base attributes already.
+in stdenv.mkDerivation (base // removeAttrs extraAttrs [
+  "name" "gypFlags" "buildTargets"
+])
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index fa91a877fdc0..4dfdca882bc8 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -1,276 +1,86 @@
-{ stdenv, fetchurl, makeWrapper, ninja, which
-
-# default dependencies
-, bzip2, flac, speex
-, libevent, expat, libjpeg
-, libpng, libxml2, libxslt
-, xdg_utils, yasm, zlib
-, libusb1, libexif, pciutils
-
-, python, pythonPackages, perl, pkgconfig
-, nspr, udev, krb5, file
-, utillinux, alsaLib
-, gcc, bison, gperf
-, glib, gtk, dbus_glib
-, libXScrnSaver, libXcursor, libXtst, mesa
-, protobuf, speechd, libXdamage
-
-# optional dependencies
-, libgcrypt ? null # gnomeSupport || cupsSupport
+{ newScope, stdenv, makeWrapper, makeDesktopItem
 
 # package customization
 , channel ? "stable"
-, enableSELinux ? false, libselinux ? null
+, enableSELinux ? false
 , enableNaCl ? false
-, useOpenSSL ? false, nss ? null, openssl ? null
-, gnomeSupport ? false, gconf ? null
-, gnomeKeyringSupport ? false, libgnome_keyring ? null
+, useOpenSSL ? false
+, gnomeSupport ? false
+, gnomeKeyringSupport ? false
 , proprietaryCodecs ? true
+, enablePepperFlash ? false
+, enablePepperPDF ? false
 , cupsSupport ? false
-, pulseSupport ? false, pulseaudio ? null
+, pulseSupport ? false
 }:
 
-with stdenv.lib;
-
 let
-  src = with getAttr channel (import ./sources.nix); stdenv.mkDerivation {
-    name = "chromium-source-${version}";
+  callPackage = newScope chromium;
 
-    src = fetchurl {
-      inherit url sha256;
+  chromium = {
+    source = callPackage ./source {
+      inherit channel;
+      # XXX: common config
+      inherit useOpenSSL;
     };
 
-    phases = [ "unpackPhase" "patchPhase" "installPhase" ];
-
-    opensslPatches = optional useOpenSSL openssl.patches;
-
-    prePatch = "patchShebangs .";
-
-    patches = singleton (
-      if versionOlder version "31.0.0.0"
-      then ./sandbox_userns_30.patch
-      else ./sandbox_userns_31.patch
-    );
-
-    postPatch = ''
-      sed -i -r -e 's/-f(stack-protector)(-all)?/-fno-\1/' build/common.gypi
-      sed -i -e 's|/usr/bin/gcc|gcc|' third_party/WebKit/Source/core/core.gypi
-    '' + optionalString useOpenSSL ''
-      cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
-    '';
-
-    outputs = [ "out" "sandbox" "bundled" "main" ];
-    installPhase = ''
-      ensureDir "$out" "$sandbox" "$bundled" "$main"
-
-      header "copying browser main sources to $main"
-      find . -mindepth 1 -maxdepth 1 \
-        \! -path ./sandbox \
-        \! -path ./third_party \
-        \! -path ./build \
-        \! -path ./tools \
-        \! -name '.*' \
-        -print | xargs cp -rt "$main"
-      stopNest
-
-      header "copying sandbox components to $sandbox"
-      cp -rt "$sandbox" sandbox/*
-      stopNest
-
-      header "copying third party sources to $bundled"
-      cp -rt "$bundled" third_party/*
-      stopNest
-
-      header "copying build requisites to $out"
-      cp -rt "$out" build tools
-      stopNest
-
-      rm -rf "$out/tools/gyp" # XXX: Don't even copy it in the first place.
-    '';
-
-    passthru = {
-      inherit version;
+    mkChromiumDerivation = callPackage ./common.nix {
+      inherit enableSELinux enableNaCl useOpenSSL gnomeSupport
+              gnomeKeyringSupport proprietaryCodecs cupsSupport
+              pulseSupport;
     };
-  };
 
-  mkGypFlags =
-    let
-      sanitize = value:
-        if value == true then "1"
-        else if value == false then "0"
-        else "${value}";
-      toFlag = key: value: "-D${key}=${sanitize value}";
-    in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
+    browser = callPackage ./browser.nix { };
+    sandbox = callPackage ./sandbox.nix { };
 
-  gypFlagsUseSystemLibs = {
-    use_system_bzip2 = true;
-    use_system_flac = true;
-    use_system_libevent = true;
-    use_system_libexpat = true;
-    use_system_libexif = true;
-    use_system_libjpeg = true;
-    use_system_libpng = false; # PNG dlopen() version conflict
-    use_system_libusb = true;
-    use_system_libxml = true;
-    use_system_speex = true;
-    use_system_ssl = useOpenSSL;
-    use_system_stlport = true;
-    use_system_xdg_utils = true;
-    use_system_yasm = true;
-    use_system_zlib = false; # http://crbug.com/143623
-    use_system_protobuf = true;
-
-    use_system_harfbuzz = false;
-    use_system_icu = false;
-    use_system_libwebp = false; # http://crbug.com/133161
-    use_system_skia = false;
-    use_system_sqlite = false; # http://crbug.com/22208
-    use_system_v8 = false;
+    plugins = callPackage ./plugins.nix {
+      inherit enablePepperFlash enablePepperPDF;
+    };
   };
 
-  defaultDependencies = [
-    bzip2 flac speex
-    libevent expat libjpeg
-    libpng libxml2 libxslt
-    xdg_utils yasm zlib
-    libusb1 libexif
-  ];
-
-  sandbox = import ./sandbox.nix {
-    inherit stdenv;
-    src = src.sandbox;
-    binary = "${packageName}_sandbox";
+  desktopItem = makeDesktopItem {
+    name = "chromium";
+    exec = "chromium";
+    icon = "${chromium.browser}/share/icons/hicolor/48x48/apps/chromium.png";
+    comment = "An open source web browser from Google";
+    desktopName = "Chromium";
+    genericName = "Web browser";
+    mimeType = stdenv.lib.concatStringsSep ";" [
+      "text/html"
+      "text/xml"
+      "application/xhtml+xml"
+      "x-scheme-handler/http"
+      "x-scheme-handler/https"
+      "x-scheme-handler/ftp"
+      "x-scheme-handler/mailto"
+      "x-scheme-handler/webcal"
+    ];
+    categories = "Network;WebBrowser";
   };
 
-  # build paths and release info
-  packageName = "chromium";
-  buildType = "Release";
-  buildPath = "out/${buildType}";
-  libExecPath = "$out/libexec/${packageName}";
-  sandboxPath = "${sandbox}/bin/${packageName}_sandbox";
-
-in stdenv.mkDerivation rec {
-  name = "${packageName}-${src.version}";
-  inherit packageName src;
-
-  buildInputs = defaultDependencies ++ [
-    which makeWrapper
-    python perl pkgconfig
-    nspr udev
-    (if useOpenSSL then openssl else nss)
-    utillinux alsaLib
-    gcc bison gperf
-    krb5 file
-    glib gtk dbus_glib
-    libXScrnSaver libXcursor libXtst mesa
-    pciutils protobuf speechd libXdamage
-    pythonPackages.gyp
-  ] ++ optional gnomeKeyringSupport libgnome_keyring
-    ++ optionals gnomeSupport [ gconf libgcrypt ]
-    ++ optional enableSELinux libselinux
-    ++ optional cupsSupport libgcrypt
-    ++ optional pulseSupport pulseaudio;
-
-  prePatch = ''
-    # XXX: Figure out a way how to split these properly.
-    #cpflags="-dsr --no-preserve=mode"
-    cpflags="-dr"
-    cp $cpflags "${src.main}"/* .
-    cp $cpflags "${src.bundled}" third_party
-    cp $cpflags "${src.sandbox}" sandbox
-    chmod -R u+w . # XXX!
-  '';
-
-  postPatch = ''
-    sed -i -e '/base::FilePath exe_dir/,/^ *} *$/c \
-      sandbox_binary = \
-        base::FilePath("'"${sandboxPath}"'");
-    ' content/browser/browser_main_loop.cc
-  '';
-
-  gypFlags = mkGypFlags (gypFlagsUseSystemLibs // {
-    linux_use_gold_binary = false;
-    linux_use_gold_flags = false;
-    proprietary_codecs = false;
-    use_gnome_keyring = gnomeKeyringSupport;
-    use_gconf = gnomeSupport;
-    use_gio = gnomeSupport;
-    use_pulseaudio = pulseSupport;
-    disable_nacl = !enableNaCl;
-    use_openssl = useOpenSSL;
-    selinux = enableSELinux;
-    use_cups = cupsSupport;
-    linux_sandbox_path="${sandboxPath}";
-    linux_sandbox_chrome_path="${libExecPath}/${packageName}";
-    werror = "";
-
-    # Google API keys, see http://www.chromium.org/developers/how-tos/api-keys.
-    # Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
-    # please get your own set of keys.
-    google_api_key = "AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI";
-    google_default_client_id = "404761575300.apps.googleusercontent.com";
-    google_default_client_secret = "9rIFQjfnkykEmqb6FfjJQD1D";
+in stdenv.mkDerivation {
+  name = "chromium-${channel}-${chromium.browser.version}";
 
-  } // optionalAttrs proprietaryCodecs {
-    # enable support for the H.264 codec
-    proprietary_codecs = true;
-    ffmpeg_branding = "Chrome";
-  } // optionalAttrs (stdenv.system == "x86_64-linux") {
-    target_arch = "x64";
-  } // optionalAttrs (stdenv.system == "i686-linux") {
-    target_arch = "ia32";
-  });
+  buildInputs = [ makeWrapper ];
 
-  configurePhase = ''
-    python build/gyp_chromium -f ninja --depth "$(pwd)" ${gypFlags}
-  '';
-
-  buildPhase = let
-    CC = "${gcc}/bin/gcc";
-    CXX = "${gcc}/bin/g++";
+  buildCommand = let
+    browserBinary = "${chromium.browser}/libexec/chromium/chromium";
+    sandboxBinary = "${chromium.sandbox}/bin/chromium-sandbox";
   in ''
-    CC="${CC}" CC_host="${CC}"     \
-    CXX="${CXX}" CXX_host="${CXX}" \
-    LINK_host="${CXX}"             \
-      "${ninja}/bin/ninja" -C "${buildPath}"  \
-        -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
-        chrome ${optionalString (!enableSELinux) "chrome_sandbox"}
-  '';
-
-  installPhase = ''
-    ensureDir "${libExecPath}"
-    cp -v "${buildPath}/"*.pak "${libExecPath}/"
-    cp -vR "${buildPath}/locales" "${buildPath}/resources" "${libExecPath}/"
-    cp -v ${buildPath}/libffmpegsumo.so "${libExecPath}/"
-
-    cp -v "${buildPath}/chrome" "${libExecPath}/${packageName}"
+    mkdir -p "$out/bin" "$out/share/applications"
 
-    mkdir -vp "$out/bin"
-    makeWrapper "${libExecPath}/${packageName}" "$out/bin/${packageName}"
+    ln -s "${chromium.browser}/share" "$out/share"
+    makeWrapper "${browserBinary}" "$out/bin/chromium" \
+      --set CHROMIUM_SANDBOX_BINARY_PATH "${sandboxBinary}" \
+      --add-flags "${chromium.plugins.flagsEnabled}"
 
-    mkdir -vp "$out/share/man/man1"
-    cp -v "${buildPath}/chrome.1" "$out/share/man/man1/${packageName}.1"
-
-    for icon_file in chrome/app/theme/chromium/product_logo_*[0-9].png; do
-      num_and_suffix="''${icon_file##*logo_}"
-      icon_size="''${num_and_suffix%.*}"
-      expr "$icon_size" : "^[0-9][0-9]*$" || continue
-      logo_output_prefix="$out/share/icons/hicolor"
-      logo_output_path="$logo_output_prefix/''${icon_size}x''${icon_size}/apps"
-      mkdir -vp "$logo_output_path"
-      cp -v "$icon_file" "$logo_output_path/${packageName}.png"
-    done
+    ln -s "${chromium.browser}/share/icons" "$out/share/icons"
+    cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
   '';
 
-  passthru = {
-    inherit sandbox;
-  };
+  inherit (chromium.browser) meta packageName;
 
-  meta = {
-    description = "An open source web browser from Google";
-    homepage = http://www.chromium.org/;
-    maintainers = with maintainers; [ goibhniu chaoflow aszlig ];
-    license = licenses.bsd3;
-    platforms = platforms.linux;
+  passthru = {
+    mkDerivation = chromium.mkChromiumDerivation;
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/plugins.nix b/pkgs/applications/networking/browsers/chromium/plugins.nix
new file mode 100644
index 000000000000..e0c45f910751
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/plugins.nix
@@ -0,0 +1,78 @@
+{ stdenv
+, enablePepperFlash ? false
+, enablePepperPDF ? false
+
+, source
+}:
+
+with stdenv.lib;
+
+let
+  plugins = stdenv.mkDerivation {
+    name = "chromium-binary-plugins";
+
+    # XXX: Only temporary and has to be version-specific
+    src = source.plugins;
+
+    phases = [ "unpackPhase" "patchPhase" "checkPhase" "installPhase" ];
+    outputs = [ "pdf" "flash" ];
+
+    unpackCmd = let
+      chan = if source.channel == "dev"    then "chrome-unstable"
+        else if source.channel == "stable" then "chrome"
+        else "chrome-${source.channel}";
+    in ''
+      mkdir -p plugins
+      ar p "$src" data.tar.lzma | tar xJ -C plugins --strip-components=4 \
+        ./opt/google/${chan}/PepperFlash \
+        ./opt/google/${chan}/libpdf.so
+    '';
+
+    doCheck = true;
+    checkPhase = ''
+      ! find -iname '*.so' -exec ldd {} + | grep 'not found'
+    '';
+
+    patchPhase = let
+      rpaths = [ stdenv.gcc.gcc ];
+      mkrpath = p: "${makeSearchPath "lib64" p}:${makeSearchPath "lib" p}";
+    in ''
+      for sofile in PepperFlash/libpepflashplayer.so libpdf.so; do
+        chmod +x "$sofile"
+        patchelf --set-rpath "${mkrpath rpaths}" "$sofile"
+      done
+    '';
+
+    installPhase = let
+      pdfName = "Chrome PDF Viewer";
+      pdfDescription = "Portable Document Format";
+      pdfMimeTypes = concatStringsSep ";" [
+        "application/pdf"
+        "application/x-google-chrome-print-preview-pdf"
+      ];
+      pdfInfo = "#${pdfName}#${pdfDescription};${pdfMimeTypes}";
+    in ''
+      install -vD libpdf.so "$pdf/lib/libpdf.so"
+      mkdir -p "$pdf/nix-support"
+      echo "--register-pepper-plugins='$pdf/lib/libpdf.so${pdfInfo}'" \
+        > "$pdf/nix-support/chromium-flags"
+
+      flashVersion="$(
+        sed -n -r 's/.*"version": "([^"]+)",.*/\1/p' PepperFlash/manifest.json
+      )"
+
+      install -vD PepperFlash/libpepflashplayer.so \
+        "$flash/lib/libpepflashplayer.so"
+      mkdir -p "$flash/nix-support"
+      echo "--ppapi-flash-path='$flash/lib/libpepflashplayer.so'" \
+           "--ppapi-flash-version=$flashVersion" \
+           > "$flash/nix-support/chromium-flags"
+    '';
+
+    passthru.flagsEnabled = let
+      enabledPlugins = optional enablePepperFlash plugins.flash
+                    ++ optional enablePepperPDF   plugins.pdf;
+      getFlags = plugin: "$(< ${plugin}/nix-support/chromium-flags)";
+    in concatStringsSep " " (map getFlags enabledPlugins);
+  };
+in plugins
diff --git a/pkgs/applications/networking/browsers/chromium/sandbox.nix b/pkgs/applications/networking/browsers/chromium/sandbox.nix
index b43385e86338..b470ed633253 100644
--- a/pkgs/applications/networking/browsers/chromium/sandbox.nix
+++ b/pkgs/applications/networking/browsers/chromium/sandbox.nix
@@ -1,12 +1,13 @@
-{ stdenv, src, binary }:
+{ stdenv, source }:
 
 stdenv.mkDerivation {
-  name = "chromium-sandbox-${src.version}";
-  inherit src;
+  name = "chromium-sandbox-${source.version}";
+  src = source.sandbox;
 
   patchPhase = ''
     sed -i -e '/#include.*base_export/c \
       #define BASE_EXPORT __attribute__((visibility("default")))
+    /#include/s|sandbox/linux|'"$(pwd)"'/linux|
     ' linux/suid/*.[hc]
   '';
 
@@ -15,6 +16,6 @@ stdenv.mkDerivation {
   '';
 
   installPhase = ''
-    install -svD sandbox "$out/bin/${binary}"
+    install -svD sandbox "$out/bin/chromium-sandbox"
   '';
 }
diff --git a/pkgs/applications/networking/browsers/chromium/sandbox_userns_30.patch b/pkgs/applications/networking/browsers/chromium/sandbox_userns_30.patch
deleted file mode 100644
index 9a412352c521..000000000000
--- a/pkgs/applications/networking/browsers/chromium/sandbox_userns_30.patch
+++ /dev/null
@@ -1,293 +0,0 @@
-commit 41510de6ae32e6161073992bd1243f7f33148a06
-Author: aszlig <aszlig@redmoonstudios.org>
-Date:   Thu May 16 14:17:56 2013 +0200
-
-    zygote: Add support for user namespaces on Linux.
-    
-    The implementation is done by patching the Zygote host to execute the sandbox
-    binary with CLONE_NEWUSER and setting the uid and gid mapping so that the child
-    process is using uid 0 and gid 0 which map to the current user of the parent.
-    Afterwards, the sandbox will continue as if it was called as a setuid binary.
-    
-    In addition, this adds new_user_namespace as an option in process_util in order
-    to set the UID and GID mapping correctly. The reason for this is that just
-    passing CLONE_NEWUSER to clone_flags doesn't help in LaunchProcess(), because
-    without setting the mappings exec*() will clear the process's capability sets.
-    
-    If the kernel doesn't support unprivileged user namespaces and the sandbox
-    binary doesn't have the setuid flag, the Zygote main process will run without a
-    sandbox. This is to mimic the behaviour if no SUID sandbox binary path is set.
-    
-    Signed-off-by: aszlig <aszlig@redmoonstudios.org>
-
-diff --git a/base/process/launch.h b/base/process/launch.h
-index 45b1053..ce71418 100644
---- a/base/process/launch.h
-+++ b/base/process/launch.h
-@@ -51,6 +51,7 @@ struct LaunchOptions {
-         new_process_group(false)
- #if defined(OS_LINUX)
-         , clone_flags(0)
-+        , new_user_namespace(false)
- #endif  // OS_LINUX
- #if defined(OS_CHROMEOS)
-         , ctrl_terminal_fd(-1)
-@@ -125,6 +126,9 @@ struct LaunchOptions {
- #if defined(OS_LINUX)
-   // If non-zero, start the process using clone(), using flags as provided.
-   int clone_flags;
-+
-+  // If true, start the process in a new user namespace.
-+  bool new_user_namespace;
- #endif  // defined(OS_LINUX)
- 
- #if defined(OS_CHROMEOS)
-diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
-index 52e149c..312f835 100644
---- a/base/process/launch_posix.cc
-+++ b/base/process/launch_posix.cc
-@@ -37,6 +37,13 @@
- #include "base/threading/platform_thread.h"
- #include "base/threading/thread_restrictions.h"
- 
-+#if defined(OS_LINUX)
-+#include <sched.h>
-+#if !defined(CLONE_NEWUSER)
-+#define CLONE_NEWUSER 0x10000000
-+#endif
-+#endif
-+
- #if defined(OS_CHROMEOS)
- #include <sys/ioctl.h>
- #endif
-@@ -416,13 +423,23 @@ bool LaunchProcess(const std::vector<std::string>& argv,
- 
-   pid_t pid;
- #if defined(OS_LINUX)
--  if (options.clone_flags) {
-+  int map_pipe_fd[2];
-+  int flags = options.clone_flags;
-+
-+  if (options.new_user_namespace) {
-+    flags |= CLONE_NEWUSER;
-+    if (pipe(map_pipe_fd) < 0) {
-+      DPLOG(ERROR) << "user namespace pipe";
-+      return false;
-+    }
-+  }
-+
-+  if (options.clone_flags || options.new_user_namespace) {
-     // Signal handling in this function assumes the creation of a new
-     // process, so we check that a thread is not being created by mistake
-     // and that signal handling follows the process-creation rules.
--    RAW_CHECK(
--        !(options.clone_flags & (CLONE_SIGHAND | CLONE_THREAD | CLONE_VM)));
--    pid = syscall(__NR_clone, options.clone_flags, 0, 0, 0);
-+    RAW_CHECK(!(flags & (CLONE_SIGHAND | CLONE_THREAD | CLONE_VM)));
-+    pid = syscall(__NR_clone, flags, 0, 0, 0);
-   } else
- #endif
-   {
-@@ -440,6 +457,21 @@ bool LaunchProcess(const std::vector<std::string>& argv,
-   } else if (pid == 0) {
-     // Child process
- 
-+#if defined(OS_LINUX)
-+    if (options.new_user_namespace) {
-+      // Close the write end of the pipe so we get an EOF when the parent closes
-+      // the FD. This is to avoid race conditions when the UID/GID mappings are
-+      // written _after_ execvp().
-+      close(map_pipe_fd[1]);
-+
-+      char dummy;
-+      if (HANDLE_EINTR(read(map_pipe_fd[0], &dummy, 1)) != 0) {
-+        RAW_LOG(ERROR, "Unexpected input in uid/gid mapping pipe.");
-+        _exit(127);
-+      }
-+    }
-+#endif
-+
-     // DANGER: fork() rule: in the child, if you don't end up doing exec*(),
-     // you call _exit() instead of exit(). This is because _exit() does not
-     // call any previously-registered (in the parent) exit handlers, which
-@@ -555,6 +587,40 @@ bool LaunchProcess(const std::vector<std::string>& argv,
-     _exit(127);
-   } else {
-     // Parent process
-+#if defined(OS_LINUX)
-+    if (options.new_user_namespace) {
-+      // We need to write UID/GID mapping here to map the current user outside
-+      // the namespace to the root user inside the namespace in order to
-+      // correctly "fool" the child process.
-+      char buf[256];
-+      int map_fd, map_len;
-+
-+      snprintf(buf, sizeof(buf), "/proc/%d/uid_map", pid);
-+      map_fd = open(buf, O_RDWR);
-+      DPCHECK(map_fd >= 0);
-+      snprintf(buf, sizeof(buf), "0 %d 1", geteuid());
-+      map_len = strlen(buf);
-+      if (write(map_fd, buf, map_len) != map_len) {
-+        RAW_LOG(WARNING, "Can't write to uid_map.");
-+      }
-+      close(map_fd);
-+
-+      snprintf(buf, sizeof(buf), "/proc/%d/gid_map", pid);
-+      map_fd = open(buf, O_RDWR);
-+      DPCHECK(map_fd >= 0);
-+      snprintf(buf, sizeof(buf), "0 %d 1", getegid());
-+      map_len = strlen(buf);
-+      if (write(map_fd, buf, map_len) != map_len) {
-+        RAW_LOG(WARNING, "Can't write to gid_map.");
-+      }
-+      close(map_fd);
-+
-+      // Close the pipe on the parent, so the child can continue doing the
-+      // execvp() call.
-+      close(map_pipe_fd[1]);
-+    }
-+#endif
-+
-     if (options.wait) {
-       // While this isn't strictly disk IO, waiting for another process to
-       // finish is the sort of thing ThreadRestrictions is trying to prevent.
-diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc
-index bb84e62..bce0d18 100644
---- a/content/browser/zygote_host/zygote_host_impl_linux.cc
-+++ b/content/browser/zygote_host/zygote_host_impl_linux.cc
-@@ -119,25 +119,31 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
- 
-   sandbox_binary_ = sandbox_cmd.c_str();
- 
--  // A non empty sandbox_cmd means we want a SUID sandbox.
--  using_suid_sandbox_ = !sandbox_cmd.empty();
-+  bool userns_sandbox = false;
-+  const std::vector<std::string> cmd_line_unwrapped(cmd_line.argv());
- 
--  if (using_suid_sandbox_) {
-+  if (!sandbox_cmd.empty()) {
-     struct stat st;
-     if (stat(sandbox_binary_.c_str(), &st) != 0) {
-       LOG(FATAL) << "The SUID sandbox helper binary is missing: "
-                  << sandbox_binary_ << " Aborting now.";
-     }
- 
--    if (access(sandbox_binary_.c_str(), X_OK) == 0 &&
--        (st.st_uid == 0) &&
--        (st.st_mode & S_ISUID) &&
--        (st.st_mode & S_IXOTH)) {
-+    if (access(sandbox_binary_.c_str(), X_OK) == 0) {
-+      using_suid_sandbox_ = true;
-+
-       cmd_line.PrependWrapper(sandbox_binary_);
- 
-       scoped_ptr<sandbox::SetuidSandboxClient>
-           sandbox_client(sandbox::SetuidSandboxClient::Create());
-       sandbox_client->SetupLaunchEnvironment();
-+
-+      if (!((st.st_uid == 0) &&
-+            (st.st_mode & S_ISUID) &&
-+            (st.st_mode & S_IXOTH))) {
-+        userns_sandbox = true;
-+        sandbox_client->SetNoSuid();
-+      }
-     } else {
-       LOG(FATAL) << "The SUID sandbox helper binary was found, but is not "
-                     "configured correctly. Rather than run without sandboxing "
-@@ -161,7 +167,19 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
-   base::ProcessHandle process = -1;
-   base::LaunchOptions options;
-   options.fds_to_remap = &fds_to_map;
-+  if (userns_sandbox)
-+    options.new_user_namespace = true;
-   base::LaunchProcess(cmd_line.argv(), options, &process);
-+
-+  if (process == -1 && userns_sandbox) {
-+    LOG(ERROR) << "User namespace sandbox failed to start, running without "
-+               << "sandbox! You need at least kernel 3.8.0 with CONFIG_USER_NS "
-+               << "enabled in order to use the sandbox without setuid bit.";
-+    using_suid_sandbox_ = false;
-+    options.new_user_namespace = false;
-+    base::LaunchProcess(cmd_line_unwrapped, options, &process);
-+  }
-+
-   CHECK(process != -1) << "Failed to launch zygote process";
- 
-   if (using_suid_sandbox_) {
-diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
-index 1f0e9f5..ade5aab 100644
---- a/content/zygote/zygote_main_linux.cc
-+++ b/content/zygote/zygote_main_linux.cc
-@@ -420,6 +420,13 @@ static bool EnterSandbox(sandbox::SetuidSandboxClient* setuid_sandbox,
-       *has_started_new_init = true;
-     }
- 
-+    // Don't set non-dumpable, as it causes trouble when the host tries to find
-+    // the zygote process (XXX: Not quite sure why this happens with user
-+    // namespaces). Fortunately, we also have the seccomp filter sandbox which
-+    // should disallow the use of ptrace.
-+    if (setuid_sandbox->IsNoSuid())
-+      return true;
-+
- #if !defined(OS_OPENBSD)
-     // Previously, we required that the binary be non-readable. This causes the
-     // kernel to mark the process as non-dumpable at startup. The thinking was
-diff --git a/sandbox/linux/suid/client/setuid_sandbox_client.cc b/sandbox/linux/suid/client/setuid_sandbox_client.cc
-index 34231d4..36e3201 100644
---- a/sandbox/linux/suid/client/setuid_sandbox_client.cc
-+++ b/sandbox/linux/suid/client/setuid_sandbox_client.cc
-@@ -166,6 +166,10 @@ bool SetuidSandboxClient::IsInNewNETNamespace() const {
-   return env_->HasVar(kSandboxNETNSEnvironmentVarName);
- }
- 
-+bool SetuidSandboxClient::IsNoSuid() const {
-+  return env_->HasVar(kSandboxNoSuidVarName);
-+}
-+
- bool SetuidSandboxClient::IsSandboxed() const {
-   return sandboxed_;
- }
-@@ -175,5 +179,9 @@ void SetuidSandboxClient::SetupLaunchEnvironment() {
-   SetSandboxAPIEnvironmentVariable(env_);
- }
- 
-+void SetuidSandboxClient::SetNoSuid() {
-+  env_->SetVar(kSandboxNoSuidVarName, "1");
-+}
-+
- }  // namespace sandbox
- 
-diff --git a/sandbox/linux/suid/client/setuid_sandbox_client.h b/sandbox/linux/suid/client/setuid_sandbox_client.h
-index a9f6536..2e8113a 100644
---- a/sandbox/linux/suid/client/setuid_sandbox_client.h
-+++ b/sandbox/linux/suid/client/setuid_sandbox_client.h
-@@ -39,6 +39,8 @@ class SetuidSandboxClient {
-   bool IsInNewPIDNamespace() const;
-   // Did the setuid helper create a new network namespace ?
-   bool IsInNewNETNamespace() const;
-+  // Is sandboxed without SUID binary ?
-+  bool IsNoSuid() const;
-   // Are we done and fully sandboxed ?
-   bool IsSandboxed() const;
- 
-@@ -46,6 +48,8 @@ class SetuidSandboxClient {
-   // helper.
-   void SetupLaunchEnvironment();
- 
-+  void SetNoSuid();
-+
-  private:
-   // Holds the environment. Will never be NULL.
-   base::Environment* env_;
-diff --git a/sandbox/linux/suid/common/sandbox.h b/sandbox/linux/suid/common/sandbox.h
-index aad4ff8..bd710d5 100644
---- a/sandbox/linux/suid/common/sandbox.h
-+++ b/sandbox/linux/suid/common/sandbox.h
-@@ -18,6 +18,7 @@ static const char kAdjustLowMemMarginSwitch[] = "--adjust-low-mem";
- 
- static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D";
- static const char kSandboxHelperPidEnvironmentVarName[] = "SBX_HELPER_PID";
-+static const char kSandboxNoSuidVarName[] = "SBX_NO_SUID";
- 
- static const long kSUIDSandboxApiNumber = 1;
- static const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ";
diff --git a/pkgs/applications/networking/browsers/chromium/source/default.nix b/pkgs/applications/networking/browsers/chromium/source/default.nix
new file mode 100644
index 000000000000..d7ccc412fa4f
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/source/default.nix
@@ -0,0 +1,77 @@
+{ stdenv, fetchurl, python
+, channel ? "stable"
+, useOpenSSL # XXX
+}:
+
+with stdenv.lib;
+
+with (import ./update.nix {
+  inherit (stdenv) system;
+}).getChannel channel;
+
+stdenv.mkDerivation {
+  name = "chromium-source-${version}";
+
+  src = fetchurl main;
+
+  buildInputs = [ python ]; # cannot patch shebangs otherwise
+
+  phases = [ "unpackPhase" "patchPhase" "installPhase" ];
+
+  opensslPatches = optional useOpenSSL openssl.patches;
+
+  prePatch = "patchShebangs .";
+
+  patches = singleton ./sandbox_userns_36.patch;
+
+  postPatch = ''
+    sed -i -r \
+      -e 's/-f(stack-protector)(-all)?/-fno-\1/' \
+      -e 's|/bin/echo|echo|' \
+      -e "/python_arch/s/: *'[^']*'/: '""'/" \
+      build/common.gypi chrome/chrome_tests.gypi
+  '' + optionalString (versionOlder version "38.0.0.0") ''
+    sed -i -e '/not RunGN/,+1d' -e '/import.*depot/d' build/gyp_chromium
+    sed -i -e 's|/usr/bin/gcc|gcc|' \
+      third_party/WebKit/Source/build/scripts/scripts.gypi \
+      third_party/WebKit/Source/build/scripts/preprocessor.pm
+  '' + optionalString useOpenSSL ''
+    cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
+  '';
+
+  outputs = [ "out" "sandbox" "bundled" "main" ];
+  installPhase = ''
+    mkdir -p "$out" "$sandbox" "$bundled" "$main"
+
+    header "copying browser main sources to $main"
+    find . -mindepth 1 -maxdepth 1 \
+      \! -path ./sandbox \
+      \! -path ./third_party \
+      \! -path ./build \
+      \! -path ./tools \
+      \! -name '.*' \
+      -print | xargs cp -rt "$main"
+    stopNest
+
+    header "copying sandbox components to $sandbox"
+    cp -rt "$sandbox" sandbox/*
+    stopNest
+
+    header "copying third party sources to $bundled"
+    cp -rt "$bundled" third_party/*
+    stopNest
+
+    header "copying build requisites to $out"
+    cp -rt "$out" build tools
+    stopNest
+
+    rm -rf "$out/tools/gyp" # XXX: Don't even copy it in the first place.
+  '';
+
+  preferLocalBuild = true;
+
+  passthru = {
+    inherit version channel;
+    plugins = fetchurl binary;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/chromium/sandbox_userns_31.patch b/pkgs/applications/networking/browsers/chromium/source/sandbox_userns_36.patch
index 490c1a9cebe9..57f5992a3fa8 100644
--- a/pkgs/applications/networking/browsers/chromium/sandbox_userns_31.patch
+++ b/pkgs/applications/networking/browsers/chromium/source/sandbox_userns_36.patch
@@ -1,4 +1,4 @@
-commit ff4e8b4af04c58fc4c58ee7ed108aefcdc26a960
+commit 0fec7e4a742f001c9816a8b58a1120fb44230867
 Author: aszlig <aszlig@redmoonstudios.org>
 Date:   Thu May 16 14:17:56 2013 +0200
 
@@ -21,25 +21,25 @@ Date:   Thu May 16 14:17:56 2013 +0200
     Signed-off-by: aszlig <aszlig@redmoonstudios.org>
 
 diff --git a/base/process/launch.cc b/base/process/launch.cc
-index 1329a5a..ec28fdf 100644
+index 81748f5..930f20f 100644
 --- a/base/process/launch.cc
 +++ b/base/process/launch.cc
-@@ -24,6 +24,7 @@ LaunchOptions::LaunchOptions()
-       new_process_group(false)
+@@ -26,6 +26,7 @@ LaunchOptions::LaunchOptions()
  #if defined(OS_LINUX)
        , clone_flags(0)
+       , allow_new_privs(false)
 +      , new_user_namespace(false)
  #endif  // OS_LINUX
  #if defined(OS_CHROMEOS)
        , ctrl_terminal_fd(-1)
 diff --git a/base/process/launch.h b/base/process/launch.h
-index ac2df5e..34a3851 100644
+index 9e39fba..00e4c79 100644
 --- a/base/process/launch.h
 +++ b/base/process/launch.h
-@@ -100,6 +100,9 @@ struct BASE_EXPORT LaunchOptions {
- #if defined(OS_LINUX)
-   // If non-zero, start the process using clone(), using flags as provided.
-   int clone_flags;
+@@ -115,6 +115,9 @@ struct BASE_EXPORT LaunchOptions {
+   // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If
+   // true, then this bit will not be set in the new child process.
+   bool allow_new_privs;
 +
 +  // If true, start the process in a new user namespace.
 +  bool new_user_namespace;
@@ -47,24 +47,21 @@ index ac2df5e..34a3851 100644
  
  #if defined(OS_CHROMEOS)
 diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
-index de6286d..9333494 100644
+index 457234f..a99ce9b 100644
 --- a/base/process/launch_posix.cc
 +++ b/base/process/launch_posix.cc
-@@ -37,6 +37,13 @@
- #include "base/threading/platform_thread.h"
- #include "base/threading/thread_restrictions.h"
+@@ -40,6 +40,10 @@
  
-+#if defined(OS_LINUX)
+ #if defined(OS_LINUX)
+ #include <sys/prctl.h>
 +#include <sched.h>
 +#if !defined(CLONE_NEWUSER)
 +#define CLONE_NEWUSER 0x10000000
 +#endif
-+#endif
-+
- #if defined(OS_CHROMEOS)
- #include <sys/ioctl.h>
  #endif
-@@ -294,13 +301,23 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+ 
+ #if defined(OS_CHROMEOS)
+@@ -301,13 +305,23 @@ bool LaunchProcess(const std::vector<std::string>& argv,
  
    pid_t pid;
  #if defined(OS_LINUX)
@@ -92,9 +89,9 @@ index de6286d..9333494 100644
    } else
  #endif
    {
-@@ -318,6 +335,21 @@ bool LaunchProcess(const std::vector<std::string>& argv,
-   } else if (pid == 0) {
-     // Child process
+@@ -328,6 +342,21 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+     // DANGER: no calls to malloc or locks are allowed from now on:
+     // http://crbug.com/36678
  
 +#if defined(OS_LINUX)
 +    if (options.new_user_namespace) {
@@ -114,7 +111,7 @@ index de6286d..9333494 100644
      // DANGER: fork() rule: in the child, if you don't end up doing exec*(),
      // you call _exit() instead of exit(). This is because _exit() does not
      // call any previously-registered (in the parent) exit handlers, which
-@@ -433,6 +465,40 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+@@ -452,6 +481,40 @@ bool LaunchProcess(const std::vector<std::string>& argv,
      _exit(127);
    } else {
      // Parent process
@@ -156,51 +153,27 @@ index de6286d..9333494 100644
        // While this isn't strictly disk IO, waiting for another process to
        // finish is the sort of thing ThreadRestrictions is trying to prevent.
 diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc
-index fea43b5..95cbe07 100644
+index 9d63ad9..0885705 100644
 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc
 +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc
-@@ -121,25 +121,31 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+@@ -144,6 +144,9 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+   // A non empty sandbox_cmd means we want a SUID sandbox.
+   using_suid_sandbox_ = !sandbox_cmd.empty();
  
-   sandbox_binary_ = sandbox_cmd.c_str();
- 
--  // A non empty sandbox_cmd means we want a SUID sandbox.
--  using_suid_sandbox_ = !sandbox_cmd.empty();
 +  bool userns_sandbox = false;
 +  const std::vector<std::string> cmd_line_unwrapped(cmd_line.argv());
- 
--  if (using_suid_sandbox_) {
-+  if (!sandbox_cmd.empty()) {
-     struct stat st;
-     if (stat(sandbox_binary_.c_str(), &st) != 0) {
-       LOG(FATAL) << "The SUID sandbox helper binary is missing: "
-                  << sandbox_binary_ << " Aborting now.";
-     }
- 
--    if (access(sandbox_binary_.c_str(), X_OK) == 0 &&
--        (st.st_uid == 0) &&
--        (st.st_mode & S_ISUID) &&
--        (st.st_mode & S_IXOTH)) {
-+    if (access(sandbox_binary_.c_str(), X_OK) == 0) {
-+      using_suid_sandbox_ = true;
 +
-       cmd_line.PrependWrapper(sandbox_binary_);
+   // Start up the sandbox host process and get the file descriptor for the
+   // renderers to talk to it.
+   const int sfd = RenderSandboxHostLinux::GetInstance()->GetRendererSocket();
+@@ -156,11 +159,24 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+     sandbox_client->PrependWrapper(&cmd_line);
+     sandbox_client->SetupLaunchOptions(&options, &fds_to_map, &dummy_fd);
+     sandbox_client->SetupLaunchEnvironment();
++    userns_sandbox = sandbox_client->IsNoSuid();
+   }
  
-       scoped_ptr<sandbox::SetuidSandboxClient>
-           sandbox_client(sandbox::SetuidSandboxClient::Create());
-       sandbox_client->SetupLaunchEnvironment();
-+
-+      if (!((st.st_uid == 0) &&
-+            (st.st_mode & S_ISUID) &&
-+            (st.st_mode & S_IXOTH))) {
-+        userns_sandbox = true;
-+        sandbox_client->SetNoSuid();
-+      }
-     } else {
-       LOG(FATAL) << "The SUID sandbox helper binary was found, but is not "
-                     "configured correctly. Rather than run without sandboxing "
-@@ -163,7 +169,19 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
    base::ProcessHandle process = -1;
-   base::LaunchOptions options;
    options.fds_to_remap = &fds_to_map;
 +  if (userns_sandbox)
 +    options.new_user_namespace = true;
@@ -216,31 +189,31 @@ index fea43b5..95cbe07 100644
 +  }
 +
    CHECK(process != -1) << "Failed to launch zygote process";
+   dummy_fd.reset();
  
-   if (using_suid_sandbox_) {
 diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
-index 567b305..1089233 100644
+index 11f0602..b7b8214 100644
 --- a/content/zygote/zygote_main_linux.cc
 +++ b/content/zygote/zygote_main_linux.cc
-@@ -426,6 +426,13 @@ static bool EnterSuidSandbox(LinuxSandbox* linux_sandbox,
-       *has_started_new_init = true;
-     }
+@@ -389,6 +389,13 @@ static bool EnterSuidSandbox(sandbox::SetuidSandboxClient* setuid_sandbox) {
+     CHECK(CreateInitProcessReaper());
+   }
  
-+    // Don't set non-dumpable, as it causes trouble when the host tries to find
-+    // the zygote process (XXX: Not quite sure why this happens with user
-+    // namespaces). Fortunately, we also have the seccomp filter sandbox which
-+    // should disallow the use of ptrace.
-+    if (setuid_sandbox->IsNoSuid())
-+      return true;
++  // Don't set non-dumpable, as it causes trouble when the host tries to find
++  // the zygote process (XXX: Not quite sure why this happens with user
++  // namespaces). Fortunately, we also have the seccomp filter sandbox which
++  // should disallow the use of ptrace.
++  if (setuid_sandbox->IsNoSuid())
++    return true;
 +
  #if !defined(OS_OPENBSD)
-     // Previously, we required that the binary be non-readable. This causes the
-     // kernel to mark the process as non-dumpable at startup. The thinking was
+   // Previously, we required that the binary be non-readable. This causes the
+   // kernel to mark the process as non-dumpable at startup. The thinking was
 diff --git a/sandbox/linux/suid/client/setuid_sandbox_client.cc b/sandbox/linux/suid/client/setuid_sandbox_client.cc
-index 34231d4..36e3201 100644
+index fc03cdd..a972faa 100644
 --- a/sandbox/linux/suid/client/setuid_sandbox_client.cc
 +++ b/sandbox/linux/suid/client/setuid_sandbox_client.cc
-@@ -166,6 +166,10 @@ bool SetuidSandboxClient::IsInNewNETNamespace() const {
+@@ -229,6 +229,10 @@ bool SetuidSandboxClient::IsInNewNETNamespace() const {
    return env_->HasVar(kSandboxNETNSEnvironmentVarName);
  }
  
@@ -251,21 +224,34 @@ index 34231d4..36e3201 100644
  bool SetuidSandboxClient::IsSandboxed() const {
    return sandboxed_;
  }
-@@ -175,5 +179,9 @@ void SetuidSandboxClient::SetupLaunchEnvironment() {
-   SetSandboxAPIEnvironmentVariable(env_);
- }
+@@ -277,8 +281,7 @@ void SetuidSandboxClient::PrependWrapper(base::CommandLine* cmd_line) {
+                                     "LinuxSUIDSandboxDevelopment.";
+   }
  
-+void SetuidSandboxClient::SetNoSuid() {
-+  env_->SetVar(kSandboxNoSuidVarName, "1");
-+}
+-  if (access(sandbox_binary.c_str(), X_OK) != 0 || (st.st_uid != 0) ||
+-      ((st.st_mode & S_ISUID) == 0) || ((st.st_mode & S_IXOTH)) == 0) {
++  if (access(sandbox_binary.c_str(), X_OK) != 0) {
+     LOG(FATAL) << "The SUID sandbox helper binary was found, but is not "
+                   "configured correctly. Rather than run without sandboxing "
+                   "I'm aborting now. You need to make sure that "
+@@ -286,6 +289,12 @@ void SetuidSandboxClient::PrependWrapper(base::CommandLine* cmd_line) {
+   }
+ 
+   cmd_line->PrependWrapper(sandbox_binary);
 +
- }  // namespace sandbox
++  if (!((st.st_uid == 0) &&
++        (st.st_mode & S_ISUID) &&
++        (st.st_mode & S_IXOTH))) {
++    env_->SetVar(kSandboxNoSuidVarName, "1");
++  }
+ }
  
+ void SetuidSandboxClient::SetupLaunchOptions(
 diff --git a/sandbox/linux/suid/client/setuid_sandbox_client.h b/sandbox/linux/suid/client/setuid_sandbox_client.h
-index a9f6536..2e8113a 100644
+index 2bbad7a..8605475 100644
 --- a/sandbox/linux/suid/client/setuid_sandbox_client.h
 +++ b/sandbox/linux/suid/client/setuid_sandbox_client.h
-@@ -39,6 +39,8 @@ class SetuidSandboxClient {
+@@ -66,6 +66,8 @@ class SANDBOX_EXPORT SetuidSandboxClient {
    bool IsInNewPIDNamespace() const;
    // Did the setuid helper create a new network namespace ?
    bool IsInNewNETNamespace() const;
@@ -274,20 +260,11 @@ index a9f6536..2e8113a 100644
    // Are we done and fully sandboxed ?
    bool IsSandboxed() const;
  
-@@ -46,6 +48,8 @@ class SetuidSandboxClient {
-   // helper.
-   void SetupLaunchEnvironment();
- 
-+  void SetNoSuid();
-+
-  private:
-   // Holds the environment. Will never be NULL.
-   base::Environment* env_;
 diff --git a/sandbox/linux/suid/common/sandbox.h b/sandbox/linux/suid/common/sandbox.h
-index aad4ff8..bd710d5 100644
+index 9345287..2db659e 100644
 --- a/sandbox/linux/suid/common/sandbox.h
 +++ b/sandbox/linux/suid/common/sandbox.h
-@@ -18,6 +18,7 @@ static const char kAdjustLowMemMarginSwitch[] = "--adjust-low-mem";
+@@ -15,6 +15,7 @@ static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score";
  
  static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D";
  static const char kSandboxHelperPidEnvironmentVarName[] = "SBX_HELPER_PID";
diff --git a/pkgs/applications/networking/browsers/chromium/source/sources.nix b/pkgs/applications/networking/browsers/chromium/source/sources.nix
new file mode 100644
index 000000000000..4a610827913f
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/source/sources.nix
@@ -0,0 +1,21 @@
+# This file is autogenerated from update.sh in the parent directory.
+{
+  dev = {
+    version = "38.0.2107.3";
+    sha256 = "0zb1mj3xgvvs5ijix4b52vj9dlymqkipn8srfzvhwl7g4hx5ss3v";
+    sha256bin32 = "12lvvmg3bqacb0qw72bwlxm2m57s39mz2810agngdgzv0hd835cv";
+    sha256bin64 = "1vw36s8nlvdsl8pjbh4gny00kvcizn1i2lznzqzysicz2rz7ncrh";
+  };
+  beta = {
+    version = "37.0.2062.58";
+    sha256 = "0jck4s6nrizj9wmifsjviin9ifnviihs21fi05wzljyfnbgc4byl";
+    sha256bin32 = "1cm1r8bqy66gvdhbrgn9pdc11i72dca96ab5j3m3349p6728jbgk";
+    sha256bin64 = "0cpb189pn5jiplldkgy8lfbcwvfik66kjjf6y2i708xa5ggfpwfi";
+  };
+  stable = {
+    version = "36.0.1985.125";
+    sha256 = "08shkm89qzzdlrjg0rg5qiszbk6ziginsicyxqyk353y76jx10hp";
+    sha256bin32 = "1ahazz56k127xncgl1lzwsmydbh0vcxq0hzrb9cm9zzdkzqjzg03";
+    sha256bin64 = "0qx5316cd8l9g8w389aqi5m3csmr5s8hs7sivlk02mbs0jzi8ppc";
+  };
+}
diff --git a/pkgs/applications/networking/browsers/chromium/source/update.nix b/pkgs/applications/networking/browsers/chromium/source/update.nix
new file mode 100644
index 000000000000..cfa5f1e009b8
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/source/update.nix
@@ -0,0 +1,122 @@
+{ system ? builtins.currentSystem }:
+
+let
+  inherit (import <nixpkgs> {
+    inherit system;
+  }) lib writeText stdenv;
+
+  sources = if builtins.pathExists ./sources.nix
+            then import ./sources.nix
+            else null;
+
+  bucketURL = "http://commondatastorage.googleapis.com/"
+            + "chromium-browser-official";
+
+  debURL = "https://dl.google.com/linux/chrome/deb/pool/main/g";
+
+  # Untrusted mirrors, don't try to update from them!
+  debMirrors = [
+    "http://95.31.35.30/chrome/pool/main/g"
+    "http://mirror.pcbeta.com/google/chrome/deb/pool/main/g"
+  ];
+
+  tryChannel = channel: let
+    chan = builtins.getAttr channel sources;
+  in if sources != null then ''
+    oldver="${chan.version}";
+    echo -n "Checking if $oldver ($channel) is up to date..." >&2;
+    if [ "x$(get_newest_ver "$version" "$oldver")" != "x$oldver" ];
+    then
+      echo " no, getting sha256 for new version $version:" >&2;
+      sha256="$(prefetch_sha "$channel" "$version")" || return 1;
+    else
+      echo " yes, keeping old sha256." >&2;
+      sha256="${chan.sha256}";
+      ${if (chan ? sha256bin32 && chan ? sha256bin64) then ''
+        sha256="$sha256.${chan.sha256bin32}.${chan.sha256bin64}";
+      '' else ''
+        sha256="$sha256.$(prefetch_deb_sha "$channel" "$version")";
+      ''}
+    fi;
+  '' else ''
+    sha256="$(prefetch_sha "$channel" "$version")" || return 1;
+  '';
+
+  caseChannel = channel: ''
+    ${channel}) ${tryChannel channel};;
+  '';
+
+in rec {
+  getChannel = channel: let
+    chanAttrs = builtins.getAttr channel sources;
+  in {
+    inherit (chanAttrs) version;
+
+    main = {
+      url = "${bucketURL}/chromium-${chanAttrs.version}.tar.xz";
+      inherit (chanAttrs) sha256;
+    };
+
+    binary = let
+      pname = if channel == "dev"
+              then "google-chrome-unstable"
+              else "google-chrome-${channel}";
+      arch = if stdenv.is64bit then "amd64" else "i386";
+      relpath = "${pname}/${pname}_${chanAttrs.version}-1_${arch}.deb";
+    in lib.optionalAttrs (chanAttrs ? sha256bin64) {
+      urls = map (url: "${url}/${relpath}") ([ debURL ] ++ debMirrors);
+      sha256 = if stdenv.is64bit
+               then chanAttrs.sha256bin64
+               else chanAttrs.sha256bin32;
+    };
+  };
+
+  updateHelpers = writeText "update-helpers.sh" ''
+
+    prefetch_main_sha()
+    {
+      nix-prefetch-url "${bucketURL}/chromium-$2.tar.xz";
+    }
+
+    prefetch_deb_sha()
+    {
+      channel="$1";
+      version="$2";
+
+      case "$1" in
+        dev) pname="google-chrome-unstable";;
+        *)   pname="google-chrome-$channel";;
+      esac;
+
+      deb_pre="${debURL}/$pname/$pname";
+
+      deb32=$(nix-prefetch-url "''${deb_pre}_$version-1_i386.deb");
+      deb64=$(nix-prefetch-url "''${deb_pre}_$version-1_amd64.deb");
+
+      echo "$deb32.$deb64";
+      return 0;
+    }
+
+    prefetch_sha()
+    {
+      main_sha="$(prefetch_main_sha "$@")" || return 1;
+      deb_sha="$(prefetch_deb_sha "$@")" || return 1;
+      echo "$main_sha.$deb_sha";
+      return 0;
+    }
+
+    get_sha256()
+    {
+      channel="$1";
+      version="$2";
+
+      case "$channel" in
+        ${lib.concatMapStrings caseChannel [ "stable" "dev" "beta" ]}
+      esac;
+
+      sha_insert "$version" "$sha256";
+      echo "$sha256";
+      return 0;
+    }
+  '';
+}
diff --git a/pkgs/applications/networking/browsers/chromium/sources.nix b/pkgs/applications/networking/browsers/chromium/sources.nix
deleted file mode 100644
index aae71e8dfb60..000000000000
--- a/pkgs/applications/networking/browsers/chromium/sources.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is autogenerated from update.sh in the same directory.
-{
-  dev = {
-    version = "32.0.1671.3";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-32.0.1671.3.tar.xz";
-    sha256 = "0bv86ig3mrd95zh78880bcyh9b8w46s7slxq3mwwmrmqp0s8qaq0";
-  };
-  beta = {
-    version = "31.0.1650.34";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-31.0.1650.34.tar.xz";
-    sha256 = "0c73kvp09cmq4x42rcf45v0mnbyb8rcyi5i4pj0pvfn451vbngdq";
-  };
-  stable = {
-    version = "30.0.1599.114";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1599.114.tar.xz";
-    sha256 = "0q5pq8bj4y0c7hd121db1fa9g3apkpkhb6cf14ag7abgrda2pzw2";
-  };
-}
diff --git a/pkgs/applications/networking/browsers/chromium/update.sh b/pkgs/applications/networking/browsers/chromium/update.sh
index 0c4881bb3962..e82d22f34fd0 100755
--- a/pkgs/applications/networking/browsers/chromium/update.sh
+++ b/pkgs/applications/networking/browsers/chromium/update.sh
@@ -3,16 +3,9 @@
 channels_url="http://omahaproxy.appspot.com/all?csv=1";
 history_url="http://omahaproxy.appspot.com/history";
 bucket_url="http://commondatastorage.googleapis.com/chromium-browser-official/";
-output_file="$(cd "$(dirname "$0")" && pwd)/sources.nix";
+base_path="$(cd "$(dirname "$0")" && pwd)/source";
 
-nix_getattr()
-{
-    input_file="$1";
-    attr="$2";
-
-    var="$(nix-instantiate --eval-only -A "$attr" "$output_file")";
-    echo "$var" | tr -d '\\"';
-}
+source "$(nix-build --no-out-link "$base_path/update.nix" -A updateHelpers)";
 
 ### poor mans key/value-store :-) ###
 
@@ -53,39 +46,6 @@ get_newest_ver()
     fi;
 }
 
-if [ -e "$output_file" ];
-then
-    get_sha256()
-    {
-        channel="$1";
-        version="$2";
-        url="$3";
-
-        oldver="$(nix_getattr "$output_file" "$channel.version")";
-
-        echo -n "Checking if $oldver ($channel) is up to date..." >&2;
-
-        if [ "x$(get_newest_ver "$version" "$oldver")" != "x$oldver" ];
-        then
-            echo " no, getting sha256 for new version $version:" >&2;
-            sha256="$(nix-prefetch-url "$url")" || return 1;
-        else
-            echo " yes, keeping old sha256." >&2;
-            sha256="$(nix_getattr "$output_file" "$channel.sha256")" \
-                || return 1;
-        fi;
-
-        sha_insert "$version" "$sha256";
-        echo "$sha256";
-        return 0;
-    }
-else
-    get_sha256()
-    {
-        nix-prefetch-url "$3";
-    }
-fi;
-
 fetch_filtered_history()
 {
     curl -s "$history_url" | sed -nr 's/^'"linux,$1"',([^,]+).*$/\1/p';
@@ -99,9 +59,8 @@ get_prev_sha256()
     for version in $(fetch_filtered_history "$channel");
     do
         [ "x$version" = "x$current_version" ] && continue;
-        url="${bucket_url%/}/chromium-$version.tar.xz";
-        sha256="$(get_sha256 "$channel" "$version" "$url")" || continue;
-        echo "$sha256:$version:$url";
+        sha256="$(get_sha256 "$channel" "$version")" || continue;
+        echo "$sha256:$version";
         return 0;
     done;
 }
@@ -113,34 +72,39 @@ get_channel_exprs()
         channel="${chline%%,*}";
         version="${chline##*,}";
 
-        url="${bucket_url%/}/chromium-$version.tar.xz";
-
         echo -n "Checking if sha256 of version $version is cached..." >&2;
         if sha256="$(sha_lookup "$version")";
         then
             echo " yes: $sha256" >&2;
         else
             echo " no." >&2;
-            sha256="$(get_sha256 "$channel" "$version" "$url")";
+            sha256="$(get_sha256 "$channel" "$version")";
             if [ $? -ne 0 ];
             then
                 echo "Whoops, failed to fetch $version, trying previous" \
                      "versions:" >&2;
 
-                sha_ver_url="$(get_prev_sha256 "$channel" "$version")";
-                sha256="${sha_ver_url%%:*}";
-                ver_url="${sha_ver_url#*:}";
-                version="${ver_url%%:*}";
-                url="${ver_url#*:}";
+                sha_ver="$(get_prev_sha256 "$channel" "$version")";
+                sha256="${sha_ver%:*}";
+                version="${sha_ver#*:}";
             fi;
         fi;
 
         sha_insert "$version" "$sha256";
 
+        main="${sha256%%.*}";
+        deb="${sha256#*.}";
+        deb32="${deb%.*}";
+        deb64="${deb#*.}";
+
         echo "  $channel = {";
         echo "    version = \"$version\";";
-        echo "    url = \"$url\";";
-        echo "    sha256 = \"$sha256\";";
+        echo "    sha256 = \"$main\";";
+        if [ "x${deb#*[a-z0-9].[a-z0-9]}" != "x$deb" ];
+        then
+            echo "    sha256bin32 = \"$deb32\";";
+            echo "    sha256bin64 = \"$deb64\";";
+        fi;
         echo "  };";
     done;
 }
@@ -151,8 +115,8 @@ omaha="$(curl -s "$channels_url")";
 versions="$(echo "$omaha" | sed -nr -e 's/^linux,([^,]+,[^,]+).*$/\1/p')";
 channel_exprs="$(get_channel_exprs "$versions")";
 
-cat > "$output_file" <<-EOF
-# This file is autogenerated from update.sh in the same directory.
+cat > "$base_path/sources.nix" <<-EOF
+# This file is autogenerated from update.sh in the parent directory.
 {
 $channel_exprs
 }
diff --git a/pkgs/applications/networking/browsers/conkeror/default.nix b/pkgs/applications/networking/browsers/conkeror/default.nix
index b44a39d87aa1..47381f06d68d 100644
--- a/pkgs/applications/networking/browsers/conkeror/default.nix
+++ b/pkgs/applications/networking/browsers/conkeror/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchgit, unzip, xulrunner, makeWrapper }:
 
 stdenv.mkDerivation {
-  name = "conkeror-1.0pre-20130817-1";
+  name = "conkeror-1.0pre-20140616";
 
   src = fetchgit {
     url = git://repo.or.cz/conkeror.git;
-    rev = "refs/tags/debian-1.0--pre+git130817-1";
-    sha256 = "aef3c782ac98c031e7b99852f42538e225e151cd226cde3094823a5cae015fcf";
+    rev = "8a26fff5896a3360549e2adfbf06b1d57e909266";
+    sha256 = "56f1c71ca1753a63d7599d3e8bf52277711b2693e7709ed7c146f34940441cb4";
   };
 
   buildInputs = [ unzip makeWrapper ];
diff --git a/pkgs/applications/networking/browsers/dillo/default.nix b/pkgs/applications/networking/browsers/dillo/default.nix
new file mode 100644
index 000000000000..0cf23f38b0f0
--- /dev/null
+++ b/pkgs/applications/networking/browsers/dillo/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl
+, fltk
+, openssl
+, libjpeg, libpng
+, perl
+, libXcursor, libXi, libXinerama
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.0.4";
+  name = "dillo-${version}";
+
+  src = fetchurl {
+    url = "http://www.dillo.org/download/${name}.tar.bz2";
+    sha256 = "0ffz481vgl7f12f575pmbagm8swgxgv9s9c0p8c7plhd04jsnazf";
+  };
+
+  buildInputs = with stdenv.lib;
+    [ fltk openssl libjpeg libpng libXcursor libXi libXinerama ];
+
+  nativeBuildInputs = [ perl ];
+
+  configureFlags =  "--enable-ssl";
+
+  meta = {
+    homepage = http://www.dillo.org/;
+    description = "A fast graphical web browser with a small footprint";
+    maintainers = [ stdenv.lib.maintainers.AndersonTorres ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/dwb/default.nix b/pkgs/applications/networking/browsers/dwb/default.nix
index 0421a8a6c6a8..ecb57d6fe6ca 100644
--- a/pkgs/applications/networking/browsers/dwb/default.nix
+++ b/pkgs/applications/networking/browsers/dwb/default.nix
@@ -1,35 +1,33 @@
-{ stdenv, fetchgit, pkgconfig, makeWrapper, libsoup, webkit, gtk3, gnutls, json_c,
-  m4, glib_networking, gsettings_desktop_schemas }:
+{ stdenv, fetchgit, pkgconfig, makeWrapper, libsoup, webkitgtk2, gtk2, gnutls, json_c,
+  m4, glib_networking, gsettings_desktop_schemas, dconf }:
 
 stdenv.mkDerivation {
-  name = "dwb-0.1";
+  name = "dwb-2014-07-03";
 
   src = fetchgit {
     url = "https://bitbucket.org/portix/dwb.git";
-    rev = "84a8621787baded72e84afdd5cdda278cb81e007";
-    sha256 = "5a32f3c21ad59b43935a16108244f84d260fafaea9b93d41e8de9ba9089ee7b0";
+    rev = "6224470489eb5ba92987e01396269f8b7cd78ada";
+    sha256 = "04p9frsnh1qz067cw36anvr41an789fba839svdjrdva0f2751g8";
   };
 
-  buildInputs = [ pkgconfig makeWrapper libsoup webkit gtk3 gnutls json_c m4  ];
+  buildInputs = [ pkgconfig makeWrapper gsettings_desktop_schemas libsoup webkitgtk2 gtk2 gnutls json_c m4 ];
 
   # There are Xlib and gtk warnings therefore I have set Wno-error
-  preBuild=''
-    makeFlagsArray=(CPPFLAGS="-Wno-error" GTK=3 PREFIX=$out);
-  '';
+  makeFlags = ''PREFIX=$(out) GTK=2 CPPFLAGS="-Wno-error"'';
 
-  postInstall=''
+  preFixup=''
     wrapProgram "$out/bin/dwb" \
-     --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
-     --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share:$out/share"
+     --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules:${dconf}/lib/gio/modules" \
+     --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
     wrapProgram "$out/bin/dwbem" \
      --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://portix.bitbucket.org/dwb/;
     description = "A lightweight web browser based on the webkit web browser engine and the gtk toolkit";
-    platforms = stdenv.lib.platforms.mesaPlatforms;
-    maintainers = [ stdenv.lib.maintainers.pSub ];
-    license = "GPL";
+    platforms = platforms.mesaPlatforms;
+    maintainers = with maintainers;[ pSub ];
+    license = licenses.gpl3;
   };
 }
diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix
index 1618042364e8..0e4fd4db1ba8 100644
--- a/pkgs/applications/networking/browsers/elinks/default.nix
+++ b/pkgs/applications/networking/browsers/elinks/default.nix
@@ -1,28 +1,34 @@
-{ stdenv, fetchurl, python, perl, ncurses, x11, bzip2, zlib, openssl
+{ stdenv, fetchurl, perl, ncurses, x11, bzip2, zlib, openssl
 , spidermonkey, gpm
-, enableGuile ? true, guile ? null }:
+, enableGuile ? false, guile ? null   # Incompatible licenses, LGPLv3 - GPLv2
+, enablePython ? false, python ? null
+}:
 
 assert enableGuile -> guile != null;
+assert enablePython -> python != null;
 
 stdenv.mkDerivation rec {
-  name = "elinks-0.12pre5";
+  name = "elinks-0.12pre6";
 
   src = fetchurl {
-    url = http://elinks.or.cz/download/elinks-0.12pre5.tar.bz2;
-    sha256 = "1li4vlbq8wvnigxlkzb15490y90jg6y9yzzrqpqcz2h965w5869d";
+    url = http://elinks.or.cz/download/elinks-0.12pre6.tar.bz2;
+    sha256 = "1nnakbi01g7yd3zqwprchh5yp45br8086b0kbbpmnclabcvlcdiq";
   };
 
   patches = [ ./gc-init.patch ];
 
-  buildInputs = [ python perl ncurses x11 bzip2 zlib openssl spidermonkey gpm ]
-    ++ stdenv.lib.optional enableGuile guile;
+  buildInputs = [ perl ncurses x11 bzip2 zlib openssl spidermonkey gpm ]
+    ++ stdenv.lib.optional enableGuile guile
+    ++ stdenv.lib.optional enablePython python;
 
   configureFlags =
     ''
       --enable-finger --enable-html-highlight
-      --with-perl --with-python --enable-gopher --enable-cgi --enable-bittorrent
+      --with-perl --enable-gopher --enable-cgi --enable-bittorrent
+      --with-spidermonkey=${spidermonkey}
       --enable-nntp --with-openssl=${openssl}
-    '' + stdenv.lib.optionalString enableGuile " --with-guile";
+    '' + stdenv.lib.optionalString enableGuile " --with-guile"
+    + stdenv.lib.optionalString enablePython " --with-python";
 
   crossAttrs = {
     propagatedBuildInputs = [ ncurses.crossDrv zlib.crossDrv openssl.crossDrv ];
@@ -37,5 +43,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Full-featured text-mode web browser";
     homepage = http://elinks.or.cz;
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix
new file mode 100644
index 000000000000..969ced923b3d
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix
@@ -0,0 +1,339 @@
+# This file is generated from generate_nix.rb
+# Execute the following command in a temporary directory to update the file.
+#
+# ruby generate_nix.rb > default.nix
+
+{ stdenv, fetchurl, config
+, alsaLib
+, atk
+, cairo
+, cups
+, dbus_glib
+, dbus_libs
+, fontconfig
+, freetype
+, gconf
+, gdk_pixbuf
+, glib
+, glibc
+, gst_plugins_base
+, gstreamer
+, gtk
+, libX11
+, libXScrnSaver
+, libXext
+, libXinerama
+, libXrender
+, libXt
+, libcanberra
+, libgnome
+, libgnomeui
+, mesa
+, nspr
+, nss
+, pango
+, heimdal
+, pulseaudio
+, systemd
+}:
+
+let
+  version = "31.0";
+  sources = [
+    { locale = "ach"; arch = "linux-i686"; sha256 = "8372c1227b75486e297fd914bac530a45b22b789e627638e010d4c25337f350f"; }
+    { locale = "ach"; arch = "linux-x86_64"; sha256 = "e01412aa570a462a3bb1ba851cd7133014b3299c0ad349c15534edc35c6d6397"; }
+    { locale = "af"; arch = "linux-i686"; sha256 = "e75bd2d41de60483ed1eadcf03d9cd57146210ff9fdfe04e984404ce4bca29f7"; }
+    { locale = "af"; arch = "linux-x86_64"; sha256 = "32697271215a0e63b7d0b25398d27772da5d53e88d020df24f170ebc341e5394"; }
+    { locale = "an"; arch = "linux-i686"; sha256 = "3a590702183a86283e4de415eefdeed6f95f1e5d48c64456c4d6db8f84dcfb68"; }
+    { locale = "an"; arch = "linux-x86_64"; sha256 = "98d35a6a2f0875a9723ed9511f3bea65f58da3196db3f75aaf7420d45bde33ad"; }
+    { locale = "ar"; arch = "linux-i686"; sha256 = "e632f104442b725cf8e0e25c9a924b166289e1fab601a70aee0a81394632423c"; }
+    { locale = "ar"; arch = "linux-x86_64"; sha256 = "603a054ceb36645881f52042e556572252e898bfa78cec04811e65f27b9db026"; }
+    { locale = "as"; arch = "linux-i686"; sha256 = "05e64b9113f450bfbfa1b99c9580dbb2442af35d6cc20dec0c7af379dd5d37db"; }
+    { locale = "as"; arch = "linux-x86_64"; sha256 = "85b57a101afd0c4aae040bb1f3523ddda3079d46ac8abe9cad826939fd274353"; }
+    { locale = "ast"; arch = "linux-i686"; sha256 = "5df5eb0db623b42d9a2c9be58807ec66f43a26dd1365d44202d4b0db50d6a6f0"; }
+    { locale = "ast"; arch = "linux-x86_64"; sha256 = "6faac3f3637bd68d6c20c73dd84c554afdaa136c4e142c26eb8142b7ab00895f"; }
+    { locale = "be"; arch = "linux-i686"; sha256 = "4a87051df26ddb3fd2cf7c2beabc2d403cbc4d2f2e7e0802fb11566722171b57"; }
+    { locale = "be"; arch = "linux-x86_64"; sha256 = "8194b851ed7f9559b78f63711df598ed094783eb2cc288fbd1e880d53118dde5"; }
+    { locale = "bg"; arch = "linux-i686"; sha256 = "f6f903529d3276d1aa55968d4978fe5977d45076db0ee99d87199d59a9441ad5"; }
+    { locale = "bg"; arch = "linux-x86_64"; sha256 = "bce34ee8ec314db0f7abfeddf491d15642dcedea125dc9bb7d7dda3915054940"; }
+    { locale = "bn-BD"; arch = "linux-i686"; sha256 = "9bd0e37ddf9a222263ca90308245e2078f45d754d8a2b0bc1e4dea13a5e7b581"; }
+    { locale = "bn-BD"; arch = "linux-x86_64"; sha256 = "debb3a9983e4219b6632cdfd09d04ab95314ba4e0bd7ff36fd89f0a748d25cdd"; }
+    { locale = "bn-IN"; arch = "linux-i686"; sha256 = "ea2c9d29f4a3dfe8e0f146979c47ccba835b81cb1f1ed6e95124a837918590fa"; }
+    { locale = "bn-IN"; arch = "linux-x86_64"; sha256 = "b2bf8e36ac1ca1afeae463bf95a289db7cf2d2fa303083ab405497cca2993b57"; }
+    { locale = "br"; arch = "linux-i686"; sha256 = "b4b9d2828e5387a65d0f63b2149400626cd47fc81b97b912eda11b3fe31d4604"; }
+    { locale = "br"; arch = "linux-x86_64"; sha256 = "c3af78f1215ffc1e9b6c193ba87d17e2f08e1a24856ee68aabf95b3ee7804ea9"; }
+    { locale = "bs"; arch = "linux-i686"; sha256 = "7930f10d5d43e4504b9f347bcb2a2ef451be4418cee86c199b3e98c38587a20d"; }
+    { locale = "bs"; arch = "linux-x86_64"; sha256 = "ee31279d2acf7286c9a59c99e68fdd1692b96247585230df20ea2bea5ee30ba2"; }
+    { locale = "ca"; arch = "linux-i686"; sha256 = "f22f7964180ad27a122e56f070c6a2a0e3b044fe15ec5046b04db03877a3b7c7"; }
+    { locale = "ca"; arch = "linux-x86_64"; sha256 = "84e8675f9613d1a8a49a760ee46d4625b88092cfc542e6b750384d0d5a0a465f"; }
+    { locale = "cs"; arch = "linux-i686"; sha256 = "bed550a83c763a8147ef862cca7ca36106bfc5b34ea81f008c94886b86a3dde2"; }
+    { locale = "cs"; arch = "linux-x86_64"; sha256 = "8bf76f388c6286a1b91cf460325b98c2dd08842031288617d9141b1368b5f62c"; }
+    { locale = "csb"; arch = "linux-i686"; sha256 = "2420bf49ff3429b3f186b17555b8b3250d44579b5ff7ce616914af646b5996be"; }
+    { locale = "csb"; arch = "linux-x86_64"; sha256 = "a0ee304a61b12ec1dd3caf5d876acbd9d2ad4443f9b96e73ecc1de8a1e16206f"; }
+    { locale = "cy"; arch = "linux-i686"; sha256 = "603a66c237e95534d2dbd004e7fd77b69d5b99b73cba797c7825aaca6d849c61"; }
+    { locale = "cy"; arch = "linux-x86_64"; sha256 = "69f68c024d6e9999b5a846d12c5a61ca63d962f6bd21737769d1fe5519916dad"; }
+    { locale = "da"; arch = "linux-i686"; sha256 = "da8ed391e8ae9729cf2af35700aff3f6900af208fee9eab6a6bd0fcb303abd09"; }
+    { locale = "da"; arch = "linux-x86_64"; sha256 = "7e3cc63eb61289e1006f683581345caaffe3ae39f7a636ff4f451b1e77a8ffb6"; }
+    { locale = "de"; arch = "linux-i686"; sha256 = "f191e74047cdddd43fa72242b1dce15a28160f62b4b8eae08ad117f4b27d6e0f"; }
+    { locale = "de"; arch = "linux-x86_64"; sha256 = "a81165d446cab525645ca2b18ef28cf253c6ee6267086d692a3904c79f7e5be0"; }
+    { locale = "el"; arch = "linux-i686"; sha256 = "eb0757aafd2a1c4bb9abeab01a3960d3ac21b92879f8dc7d24f485a43d305957"; }
+    { locale = "el"; arch = "linux-x86_64"; sha256 = "900f64bad286393f6d96f0ff00c6e78ae6cce998046cf506e2b3ec7a7b8e76c0"; }
+    { locale = "en-GB"; arch = "linux-i686"; sha256 = "99284b229b7bfcc44cce3ebeee523e49bd5d9c7d860345ad3e242af4f9848683"; }
+    { locale = "en-GB"; arch = "linux-x86_64"; sha256 = "9a4e003441556422375d4bede21da27a03d31b5ec452ff467abcfffdfe363f4a"; }
+    { locale = "en-US"; arch = "linux-i686"; sha256 = "13b4297db52ef851b38f292eba2b2136e4c2f1453e004012fe8b1fbcf000abce"; }
+    { locale = "en-US"; arch = "linux-x86_64"; sha256 = "ce87f081c4867b9968a2695341001854aa6c1f4f19073d13f54f333cfed236fc"; }
+    { locale = "en-ZA"; arch = "linux-i686"; sha256 = "849584baf4c6dd330bf9c798e3e8923004a3a381642d4f684b5de3fb5b4fd895"; }
+    { locale = "en-ZA"; arch = "linux-x86_64"; sha256 = "635d0cb43a2b5f7f0401f961fd88fc0d6735223ad421ec0ef92a4ee16b29727f"; }
+    { locale = "eo"; arch = "linux-i686"; sha256 = "91da9571212dc82f5d7140e4de073189018f7f895a3b263a4f8840401b4b10bb"; }
+    { locale = "eo"; arch = "linux-x86_64"; sha256 = "77f39ab0168efe9070ecd881dbd2884fe5f35eeea17a63ad8d957398f6eef40d"; }
+    { locale = "es-AR"; arch = "linux-i686"; sha256 = "f4ec6f07e67195981c12b5cbc3a6289a6e9d29539014c034039bd498a40f9301"; }
+    { locale = "es-AR"; arch = "linux-x86_64"; sha256 = "3f24135fd1a6fd2207bf1d80fc79cb34536b109e195e43a3a13eba0b68548c0e"; }
+    { locale = "es-CL"; arch = "linux-i686"; sha256 = "de3672a512473cc6edc48bb775bc9a405d0c9effccdb0cd46af5ce2593d67613"; }
+    { locale = "es-CL"; arch = "linux-x86_64"; sha256 = "770134c2bd8bc9f2e629e355b8e3b0949f67dd2ecd1b3a1d513bff364e53b734"; }
+    { locale = "es-ES"; arch = "linux-i686"; sha256 = "4eeb5854427cde599468b90af70ae3e04eb9aff5132659f6e1ddb2f859f0be74"; }
+    { locale = "es-ES"; arch = "linux-x86_64"; sha256 = "eb91e2e9b80cab85e6ab75e78a9b206a18bb647ffb247c0d5ed324ee219dccd9"; }
+    { locale = "es-MX"; arch = "linux-i686"; sha256 = "0aa0c85a51a50adb9eca5e5a1eda0ca11ddc15ad12b2d930ebe769f10d535433"; }
+    { locale = "es-MX"; arch = "linux-x86_64"; sha256 = "3f340072c80c95283b17e797bf4fdbde9d1de55b5f10f1c9e8193f8426c6157d"; }
+    { locale = "et"; arch = "linux-i686"; sha256 = "4719961e58e755ea2d9b94ff7439e1f9e858b0dacbd8631f98fadebca36c72a1"; }
+    { locale = "et"; arch = "linux-x86_64"; sha256 = "70aa1a76414c50b00fc85be87a07b936c7f60d83037f13716862e8491ec8d609"; }
+    { locale = "eu"; arch = "linux-i686"; sha256 = "ea450d11b0cd3b4381797bf6ca48d74fb18d661864eccb365bc2d51b872b101a"; }
+    { locale = "eu"; arch = "linux-x86_64"; sha256 = "d543e7fdd4c27875d30a1d527219e257296c6010e80dc0d5529722aa82cc666f"; }
+    { locale = "fa"; arch = "linux-i686"; sha256 = "4b8aaf0d27f10474c6ec4eeec1418ffb08338475c5433199ac2db79aab5273b2"; }
+    { locale = "fa"; arch = "linux-x86_64"; sha256 = "df10d71c7a762696ee682ca705052b15031dc7e84aa396f67fa26463e3dcd353"; }
+    { locale = "ff"; arch = "linux-i686"; sha256 = "acdfec7656b48e5502692c408cd8c7543add80181130bdd2e0ec66ac44219a06"; }
+    { locale = "ff"; arch = "linux-x86_64"; sha256 = "a9a0041cba2f80b09a2f22da6f1e9bfdfc1cbf0f5c324a427a1758174901fc27"; }
+    { locale = "fi"; arch = "linux-i686"; sha256 = "304e90020134af5564d5c90c5d9fee6264aa871e82419408f5b0e9d97f8f8ff1"; }
+    { locale = "fi"; arch = "linux-x86_64"; sha256 = "bfb86547ea4e0a5650a152070a7651a7f63b0df366fa4aed7f890033332e64a5"; }
+    { locale = "fr"; arch = "linux-i686"; sha256 = "1ccef0f95df1571b9e378d97122303982f93251bd3ed70d0af93babc3459bad2"; }
+    { locale = "fr"; arch = "linux-x86_64"; sha256 = "93ffcc3bbba8b7e0941fe674f6a67ed378e75b37c3e52debbef2434ea75f2b09"; }
+    { locale = "fy-NL"; arch = "linux-i686"; sha256 = "20ae7baa888fdcb467388313fa51104f8ba77ca31b2bcd731e2d65a46ff75c3f"; }
+    { locale = "fy-NL"; arch = "linux-x86_64"; sha256 = "33a028be0c63dc892efc93bd03375c8c4f9be38acb96a2bc516300c204086b3d"; }
+    { locale = "ga-IE"; arch = "linux-i686"; sha256 = "ddf134c692d321744bd787b7833ccc9b06ef130865c8f8ee816d35ff55c344a7"; }
+    { locale = "ga-IE"; arch = "linux-x86_64"; sha256 = "e76e18b18a7468ee6a550e837abf04b79833ae084210f723d0781f2b81e3077e"; }
+    { locale = "gd"; arch = "linux-i686"; sha256 = "3c361e322be79ffaec9a382aacf3b9cc90f03fa664e35e283cd8572e66d3b8b0"; }
+    { locale = "gd"; arch = "linux-x86_64"; sha256 = "5e95305321ff373d9cc6eee522dbd5ee948e6c298f2fb38d655965ec1de448e0"; }
+    { locale = "gl"; arch = "linux-i686"; sha256 = "99b9dbf38f50f5385072d72d14684e980aead6125c4c91cfa8e69bd5c7f1aa0e"; }
+    { locale = "gl"; arch = "linux-x86_64"; sha256 = "372bf1395f96be3b41d05630267354f7a6c0706e90f5e21320ab5ebd5d411d41"; }
+    { locale = "gu-IN"; arch = "linux-i686"; sha256 = "0b8429553052c8e23d3aaf1210d53b51fac2250d1d526311a22757ebd85ca54f"; }
+    { locale = "gu-IN"; arch = "linux-x86_64"; sha256 = "da6a7d7292965a0c1eaf58564d9bf85192719831208e8762d06c7082ee9824d7"; }
+    { locale = "he"; arch = "linux-i686"; sha256 = "78ac97da0515eb5a94455dcbf4cbd9a8d1ddbf03d4b8d29bad7b9e8fdbf5ef12"; }
+    { locale = "he"; arch = "linux-x86_64"; sha256 = "c0d853c639cfa7b14ce10ee50776f3aebf0c84807bb59d9ec6e0e20554ae8ed2"; }
+    { locale = "hi-IN"; arch = "linux-i686"; sha256 = "82376fe3005c56d2e895e1ffa0e9233f3885700117a73d1c49d67d742e324752"; }
+    { locale = "hi-IN"; arch = "linux-x86_64"; sha256 = "0ed6234fa9c5d449437d133c83f572ceca3dd82df6cbee8573c9f137c50bcf9c"; }
+    { locale = "hr"; arch = "linux-i686"; sha256 = "10ff3539c27dc49763fe322e9540878d421bdf590d9a307fecc6c158472889c3"; }
+    { locale = "hr"; arch = "linux-x86_64"; sha256 = "f97d7e3b290b0fc6a9116198da7fc7eb32895da74a3ad572d29577e14ab12f20"; }
+    { locale = "hsb"; arch = "linux-i686"; sha256 = "bba1a949823e70d1b5f4a0bec27437b6fc11638fa67b2ca286a833a0d44f5ef8"; }
+    { locale = "hsb"; arch = "linux-x86_64"; sha256 = "5efaf3ec7f7b5d94df17d2fe0d5877a35442d33ccbf141fcf30e11351f9b4000"; }
+    { locale = "hu"; arch = "linux-i686"; sha256 = "88a86463f2a47e38886cd2e8b470702623c772086b71d55e61de80e1c1be4fb3"; }
+    { locale = "hu"; arch = "linux-x86_64"; sha256 = "967ff3bb62c8dbc93a25f75bec73803428b3fe5024841d3e2d97e444c1d27304"; }
+    { locale = "hy-AM"; arch = "linux-i686"; sha256 = "4bac63a8b8fea36c3dab794dff933972f9adff7f91a7d3957d4edc3c60534016"; }
+    { locale = "hy-AM"; arch = "linux-x86_64"; sha256 = "9c26a2438462429f96b2d8bb8c4566b1b1f7d03200ed68aaca4eb6602342c33c"; }
+    { locale = "id"; arch = "linux-i686"; sha256 = "e36cd7195d5cd21afd97f31a5108af5999ade8a97f92db3e00067f3cfc31cd72"; }
+    { locale = "id"; arch = "linux-x86_64"; sha256 = "191e47625a6764670bfbab673989e5b2e6ad45ad1c3a0544a129afe8cb963171"; }
+    { locale = "is"; arch = "linux-i686"; sha256 = "c839d21d4e16b05bd9aa995ff2124b6b8418ca1405a8f3bfc70fb65b5710488b"; }
+    { locale = "is"; arch = "linux-x86_64"; sha256 = "16d8df9867e6a13a2be7408f459e2c67d449a47105cf9709e4a743abed8229a9"; }
+    { locale = "it"; arch = "linux-i686"; sha256 = "7f9c3909cda97d9a40f2630af4f11e6dd8e29f45ab949348123c4334f6aee8fe"; }
+    { locale = "it"; arch = "linux-x86_64"; sha256 = "52f95491dbf4ee9a1f2ee552feb8a30b8196b6747064e45d5a98d0fecfa11f67"; }
+    { locale = "ja"; arch = "linux-i686"; sha256 = "6586fd1d792feea4e98442736f06eab15d7de526667db6a3ce7de1afac9fdaec"; }
+    { locale = "ja"; arch = "linux-x86_64"; sha256 = "0ef883bdf3d415a5795bd613af05b16a406b3af3415ac1c1ebc646dd76f76467"; }
+    { locale = "kk"; arch = "linux-i686"; sha256 = "39167c7ee9f0e9b62308fcaba0f061bda0eaac9d3bb707c6556f71085c7ddd54"; }
+    { locale = "kk"; arch = "linux-x86_64"; sha256 = "ec2c9ae1f5daba1e3b0c8a4f24737b0968bc818748b682418f02983e25302703"; }
+    { locale = "km"; arch = "linux-i686"; sha256 = "797747aa402ad42b6addd04d69995b0ea5c628da71f2cce15c8e612d15461189"; }
+    { locale = "km"; arch = "linux-x86_64"; sha256 = "fd75e5fbba75dd8a6cdafdb1c4983bfd4336f300df559518d3fff0e6e7e482d6"; }
+    { locale = "kn"; arch = "linux-i686"; sha256 = "fada07e5679bcf174078e0c596cd121301f72c307401922e5772c6fa79eeedbe"; }
+    { locale = "kn"; arch = "linux-x86_64"; sha256 = "d9cbb3dc02e3db54ea691dc09c882fcd65fd99bb1d0250e29e3d0a37df72179b"; }
+    { locale = "ko"; arch = "linux-i686"; sha256 = "22bd8b1dec10117579a267d5bb9b10f460c27c9419305aa1cc4456b09fcd7df5"; }
+    { locale = "ko"; arch = "linux-x86_64"; sha256 = "0e9da5e79ebb149a62606e002202b70908d329a26c213df35480962fb05a9f7c"; }
+    { locale = "ku"; arch = "linux-i686"; sha256 = "e5f55ab5112ca3a137c4df37460304ff7e33471e3e95e2709ace1cb32ef88084"; }
+    { locale = "ku"; arch = "linux-x86_64"; sha256 = "224385ae3a9da1fbbbc0d309eba0de6f64e29da4de29299cb1c778cb5a57c968"; }
+    { locale = "lij"; arch = "linux-i686"; sha256 = "e39f5edc61e25f490dcae7ea4fdc91033f5e868cbcaf848180c40bd920455f17"; }
+    { locale = "lij"; arch = "linux-x86_64"; sha256 = "f6e9725f368ce4df3be078a1ad268a29cfeba01e5606de85fbe2e375b3a5e263"; }
+    { locale = "lt"; arch = "linux-i686"; sha256 = "46b2c694c60540ded3d3f6cb504bc5b7a709cc0940ff6b3223f05d7b8e1f7309"; }
+    { locale = "lt"; arch = "linux-x86_64"; sha256 = "51d10f5c63e377b0f9e46d7ee12ea8552b8df57d6e8d9334555b7fbab617c8a4"; }
+    { locale = "lv"; arch = "linux-i686"; sha256 = "8e224c3efcca9864255332b7f7c089c0c04b0eb2dfe60cd04d7dd6a61d807852"; }
+    { locale = "lv"; arch = "linux-x86_64"; sha256 = "e53090be92e7557be5d38aed25ac0a2fb1006d15bb38d61141473f4b38c6e26c"; }
+    { locale = "mai"; arch = "linux-i686"; sha256 = "479795f542d17476bb721d3e7c7fef565617528016085976a63b9e5864b4dd31"; }
+    { locale = "mai"; arch = "linux-x86_64"; sha256 = "8daa2882e27a19894ded43885e868dd7203f506cb1bd25ede1d36328fffbbe0d"; }
+    { locale = "mk"; arch = "linux-i686"; sha256 = "78f6fa53d5fda46fbe54b9978acaa75faaf094d2d3b8e464539609253da07c52"; }
+    { locale = "mk"; arch = "linux-x86_64"; sha256 = "47a147a93dc7d1e683a57f0d7ddd7fbe3d944145932e0773be8dab6a7a0b4b01"; }
+    { locale = "ml"; arch = "linux-i686"; sha256 = "6ac6a36596db8bf675df76abc629fc99ff019455f8c08842668a08cb40b67e9a"; }
+    { locale = "ml"; arch = "linux-x86_64"; sha256 = "c4d4bed760c429c5db1d5c42682127794f81e20182aed0fc37f4c9aaf7bc582c"; }
+    { locale = "mr"; arch = "linux-i686"; sha256 = "a2fc483f2aca2cbb7bdff42e4b27b711fdf27f46bee707d1c6d664c391c95def"; }
+    { locale = "mr"; arch = "linux-x86_64"; sha256 = "5209926b3130b8b75d933287872af62ac752fc9e3fc170b540a2f0bc49d97bdf"; }
+    { locale = "ms"; arch = "linux-i686"; sha256 = "926944ef9a3807b3379bba4b2fff05d8c2776cc4e3239b0b2bd2e5424151e6ee"; }
+    { locale = "ms"; arch = "linux-x86_64"; sha256 = "20cf8557fa41119febc99bbc6de10ea7e97d3c1abc2245241db862ca8a735db1"; }
+    { locale = "nb-NO"; arch = "linux-i686"; sha256 = "5a2778d9e93ae4371ad29737904aaecacf494855b45e5e79cfe773410f6600f6"; }
+    { locale = "nb-NO"; arch = "linux-x86_64"; sha256 = "8cfe4c778ee258dcd511990fd71eefcda46ab73c4448705e3815c5c371ee6ea1"; }
+    { locale = "nl"; arch = "linux-i686"; sha256 = "350efbbaeb3ef9eee16a398ce482c2a3790f5b85dda6177857d7448de03af9e1"; }
+    { locale = "nl"; arch = "linux-x86_64"; sha256 = "6d1310f7e2ebe5fc846f966bfa930a2bf3cd0877260de40b01496cb860630c37"; }
+    { locale = "nn-NO"; arch = "linux-i686"; sha256 = "6447690e509ec0d1306bbfa484df82e62dd5909603b43440443c28bf2f489f24"; }
+    { locale = "nn-NO"; arch = "linux-x86_64"; sha256 = "6e71ad4fe85b02f8745e6b3b39a6f69f13fff45fd555704747d1f59fcf64447a"; }
+    { locale = "or"; arch = "linux-i686"; sha256 = "71866d15af41df9d98716544d25d8fc2069a9a8f92cdd8180731e3b3fb3c3492"; }
+    { locale = "or"; arch = "linux-x86_64"; sha256 = "22ace7c20948526f1011e16581c870a919c4d8002bd0c3210ae8f702d1f8a03f"; }
+    { locale = "pa-IN"; arch = "linux-i686"; sha256 = "12eabc66d39bd767c129c1a1777a6a13812efa0bc3df430dd7940908f53094ec"; }
+    { locale = "pa-IN"; arch = "linux-x86_64"; sha256 = "54501bca85e231e9fab0aa894a6e566966fdbd172fc45888d97eb828e248d105"; }
+    { locale = "pl"; arch = "linux-i686"; sha256 = "e16acf44c5ab2ee708ba0f74301106a5fc0c36cd65ebd302043af09803f30138"; }
+    { locale = "pl"; arch = "linux-x86_64"; sha256 = "a1532684d5d0e9e2091a5d42202dc6b49ee8c21df14600f0772e1f0f53f6d638"; }
+    { locale = "pt-BR"; arch = "linux-i686"; sha256 = "9827bfda689b01e795d4ddf7ab1169e25cc1728175af74e8a08fa3e8ef40e40c"; }
+    { locale = "pt-BR"; arch = "linux-x86_64"; sha256 = "bfe02180011d564fe8deff4d3f3f8e3a6bfde05469738b5b2f8849a2ee485ba8"; }
+    { locale = "pt-PT"; arch = "linux-i686"; sha256 = "83fcda599d09946da8a968d903fa12b93502a23337f019d3217cc80f81607fe7"; }
+    { locale = "pt-PT"; arch = "linux-x86_64"; sha256 = "533050be56e6dbf06a5631a5b7a7db2da4f5514f224cb787600671c79c020379"; }
+    { locale = "rm"; arch = "linux-i686"; sha256 = "62906af16b8e179be3015f6be9cf4b9481fcc506044c053373f9bc2e315729fa"; }
+    { locale = "rm"; arch = "linux-x86_64"; sha256 = "f968ed9ba8ed43d0d52b02db23b2badf6e6a2544d105f23d6b09b80a07a28ee3"; }
+    { locale = "ro"; arch = "linux-i686"; sha256 = "503fc4cf0de24ff5b1658d09264f8bb3b131c678f61c554ddf1006633ff2d336"; }
+    { locale = "ro"; arch = "linux-x86_64"; sha256 = "514625ffbf4af4519a7671896f2f2797a1b17057dea356f7c17fa52a17736358"; }
+    { locale = "ru"; arch = "linux-i686"; sha256 = "01521832ab38fd46751578691b82c0283d9c7a68459ab7225328afa285699b01"; }
+    { locale = "ru"; arch = "linux-x86_64"; sha256 = "16b780ed767ff0537ec4619453d8cd3ebdcf124704d03d1741b5501007078dee"; }
+    { locale = "si"; arch = "linux-i686"; sha256 = "35ee6cded95ea13c8c480a46ffc9398f50d172aff2030611d6713b04ddc1c54d"; }
+    { locale = "si"; arch = "linux-x86_64"; sha256 = "c4ad9cec257bacffbcf3b4c84c63ec52e1ce830754b5be0b622a44ab223919ad"; }
+    { locale = "sk"; arch = "linux-i686"; sha256 = "53a6bc5aebe5edf4bad34e163a54a3bed30a7c74ff883463caf057793ac3f58e"; }
+    { locale = "sk"; arch = "linux-x86_64"; sha256 = "5110806bb3f02317b542bb79ce34c6bffeef68982807a5e53614958fb9adc779"; }
+    { locale = "sl"; arch = "linux-i686"; sha256 = "3a58652b394fc2ffe1abcc1e89596f3e9357a2455cda8a0c76a44ff20331ada2"; }
+    { locale = "sl"; arch = "linux-x86_64"; sha256 = "fb733f327080e5b4e2ae079a5cdbdb645fde1c9388368c13fcc6af4d3d91da7a"; }
+    { locale = "son"; arch = "linux-i686"; sha256 = "56a262e4411404e94747312858ae1e7ca99ea48171361f03cdc660f8b0da0da2"; }
+    { locale = "son"; arch = "linux-x86_64"; sha256 = "db77a5cab885f96efcbaae8e9f284ad30ab78aae1a405a5f1c2ac7d4d2e43498"; }
+    { locale = "sq"; arch = "linux-i686"; sha256 = "fde7c85f09997ab3f7918072a9577f8d70947c5fafcc70782d684759146941bd"; }
+    { locale = "sq"; arch = "linux-x86_64"; sha256 = "9865054be5d0a3913e4fa16aafdacd345607955b1d733d978033a2825d926c32"; }
+    { locale = "sr"; arch = "linux-i686"; sha256 = "87f9f7d46a211b9205df5258f551b7c42264fdb81c70f836a37b3d5a821c4c03"; }
+    { locale = "sr"; arch = "linux-x86_64"; sha256 = "ed03914c382efdec2f218e87e8efdd2b761e16ad0cc2a646b02050f27503161b"; }
+    { locale = "sv-SE"; arch = "linux-i686"; sha256 = "1e28e39ac45177607a2ff3c71d3317b8b777679bc9e8dad2236991f05c6823ca"; }
+    { locale = "sv-SE"; arch = "linux-x86_64"; sha256 = "81c2fdc5ec9f338b1dc3cd5d2e8dd62cf106c4cf759826be8eb7f3f3f550c49e"; }
+    { locale = "ta"; arch = "linux-i686"; sha256 = "8e27ba1c8079745a93bebf6f7e4dbfa9ffc32b91d6dfa12975497466f3ec1550"; }
+    { locale = "ta"; arch = "linux-x86_64"; sha256 = "c244aeff11608d6f1a8513045ab53d4909af02915761b15ff34ddbbc9995dcbe"; }
+    { locale = "te"; arch = "linux-i686"; sha256 = "32e404eeeebeb521d909cc64fe1ba3c0b40130f7a4b4ae742a48ba61e8b668d4"; }
+    { locale = "te"; arch = "linux-x86_64"; sha256 = "83b5cefddc6308050c24d9fb30818fa1fb3c1d4ba9a2de9d8fc99878b01855b4"; }
+    { locale = "th"; arch = "linux-i686"; sha256 = "009cb39521635c1c89717b3d526a59c05e7ab82082ec31f0fd482800f01d3e8b"; }
+    { locale = "th"; arch = "linux-x86_64"; sha256 = "1fe31902ef44e7049e9efa4774098c00d3ecad0a4c4f585716cb4bec158e3b88"; }
+    { locale = "tr"; arch = "linux-i686"; sha256 = "e54ee04479b9891420af6fc1d639da121b677660a5bf1dfd8565792c9e1cdbdf"; }
+    { locale = "tr"; arch = "linux-x86_64"; sha256 = "bdfae1142a7714a0be9bd24b02582a9ab9913c17d130cf0b2928deb657f8bebc"; }
+    { locale = "uk"; arch = "linux-i686"; sha256 = "b2d6b518e86c3bae1068f7a6d7cdc975f3b0f99e514c5d3d18dbe5e62d15dbce"; }
+    { locale = "uk"; arch = "linux-x86_64"; sha256 = "71bd0518b69c911dbb21297cd676ed66231a3b7bc59090a9f6a85d6882263277"; }
+    { locale = "vi"; arch = "linux-i686"; sha256 = "390fb219da7169d69a7aca1df883750d56bf34f0f7b6b49781d6f3c6b8962962"; }
+    { locale = "vi"; arch = "linux-x86_64"; sha256 = "1c5af9f646ced5533223bca6dd36f364c0ca9d3f02ba93797aa8b091144cf7e2"; }
+    { locale = "xh"; arch = "linux-i686"; sha256 = "5d0d04c7c84ffc51b11f99205ae767954b78d98c3a2d18bfcceca1cb292fcd9a"; }
+    { locale = "xh"; arch = "linux-x86_64"; sha256 = "5fafe2b375ee0935da52ec9037c4f515d1be5cf783548215d289a300e06bb9de"; }
+    { locale = "zh-CN"; arch = "linux-i686"; sha256 = "1361b7cfc08d4d000107a244ec2a163ab27616b1d1db13917f34acc4d4167d34"; }
+    { locale = "zh-CN"; arch = "linux-x86_64"; sha256 = "66aa04a7b5240df285afd37608c816b7c09cb365c6d0cd5aa4dbe8a7be61d824"; }
+    { locale = "zh-TW"; arch = "linux-i686"; sha256 = "c0e3d9b584ba10e2a67a904253b2d93ab3546465e69619f932b566ad6b04a003"; }
+    { locale = "zh-TW"; arch = "linux-x86_64"; sha256 = "6a24f9f3631bc0bcc15de6a124c0f7dbcee6d0099e2f0b0622a18e54c04620a9"; }
+    { locale = "zu"; arch = "linux-i686"; sha256 = "7fa59f6ee26d48f992015b0bb667a0c230cea854eafa67d7c4e51d38e1a267d3"; }
+    { locale = "zu"; arch = "linux-x86_64"; sha256 = "4af969f1e0d0703e83d903fc2a30739ae2ab42cc3a24219be8bfd152490970c5"; }
+  ];
+
+  arch = if stdenv.system == "i686-linux"
+    then "linux-i686"
+    else "linux-x86_64";
+
+  isPrefixOf = prefix: string:
+    builtins.substring 0 (builtins.stringLength prefix) string == prefix;
+
+  sourceMatches = locale: source:
+      (isPrefixOf source.locale locale) && source.arch == arch;
+
+  systemLocale = config.i18n.defaultLocale or "en-US";
+
+  defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources;
+
+  source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources;
+
+in
+
+stdenv.mkDerivation {
+  name = "firefox-bin-${version}";
+
+  src = fetchurl {
+    url = "http://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/${source.arch}/${source.locale}/firefox-${version}.tar.bz2";
+    inherit (source) sha256;
+  };
+
+  phases = "unpackPhase installPhase";
+
+  libPath = stdenv.lib.makeLibraryPath
+    [ stdenv.gcc.gcc
+      alsaLib
+      atk
+      cairo
+      cups
+      dbus_glib
+      dbus_libs
+      fontconfig
+      freetype
+      gconf
+      gdk_pixbuf
+      glib
+      glibc
+      gst_plugins_base
+      gstreamer
+      gtk
+      libX11
+      libXScrnSaver
+      libXext
+      libXinerama
+      libXrender
+      libXt
+      libcanberra
+      libgnome
+      libgnomeui
+      mesa
+      nspr
+      nss
+      pango
+      heimdal
+      pulseaudio
+      systemd
+    ] + ":" + stdenv.lib.makeSearchPath "lib64" [
+      stdenv.gcc.gcc
+    ];
+
+  # "strip" after "patchelf" may break binaries.
+  # See: https://github.com/NixOS/patchelf/issues/10
+  dontStrip = 1;
+
+  installPhase =
+    ''
+      mkdir -p "$prefix/usr/lib/firefox-bin-${version}"
+      cp -r * "$prefix/usr/lib/firefox-bin-${version}"
+
+      mkdir -p "$out/bin"
+      ln -s "$prefix/usr/lib/firefox-bin-${version}/firefox" "$out/bin/"
+
+      for executable in \
+        firefox mozilla-xremote-client firefox-bin plugin-container \
+        updater crashreporter webapprt-stub
+      do
+        patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          "$out/usr/lib/firefox-bin-${version}/$executable"
+      done
+
+      for executable in \
+        firefox mozilla-xremote-client firefox-bin plugin-container \
+        updater crashreporter webapprt-stub libxul.so
+      do
+        patchelf --set-rpath "$libPath" \
+          "$out/usr/lib/firefox-bin-${version}/$executable"
+      done
+
+      # Create a desktop item.
+      mkdir -p $out/share/applications
+      cat > $out/share/applications/firefox.desktop <<EOF
+      [Desktop Entry]
+      Type=Application
+      Exec=$out/bin/firefox
+      Icon=$out/lib/firefox-bin-${version}/chrome/icons/default/default256.png
+      Name=Firefox
+      GenericName=Web Browser
+      Categories=Application;Network;
+      EOF
+    '';
+
+  meta = with stdenv.lib; {
+    description = "Mozilla Firefox, free web browser";
+    homepage = http://www.mozilla.org/firefox/;
+    license = {
+      shortName = "unfree"; # not sure
+      fullName = "unfree";
+      url = http://www.mozilla.org/en-US/foundation/trademarks/policy/;
+    };
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/firefox-bin/generate_nix.rb b/pkgs/applications/networking/browsers/firefox-bin/generate_nix.rb
new file mode 100644
index 000000000000..a768b1f8dffc
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox-bin/generate_nix.rb
@@ -0,0 +1,217 @@
+# TODO share code with thunderbird-bin/generate_nix.rb
+
+version = if ARGV.empty?
+            "latest"
+          else
+            ARGV[0]
+          end
+
+base_path = "download-installer.cdn.mozilla.net/pub/firefox/releases"
+
+arches = ["linux-i686", "linux-x86_64"]
+
+arches.each do |arch|
+  system("wget", "--recursive", "--continue", "--no-parent", "--reject-regex", ".*\\?.*", "--reject", "xpi", "http://#{base_path}/#{version}/#{arch}/")
+end
+
+locales = Dir.glob("#{base_path}/#{version}/#{arches[0]}/*").map do |path|
+  File.basename(path)
+end.sort
+
+locales.delete("index.html")
+locales.delete("xpi")
+
+# real version number, e.g. "30.0" instead of "latest".
+real_version = Dir.glob("#{base_path}/#{version}/#{arches[0]}/#{locales[0]}/firefox-*")[0].match(/firefox-([0-9.]*)/)[1][0..-2]
+
+locale_arch_path_tuples = locales.flat_map do |locale|
+  arches.map do |arch|
+    path = Dir.glob("#{base_path}/#{version}/#{arch}/#{locale}/firefox-*")[0]
+
+    [locale, arch, path]
+  end
+end
+
+paths = locale_arch_path_tuples.map do |tuple| tuple[2] end
+
+hashes = IO.popen(["sha256sum", "--binary", *paths]) do |input|
+  input.each_line.map do |line|
+    $stderr.puts(line)
+
+    line.match(/^[0-9a-f]*/)[0]
+  end
+end
+
+
+puts(<<"EOH")
+# This file is generated from generate_nix.rb
+# Execute the following command in a temporary directory to update the file.
+#
+# ruby generate_nix.rb > default.nix
+
+{ stdenv, fetchurl, config
+, alsaLib
+, atk
+, cairo
+, cups
+, dbus_glib
+, dbus_libs
+, fontconfig
+, freetype
+, gconf
+, gdk_pixbuf
+, glib
+, glibc
+, gst_plugins_base
+, gstreamer
+, gtk
+, libX11
+, libXScrnSaver
+, libXext
+, libXinerama
+, libXrender
+, libXt
+, libcanberra
+, libgnome
+, libgnomeui
+, mesa
+, nspr
+, nss
+, pango
+, heimdal
+, pulseaudio
+, systemd
+}:
+
+let
+  version = "#{real_version}";
+  sources = [
+EOH
+
+locale_arch_path_tuples.zip(hashes) do |tuple, hash|
+  locale, arch, path = tuple
+
+  puts(%Q|    { locale = "#{locale}"; arch = "#{arch}"; sha256 = "#{hash}"; }|)
+end
+
+puts(<<'EOF')
+  ];
+
+  arch = if stdenv.system == "i686-linux"
+    then "linux-i686"
+    else "linux-x86_64";
+
+  isPrefixOf = prefix: string:
+    builtins.substring 0 (builtins.stringLength prefix) string == prefix;
+
+  sourceMatches = locale: source:
+      (isPrefixOf source.locale locale) && source.arch == arch;
+
+  systemLocale = config.i18n.defaultLocale or "en-US";
+
+  defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources;
+
+  source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources;
+
+in
+
+stdenv.mkDerivation {
+  name = "firefox-bin-${version}";
+
+  src = fetchurl {
+    url = "http://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/${source.arch}/${source.locale}/firefox-${version}.tar.bz2";
+    inherit (source) sha256;
+  };
+
+  phases = "unpackPhase installPhase";
+
+  libPath = stdenv.lib.makeLibraryPath
+    [ stdenv.gcc.gcc
+      alsaLib
+      atk
+      cairo
+      cups
+      dbus_glib
+      dbus_libs
+      fontconfig
+      freetype
+      gconf
+      gdk_pixbuf
+      glib
+      glibc
+      gst_plugins_base
+      gstreamer
+      gtk
+      libX11
+      libXScrnSaver
+      libXext
+      libXinerama
+      libXrender
+      libXt
+      libcanberra
+      libgnome
+      libgnomeui
+      mesa
+      nspr
+      nss
+      pango
+      heimdal
+      pulseaudio
+      systemd
+    ] + ":" + stdenv.lib.makeSearchPath "lib64" [
+      stdenv.gcc.gcc
+    ];
+
+  # "strip" after "patchelf" may break binaries.
+  # See: https://github.com/NixOS/patchelf/issues/10
+  dontStrip = 1;
+
+  installPhase =
+    ''
+      mkdir -p "$prefix/usr/lib/firefox-bin-${version}"
+      cp -r * "$prefix/usr/lib/firefox-bin-${version}"
+
+      mkdir -p "$out/bin"
+      ln -s "$prefix/usr/lib/firefox-bin-${version}/firefox" "$out/bin/"
+
+      for executable in \
+        firefox mozilla-xremote-client firefox-bin plugin-container \
+        updater crashreporter webapprt-stub
+      do
+        patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          "$out/usr/lib/firefox-bin-${version}/$executable"
+      done
+
+      for executable in \
+        firefox mozilla-xremote-client firefox-bin plugin-container \
+        updater crashreporter webapprt-stub libxul.so
+      do
+        patchelf --set-rpath "$libPath" \
+          "$out/usr/lib/firefox-bin-${version}/$executable"
+      done
+
+      # Create a desktop item.
+      mkdir -p $out/share/applications
+      cat > $out/share/applications/firefox.desktop <<EOF
+      [Desktop Entry]
+      Type=Application
+      Exec=$out/bin/firefox
+      Icon=$out/lib/firefox-bin-${version}/chrome/icons/default/default256.png
+      Name=Firefox
+      GenericName=Web Browser
+      Categories=Application;Network;
+      EOF
+    '';
+
+  meta = with stdenv.lib; {
+    description = "Mozilla Firefox, free web browser";
+    homepage = http://www.mozilla.org/firefox/;
+    license = {
+      shortName = "unfree"; # not sure
+      fullName = "unfree";
+      url = http://www.mozilla.org/en-US/foundation/trademarks/policy/;
+    };
+    platforms = platforms.linux;
+  };
+}
+EOF
diff --git a/pkgs/applications/networking/browsers/firefox/3.6.nix b/pkgs/applications/networking/browsers/firefox/3.6.nix
deleted file mode 100644
index c430bb7089a8..000000000000
--- a/pkgs/applications/networking/browsers/firefox/3.6.nix
+++ /dev/null
@@ -1,155 +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
-
-, # 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
-}:
-
-rec {
-
-  firefoxVersion = "3.6.27";
-  
-  xulVersion = "1.9.2.27"; # this attribute is used by other packages
-
-  
-  src = fetchurl {
-    url = "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
-    sha1 = "dd472a10e4ef5b017f00074d0325be13e832d610";
-  };
-
-
-  commonConfigureFlags =
-    [ "--enable-optimize"
-      "--disable-debug"
-      "--enable-strip"
-      "--with-system-jpeg"
-      "--with-system-zlib"
-      "--with-system-bz2"
-      "--with-system-nspr"
-      "--with-system-nss"
-      # "--with-system-png" # <-- "--with-system-png won't work because the system's libpng doesn't have APNG support"
-      "--enable-system-cairo"
-      #"--enable-system-sqlite" # <-- this seems to be discouraged
-      "--disable-crashreporter"
-      "--disable-tests"
-      "--disable-necko-wifi" # maybe we want to enable this at some point
-    ];
-
-  xulrunner = stdenv.mkDerivation {
-    name = "xulrunner-${xulVersion}";
-    
-    inherit src;
-
-    patches = [
-      # Loongson2f related patches:
-      ./xulrunner-chromium-mips.patch
-      ./xulrunner-mips-n32.patch
-      ./xulrunner-1.9.2_beta4-mips-bus-error.patch
-
-      # Fix building on GCC 4.6.
-      ./gcc-4.6.patch
-    ];
-
-    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
-      ];
-
-    preConfigure = if stdenv.isMips then ''
-      export ac_cv_thread_keyword=no
-    '' else "";
-
-    configureFlags =
-      [ "--enable-application=xulrunner"
-        "--disable-javaxpcom"
-      ] ++ commonConfigureFlags;
-
-    # !!! Temporary hack.
-    preBuild = ''
-     export NIX_ENFORCE_PURITY=
-    '';
-
-    installFlags = "SKIP_GRE_REGISTRATION=1";
-
-    postInstall = ''
-      # Fix some references to /bin paths in the Xulrunner shell script.
-      substituteInPlace $out/bin/xulrunner \
-          --replace /bin/pwd "$(type -tP pwd)" \
-          --replace /bin/ls "$(type -tP ls)"
-
-      # Fix run-mozilla.sh search
-      libDir=$(cd $out/lib && ls -d xulrunner-[0-9]*)
-      echo libDir: $libDir
-      test -n "$libDir"
-      cd $out/bin
-      mv xulrunner ../lib/$libDir/
-
-      for i in $out/lib/$libDir/*; do 
-          file $i;
-          if file $i | grep executable &>/dev/null; then 
-              ln -s $i $out/bin
-          fi;
-      done;
-      rm -f $out/bin/run-mozilla.sh
-    ''; # */
-
-    enableParallelBuilding = true;
-
-    meta = {
-      description = "Mozilla Firefox XUL runner";
-      homepage = http://www.mozilla.org/firefox/;
-    };
-
-    passthru = { inherit gtk; version = xulVersion; };
-  };
-
-
-  firefox = stdenv.mkDerivation rec {
-    name = "firefox-${firefoxVersion}";
-
-    inherit src;
-
-    buildInputs =
-      [ pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2 python
-        dbus dbus_glib pango freetype fontconfig alsaLib nspr nss libnotify
-        xlibs.pixman
-      ];
-
-    propagatedBuildInputs = [xulrunner];
-
-    configureFlags =
-      [ "--enable-application=browser"
-        "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
-      ]
-      ++ commonConfigureFlags
-      ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
-
-    postInstall = ''
-      libDir=$(cd $out/lib && ls -d firefox-[0-9]*)
-      test -n "$libDir"
-
-      ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $out/lib/$libDir/xulrunner
-
-      # Register extensions etc. !!! is this needed anymore?
-      echo "running firefox -register..."
-      $out/bin/firefox -register
-    ''; # */
-
-    meta = {
-      description = "Mozilla Firefox - the browser, reloaded";
-      homepage = http://www.mozilla.org/firefox/;
-    };
-
-    passthru = {
-      inherit gtk xulrunner nspr;
-      isFirefox3Like = true;
-    };
-  };
-}
diff --git a/pkgs/applications/networking/browsers/firefox/30.nix b/pkgs/applications/networking/browsers/firefox/30.nix
new file mode 100644
index 000000000000..1e2c3e2cfb19
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox/30.nix
@@ -0,0 +1,211 @@
+{ stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
+, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xlibs
+, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
+, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
+, hunspell, libevent, libstartup_notification, libvpx
+, cairo, gstreamer, gst_plugins_base, icu
+, debugBuild ? false
+, # 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 = "30.0";
+
+  xulVersion = "30.0"; # this attribute is used by other packages
+
+
+  src = fetchurl {
+    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
+    sha1 = "bll9hxf31gvg9db6gxgmq25qsjif3p11";
+  };
+
+  commonConfigureFlags =
+    [ "--with-system-jpeg"
+      "--with-system-zlib"
+      "--with-system-bz2"
+      "--with-system-nspr"
+      "--with-system-nss"
+      "--with-system-libevent"
+      "--with-system-libvpx"
+      "--with-system-png"
+      # "--with-system-icu" # causes ‘ar: invalid option -- 'L'’ in Firefox 28.0
+      "--enable-system-ffi"
+      "--enable-system-hunspell"
+      "--enable-system-pixman"
+      "--enable-system-sqlite"
+      "--enable-system-cairo"
+      "--enable-gstreamer"
+      "--enable-startup-notification"
+      # "--enable-content-sandbox"            # available since 26.0, but not much info available
+      # "--enable-content-sandbox-reporter"   # keeping disabled for now
+      "--disable-crashreporter"
+      "--disable-tests"
+      "--disable-necko-wifi" # maybe we want to enable this at some point
+      "--disable-installer"
+      "--disable-updater"
+      "--disable-pulseaudio"
+    ] ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
+                        else [ "--disable-debug" "--enable-release"
+                               "--enable-optimize" "--enable-strip" ]);
+
+
+  xulrunner = stdenv.mkDerivation rec {
+    name = "xulrunner-${xulVersion}";
+
+    inherit src;
+
+    buildInputs =
+      [ pkgconfig libpng gtk perl zip libIDL libjpeg zlib 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
+        hunspell libevent libstartup_notification libvpx cairo
+        gstreamer gst_plugins_base icu
+      ];
+
+    configureFlags =
+      [ "--enable-application=xulrunner"
+        "--disable-javaxpcom"
+      ] ++ commonConfigureFlags;
+
+    #enableParallelBuilding = true; # cf. https://github.com/NixOS/nixpkgs/pull/1699#issuecomment-35196282
+
+    preConfigure =
+      ''
+        export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
+
+        mkdir ../objdir
+        cd ../objdir
+        configureScript=../mozilla-release/configure
+      ''; # */
+
+    #installFlags = "SKIP_GRE_REGISTRATION=1";
+
+    preInstall = ''
+      # The following is needed for startup cache creation on grsecurity kernels
+      paxmark m ../objdir/dist/bin/xpcshell
+    '';
+
+    postInstall = ''
+      # Fix run-mozilla.sh search
+      libDir=$(cd $out/lib && ls -d xulrunner-[0-9]*)
+      echo libDir: $libDir
+      test -n "$libDir"
+      cd $out/bin
+      rm xulrunner
+
+      for i in $out/lib/$libDir/*; do
+          file $i;
+          if file $i | grep executable &>/dev/null; then
+              echo -e '#! /bin/sh\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
+              chmod a+x "$out/bin/$(basename "$i")";
+          fi;
+      done
+      for i in $out/lib/$libDir/*.so; do
+          patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
+      done
+
+      # For grsecurity kernels
+      paxmark m $out/lib/$libDir/{plugin-container,xulrunner}
+
+      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 libpng gtk perl zip libIDL libjpeg zlib bzip2 python
+        dbus dbus_glib pango freetype fontconfig alsaLib nspr nss libnotify
+        xlibs.pixman yasm mesa sqlite file unzip pysqlite
+        hunspell libevent libstartup_notification libvpx cairo
+        gstreamer gst_plugins_base icu
+      ];
+
+    patches = [
+      ./disable-reporter.patch # fixes "search box not working when built on xulrunner"
+      ./xpidl.patch
+    ];
+
+    propagatedBuildInputs = [xulrunner];
+
+    configureFlags =
+      [ "--enable-application=browser"
+        "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
+        "--enable-chrome-format=jar"
+      ]
+      ++ commonConfigureFlags
+      ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
+
+    makeFlags = [
+      "SYSTEM_LIBXUL=1"
+    ];
+
+    # Because preConfigure runs configure from a subdirectory.
+    configureScript = "../configure";
+
+    preConfigure =
+      ''
+        # Hack to work around make's idea of -lbz2 dependency
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":"
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+
+        # Building directly in the main source directory is not allowed.
+        mkdir obj_dir
+        cd obj_dir
+      '';
+
+    postInstall =
+      ''
+        ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
+        cd "$out/lib/"firefox-*
+        rm firefox
+        echo -e '#!${stdenv.shell}\nexec ${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
+        chmod a+x firefox
+
+        # Put chrome.manifest etc. in the right place.
+        mv browser/* .
+        rmdir browser
+      ''; # */
+
+    meta = {
+      description = "Mozilla Firefox - the browser, reloaded";
+      homepage = http://www.mozilla.com/en-US/firefox/;
+      maintainers = with stdenv.lib.maintainers; [ eelco wizeman ];
+    };
+
+    passthru = {
+      inherit gtk xulrunner nspr;
+      isFirefox3Like = true;
+    };
+  };
+}
diff --git a/pkgs/applications/networking/browsers/firefox/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix
index 45606c9af825..ad2ea75bd704 100644
--- a/pkgs/applications/networking/browsers/firefox/default.nix
+++ b/pkgs/applications/networking/browsers/firefox/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
-, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xlibs
+{ lib, stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
+, libjpeg, zlib, dbus, dbus_glib, bzip2, xlibs
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
 , yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
 , hunspell, libevent, libstartup_notification, libvpx
-, cairo, gstreamer, gst_plugins_base
+, cairo, gstreamer, gst_plugins_base, icu
 , debugBuild ? false
 , # If you want the resulting program to call itself "Firefox" instead
   # of "Shiretoko" or whatever, enable this option.  However, those
@@ -15,29 +15,30 @@
 
 assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
 
-let optional = stdenv.lib.optional;
-in rec {
-
-  firefoxVersion = "25.0";
-
-  xulVersion = "25.0"; # this attribute is used by other packages
+let version = "31.0"; in
 
+stdenv.mkDerivation rec {
+  name = "firefox-${version}";
 
   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.
-        "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
-    ];
-    sha1 = "854722e283659d2b6b2eacd38f757b3c5b63a448";
+    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${version}/source/firefox-${version}.source.tar.bz2";
+    sha1 = "a6c3e25ee3aeb7da42db2aaeb50a385d63532beb";
   };
 
-  commonConfigureFlags =
-    [ "--enable-optimize"
-      #"--enable-profiling"
-      (if debugBuild then "--enable-debug" else "--disable-debug")
-      "--enable-strip"
+  buildInputs =
+    [ pkgconfig gtk perl zip libIDL libjpeg zlib 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
+      hunspell libevent libstartup_notification libvpx cairo
+      gstreamer gst_plugins_base icu
+    ];
+
+  configureFlags =
+    [ "--enable-application=browser"
+      "--disable-javaxpcom"
       "--with-system-jpeg"
       "--with-system-zlib"
       "--with-system-bz2"
@@ -45,152 +46,62 @@ in rec {
       "--with-system-nss"
       "--with-system-libevent"
       "--with-system-libvpx"
-      "--with-system-png"
-      "--enable-startup-notification"
+      # "--with-system-png" # needs APNG support
+      # "--with-system-icu" # causes ‘ar: invalid option -- 'L'’ in Firefox 28.0
       "--enable-system-ffi"
       "--enable-system-hunspell"
       "--enable-system-pixman"
       "--enable-system-sqlite"
       "--enable-system-cairo"
+      "--enable-gstreamer"
+      "--enable-startup-notification"
+      # "--enable-content-sandbox"            # available since 26.0, but not much info available
+      # "--enable-content-sandbox-reporter"   # keeping disabled for now
       "--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 libpng gtk perl zip libIDL libjpeg zlib 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
-        hunspell libevent libstartup_notification libvpx cairo
-        gstreamer gst_plugins_base
-      ];
-
-    configureFlags =
-      [ "--enable-application=xulrunner"
-        "--disable-javaxpcom"
-      ] ++ commonConfigureFlags;
-
-    enableParallelBuilding = true;
-
-    preConfigure =
-      ''
-        export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
-
-        mkdir ../objdir
-        cd ../objdir
-        configureScript=../mozilla-release/configure
-      ''; # */
-
-    #installFlags = "SKIP_GRE_REGISTRATION=1";
-
-    postInstall = ''
-      # Fix run-mozilla.sh search
-      libDir=$(cd $out/lib && ls -d xulrunner-[0-9]*)
-      echo libDir: $libDir
-      test -n "$libDir"
-      cd $out/bin
-      rm xulrunner
-
-      for i in $out/lib/$libDir/*; do
-          file $i;
-          if file $i | grep executable &>/dev/null; then
-              echo -e '#! /bin/sh\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
-              chmod a+x "$out/bin/$(basename "$i")";
-          fi;
-      done
-      for i in $out/lib/$libDir/*.so; do
-          patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
-      done
-      for i in $out/lib/$libDir/{plugin-container,xulrunner,xulrunner-stub}; do
-          wrapProgram $i --prefix LD_LIBRARY_PATH ':' "$out/lib/$libDir"
-      done
-      rm -f $out/bin/run-mozilla.sh
-    ''; # */
-
-    meta = {
-      description = "Mozilla Firefox XUL runner";
-      homepage = http://www.mozilla.com/en-US/firefox/;
-    };
-
-    passthru = { inherit gtk; version = xulVersion; };
+      "--disable-pulseaudio"
+    ]
+    ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
+                      else [ "--disable-debug" "--enable-release"
+                             "--enable-optimize" "--enable-strip" ])
+    ++ lib.optional enableOfficialBranding "--enable-official-branding";
+
+  enableParallelBuilding = true;
+
+  preConfigure =
+    ''
+      mkdir ../objdir
+      cd ../objdir
+      configureScript=../mozilla-release/configure
+    '';
+
+  preInstall =
+    ''
+      # The following is needed for startup cache creation on grsecurity kernels.
+      paxmark m ../objdir/dist/bin/xpcshell
+    '';
+
+  postInstall =
+    ''
+      # For grsecurity kernels
+      paxmark m $out/lib/*/{plugin-container,xulrunner}
+
+      # Remove SDK cruft. FIXME: move to a separate output?
+      rm -rf $out/share/idl $out/include $out/lib/firefox-devel-*
+    '';
+
+  meta = {
+    description = "Mozilla Firefox - the browser, reloaded";
+    homepage = http://www.mozilla.com/en-US/firefox/;
+    maintainers = with lib.maintainers; [ eelco wizeman ];
+    platforms = lib.platforms.linux;
   };
 
-
-  firefox = stdenv.mkDerivation rec {
-    name = "firefox-${firefoxVersion}";
-
-    inherit src;
-
-    enableParallelBuilding = true;
-
-    buildInputs =
-      [ pkgconfig libpng gtk perl zip libIDL libjpeg zlib bzip2 python
-        dbus dbus_glib pango freetype fontconfig alsaLib nspr nss libnotify
-        xlibs.pixman yasm mesa sqlite file unzip pysqlite
-        hunspell libevent libstartup_notification libvpx cairo
-        gstreamer gst_plugins_base
-      ];
-
-    patches = [
-      ./disable-reporter.patch # fixes "search box not working when built on xulrunner"
-    ];
-
-    propagatedBuildInputs = [xulrunner];
-
-    configureFlags =
-      [ "--enable-application=browser"
-        "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
-        "--enable-chrome-format=jar"
-      ]
-      ++ commonConfigureFlags
-      ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
-
-    makeFlags = [
-      "SYSTEM_LIBXUL=1"
-    ];
-
-    # Hack to work around make's idea of -lbz2 dependency
-    preConfigure =
-      ''
-        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-          stdenv.lib.concatStringsSep ":"
-            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
-        }' ';'
-      '';
-
-    postInstall =
-      ''
-        ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
-        cd "$out/lib/"firefox-*
-        rm firefox
-        echo -e '#!${stdenv.shell}\nexec ${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
-        chmod a+x firefox
-
-        # Put chrome.manifest etc. in the right place.
-        mv browser/* .
-        rmdir browser
-      ''; # */
-
-    meta = {
-      description = "Mozilla Firefox - the browser, reloaded";
-      homepage = http://www.mozilla.com/en-US/firefox/;
-      maintainers = [ stdenv.lib.maintainers.eelco ];
-    };
-
-    passthru = {
-      inherit gtk xulrunner nspr;
-      isFirefox3Like = true;
-    };
+  passthru = {
+    inherit gtk nspr version;
+    isFirefox3Like = true;
   };
 }
diff --git a/pkgs/applications/networking/browsers/firefox/disable-reporter.patch b/pkgs/applications/networking/browsers/firefox/disable-reporter.patch
deleted file mode 100644
index 0a71a7210f2a..000000000000
--- a/pkgs/applications/networking/browsers/firefox/disable-reporter.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-# from:
-# - https://www.linuxquestions.org/questions/linux-from-scratch-13/blfs-xulrunner-firefox-21-0-and-search-4175462532/
-# - http://www.mail-archive.com/blfs-support@linuxfromscratch.org/msg17359.html
-
---- mozilla-release/browser/base/content/browser.js.orig	2013-05-11 16:19:21.000000000 -0300
-+++ mozilla-release/browser/base/content/browser.js	2013-06-07 00:39:16.114862388 -0300
-@@ -3559,10 +3559,12 @@
-    */
-   recordSearchInHealthReport: function (engine, source) {
- #ifdef MOZ_SERVICES_HEALTHREPORT
--    let reporter = Cc["@mozilla.org/datareporting/service;1"]
-+    /*let reporter = Cc["@mozilla.org/datareporting/service;1"]
-                      .getService()
-                      .wrappedJSObject
-                      .healthReporter;
-+    */
-+       return;
- 
-     // This can happen if the FHR component of the data reporting service is
-     // disabled. This is controlled by a pref that most will never use.
diff --git a/pkgs/applications/networking/browsers/firefox/gcc-4.6.patch b/pkgs/applications/networking/browsers/firefox/gcc-4.6.patch
deleted file mode 100644
index f5f685951ef4..000000000000
--- a/pkgs/applications/networking/browsers/firefox/gcc-4.6.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://346825.bugs.gentoo.org/attachment.cgi?id=270163
-
---- a/gfx/ots/src/os2.cc
-+++ b/gfx/ots/src/os2.cc
-@@ -2,6 +2,8 @@
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- 
-+#include <cstddef>
-+
- #include "os2.h"
- 
- #include "head.h"
diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix
index bf4c7f3e7d22..6a00dfcd8c19 100644
--- a/pkgs/applications/networking/browsers/firefox/wrapper.nix
+++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix
@@ -2,8 +2,10 @@
 , browserName, desktopName, nameSuffix, icon
 }:
 
+let p = builtins.parseDrvName browser.name; in
+
 stdenv.mkDerivation {
-  name = browser.name + "-with-plugins";
+  name = "${p.name}-with-plugins-${p.version}";
 
   desktopItem = makeDesktopItem {
     name = browserName;
@@ -40,6 +42,8 @@ stdenv.mkDerivation {
     echo ${browser} > $out/nix-support/propagated-user-env-packages
   '';
 
+  preferLocalBuild = true;
+
   # Let each plugin tell us (through its `mozillaPlugin') attribute
   # where to find the plugin in its tree.
   plugins = map (x: x + x.mozillaPlugin) plugins;
diff --git a/pkgs/applications/networking/browsers/firefox/xulrunner-1.9.2_beta4-mips-bus-error.patch b/pkgs/applications/networking/browsers/firefox/xulrunner-1.9.2_beta4-mips-bus-error.patch
deleted file mode 100644
index 54799397f6f8..000000000000
--- a/pkgs/applications/networking/browsers/firefox/xulrunner-1.9.2_beta4-mips-bus-error.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-http://www.gentoo-cn.org/gitweb/?p=loongson.git;a=blob;f=net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-bus-error.patch;h=2bf51d77054796ffaf4f4d903dd8560bf96b7844;hb=HEAD
-
---- ./xpcom/glue/nsTArray.h.orig	2009-04-26 01:21:58.000000000 +0800
-+++ ./xpcom/glue/nsTArray.h	2009-04-26 01:21:33.000000000 +0800
-@@ -168,6 +168,7 @@
- 
-     // The array's elements (prefixed with a Header).  This pointer is never
-     // null.  If the array is empty, then this will point to sEmptyHdr.
-+    void   *padding;
-     Header *mHdr;
- };
-
-diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp
-index 6d452d0..3ce4193 100644
---- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
-+++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
-@@ -169,8 +169,8 @@ private:
-   PRBool SetupForDirectTextRun(gfxContext *aContext, float aScale);
-   void SetupFor(gfxContext *aContext, float aScale);
- 
--  nsSVGGlyphFrame *mSource;
-   nsAutoTArray<CharacterPosition,80> mPositions;
-+  nsSVGGlyphFrame *mSource;
-   gfxMatrix mInitialMatrix;
-   // Textrun advance width from start to mCurrentChar, in appunits
-   gfxFloat mCurrentAdvance;
diff --git a/pkgs/applications/networking/browsers/firefox/xulrunner-chromium-mips.patch b/pkgs/applications/networking/browsers/firefox/xulrunner-chromium-mips.patch
deleted file mode 100644
index d309f5fb6e80..000000000000
--- a/pkgs/applications/networking/browsers/firefox/xulrunner-chromium-mips.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-http://gentoo-overlays.zugaina.org/loongson/portage/net-libs/xulrunner/files/xulrunner-chromium-mips.patch
-
-diff --git a/ipc/chromium/src/base/atomicops.h b/ipc/chromium/src/base/atomicops.h
-index 87df918..363bf63 100644
---- a/ipc/chromium/src/base/atomicops.h
-+++ b/ipc/chromium/src/base/atomicops.h
-@@ -132,6 +132,8 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
- #include "base/atomicops_internals_x86_gcc.h"
- #elif defined(COMPILER_GCC) && defined(ARCH_CPU_ARM_FAMILY)
- #include "base/atomicops_internals_arm_gcc.h"
-+#elif defined(COMPILER_GCC) && defined(ARCH_CPU_MIPS_FAMILY)
-+#include "base/atomicops_internals_mips_gcc.h"
- #else
- #error "Atomic operations are not supported on your platform"
- #endif
-diff --git a/ipc/chromium/src/base/atomicops_internals_mips_gcc.h b/ipc/chromium/src/base/atomicops_internals_mips_gcc.h
-new file mode 100644
-index 0000000..d1b87ee
---- /dev/null
-+++ b/ipc/chromium/src/base/atomicops_internals_mips_gcc.h
-@@ -0,0 +1,160 @@
-+// Copyright (c) 2010 Zhang, Le <r0bertz@gentoo.org>
-+// Use of this source code is governed by GPLv2.
-+
-+// This file is an internal atomic implementation, use base/atomicops.h instead.
-+
-+#ifndef BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_
-+#define BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_
-+
-+#define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
-+
-+namespace base {
-+namespace subtle {
-+
-+// 32-bit low-level operations on any platform.
-+
-+inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
-+                                         Atomic32 old_value,
-+                                         Atomic32 new_value) {
-+  Atomic32 prev;
-+   __asm__ __volatile__(
-+                       " .set  push        \n"
-+                       " .set  noat        \n"
-+                       " .set  mips3       \n"
-+                       "1: ll  %0, %2      \n"
-+                       " bne %0, %z3, 2f   \n"
-+                       " .set  mips0       \n"
-+                       " move  $1, %z4     \n"
-+                       " .set  mips3       \n"
-+                       " sc  $1, %1        \n"
-+                       " beqz  $1, 3f      \n"
-+                       "2:                 \n"
-+                       " .subsection 2     \n"
-+                       "3: b 1b            \n"
-+                       " .previous         \n"
-+                       " .set  pop         \n"
-+                       : "=&r" (prev), "=R" (*ptr)       
-+                       : "R" (*ptr), "Jr" (old_value), "Jr" (new_value)     
-+                       : "memory");
-+  return prev;
-+}
-+
-+inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
-+                                         Atomic32 new_value) {
-+  unsigned int ret_value;
-+  unsigned long dummy;
-+
-+  __asm__ __volatile__("       .set    mips3                                   \n"
-+                       "1:     ll      %0, %3                  # xchg_u32      \n"
-+                       "       .set    mips0                                   \n"
-+                       "       move    %2, %z4                                 \n"
-+                       "       .set    mips3                                   \n"
-+                       "       sc      %2, %1                                  \n"
-+                       "       beqz    %2, 2f                                  \n"
-+                       "       .subsection 2                                   \n"
-+                       "2:     b       1b                                      \n"
-+                       "       .previous                                       \n"
-+                       "       .set    mips0                                   \n"
-+                       : "=&r" (ret_value), "=m" (*ptr), "=&r" (dummy)
-+                       : "R" (*ptr), "Jr" (new_value)
-+                       : "memory");
-+
-+  return ret_value;  // Now it's the previous value.
-+}
-+
-+inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
-+                                          Atomic32 increment) {
-+  Atomic32 temp, result;
-+    __asm__ __volatile__(
-+    " .set  mips3         \n"
-+    "1: ll  %1, %2    # atomic_add_return \n"
-+    " addu  %0, %1, %3        \n"
-+    " sc  %0, %2          \n"
-+    " beqz  %0, 2f          \n"
-+    " addu  %0, %1, %3        \n"
-+    " .subsection 2         \n"
-+    "2: b 1b          \n"
-+    " .previous         \n"
-+    " .set  mips0         \n"
-+    : "=&r" (result), "=&r" (temp), "=m" (*ptr)
-+    : "Ir" (increment), "m" (*ptr)
-+    : "memory");
-+  return result;
-+}
-+
-+inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
-+                                        Atomic32 increment) {
-+  Atomic32 temp, result;
-+    __asm__ __volatile__(
-+    " .set  mips3         \n"
-+    "1: ll  %1, %2    # atomic_add_return \n"
-+    " addu  %0, %1, %3        \n"
-+    " sc  %0, %2          \n"
-+    " beqz  %0, 2f          \n"
-+    " addu  %0, %1, %3        \n"
-+    " .subsection 2         \n"
-+    "2: b 1b          \n"
-+    " .previous         \n"
-+    " .set  mips0         \n"
-+    : "=&r" (result), "=&r" (temp), "=m" (*ptr)
-+    : "Ir" (increment), "m" (*ptr)
-+    : "memory");
-+  __asm__ __volatile__("sync" : : : "memory");
-+  return result;
-+}
-+
-+inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
-+                                       Atomic32 old_value,
-+                                       Atomic32 new_value) {
-+  Atomic32 x = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-+  __asm__ __volatile__("sync" : : : "memory");
-+  return x;
-+}
-+
-+inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
-+                                       Atomic32 old_value,
-+                                       Atomic32 new_value) {
-+  return NoBarrier_CompareAndSwap(ptr, old_value, new_value);
-+}
-+
-+inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
-+  *ptr = value;
-+}
-+
-+inline void MemoryBarrier() {
-+  __asm__ __volatile__("sync" : : : "memory");
-+}
-+
-+inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
-+  *ptr = value;
-+  __asm__ __volatile__("sync" : : : "memory");
-+}
-+
-+inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
-+  ATOMICOPS_COMPILER_BARRIER();
-+  *ptr = value; // An x86 store acts as a release barrier.
-+  // See comments in Atomic64 version of Release_Store(), below.
-+}
-+
-+inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
-+  return *ptr;
-+}
-+
-+inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
-+  Atomic32 value = *ptr; // An x86 load acts as a acquire barrier.
-+  // See comments in Atomic64 version of Release_Store(), below.
-+  ATOMICOPS_COMPILER_BARRIER();
-+  return value;
-+}
-+
-+inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
-+  MemoryBarrier();
-+  return *ptr;
-+}
-+
-+} // namespace base::subtle
-+} // namespace base
-+
-+#undef ATOMICOPS_COMPILER_BARRIER
-+
-+#endif  // BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_
-diff --git a/ipc/chromium/src/base/debug_util_posix.cc b/ipc/chromium/src/base/debug_util_posix.cc
-index f7c58b4..50fb41d 100644
---- a/ipc/chromium/src/base/debug_util_posix.cc
-+++ b/ipc/chromium/src/base/debug_util_posix.cc
-@@ -108,7 +108,7 @@ bool DebugUtil::BeingDebugged() {
- 
- // static
- void DebugUtil::BreakDebugger() {
--#if !defined(ARCH_CPU_ARM_FAMILY)
-+#if !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY)
-   asm ("int3");
- #endif
- }
-diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h
-index 36f83e7..128bbc7 100644
---- a/ipc/chromium/src/build/build_config.h
-+++ b/ipc/chromium/src/build/build_config.h
-@@ -57,6 +57,8 @@
- #define ARCH_CPU_ARMEL 1
- #define ARCH_CPU_32_BITS 1
- #define WCHAR_T_IS_UNSIGNED 1
-+#elif defined(__MIPSEL__)
-+#define ARCH_CPU_MIPS_FAMILY 1
- #else
- #error Please add support for your architecture in build/build_config.h
- #endif
diff --git a/pkgs/applications/networking/browsers/firefox/xulrunner-mips-n32.patch b/pkgs/applications/networking/browsers/firefox/xulrunner-mips-n32.patch
deleted file mode 100644
index 8be510352607..000000000000
--- a/pkgs/applications/networking/browsers/firefox/xulrunner-mips-n32.patch
+++ /dev/null
@@ -1,764 +0,0 @@
-http://gentoo-overlays.zugaina.org/loongson/portage/net-libs/xulrunner/files/xulrunner-mips-n32.patch
-
-From 1aa3577cf7e79b574bd2cff058ea00221194869b Mon Sep 17 00:00:00 2001
-From: Zhang Le <r0bertz@gentoo.org>
-Date: Thu, 12 Mar 2009 02:24:34 +0800
-Subject: [PATCH 2/2] xulrunner mips n32 ABI patch
-
-Signed-off-by: Zhang Le <r0bertz@gentoo.org>
----
- xpcom/reflect/xptcall/src/md/unix/Makefile.in      |    5 +
- .../xptcall/src/md/unix/xptcinvoke_asm_mips64.s    |  159 ++++++++++++++
- .../xptcall/src/md/unix/xptcinvoke_mips64.cpp      |  173 ++++++++++++++++
- .../xptcall/src/md/unix/xptcstubs_asm_mips64.s     |  149 +++++++++++++
- .../xptcall/src/md/unix/xptcstubs_mips64.cpp       |  218 ++++++++++++++++++++
- 5 files changed, 704 insertions(+), 0 deletions(-)
- create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
- create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
- create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
- create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
-
-diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
-index 524174e..63586cf 100644
---- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
-+++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
-@@ -274,8 +274,13 @@ endif
- 
- ifeq ($(OS_ARCH),Linux)
- ifneq (,$(findstring mips, $(OS_TEST)))
-+ifneq (,$(findstring mips64, $(OS_TEST)))
-+CPPSRCS		:= xptcinvoke_mips64.cpp xptcstubs_mips64.cpp
-+ASFILES		:= xptcinvoke_asm_mips64.s xptcstubs_asm_mips64.s
-+else
- CPPSRCS		:= xptcinvoke_mips.cpp xptcstubs_mips.cpp
- ASFILES		:= xptcinvoke_asm_mips.s xptcstubs_asm_mips.s
-+endif
- ASFLAGS		+= -I$(DIST)/include -x assembler-with-cpp
- endif
- endif
-diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
-new file mode 100644
-index 0000000..f146ad8
---- /dev/null
-+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
-@@ -0,0 +1,159 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is mozilla.org code.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * Netscape Communications Corporation.
-+ * Portions created by the Initial Developer are Copyright (C) 1998
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *   ZHANG Le    <r0bertz@gentoo.org>
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either of the GNU General Public License Version 2 or later (the "GPL"),
-+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+#include <sys/regdef.h>
-+#include <sys/asm.h>
-+
-+.text
-+.globl  invoke_count_words
-+.globl  invoke_copy_to_stack
-+
-+LOCALSZ=7		# a0, a1, a2, a3, s0, ra, gp
-+FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
-+
-+RAOFF=FRAMESZ-(1*SZREG)
-+A0OFF=FRAMESZ-(2*SZREG)
-+A1OFF=FRAMESZ-(3*SZREG)
-+A2OFF=FRAMESZ-(4*SZREG)
-+A3OFF=FRAMESZ-(5*SZREG)
-+S0OFF=FRAMESZ-(6*SZREG)
-+GPOFF=FRAMESZ-(7*SZREG)
-+
-+#
-+# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params)
-+#                      a0       a1          a2         a3
-+
-+NESTED(_NS_InvokeByIndex_P, FRAMESZ, ra)
-+	PTR_SUBU sp, FRAMESZ
-+	SETUP_GP64(GPOFF, _NS_InvokeByIndex_P)
-+
-+	REG_S	ra, RAOFF(sp)
-+	REG_S	a0, A0OFF(sp)
-+	REG_S	a1, A1OFF(sp)
-+	REG_S	a2, A2OFF(sp)
-+	REG_S	a3, A3OFF(sp)
-+	REG_S	s0, S0OFF(sp)
-+
-+	# invoke_count_words(paramCount, params)
-+	move    a0, a2
-+	move    a1, a3
-+	jal     invoke_count_words
-+
-+	# invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount,
-+	#                      nsXPTCVariant* s, PRUint32 *reg)
-+
-+	REG_L   a1, A2OFF(sp)   # a1 - paramCount
-+	REG_L	a2, A3OFF(sp)	# a2 - params
-+
-+	# save sp before we copy the params to the stack
-+	move	t0, sp
-+
-+	# assume full size of 16 bytes per param to be safe
-+	sll	v0, 4		# 16 bytes * num params
-+	subu	sp, sp, v0	# make room
-+	move	a0, sp		# a0 - param stack address
-+
-+	# create temporary stack space to write int and fp regs
-+	subu    sp, 64          # 64 = 8 regs of 8 bytes
-+	move    a3, sp
-+
-+	# save the old sp and save the arg stack
-+	subu	sp, sp, 16
-+	REG_S	t0, 0(sp)
-+	REG_S	a0, 8(sp)
-+
-+	# copy the param into the stack areas
-+	jal	invoke_copy_to_stack
-+
-+	REG_L	t3, 8(sp)	# get previous a0
-+	REG_L	sp, 0(sp)	# get orig sp back
-+
-+	REG_L	a0, A0OFF(sp)	# a0 - that
-+	REG_L	a1, A1OFF(sp)	# a1 - methodIndex
-+
-+	# t1 = methodIndex * pow(2, PTRLOG)
-+	# (use shift instead of mult)
-+	sll	t1, a1, PTRLOG
-+
-+	# calculate the function we need to jump to,
-+	# which must then be saved in t9
-+	lw	t9, 0(a0)
-+	addu	t9, t9, t1
-+#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
-+	lw	t9, (t9)
-+#else /* not G++ V3 ABI */
-+	lw	t9, 2*PTRSIZE(t9)
-+#endif /* G++ V3 ABI */
-+
-+	# get register save area from invoke_copy_to_stack
-+	subu	t1, t3, 64
-+
-+	# a1..a7 and f13..f19 should now be set to what
-+	# invoke_copy_to_stack told us. skip a0 and f12
-+	# because that's the "this" pointer
-+
-+	REG_L	a1,  0(t1)
-+	REG_L	a2,  8(t1)
-+	REG_L	a3, 16(t1)
-+	REG_L	a4, 24(t1)
-+	REG_L	a5, 32(t1)
-+	REG_L	a6, 40(t1)
-+	REG_L	a7, 48(t1)
-+
-+	l.d	$f13,  0(t1)
-+	l.d	$f14,  8(t1)
-+	l.d	$f15, 16(t1)
-+	l.d	$f16, 24(t1)
-+	l.d	$f17, 32(t1)
-+	l.d	$f18, 40(t1)
-+	l.d	$f19, 48(t1)
-+
-+	# save away our stack pointer and create
-+	# the stack pointer for the function
-+	move	s0, sp
-+	move	sp, t3
-+
-+	jalr	t9
-+
-+	move	sp, s0
-+
-+	RESTORE_GP64
-+	REG_L	ra, RAOFF(sp)
-+	REG_L	s0, S0OFF(sp)
-+	PTR_ADDU	sp, FRAMESZ
-+	j	ra
-+.end _NS_InvokeByIndex_P
-diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
-new file mode 100644
-index 0000000..d1d1a7d
---- /dev/null
-+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
-@@ -0,0 +1,173 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is mozilla.org code.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * Netscape Communications Corporation.
-+ * Portions created by the Initial Developer are Copyright (C) 1998
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *   ZHANG Le    <r0bertz@gentoo.org>
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either of the GNU General Public License Version 2 or later (the "GPL"),
-+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+
-+/* Platform specific code to invoke XPCOM methods on native objects */
-+
-+#include "xptcprivate.h"
-+
-+#if (_MIPS_SIM != _ABIN32)
-+#error "This code is for MIPS N32 only"
-+#endif
-+
-+extern "C" uint32
-+invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s)
-+{
-+    return paramCount;
-+}
-+
-+extern "C" void
-+invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount,
-+                     nsXPTCVariant* s, PRUint64 *regs)
-+{
-+#define N_ARG_REGS       7       /* 8 regs minus 1 for "this" ptr */
-+
-+    for (PRUint32 i = 0; i < paramCount; i++, s++)
-+    {
-+        if (s->IsPtrData()) {
-+            if (i < N_ARG_REGS)
-+               regs[i] = (PRUint64)s->ptr;
-+            else
-+               *d++ = (PRUint64)s->ptr;
-+            continue;
-+        }
-+        switch (s->type) {
-+        //
-+        // signed types first
-+        //
-+        case nsXPTType::T_I8:
-+           if (i < N_ARG_REGS)
-+              ((PRInt64*)regs)[i] = s->val.i8;
-+           else
-+              *d++ = s->val.i8;
-+           break;
-+        case nsXPTType::T_I16:
-+           if (i < N_ARG_REGS)
-+              ((PRInt64*)regs)[i] = s->val.i16;
-+           else
-+              *d++ = s->val.i16;
-+           break;
-+        case nsXPTType::T_I32:
-+           if (i < N_ARG_REGS)
-+              ((PRInt64*)regs)[i] = s->val.i32;
-+           else
-+              *d++ = s->val.i32;
-+           break;
-+        case nsXPTType::T_I64:
-+           if (i < N_ARG_REGS)
-+              ((PRInt64*)regs)[i] = s->val.i64;
-+           else
-+              *d++ = s->val.i64;
-+           break;
-+        //
-+        // unsigned types next
-+        //
-+        case nsXPTType::T_U8:
-+           if (i < N_ARG_REGS)
-+              regs[i] = s->val.u8;
-+           else
-+              *d++ = s->val.u8;
-+           break;
-+        case nsXPTType::T_U16:
-+           if (i < N_ARG_REGS)
-+              regs[i] = s->val.u16;
-+           else
-+              *d++ = s->val.u16;
-+           break;
-+        case nsXPTType::T_U32:
-+           if (i < N_ARG_REGS)
-+              regs[i] = s->val.u32;
-+           else
-+              *d++ = s->val.u32;
-+           break;
-+        case nsXPTType::T_U64:
-+           if (i < N_ARG_REGS)
-+              regs[i] = s->val.u64;
-+           else
-+              *d++ = s->val.u64;
-+           break;
-+        case nsXPTType::T_FLOAT:
-+           if (i < N_ARG_REGS)
-+              *(float*)&regs[i] = s->val.f;
-+           else
-+              *(float*)d++ = s->val.f;
-+           break;
-+        case nsXPTType::T_DOUBLE:
-+           if (i < N_ARG_REGS)
-+              *(double*)&regs[i] = s->val.d;
-+           else
-+              *(double*)d++ = s->val.d;
-+           break;
-+        case nsXPTType::T_BOOL:
-+           if (i < N_ARG_REGS)
-+              regs[i] = s->val.b;
-+           else
-+              *d++ = s->val.b;
-+           break;
-+        case nsXPTType::T_CHAR:
-+           if (i < N_ARG_REGS)
-+              regs[i] = s->val.c;
-+           else
-+              *d++ = s->val.c;
-+           break;
-+        case nsXPTType::T_WCHAR:
-+           if (i < N_ARG_REGS)
-+              regs[i] = s->val.wc;
-+           else
-+              *d++ = s->val.wc;
-+           break;
-+        default:
-+           // all the others are plain pointer types
-+           if (i < N_ARG_REGS)
-+              regs[i] = (PRUint64)s->val.p;
-+           else
-+              *d++ = (PRUint64)s->val.p;
-+           break;
-+        }
-+    }
-+}
-+
-+extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
-+                                        PRUint32 paramCount,
-+                                        nsXPTCVariant* params);
-+
-+EXPORT_XPCOM_API(nsresult)
-+NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
-+                   PRUint32 paramCount, nsXPTCVariant* params)
-+{
-+    return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
-+}
-diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
-new file mode 100644
-index 0000000..dfee24b
---- /dev/null
-+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
-@@ -0,0 +1,149 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is mozilla.org code.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * Netscape Communications Corporation.
-+ * Portions created by the Initial Developer are Copyright (C) 1998
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *   ZHANG Le    <r0bertz@gentoo.org>
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either of the GNU General Public License Version 2 or later (the "GPL"),
-+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+#include <sys/regdef.h>
-+#include <sys/asm.h>
-+
-+LOCALSZ=16
-+FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
-+
-+A1OFF=FRAMESZ-(9*SZREG)
-+A2OFF=FRAMESZ-(8*SZREG)
-+A3OFF=FRAMESZ-(7*SZREG)
-+A4OFF=FRAMESZ-(6*SZREG)
-+A5OFF=FRAMESZ-(5*SZREG)
-+A6OFF=FRAMESZ-(4*SZREG)
-+A7OFF=FRAMESZ-(3*SZREG)
-+GPOFF=FRAMESZ-(2*SZREG)
-+RAOFF=FRAMESZ-(1*SZREG)
-+
-+F13OFF=FRAMESZ-(16*SZREG)
-+F14OFF=FRAMESZ-(15*SZREG)
-+F15OFF=FRAMESZ-(14*SZREG)
-+F16OFF=FRAMESZ-(13*SZREG)
-+F17OFF=FRAMESZ-(12*SZREG)
-+F18OFF=FRAMESZ-(11*SZREG)
-+F19OFF=FRAMESZ-(10*SZREG)
-+
-+#define SENTINEL_ENTRY(n)         /* defined in cpp file, not here */
-+
-+#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
-+#define STUB_ENTRY(x)						\
-+	.if x < 10;						\
-+	MAKE_STUB(x, _ZN14nsXPTCStubBase5Stub ##x ##Ev);	\
-+	.elseif x < 100;					\
-+	MAKE_STUB(x, _ZN14nsXPTCStubBase6Stub ##x ##Ev);	\
-+	.elseif x < 1000;					\
-+	MAKE_STUB(x, _ZN14nsXPTCStubBase7Stub ##x ##Ev);	\
-+	.else;							\
-+	.err;							\
-+	.endif
-+#else /* not G++ V3 ABI */
-+#define STUB_ENTRY(x)						\
-+	MAKE_STUB(x, Stub ##x ##__14nsXPTCStubBase)
-+#endif /* G++ V3 ABI */
-+
-+#define MAKE_STUB(x, name)					\
-+	.globl	name;		\
-+	.type	name,@function;	\
-+	.aent	name,0;		\
-+name:;				\
-+	PTR_SUBU sp,FRAMESZ;					\
-+	SETUP_GP64(GPOFF, name);				\
-+	li	t0,x;						\
-+	b	sharedstub;					\
-+
-+#
-+# open a dummy frame for the function entries
-+#
-+	.text
-+	.align	2
-+	.type	dummy,@function
-+	.ent	dummy, 0
-+dummy:
-+	.frame	sp, FRAMESZ, ra
-+	.mask	0x90000FF0, RAOFF-FRAMESZ
-+	.fmask	0x000FF000, F19OFF-FRAMESZ
-+
-+#include "xptcstubsdef.inc"
-+
-+sharedstub:
-+
-+	REG_S	a1, A1OFF(sp)
-+	REG_S	a2, A2OFF(sp)
-+	REG_S	a3, A3OFF(sp)
-+	REG_S	a4, A4OFF(sp)
-+	REG_S	a5, A5OFF(sp)
-+	REG_S	a6, A6OFF(sp)
-+	REG_S	a7, A7OFF(sp)
-+	REG_S	ra, RAOFF(sp)
-+
-+	s.d	$f13, F13OFF(sp)
-+	s.d	$f14, F14OFF(sp)
-+	s.d	$f15, F15OFF(sp)
-+	s.d	$f16, F16OFF(sp)
-+	s.d	$f17, F17OFF(sp)
-+	s.d	$f18, F18OFF(sp)
-+	s.d	$f19, F19OFF(sp)
-+
-+	# t0 is methodIndex
-+	move	a1, t0
-+
-+	# a2 is stack address where extra function params
-+	# are stored that do not fit in registers
-+	move	a2, sp
-+	addi	a2, FRAMESZ
-+
-+	# a3 is stack address of a1..a7
-+	move	a3, sp
-+	addi	a3, A1OFF
-+
-+	# a4 is stack address of f13..f19
-+	move	a4, sp
-+	addi	a4, F13OFF
-+
-+	# PrepareAndDispatch(that, methodIndex, args, gprArgs, fpArgs)
-+	#                     a0       a1        a2     a3       a4
-+	#
-+	jal	PrepareAndDispatch
-+
-+	REG_L	ra, RAOFF(sp)
-+	RESTORE_GP64
-+
-+	PTR_ADDU sp, FRAMESZ
-+	j	ra
-+	END(dummy)
-diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
-new file mode 100644
-index 0000000..c404065
---- /dev/null
-+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
-@@ -0,0 +1,218 @@
-+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is mozilla.org code.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * Netscape Communications Corporation.
-+ * Portions created by the Initial Developer are Copyright (C) 1999
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *   ZHANG Le    <r0bertz@gentoo.org>
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either of the GNU General Public License Version 2 or later (the "GPL"),
-+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+
-+#include "xptcprivate.h"
-+#include "xptiprivate.h"
-+
-+#if (_MIPS_SIM != _ABIN32)
-+#error "This code is for MIPS N32 only"
-+#endif
-+
-+/*
-+ * This is for MIPS N32 ABI
-+ *
-+ * When we're called, the "gp" registers are stored in gprData and
-+ * the "fp" registers are stored in fprData.  There are 8 regs
-+ * available which coorespond to the first 7 parameters of the
-+ * function and the "this" pointer.  If there are additional parms,
-+ * they are stored on the stack at address "args".
-+ *
-+ */
-+extern "C" nsresult
-+PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint64* args,
-+                   PRUint64 *gprData, double *fprData)
-+{
-+#define PARAM_BUFFER_COUNT		16
-+#define PARAM_GPR_COUNT			7
-+#define PARAM_FPR_COUNT			7
-+
-+    nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
-+    nsXPTCMiniVariant* dispatchParams = NULL;
-+    const nsXPTMethodInfo* info;
-+    PRUint8 paramCount;
-+    PRUint8 i;
-+    nsresult result = NS_ERROR_FAILURE;
-+
-+    NS_ASSERTION(self,"no self");
-+
-+    self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
-+    NS_ASSERTION(info,"no method info");
-+
-+    paramCount = info->GetParamCount();
-+
-+    // setup variant array pointer
-+    if(paramCount > PARAM_BUFFER_COUNT)
-+        dispatchParams = new nsXPTCMiniVariant[paramCount];
-+    else
-+        dispatchParams = paramBuffer;
-+    NS_ASSERTION(dispatchParams,"no place for params");
-+
-+    PRUint64* ap = args;
-+    PRUint32 iCount = 0;
-+    for(i = 0; i < paramCount; i++)
-+    {
-+        const nsXPTParamInfo& param = info->GetParam(i);
-+        const nsXPTType& type = param.GetType();
-+        nsXPTCMiniVariant* dp = &dispatchParams[i];
-+
-+        if(param.IsOut() || !type.IsArithmetic())
-+        {
-+            if (iCount < PARAM_GPR_COUNT)
-+            	dp->val.p = (void*)gprData[iCount++];
-+            else
-+            	dp->val.p = (void*)*ap++;
-+            continue;
-+        }
-+        // else
-+        switch(type)
-+        {
-+        case nsXPTType::T_I8:
-+           if (iCount < PARAM_GPR_COUNT)
-+              dp->val.i8  = (PRInt8)gprData[iCount++];
-+           else
-+              dp->val.i8  = (PRInt8)*ap++;
-+           break;
-+
-+        case nsXPTType::T_I16:
-+            if (iCount < PARAM_GPR_COUNT)
-+               dp->val.i16  = (PRInt16)gprData[iCount++];
-+            else
-+               dp->val.i16  = (PRInt16)*ap++;
-+            break;
-+
-+        case nsXPTType::T_I32:
-+            if (iCount < PARAM_GPR_COUNT)
-+               dp->val.i32  = (PRInt32)gprData[iCount++];
-+            else
-+               dp->val.i32  = (PRInt32)*ap++;
-+            break;
-+
-+        case nsXPTType::T_I64:
-+            if (iCount < PARAM_GPR_COUNT)
-+               dp->val.i64  = (PRInt64)gprData[iCount++];
-+            else
-+               dp->val.i64  = (PRInt64)*ap++;
-+            break;
-+
-+        case nsXPTType::T_U8:
-+            if (iCount < PARAM_GPR_COUNT)
-+               dp->val.u8  = (PRUint8)gprData[iCount++];
-+            else
-+               dp->val.u8  = (PRUint8)*ap++;
-+            break;
-+
-+        case nsXPTType::T_U16:
-+            if (iCount < PARAM_GPR_COUNT)
-+               dp->val.u16  = (PRUint16)gprData[iCount++];
-+            else
-+                dp->val.u16  = (PRUint16)*ap++;
-+            break;
-+
-+        case nsXPTType::T_U32:
-+            if (iCount < PARAM_GPR_COUNT)
-+               dp->val.u32  = (PRUint32)gprData[iCount++];
-+            else
-+               dp->val.u32  = (PRUint32)*ap++;
-+            break;
-+
-+        case nsXPTType::T_U64:
-+            if (iCount < PARAM_GPR_COUNT)
-+               dp->val.u64  = (PRUint64)gprData[iCount++];
-+            else
-+               dp->val.u64  = (PRUint64)*ap++;
-+            break;
-+
-+        case nsXPTType::T_FLOAT:
-+             if (iCount < PARAM_FPR_COUNT)
-+                dp->val.f  = (double)fprData[iCount++];
-+             else
-+                dp->val.f  = *((double*)ap++);
-+             break;
-+
-+        case nsXPTType::T_DOUBLE:
-+              if (iCount < PARAM_FPR_COUNT)
-+                 dp->val.d  = (double)fprData[iCount++];
-+              else
-+                 dp->val.d  = *((double*)ap++);
-+              break;
-+
-+        case nsXPTType::T_BOOL:
-+           if (iCount < PARAM_GPR_COUNT)
-+              dp->val.b  = (PRBool)gprData[iCount++];
-+           else
-+              dp->val.b  = (PRBool)*ap++;
-+           break;
-+
-+        case nsXPTType::T_CHAR:
-+           if (iCount < PARAM_GPR_COUNT)
-+              dp->val.c  = (char)gprData[iCount++];
-+           else
-+              dp->val.c  = (char)*ap++;
-+           break;
-+
-+        case nsXPTType::T_WCHAR:
-+           if (iCount < PARAM_GPR_COUNT)
-+              dp->val.wc  = (wchar_t)gprData[iCount++];
-+           else
-+              dp->val.wc  = (wchar_t)*ap++;
-+           break;
-+
-+        default:
-+            NS_ASSERTION(0, "bad type");
-+            break;
-+        }
-+    }
-+
-+    result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
-+
-+    if(dispatchParams != paramBuffer)
-+        delete [] dispatchParams;
-+
-+    return result;
-+}
-+
-+#define STUB_ENTRY(n)		/* defined in the assembly file */
-+
-+#define SENTINEL_ENTRY(n) \
-+nsresult nsXPTCStubBase::Sentinel##n() \
-+{ \
-+    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
-+    return NS_ERROR_NOT_IMPLEMENTED; \
-+}
-+
-+#include "xptcstubsdef.inc"
--- 
-1.6.2
-
diff --git a/pkgs/applications/networking/browsers/icecat-3/default.nix b/pkgs/applications/networking/browsers/icecat-3/default.nix
index 7e181669cd1c..ef2c69422b62 100644
--- a/pkgs/applications/networking/browsers/icecat-3/default.nix
+++ b/pkgs/applications/networking/browsers/icecat-3/default.nix
@@ -105,7 +105,7 @@ stdenv.mkDerivation {
     '';
 
     homepage = http://www.gnu.org/software/gnuzilla/;
-    licenses = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
+    license = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;
@@ -114,5 +114,6 @@ stdenv.mkDerivation {
   passthru = {
     inherit gtk version;
     isFirefox3Like = true;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/networking/browsers/kwebkitpart/default.nix b/pkgs/applications/networking/browsers/kwebkitpart/default.nix
index e9babf787bd1..5ced048fe649 100644
--- a/pkgs/applications/networking/browsers/kwebkitpart/default.nix
+++ b/pkgs/applications/networking/browsers/kwebkitpart/default.nix
@@ -1,12 +1,13 @@
 { stdenv, fetchgit, kdelibs }:
 
 stdenv.mkDerivation rec {
-  name = "kwebkitpart-1.3.2";
+  name = "kwebkitpart-${version}";
+  version = "1.3.3";
 
   src = fetchgit {
     url = git://anongit.kde.org/kwebkitpart;
-    rev = "292f32fda933b2ead5a61ff1ec457f839fad5c85";
-    sha256 = "1b2jar9b1yb3gy9fnq8dn2n4z8lffb6pfrj9jc4rjzv5b3rwh1ak";
+    rev = "refs/tags/v${version}";
+    sha256 = "0kszffgg3zpf319lmzlmdba5gq8kdr5xwb69xwy4s2abc9nvwvbi";
   };
 
   buildInputs = [ kdelibs ];
diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix
index 7efdf7ed015e..9b9d9ab6db17 100644
--- a/pkgs/applications/networking/browsers/links2/default.nix
+++ b/pkgs/applications/networking/browsers/links2/default.nix
@@ -8,12 +8,12 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "2.5";
+  version = "2.8";
   name = "links2-${version}";
 
   src = fetchurl {
     url = "${meta.homepage}/download/links-${version}.tar.bz2";
-    sha256 = "1wlmj8s6bxgznh0pnawihyvhffzryciz3lkagcxhf7fp64zz5izm";
+    sha256 = "15h07498z52jfdahzgvkphg1f7qvxnpbyfn2xmsls0d2dwwdll3r";
   };
 
   buildInputs =
diff --git a/pkgs/applications/networking/browsers/lynx/default.nix b/pkgs/applications/networking/browsers/lynx/default.nix
index 63760c94426d..74c9574c7d62 100644
--- a/pkgs/applications/networking/browsers/lynx/default.nix
+++ b/pkgs/applications/networking/browsers/lynx/default.nix
@@ -5,16 +5,16 @@
 assert sslSupport -> openssl != null;
 
 stdenv.mkDerivation {
-  name = "lynx-2.8.7";
+  name = "lynx-2.8.8";
   
   src = fetchurl {
-    url = http://lynx.isc.org/lynx2.8.7/lynx2.8.7.tar.bz2;
-    sha256 = "1baxwpdvak6nalr943g22z67r1d3fbibbkqvkvvar9xlvrs9gv20";
+    url = http://lynx.isc.org/lynx2.8.8/lynx2.8.8.tar.bz2;
+    sha256 = "1rxysl08acqll5b87368f04kckl8sggy1qhnq59gsxyny1ffg039";
   };
   
-  configureFlags = if sslSupport then "--with-ssl" else "";
+  configureFlags = if sslSupport then "--with-ssl=${openssl}" else "";
   
-  buildInputs = [ ncurses gzip ] ++ stdenv.lib.optional sslSupport openssl;
+  buildInputs = [ ncurses gzip ];
   nativeBuildInputs = [ ncurses ];
 
   crossAttrs = {
diff --git a/pkgs/applications/networking/browsers/midori/default.nix b/pkgs/applications/networking/browsers/midori/default.nix
index e39e377147a3..11a17709ade3 100644
--- a/pkgs/applications/networking/browsers/midori/default.nix
+++ b/pkgs/applications/networking/browsers/midori/default.nix
@@ -1,51 +1,42 @@
-args :  
-let 
-  lib = args.lib;
-  fetchurl = args.fetchurl;
-  doPatchShebangs = args.doPatchShebangs;
-  makeManyWrappers = args.makeManyWrappers;
+{ stdenv, fetchurl, cmake, pkgconfig, intltool, vala, makeWrapper
+, gtk3, webkitgtk, librsvg, libnotify
+, glib_networking, gsettings_desktop_schemas
+}:
 
-  version = "0.4"; 
-  release = "4";
-  buildInputs = with args; [
-    intltool python imagemagick gtk3 glib webkit libxml2 
-    gtksourceview pkgconfig which gettext makeWrapper 
-    file libidn sqlite docutils libnotify libsoup vala
-    kbproto xproto scrnsaverproto libXScrnSaver dbus_glib
-    glib_networking
-  ];
+let
+  version = "0.5.8";
 in
-rec {
+stdenv.mkDerivation rec {
+  name = "midori-${version}";
+
+  meta = {
+    description = "Lightweight WebKitGTK+ web browser";
+    homepage = "http://www.midori-browser.org";
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ raskin iyzsong ];
+  };
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/midori/${version}/midori-${version}.${release}.tar.bz2";
-    sha256 = "fadd43f76c1c9f6a16483e60a804e58fb6817c6a595b1acdd59bcbdd7b35bca2";
+    url = "${meta.homepage}/downloads/midori_${version}_all_.tar.bz2";
+    sha256 = "10ckm98rfqfbwr84b8mc1ssgj84wjgkr4dadvx2l7c64sigi66dg";
   };
 
-  inherit buildInputs;
-  configureFlags = ["--enable-gtk3"];
+  sourceRoot = ".";
 
-  /* doConfigure should be specified separately */
-  phaseNames = ["doUnpack" "setVars" "shebangsHere" "doConfigure" 
-    "doMakeInstall" "shebangsInstalled" "wrapWK"
-    ];
+  buildInputs = [
+    cmake pkgconfig intltool vala makeWrapper
+    webkitgtk librsvg libnotify
+  ];
 
-  setVars = args.fullDepEntry ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lnotify"
-  '' [];
-      
-  shebangsHere = (doPatchShebangs ".");
-  shebangsInstalled = (doPatchShebangs "$out/bin");
-  wrapWK = (makeManyWrappers "$out/bin/*" 
-  ''
-    --set WEBKIT_IGNORE_SSL_ERRORS 1 \
-    --prefix GIO_EXTRA_MODULES : "${args.glib_networking}/lib/gio/modules" 
-  '');
+  cmakeFlags = ''
+    -DHALF_BRO_INCOM_WEBKIT2=ON
+    -DUSE_ZEITGEIST=OFF
+  '';
 
-  name = "midori-${version}.${release}";
-  meta = {
-    description = "Light WebKit-based web browser with GTK GUI";
-    maintainers = [args.lib.maintainers.raskin];
-    platforms = with args.lib.platforms;
-      linux;
-  };
+  preFixup = ''
+    wrapProgram $out/bin/midori \
+      --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
 }
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 0363176257fd..d39dfe3582e9 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
@@ -35,6 +35,8 @@
 }:
 
 let
+  # -> http://get.adobe.com/flashplayer/
+  version = "11.2.202.394";
 
   src =
     if stdenv.system == "x86_64-linux" then
@@ -43,10 +45,9 @@ let
         # http://labs.adobe.com/technologies/flashplayer10/faq.html
         throw "no x86_64 debugging version available"
       else rec {
-        # -> http://labs.adobe.com/downloads/flashplayer10.html
-        version = "11.2.202.297";
+        inherit version;
         url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.x86_64.tar.gz";
-        sha256 = "0jfigq56p6zp61pmc4jl12p8gv2jhfmim18j1b30iikw3iv26lh8";
+        sha256 = "1w82kmda91xdsrqpkrbcbrzswnbfszy0x9hvf9wf2h14isimdknx";
       }
     else if stdenv.system == "i686-linux" then
       if debug then {
@@ -55,9 +56,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.297";
+        inherit version;
         url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.i386.tar.gz";
-        sha256 = "0mpj25b2ar7gccqmw5lffdzlr3yyfalphpgwnl18s05wy1fx484y";
+        sha256 = "0c8wp4qn6k224krihxb08g7727wlklk9bl4h7nqp3cpp85x9hg97";
       }
     else throw "Flash Player is not supported on this platform";
 
@@ -87,5 +88,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Adobe Flash Player browser plugin";
     homepage = http://www.adobe.com/products/flashplayer/;
+    maintainers = with stdenv.lib.maintainers; [ wizeman ];
+    license = stdenv.lib.licenses.unfree;
   };
 }
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix
index 7422654ec985..8cda5ad5762f 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, openssl, glib, libX11, gtk3, gettext, intltool }:
+{ stdenv, fetchurl, pkgconfig, openssl, glib, libX11, gtk2, gettext, intltool }:
 
 let version = "1.0.2"; in
 stdenv.mkDerivation rec {
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "d7cd9adf04fedf50b266a5c14ddb427cbb263d3bc160ee0ade03aca9d5356e5c";
   };
 
-  buildInputs = [ pkgconfig openssl libX11 gtk3 glib gettext intltool ];
+  buildInputs = [ pkgconfig openssl libX11 gtk2 glib gettext intltool ];
   patches = [
     ./translation-xgettext-to-intltool.patch
     ./plugin-linkfix.patch
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A browser plugin to manage Swedish BankID:s";
     homepage = http://fribid.se;
-    licenses = [ "GPLv2" "MPLv1" ];
+    license = [ "GPLv2" "MPLv1" ];
     maintainers = [ stdenv.lib.maintainers.edwtjo ];
     platforms = with stdenv.lib.platforms; linux;
   };
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 44f191e54f1d..05e3a8bf613a 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
@@ -10,12 +10,12 @@ stdenv.mkDerivation rec {
     sha256 = "913fd39e70c564cb210c2544a88869f9d1a448184421f000b14b2bc5ba718b49";
   };
 
-  buildInputs = [ pkgconfig glib dbus dbus_glib browser x11 GConf browser.xulrunner gmtk ];
+  buildInputs = [ pkgconfig glib dbus dbus_glib browser x11 GConf browser gmtk ];
 
   # !!! fix this
   preBuild =
     ''
-      export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${browser.xulrunner}/include/xulrunner-*) -I${browser.nspr}/include/nspr"
+      export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${browser}/include/xulrunner-*) -I${browser.nspr}/include/nspr"
       echo $NIX_CFLAGS_COMPILE
     '';
 
@@ -31,6 +31,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A browser plugin that uses GNOME MPlayer to play media in a browser";
     homepage = http://kdekorte.googlepages.com/gecko-mediaplayer;
+    broken = true;
   };
 }
 
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/gmtk/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/gmtk/default.nix
index 6ccab87ebe74..66309dc7f192 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/gmtk/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/gmtk/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, intltool, pkgconfig, gtk, GConf, alsaLib }:
 
 stdenv.mkDerivation rec {
-  name = "gmtk-1.0.5";
+  name = "gmtk-1.0.8";
 
   src = fetchurl {
     url = "http://gmtk.googlecode.com/files/${name}.tar.gz";
-    sha256 = "a07130d62719e8c1244f8405dd97445798df5204fc0f3f2f2b669b125114b468";
+    sha256 = "034b02nplb2bp01yn4p19345jh3yibhn4lcxznrzcsmsyj2vlzq0";
   };
 
   buildInputs = [ intltool pkgconfig gtk GConf alsaLib ];
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
index 4f7d3feb8ad6..afe0600d6f7e 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
@@ -45,20 +45,22 @@ in
 
 stdenv.mkDerivation rec {
   name = "google-talk-plugin-${version}";
-  # Use the following to determine the current upstream version:
-  # curl -s http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-amd64/Packages | sed -nr 's/^Version: *([^ ]+)-1$/\1/p'
-  version = "4.2.1.0";
+
+  # You can get the upstream version and SHA-1 hash from the following URLs:
+  # http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-amd64/Packages
+  # http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-i386/Packages
+  version = "5.1.5.0";
 
   src =
     if stdenv.system == "x86_64-linux" then
       fetchurl {
         url = "${baseURL}/google-talkplugin_${version}-1_amd64.deb";
-        sha256 = "1g7kpz2lzzz1gri5rd3isp7cfyls6gzwcw2kc8jgrgrixq9iixfd";
+        sha1 = "fc830f4c7f5816f4578ec73e6d4aef059ad4a0b1";
       }
     else if stdenv.system == "i686-linux" then
       fetchurl {
         url = "${baseURL}/google-talkplugin_${version}-1_i386.deb";
-        sha256 = "1z0zbblzlky9nyifxmnl49v4zafpqp3l08b9v1486sinm35rf58r";
+        sha1 = "9b7043c3585b3479ba11aabb7b8af755a61df963";
       }
     else throw "Google Talk does not support your platform.";
 
@@ -107,7 +109,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://www.google.com/chat/video/;
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/mplayerplug-in/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/mplayerplug-in/default.nix
index 6ee1735f76c7..5b6b2176d47e 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/mplayerplug-in/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/mplayerplug-in/default.nix
@@ -34,6 +34,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A browser plugin that uses mplayer to play digital media from websites";
     homepage = http://mplayerplug-in.sourceforge.net/;
-    licenses = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
+    license = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
   };
 }
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
index 7cb1abf31537..51511621dce6 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [which pkgconfig file glib gtk2 gtk3 curl];
 
+  preferLocalBuild = true;
+
   meta = {
     description = ''A wrapper to run browser plugins out-of-process'';
     homepage = "http://nspluginwrapper.org/";
diff --git a/pkgs/applications/networking/browsers/netsurf/default.nix b/pkgs/applications/networking/browsers/netsurf/default.nix
index cf01a3c6d5f5..07184bfd9f2c 100644
--- a/pkgs/applications/networking/browsers/netsurf/default.nix
+++ b/pkgs/applications/networking/browsers/netsurf/default.nix
@@ -42,7 +42,7 @@ rec {
     meta = { 
       description = "HTML5 compliant parsing library, written in C";
       homepage = http://www.netsurf-browser.org/projects/hubbub/;
-      license = "MIT";
+      license = stdenv.lib.licenses.mit;
       maintainers = [lib.maintainers.marcweber];
       platforms = lib.platforms.linux;
     };
@@ -63,7 +63,7 @@ rec {
     meta = { 
       description = "implementation of the W3C DOM, written in C";
       homepage = http://www.netsurf-browser.org/projects/hubbub/;
-      license = "MIT";
+      license = stdenv.lib.licenses.mit;
       maintainers = [lib.maintainers.marcweber];
       platforms = lib.platforms.linux;
     };
diff --git a/pkgs/applications/networking/browsers/netsurf/haru.nix b/pkgs/applications/networking/browsers/netsurf/haru.nix
index 883cf94b06fe..47f0c2f64552 100644
--- a/pkgs/applications/networking/browsers/netsurf/haru.nix
+++ b/pkgs/applications/networking/browsers/netsurf/haru.nix
@@ -21,5 +21,6 @@ stdenv.mkDerivation {
     license = "ZLIB/LIBPNG"; # see README.
     maintainers = [args.lib.maintainers.marcweber];
     platforms = args.lib.platforms.linux;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/networking/browsers/netsurf/libCSS.nix b/pkgs/applications/networking/browsers/netsurf/libCSS.nix
index 7ad39ee4ec9c..ede053aeca3f 100644
--- a/pkgs/applications/networking/browsers/netsurf/libCSS.nix
+++ b/pkgs/applications/networking/browsers/netsurf/libCSS.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   meta = { 
     description = "libCSS is a CSS parser and selection engine, written in C"; # used by netsurf
     homepage = http://www.netsurf-browser.org/projects/libcss/;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = [args.lib.maintainers.marcweber];
     platforms = args.lib.platforms.linux;
   };
diff --git a/pkgs/applications/networking/browsers/netsurf/libParserUtils.nix b/pkgs/applications/networking/browsers/netsurf/libParserUtils.nix
index 8ee8518c531c..32bede76e432 100644
--- a/pkgs/applications/networking/browsers/netsurf/libParserUtils.nix
+++ b/pkgs/applications/networking/browsers/netsurf/libParserUtils.nix
@@ -13,8 +13,9 @@ stdenv.mkDerivation {
   meta = { 
     description = "LibParserUtils is a library for building efficient parsers, written in C";
     homepage = http://www.netsurf-browser.org/projects/libparserutils/;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = [args.lib.maintainers.marcweber];
     platforms = args.lib.platforms.linux;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/networking/browsers/netsurf/libnsbmp.nix b/pkgs/applications/networking/browsers/netsurf/libnsbmp.nix
index 462d532cb9c4..d370002543ce 100644
--- a/pkgs/applications/networking/browsers/netsurf/libnsbmp.nix
+++ b/pkgs/applications/networking/browsers/netsurf/libnsbmp.nix
@@ -13,8 +13,9 @@ stdenv.mkDerivation {
   meta = { 
     description = "Libnsbmp is a decoding library for BMP and ICO image file formats"; # used by netsurf
     homepage = http://www.netsurf-browser.org/projects/libnsbmp/;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = [args.lib.maintainers.marcweber];
     platforms = args.lib.platforms.linux;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/networking/browsers/netsurf/libnsgif.nix b/pkgs/applications/networking/browsers/netsurf/libnsgif.nix
index 63ae2ef86d43..a4502d2354de 100644
--- a/pkgs/applications/networking/browsers/netsurf/libnsgif.nix
+++ b/pkgs/applications/networking/browsers/netsurf/libnsgif.nix
@@ -13,8 +13,9 @@ stdenv.mkDerivation {
   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";
+    license = stdenv.lib.licenses.mit;
     maintainers = [args.lib.maintainers.marcweber];
     platforms = args.lib.platforms.linux;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/networking/browsers/netsurf/libsvgtiny.nix b/pkgs/applications/networking/browsers/netsurf/libsvgtiny.nix
index a90e6fa193cd..300e9965092d 100644
--- a/pkgs/applications/networking/browsers/netsurf/libsvgtiny.nix
+++ b/pkgs/applications/networking/browsers/netsurf/libsvgtiny.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   meta = { 
     description = "implementation of SVG Tiny, written in C";
     homepage = http://www.netsurf-browser.org/projects/libsvgtiny/;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = [args.lib.maintainers.marcweber];
     platforms = args.lib.platforms.linux;
   };
diff --git a/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix b/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix
index c4e4a60fbd68..8d19d1c1ef24 100644
--- a/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix
+++ b/pkgs/applications/networking/browsers/netsurf/libwapcaplet.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   meta = { 
     description = "LibWapcaplet is a string internment library, written in C";
     homepage = http://www.netsurf-browser.org/projects/libwapcaplet/;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = [args.lib.maintainers.marcweber];
     platforms = args.lib.platforms.linux;
   };
diff --git a/pkgs/applications/networking/browsers/rekonq/default.nix b/pkgs/applications/networking/browsers/rekonq/default.nix
index c8542ad7a527..3deabd42e013 100644
--- a/pkgs/applications/networking/browsers/rekonq/default.nix
+++ b/pkgs/applications/networking/browsers/rekonq/default.nix
@@ -3,11 +3,11 @@
 assert builtins.compareVersions "4.8.3" kde4.release != 1; # https://bugs.kde.org/show_bug.cgi?id=306077
 
 stdenv.mkDerivation rec {
-  name = "rekonq-1.70"; # >=1.80 need kde >=4.9.0
+  name = "rekonq-1.80"; # >=1.80 need kde >=4.9.0
 
   src = fetchurl {
     url = "mirror://sourceforge/rekonq/${name}.tar.bz2";
-    sha256 = "05zqm329vajsn32l5b5nlbw92gl3irdcx8kifr4y921i9bkzigad";
+    sha256 = "1lzmg8psy1j1v8vrmsyw609jv9scgnigdivx97fb4spb7x6sxn4g";
   };
 
   buildInputs = [ kde4.kdelibs qca2 qoauth ];
diff --git a/pkgs/applications/networking/browsers/uzbl/default.nix b/pkgs/applications/networking/browsers/uzbl/default.nix
index 4c6458d909fd..318b95763920 100644
--- a/pkgs/applications/networking/browsers/uzbl/default.nix
+++ b/pkgs/applications/networking/browsers/uzbl/default.nix
@@ -1,45 +1,39 @@
-a :  
-let 
-  fetchgit = a.fetchgit;
+{ stdenv, fetchurl, pkgconfig, python, makeWrapper, pygtk
+, webkit, glib_networking, gsettings_desktop_schemas
+}:
 
-  buildInputs = with a; [
-    libsoup pkgconfig webkit gtk makeWrapper
-    kbproto glib pango cairo gdk_pixbuf atk
-    python3
-  ];
-in
-rec {
-  src = fetchgit {
-    url = "https://github.com/Dieterbe/uzbl.git";
-    rev = "refs/tags/2012.05.14";
-    sha256 = "1crvikb0qqsx5qb003i4w7ywh72psl37gjslrj5hx2fd2f215l0l";
-  };
+stdenv.mkDerivation rec {
+  name = "uzbl-20120514";
 
-  name = "uzbl-git";
+  meta = with stdenv.lib; {
+    description = "Tiny externally controllable webkit browser";
+    homepage    = "http://uzbl.org/";
+    license     = licenses.gpl3;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ raskin ];
+  };
 
-  inherit buildInputs;
-  configureFlags = [];
+  src = fetchurl {
+    name = "${name}.tar.gz";
+    url = "https://github.com/uzbl/uzbl/archive/2012.05.14.tar.gz";
+    sha256 = "1flpf0rg0c3n9bjifr37zxljn9yxslg8vkll7ghkm341x76cbkwn";
+  };
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["addInputs" "setVars" "doMakeInstall" "doWrap"];
+  preConfigure = ''
+    makeFlags="$makeFlags PREFIX=$out"
+    makeFlags="$makeFlags PYINSTALL_EXTRA=--prefix=$out"
+  '';
 
-  setVars = a.noDepEntry (''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -L${a.libX11}/lib -lX11"
-  '');
+  preFixup = ''
+    for f in $out/bin/*; do
+      wrapProgram $f \
+        --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+        --prefix PYTHONPATH : "$PYTHONPATH" \
+        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
+    done
+  '';
 
-  doWrap = a.makeManyWrappers "$out/bin/uzbl-core" 
-    ''
-      --prefix GST_PLUGIN_PATH : ${a.webkit.gstreamer}/lib/gstreamer-* \
-      --prefix GST_PLUGIN_PATH : ${a.webkit.gst_plugins_base}/lib/gstreamer-* \
-      --prefix GST_PLUGIN_PATH : ${a.webkit.gst_plugins_good}/lib/gstreamer-* \
-      --prefix GST_PLUGIN_PATH : ${a.webkit.gst_ffmpeg}/lib/gstreamer-* \
-      --prefix GIO_EXTRA_MODULES : ${a.glib_networking}/lib/gio/modules
-    '';
+  nativeBuildInputs = [ pkgconfig python makeWrapper ];
 
-  installFlags = "PREFIX=$out PYINSTALL_EXTRA=\"--prefix=$out\"";
-      
-  meta = {
-    description = "Tiny externally controllable webkit browser";
-    maintainers = [a.lib.maintainers.raskin];
-  };
+  buildInputs = [ gsettings_desktop_schemas webkit pygtk ];
 }
diff --git a/pkgs/applications/networking/browsers/vimb/default.nix b/pkgs/applications/networking/browsers/vimb/default.nix
new file mode 100644
index 000000000000..7c5b983f1b49
--- /dev/null
+++ b/pkgs/applications/networking/browsers/vimb/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, pkgconfig, libsoup, webkit, gtk, glib_networking
+, gsettings_desktop_schemas, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  name = "vimb-${version}";
+  version = "2.6";
+
+  src = fetchurl {
+    url = "https://github.com/fanglingsu/vimb/archive/${version}.tar.gz";
+    sha256 = "1g6zm5fk3k52jk3vbbzj7rm0kanykd4zgxrqhlvj3qzj2nsn4a21";
+  };
+
+  # Nixos default ca bundle
+  patchPhase = ''
+    sed -i s,/etc/ssl/certs/ca-certificates.crt,/etc/ssl/certs/ca-bundle.crt, src/setting.c
+  '';
+
+  buildInputs = [ makeWrapper gtk libsoup pkgconfig webkit gsettings_desktop_schemas ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  preFixup = ''
+    wrapProgram "$out/bin/vimb" \
+      --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = {
+    description = "A Vim-like browser";
+    longDescription = ''
+      A fast and lightweight vim like web browser based on the webkit web
+      browser engine and the GTK toolkit. Vimb is modal like the great vim
+      editor and also easily configurable during runtime. Vimb is mostly
+      keyboard driven and does not detract you from your daily work.
+    '';
+    homepage = "http://fanglingsu.github.io/vimb/";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.rickynils ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/vimprobable2/default.nix b/pkgs/applications/networking/browsers/vimprobable2/default.nix
index ee8e4b8434a4..8e1e00795d24 100644
--- a/pkgs/applications/networking/browsers/vimprobable2/default.nix
+++ b/pkgs/applications/networking/browsers/vimprobable2/default.nix
@@ -2,25 +2,28 @@
   pkgconfig, webkit, gsettings_desktop_schemas }:
 
 stdenv.mkDerivation rec {
-  version = "1.2.1";
+  version = "1.4.2";
   name = "vimprobable2-${version}";
   src = fetchurl {
     url = "mirror://sourceforge/vimprobable/vimprobable2_${version}.tar.bz2";
-    sha256 = "19zx1k3s2gnhzzd2wpyqsk151w9p52ifl64xaz9a6qkgvrxlli8p";
+    sha256 = "13jdximksh9r3cgd2f8vms0pbsn3x0gxvyqdqiw16xp5fmdx5kzr";
   };
 
   # Nixos default ca bundle
   patchPhase = ''
-    sed -i s,/etc/ssl/certs/ca-certificates.crt,/etc/ca-bundle.crt, config.h
+    sed -i s,/etc/ssl/certs/ca-certificates.crt,/etc/ssl/certs/ca-bundle.crt, config.h
   '';
 
-  buildInputs = [ makeWrapper gtk libsoup libX11 perl pkgconfig webkit ];
+  buildInputs = [ makeWrapper gtk libsoup libX11 perl pkgconfig webkit gsettings_desktop_schemas ];
 
   installPhase = ''
     make PREFIX=/ DESTDIR=$out install
+  '';
+
+  preFixup = ''
     wrapProgram "$out/bin/vimprobable2" \
       --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
-      --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share"
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
   '';
 
   meta = {
diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix
index 5953111fad59..5f046f7b7328 100644
--- a/pkgs/applications/networking/browsers/w3m/default.nix
+++ b/pkgs/applications/networking/browsers/w3m/default.nix
@@ -39,8 +39,9 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = false;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://w3m.sourceforge.net/;
     description = "A text-mode web browser";
+    maintainers = maintainers.mornfall;
   };
 }
diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix
index ef2f16e31936..f6e86c6289cf 100644
--- a/pkgs/applications/networking/cluster/hadoop/default.nix
+++ b/pkgs/applications/networking/cluster/hadoop/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
 
-  name = "hadoop-2.0.2-alpha";
+  name = "hadoop-2.2.0";
 
   src = fetchurl {
     url = "mirror://apache/hadoop/common/${name}/${name}.tar.gz";
-    sha256 = "1r7ailmqhny3pl5nb8bcblnhckszy6hb9n58kwa3s4b8qfk87gkb";
+    sha256 = "0r0kx8arsrvmcfy0693hpv4cz3i0razvk1xa3yhlf3ybb80a8106";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/networking/cluster/mesos/darwin.patch b/pkgs/applications/networking/cluster/mesos/darwin.patch
new file mode 100644
index 000000000000..118129f17232
--- /dev/null
+++ b/pkgs/applications/networking/cluster/mesos/darwin.patch
@@ -0,0 +1,80 @@
+diff --git a/configure.ac b/configure.ac
+index 1ebd196..a49d7d4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -463,11 +463,6 @@ __EOF__
+   fi
+ 
+   # Determine linker flags for Java if not set.
+-  if test "$OS_NAME" = "darwin"; then
+-    dir="$JAVA_HOME/jre/lib/server"
+-    JAVA_TEST_LDFLAGS="-framework JavaVM"
+-    JAVA_JVM_LIBRARY=$dir/libjvm.dylib
+-  elif test "$OS_NAME" = "linux"; then
+     for arch in amd64 i386; do
+       dir="$JAVA_HOME/jre/lib/$arch/server"
+       if test -e "$dir"; then
+@@ -477,7 +472,6 @@ __EOF__
+ 	break;
+       fi
+     done
+-  fi
+ 
+   if test -z "$JAVA_TEST_LDFLAGS"; then
+     AC_MSG_ERROR([failed to determine linker flags for using Java \
+@@ -488,26 +482,6 @@ __EOF__
+   # flags as necessary (provided JAVA_CPPFLAGS was not set).
+   AC_MSG_CHECKING([whether or not we can build with JNI])
+   if test -z "$JAVA_CPPFLAGS"; then
+-    if test "$OS_NAME" = "darwin"; then
+-      while true; do # Loop until sucessful (via break) or exhausted options.
+-        m4_foreach([java_cppflags],
+-                   [["-I$JAVA_HOME/include -I$JAVA_HOME/include/$OS_NAME"],
+-                    ["-I/System/Library/Frameworks/JavaVM.framework/Headers"]],
+-                   [JAVA_CPPFLAGS=java_cppflags
+-                    TRY_LINK_JNI([break])])
+-        # Exhausted options.
+-        AC_MSG_ERROR([failed to build with JNI
+-  -------------------------------------------------------------------
+-  It appears we were unable to compile against the JNI. This is most
+-  likely due to one of the following issues:
+-    1. You do not have a JDK installed on your system.
+-    2. All JDKs installed on your system have deprecated JNI headers.
+-  It is advised to install OpenJDK on your system, as the JDK that
+-  ships with OS X has deprecated JNI headers.
+-  -------------------------------------------------------------------
+-        ])
+-      done
+-    else
+       while true; do # Loop until sucessful (via break) or exhausted options.
+         m4_foreach([java_cppflags],
+                    [["-I$JAVA_HOME/include -I$JAVA_HOME/include/$OS_NAME"]],
+@@ -516,7 +490,6 @@ __EOF__
+         # Exhausted options.
+         AC_MSG_ERROR([failed to build with JNI])
+       done
+-    fi
+   else
+     TRY_LINK_JNI([], [AC_MSG_ERROR([failed to build with JNI])])
+   fi
+@@ -760,20 +733,6 @@ libcurl is required for mesos to build.
+ if test "x$with_cxx11" = "xyes"; then
+   AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
+ 
+-  case "$host_os" in
+-  darwin* )
+-    # If we're using clang, we need to pass -stdlib=libc++ too.
+-    if test "x$CLANG" = "xyes"; then
+-      CXXFLAGS="$CXXFLAGS -stdlib=libc++"
+-    fi
+-
+-    # GTEST on OSX needs its own tr1 tuple.
+-    # TODO(dhamon): Update to gmock 1.7 and pass GTEST_LANG_CXX11 when in
+-    # c++11 mode.
+-    CXXFLAGS="$CXXFLAGS -DGTEST_USE_OWN_TR1_TUPLE=1"
+-    ;;
+-  esac
+-
+   # Also pass the flags to 3rdparty libraries.
+   CONFIGURE_ARGS="$CONFIGURE_ARGS CXXFLAGS='$CXXFLAGS'"
+ fi
diff --git a/pkgs/applications/networking/cluster/mesos/default.nix b/pkgs/applications/networking/cluster/mesos/default.nix
new file mode 100644
index 000000000000..4329308ba04d
--- /dev/null
+++ b/pkgs/applications/networking/cluster/mesos/default.nix
@@ -0,0 +1,107 @@
+{ stdenv, lib, makeWrapper, fetchurl, fetchzip, curl, sasl, openssh, autoconf
+, automake, libtool, unzip, gnutar, jdk, maven, python, wrapPython
+, setuptools, distutils-cfg, boto, pythonProtobuf
+}:
+
+let version = "0.19.1";
+in stdenv.mkDerivation {
+  dontDisableStatic = true;
+
+  name = "mesos-${version}";
+
+  src = fetchurl {
+    url = "http://www.apache.org/dist/mesos/${version}/mesos-${version}.tar.gz";
+    sha256 = "12li5xqfcw3124qg3h2cji3yhrc7gbx91lj45zfliicwgjkbmyf1";
+  };
+
+  patches = [ ./darwin.patch ];
+
+  buildInputs = [
+    makeWrapper autoconf automake libtool curl sasl jdk maven
+    python wrapPython boto distutils-cfg
+  ];
+
+  propagatedBuildInputs = [
+    pythonProtobuf
+  ];
+
+  mavenRepo = import ./mesos-deps.nix { inherit stdenv curl; };
+
+  preConfigure = ''
+    export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/.m2"
+    ln -s $mavenRepo .m2
+
+    substituteInPlace src/launcher/fetcher.cpp \
+      --replace '"tar' '"${gnutar}/bin/tar'    \
+      --replace '"unzip' '"${unzip}/bin/unzip'
+
+    substituteInPlace src/cli/mesos-scp        \
+      --replace "'scp " "'${openssh}/bin/scp "
+  '';
+
+  configureFlags = [
+    "--sbindir=\${out}/bin"
+    "--with-python-headers=${python}/include"
+    "--with-webui"
+    "--with-java-home=${jdk}"
+    "--with-java-headers=${jdk}/include"
+    "--with-included-zookeeper"
+  ];
+
+  postInstall = ''
+    rm -rf $out/var
+    rm $out/bin/*.sh
+
+    ensureDir $out/share/java
+    cp src/java/target/mesos-*.jar $out/share/java
+
+    shopt -s extglob
+    MESOS_NATIVE_JAVA_LIBRARY=$(echo $out/lib/libmesos.*(so|dylib))
+    shopt -u extglob
+
+    ensureDir $out/nix-support
+    touch $out/nix-support/setup-hook
+    echo "export MESOS_NATIVE_JAVA_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
+    echo "export MESOS_NATIVE_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
+
+    # Inspired by: pkgs/development/python-modules/generic/default.nix
+    ensureDir "$out/lib/${python.libPrefix}"/site-packages
+    export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
+    ${python}/bin/${python.executable} src/python/setup.py install \
+      --install-lib=$out/lib/${python.libPrefix}/site-packages \
+      --old-and-unmanageable \
+      --prefix="$out"
+    rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
+  '';
+
+  postFixup = ''
+    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-native-build-inputs; do
+      if test -e $out/nix-support/$inputsfile; then
+        createBuildInputsPth $inputsfile "$(cat $out/nix-support/$inputsfile)"
+      fi
+    done
+
+    # wrap the python programs
+    declare -A pythonPathsSeen=()
+    program_PYTHONPATH="$out/libexec/mesos/python"
+    program_PATH=""
+    _addToPythonPath "$out"
+    for prog in mesos-cat mesos-ps mesos-scp mesos-tail; do
+      wrapProgram "$out/bin/$prog" \
+        --prefix PYTHONPATH ":" $program_PYTHONPATH
+      true
+    done
+  '';
+
+  meta = with lib; {
+    homepage    = "http://mesos.apache.org";
+    license     = licenses.asl20;
+    description = "A cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks";
+    maintainers = with maintainers; [ cstrahan ];
+    platforms   = with platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/cluster/mesos/fetch-mesos-deps.sh b/pkgs/applications/networking/cluster/mesos/fetch-mesos-deps.sh
new file mode 100644
index 000000000000..c58c9f2e3d6d
--- /dev/null
+++ b/pkgs/applications/networking/cluster/mesos/fetch-mesos-deps.sh
@@ -0,0 +1,1242 @@
+source $stdenv/setup
+header "fetching Apache Mesos maven repo"
+
+function fetchArtifact {
+  repoPath="$1"
+  url="http://repo.maven.apache.org/maven2/$repoPath"
+  mkdir -p $(dirname $out/$repoPath)
+  curl --fail --location --insecure --retry 3 --max-redirs 20 "$url" --output "$out/$repoPath"
+}
+
+fetchArtifact antlr/antlr/2.7.2/antlr-2.7.2.jar
+fetchArtifact antlr/antlr/2.7.2/antlr-2.7.2.jar.sha1
+fetchArtifact antlr/antlr/2.7.2/antlr-2.7.2.pom
+fetchArtifact antlr/antlr/2.7.2/antlr-2.7.2.pom.sha1
+fetchArtifact asm/asm/3.2/asm-3.2.pom
+fetchArtifact asm/asm/3.2/asm-3.2.pom.sha1
+fetchArtifact asm/asm/3.3.1/asm-3.3.1.jar
+fetchArtifact asm/asm/3.3.1/asm-3.3.1.jar.sha1
+fetchArtifact asm/asm/3.3.1/asm-3.3.1.pom
+fetchArtifact asm/asm/3.3.1/asm-3.3.1.pom.sha1
+fetchArtifact asm/asm-analysis/3.2/asm-analysis-3.2.jar
+fetchArtifact asm/asm-analysis/3.2/asm-analysis-3.2.jar.sha1
+fetchArtifact asm/asm-analysis/3.2/asm-analysis-3.2.pom
+fetchArtifact asm/asm-analysis/3.2/asm-analysis-3.2.pom.sha1
+fetchArtifact asm/asm-commons/3.2/asm-commons-3.2.pom
+fetchArtifact asm/asm-commons/3.2/asm-commons-3.2.pom.sha1
+fetchArtifact asm/asm-commons/3.3.1/asm-commons-3.3.1.jar
+fetchArtifact asm/asm-commons/3.3.1/asm-commons-3.3.1.jar.sha1
+fetchArtifact asm/asm-commons/3.3.1/asm-commons-3.3.1.pom
+fetchArtifact asm/asm-commons/3.3.1/asm-commons-3.3.1.pom.sha1
+fetchArtifact asm/asm-parent/3.2/asm-parent-3.2.pom
+fetchArtifact asm/asm-parent/3.2/asm-parent-3.2.pom.sha1
+fetchArtifact asm/asm-parent/3.3.1/asm-parent-3.3.1.pom
+fetchArtifact asm/asm-parent/3.3.1/asm-parent-3.3.1.pom.sha1
+fetchArtifact asm/asm-tree/3.2/asm-tree-3.2.pom
+fetchArtifact asm/asm-tree/3.2/asm-tree-3.2.pom.sha1
+fetchArtifact asm/asm-tree/3.3.1/asm-tree-3.3.1.jar
+fetchArtifact asm/asm-tree/3.3.1/asm-tree-3.3.1.jar.sha1
+fetchArtifact asm/asm-tree/3.3.1/asm-tree-3.3.1.pom
+fetchArtifact asm/asm-tree/3.3.1/asm-tree-3.3.1.pom.sha1
+fetchArtifact asm/asm-util/3.2/asm-util-3.2.jar
+fetchArtifact asm/asm-util/3.2/asm-util-3.2.jar.sha1
+fetchArtifact asm/asm-util/3.2/asm-util-3.2.pom
+fetchArtifact asm/asm-util/3.2/asm-util-3.2.pom.sha1
+fetchArtifact avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.pom
+fetchArtifact avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.pom.sha1
+fetchArtifact backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
+fetchArtifact backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar.sha1
+fetchArtifact backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.pom
+fetchArtifact backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.pom.sha1
+fetchArtifact classworlds/classworlds/1.1/classworlds-1.1.pom
+fetchArtifact classworlds/classworlds/1.1/classworlds-1.1.pom.sha1
+fetchArtifact classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.pom
+fetchArtifact classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.pom.sha1
+fetchArtifact com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
+fetchArtifact com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar.sha1
+fetchArtifact com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom
+fetchArtifact com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom.sha1
+fetchArtifact com/google/collections/google-collections/1.0/google-collections-1.0.pom
+fetchArtifact com/google/collections/google-collections/1.0/google-collections-1.0.pom.sha1
+fetchArtifact com/google/google/1/google-1.pom
+fetchArtifact com/google/google/1/google-1.pom.sha1
+fetchArtifact com/google/guava/guava/11.0.2/guava-11.0.2.jar
+fetchArtifact com/google/guava/guava/11.0.2/guava-11.0.2.jar.sha1
+fetchArtifact com/google/guava/guava/11.0.2/guava-11.0.2.pom
+fetchArtifact com/google/guava/guava/11.0.2/guava-11.0.2.pom.sha1
+fetchArtifact com/google/guava/guava-parent/11.0.2/guava-parent-11.0.2.pom
+fetchArtifact com/google/guava/guava-parent/11.0.2/guava-parent-11.0.2.pom.sha1
+fetchArtifact com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar
+fetchArtifact com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar.sha1
+fetchArtifact com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.pom
+fetchArtifact com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.pom.sha1
+fetchArtifact com/jcraft/jsch/0.1.44-1/jsch-0.1.44-1.jar
+fetchArtifact com/jcraft/jsch/0.1.44-1/jsch-0.1.44-1.jar.sha1
+fetchArtifact com/jcraft/jsch/0.1.44-1/jsch-0.1.44-1.pom
+fetchArtifact com/jcraft/jsch/0.1.44-1/jsch-0.1.44-1.pom.sha1
+fetchArtifact com/thoughtworks/qdox/qdox/1.12/qdox-1.12.jar
+fetchArtifact com/thoughtworks/qdox/qdox/1.12/qdox-1.12.jar.sha1
+fetchArtifact com/thoughtworks/qdox/qdox/1.12/qdox-1.12.pom
+fetchArtifact com/thoughtworks/qdox/qdox/1.12/qdox-1.12.pom.sha1
+fetchArtifact commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.pom
+fetchArtifact commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.pom.sha1
+fetchArtifact commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
+fetchArtifact commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar.sha1
+fetchArtifact commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.pom
+fetchArtifact commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.pom.sha1
+fetchArtifact commons-chain/commons-chain/1.1/commons-chain-1.1.jar
+fetchArtifact commons-chain/commons-chain/1.1/commons-chain-1.1.jar.sha1
+fetchArtifact commons-chain/commons-chain/1.1/commons-chain-1.1.pom
+fetchArtifact commons-chain/commons-chain/1.1/commons-chain-1.1.pom.sha1
+fetchArtifact commons-cli/commons-cli/1.0/commons-cli-1.0.jar
+fetchArtifact commons-cli/commons-cli/1.0/commons-cli-1.0.jar.sha1
+fetchArtifact commons-cli/commons-cli/1.0/commons-cli-1.0.pom
+fetchArtifact commons-cli/commons-cli/1.0/commons-cli-1.0.pom.sha1
+fetchArtifact commons-codec/commons-codec/1.2/commons-codec-1.2.jar
+fetchArtifact commons-codec/commons-codec/1.2/commons-codec-1.2.jar.sha1
+fetchArtifact commons-codec/commons-codec/1.2/commons-codec-1.2.pom
+fetchArtifact commons-codec/commons-codec/1.2/commons-codec-1.2.pom.sha1
+fetchArtifact commons-codec/commons-codec/1.3/commons-codec-1.3.jar
+fetchArtifact commons-codec/commons-codec/1.3/commons-codec-1.3.jar.sha1
+fetchArtifact commons-codec/commons-codec/1.3/commons-codec-1.3.pom
+fetchArtifact commons-codec/commons-codec/1.3/commons-codec-1.3.pom.sha1
+fetchArtifact commons-collections/commons-collections/2.0/commons-collections-2.0.pom
+fetchArtifact commons-collections/commons-collections/2.0/commons-collections-2.0.pom.sha1
+fetchArtifact commons-collections/commons-collections/2.1/commons-collections-2.1.pom
+fetchArtifact commons-collections/commons-collections/2.1/commons-collections-2.1.pom.sha1
+fetchArtifact commons-collections/commons-collections/3.1/commons-collections-3.1.jar
+fetchArtifact commons-collections/commons-collections/3.1/commons-collections-3.1.jar.sha1
+fetchArtifact commons-collections/commons-collections/3.1/commons-collections-3.1.pom
+fetchArtifact commons-collections/commons-collections/3.1/commons-collections-3.1.pom.sha1
+fetchArtifact commons-collections/commons-collections/3.2/commons-collections-3.2.jar
+fetchArtifact commons-collections/commons-collections/3.2/commons-collections-3.2.jar.sha1
+fetchArtifact commons-collections/commons-collections/3.2/commons-collections-3.2.pom
+fetchArtifact commons-collections/commons-collections/3.2/commons-collections-3.2.pom.sha1
+fetchArtifact commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
+fetchArtifact commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar.sha1
+fetchArtifact commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.pom
+fetchArtifact commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.pom.sha1
+fetchArtifact commons-digester/commons-digester/1.6/commons-digester-1.6.jar
+fetchArtifact commons-digester/commons-digester/1.6/commons-digester-1.6.jar.sha1
+fetchArtifact commons-digester/commons-digester/1.6/commons-digester-1.6.pom
+fetchArtifact commons-digester/commons-digester/1.6/commons-digester-1.6.pom.sha1
+fetchArtifact commons-digester/commons-digester/1.8/commons-digester-1.8.jar
+fetchArtifact commons-digester/commons-digester/1.8/commons-digester-1.8.jar.sha1
+fetchArtifact commons-digester/commons-digester/1.8/commons-digester-1.8.pom
+fetchArtifact commons-digester/commons-digester/1.8/commons-digester-1.8.pom.sha1
+fetchArtifact commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
+fetchArtifact commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar.sha1
+fetchArtifact commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.pom
+fetchArtifact commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.pom.sha1
+fetchArtifact commons-io/commons-io/1.3.2/commons-io-1.3.2.jar
+fetchArtifact commons-io/commons-io/1.3.2/commons-io-1.3.2.jar.sha1
+fetchArtifact commons-io/commons-io/1.3.2/commons-io-1.3.2.pom
+fetchArtifact commons-io/commons-io/1.3.2/commons-io-1.3.2.pom.sha1
+fetchArtifact commons-io/commons-io/1.4/commons-io-1.4.jar
+fetchArtifact commons-io/commons-io/1.4/commons-io-1.4.jar.sha1
+fetchArtifact commons-io/commons-io/1.4/commons-io-1.4.pom
+fetchArtifact commons-io/commons-io/1.4/commons-io-1.4.pom.sha1
+fetchArtifact commons-lang/commons-lang/2.1/commons-lang-2.1.jar
+fetchArtifact commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1
+fetchArtifact commons-lang/commons-lang/2.1/commons-lang-2.1.pom
+fetchArtifact commons-lang/commons-lang/2.1/commons-lang-2.1.pom.sha1
+fetchArtifact commons-lang/commons-lang/2.4/commons-lang-2.4.jar
+fetchArtifact commons-lang/commons-lang/2.4/commons-lang-2.4.jar.sha1
+fetchArtifact commons-lang/commons-lang/2.4/commons-lang-2.4.pom
+fetchArtifact commons-lang/commons-lang/2.4/commons-lang-2.4.pom.sha1
+fetchArtifact commons-lang/commons-lang/2.5/commons-lang-2.5.jar
+fetchArtifact commons-lang/commons-lang/2.5/commons-lang-2.5.jar.sha1
+fetchArtifact commons-lang/commons-lang/2.5/commons-lang-2.5.pom
+fetchArtifact commons-lang/commons-lang/2.5/commons-lang-2.5.pom.sha1
+fetchArtifact commons-lang/commons-lang/2.6/commons-lang-2.6.jar
+fetchArtifact commons-lang/commons-lang/2.6/commons-lang-2.6.jar.sha1
+fetchArtifact commons-lang/commons-lang/2.6/commons-lang-2.6.pom
+fetchArtifact commons-lang/commons-lang/2.6/commons-lang-2.6.pom.sha1
+fetchArtifact commons-logging/commons-logging/1.0/commons-logging-1.0.pom
+fetchArtifact commons-logging/commons-logging/1.0/commons-logging-1.0.pom.sha1
+fetchArtifact commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom
+fetchArtifact commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.pom.sha1
+fetchArtifact commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
+fetchArtifact commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar.sha1
+fetchArtifact commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom
+fetchArtifact commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.pom.sha1
+fetchArtifact commons-logging/commons-logging/1.1/commons-logging-1.1.pom
+fetchArtifact commons-logging/commons-logging/1.1/commons-logging-1.1.pom.sha1
+fetchArtifact commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
+fetchArtifact commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar.sha1
+fetchArtifact commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
+fetchArtifact commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom.sha1
+fetchArtifact commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.pom
+fetchArtifact commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.pom.sha1
+fetchArtifact commons-validator/commons-validator/1.2.0/commons-validator-1.2.0.jar
+fetchArtifact commons-validator/commons-validator/1.2.0/commons-validator-1.2.0.jar.sha1
+fetchArtifact commons-validator/commons-validator/1.2.0/commons-validator-1.2.0.pom
+fetchArtifact commons-validator/commons-validator/1.2.0/commons-validator-1.2.0.pom.sha1
+fetchArtifact commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar
+fetchArtifact commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar.sha1
+fetchArtifact commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.pom
+fetchArtifact commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.pom.sha1
+fetchArtifact dom4j/dom4j/1.1/dom4j-1.1.jar
+fetchArtifact dom4j/dom4j/1.1/dom4j-1.1.jar.sha1
+fetchArtifact dom4j/dom4j/1.1/dom4j-1.1.pom
+fetchArtifact dom4j/dom4j/1.1/dom4j-1.1.pom.sha1
+fetchArtifact doxia/doxia-sink-api/1.0-alpha-4/doxia-sink-api-1.0-alpha-4.pom
+fetchArtifact doxia/doxia-sink-api/1.0-alpha-4/doxia-sink-api-1.0-alpha-4.pom.sha1
+fetchArtifact javax/servlet/servlet-api/2.3/servlet-api-2.3.pom
+fetchArtifact javax/servlet/servlet-api/2.3/servlet-api-2.3.pom.sha1
+fetchArtifact javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
+fetchArtifact javax/servlet/servlet-api/2.5/servlet-api-2.5.jar.sha1
+fetchArtifact javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
+fetchArtifact javax/servlet/servlet-api/2.5/servlet-api-2.5.pom.sha1
+fetchArtifact junit/junit/3.8.1/junit-3.8.1.jar
+fetchArtifact junit/junit/3.8.1/junit-3.8.1.jar.sha1
+fetchArtifact junit/junit/3.8.1/junit-3.8.1.pom
+fetchArtifact junit/junit/3.8.1/junit-3.8.1.pom.sha1
+fetchArtifact junit/junit/3.8.2/junit-3.8.2.pom
+fetchArtifact junit/junit/3.8.2/junit-3.8.2.pom.sha1
+fetchArtifact junit/junit/4.10/junit-4.10.pom
+fetchArtifact junit/junit/4.10/junit-4.10.pom.sha1
+fetchArtifact log4j/log4j/1.2.12/log4j-1.2.12.pom
+fetchArtifact log4j/log4j/1.2.12/log4j-1.2.12.pom.sha1
+fetchArtifact log4j/log4j/1.2.14/log4j-1.2.14.jar
+fetchArtifact log4j/log4j/1.2.14/log4j-1.2.14.jar.sha1
+fetchArtifact log4j/log4j/1.2.14/log4j-1.2.14.pom
+fetchArtifact log4j/log4j/1.2.14/log4j-1.2.14.pom.sha1
+fetchArtifact logkit/logkit/1.0.1/logkit-1.0.1.pom
+fetchArtifact logkit/logkit/1.0.1/logkit-1.0.1.pom.sha1
+fetchArtifact org/apache/apache/10/apache-10.pom
+fetchArtifact org/apache/apache/10/apache-10.pom.sha1
+fetchArtifact org/apache/apache/11/apache-11.pom
+fetchArtifact org/apache/apache/11/apache-11.pom.sha1
+fetchArtifact org/apache/apache/13/apache-13.pom
+fetchArtifact org/apache/apache/13/apache-13.pom.sha1
+fetchArtifact org/apache/apache/2/apache-2.pom
+fetchArtifact org/apache/apache/2/apache-2.pom.sha1
+fetchArtifact org/apache/apache/3/apache-3.pom
+fetchArtifact org/apache/apache/3/apache-3.pom.sha1
+fetchArtifact org/apache/apache/4/apache-4.pom
+fetchArtifact org/apache/apache/4/apache-4.pom.sha1
+fetchArtifact org/apache/apache/5/apache-5.pom
+fetchArtifact org/apache/apache/5/apache-5.pom.sha1
+fetchArtifact org/apache/apache/6/apache-6.pom
+fetchArtifact org/apache/apache/6/apache-6.pom.sha1
+fetchArtifact org/apache/apache/7/apache-7.pom
+fetchArtifact org/apache/apache/7/apache-7.pom.sha1
+fetchArtifact org/apache/apache/9/apache-9.pom
+fetchArtifact org/apache/apache/9/apache-9.pom.sha1
+fetchArtifact org/apache/apache-jar-resource-bundle/1.4/apache-jar-resource-bundle-1.4.jar
+fetchArtifact org/apache/apache-jar-resource-bundle/1.4/apache-jar-resource-bundle-1.4.jar.sha1
+fetchArtifact org/apache/commons/commons-parent/12/commons-parent-12.pom
+fetchArtifact org/apache/commons/commons-parent/12/commons-parent-12.pom.sha1
+fetchArtifact org/apache/commons/commons-parent/17/commons-parent-17.pom
+fetchArtifact org/apache/commons/commons-parent/17/commons-parent-17.pom.sha1
+fetchArtifact org/apache/commons/commons-parent/3/commons-parent-3.pom
+fetchArtifact org/apache/commons/commons-parent/3/commons-parent-3.pom.sha1
+fetchArtifact org/apache/commons/commons-parent/5/commons-parent-5.pom
+fetchArtifact org/apache/commons/commons-parent/5/commons-parent-5.pom.sha1
+fetchArtifact org/apache/commons/commons-parent/7/commons-parent-7.pom
+fetchArtifact org/apache/commons/commons-parent/7/commons-parent-7.pom.sha1
+fetchArtifact org/apache/commons/commons-parent/9/commons-parent-9.pom
+fetchArtifact org/apache/commons/commons-parent/9/commons-parent-9.pom.sha1
+fetchArtifact org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.jar
+fetchArtifact org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.jar.sha1
+fetchArtifact org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.pom
+fetchArtifact org/apache/httpcomponents/httpclient/4.0.2/httpclient-4.0.2.pom.sha1
+fetchArtifact org/apache/httpcomponents/httpcomponents-client/4.0.2/httpcomponents-client-4.0.2.pom
+fetchArtifact org/apache/httpcomponents/httpcomponents-client/4.0.2/httpcomponents-client-4.0.2.pom.sha1
+fetchArtifact org/apache/httpcomponents/httpcomponents-core/4.0.1/httpcomponents-core-4.0.1.pom
+fetchArtifact org/apache/httpcomponents/httpcomponents-core/4.0.1/httpcomponents-core-4.0.1.pom.sha1
+fetchArtifact org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar
+fetchArtifact org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar.sha1
+fetchArtifact org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.pom
+fetchArtifact org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.pom.sha1
+fetchArtifact org/apache/httpcomponents/project/4.0/project-4.0.pom
+fetchArtifact org/apache/httpcomponents/project/4.0/project-4.0.pom.sha1
+fetchArtifact org/apache/httpcomponents/project/4.1/project-4.1.pom
+fetchArtifact org/apache/httpcomponents/project/4.1/project-4.1.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia/1.0/doxia-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia/1.0/doxia-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia/1.0-alpha-10/doxia-1.0-alpha-10.pom
+fetchArtifact org/apache/maven/doxia/doxia/1.0-alpha-10/doxia-1.0-alpha-10.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia/1.0-alpha-7/doxia-1.0-alpha-7.pom
+fetchArtifact org/apache/maven/doxia/doxia/1.0-alpha-7/doxia-1.0-alpha-7.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia/1.2/doxia-1.2.pom
+fetchArtifact org/apache/maven/doxia/doxia/1.2/doxia-1.2.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia/1.3/doxia-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia/1.3/doxia-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-core/1.0/doxia-core-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-core/1.3/doxia-core-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-core/1.3/doxia-core-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-core/1.3/doxia-core-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-core/1.3/doxia-core-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.0/doxia-decoration-model-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.2/doxia-decoration-model-1.2.pom
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.2/doxia-decoration-model-1.2.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.3/doxia-decoration-model-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.3/doxia-decoration-model-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.3/doxia-decoration-model-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-decoration-model/1.3/doxia-decoration-model-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-logging-api/1.2/doxia-logging-api-1.2.pom
+fetchArtifact org/apache/maven/doxia/doxia-logging-api/1.2/doxia-logging-api-1.2.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-logging-api/1.3/doxia-logging-api-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-logging-api/1.3/doxia-logging-api-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-logging-api/1.3/doxia-logging-api-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-logging-api/1.3/doxia-logging-api-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.0/doxia-module-apt-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.3/doxia-module-apt-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.3/doxia-module-apt-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.3/doxia-module-apt-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-apt/1.3/doxia-module-apt-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.0/doxia-module-fml-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.3/doxia-module-fml-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.3/doxia-module-fml-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.3/doxia-module-fml-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-fml/1.3/doxia-module-fml-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.0/doxia-module-xdoc-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.3/doxia-module-xdoc-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.3/doxia-module-xdoc-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.3/doxia-module-xdoc-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-xdoc/1.3/doxia-module-xdoc-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.0/doxia-module-xhtml-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.3/doxia-module-xhtml-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.3/doxia-module-xhtml-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.3/doxia-module-xhtml-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-module-xhtml/1.3/doxia-module-xhtml-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-modules/1.0/doxia-modules-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-modules/1.0/doxia-modules-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-modules/1.3/doxia-modules-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-modules/1.3/doxia-modules-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0/doxia-sink-api-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0-alpha-10/doxia-sink-api-1.0-alpha-10.pom
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0-alpha-10/doxia-sink-api-1.0-alpha-10.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.pom
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.3/doxia-sink-api-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.3/doxia-sink-api-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.3/doxia-sink-api-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-sink-api/1.3/doxia-sink-api-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.jar
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.0/doxia-site-renderer-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.3/doxia-site-renderer-1.3.jar
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.3/doxia-site-renderer-1.3.jar.sha1
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.3/doxia-site-renderer-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-site-renderer/1.3/doxia-site-renderer-1.3.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sitetools/1.0/doxia-sitetools-1.0.pom
+fetchArtifact org/apache/maven/doxia/doxia-sitetools/1.0/doxia-sitetools-1.0.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sitetools/1.2/doxia-sitetools-1.2.pom
+fetchArtifact org/apache/maven/doxia/doxia-sitetools/1.2/doxia-sitetools-1.2.pom.sha1
+fetchArtifact org/apache/maven/doxia/doxia-sitetools/1.3/doxia-sitetools-1.3.pom
+fetchArtifact org/apache/maven/doxia/doxia-sitetools/1.3/doxia-sitetools-1.3.pom.sha1
+fetchArtifact org/apache/maven/maven/2.0/maven-2.0.pom
+fetchArtifact org/apache/maven/maven/2.0/maven-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven/2.0.1/maven-2.0.1.pom
+fetchArtifact org/apache/maven/maven/2.0.1/maven-2.0.1.pom.sha1
+fetchArtifact org/apache/maven/maven/2.0.2/maven-2.0.2.pom
+fetchArtifact org/apache/maven/maven/2.0.2/maven-2.0.2.pom.sha1
+fetchArtifact org/apache/maven/maven/2.0.5/maven-2.0.5.pom
+fetchArtifact org/apache/maven/maven/2.0.5/maven-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven/2.0.6/maven-2.0.6.pom
+fetchArtifact org/apache/maven/maven/2.0.6/maven-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven/2.0.8/maven-2.0.8.pom
+fetchArtifact org/apache/maven/maven/2.0.8/maven-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven/2.0.9/maven-2.0.9.pom
+fetchArtifact org/apache/maven/maven/2.0.9/maven-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven/2.2.0/maven-2.2.0.pom
+fetchArtifact org/apache/maven/maven/2.2.0/maven-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven/2.2.1/maven-2.2.1.pom
+fetchArtifact org/apache/maven/maven/2.2.1/maven-2.2.1.pom.sha1
+fetchArtifact org/apache/maven/maven/3.0/maven-3.0.pom
+fetchArtifact org/apache/maven/maven/3.0/maven-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.pom
+fetchArtifact org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.3/maven-archiver-2.3.jar
+fetchArtifact org/apache/maven/maven-archiver/2.3/maven-archiver-2.3.jar.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.3/maven-archiver-2.3.pom
+fetchArtifact org/apache/maven/maven-archiver/2.3/maven-archiver-2.3.pom.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.jar
+fetchArtifact org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.jar.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.pom
+fetchArtifact org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.pom.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
+fetchArtifact org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.pom
+fetchArtifact org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.pom.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar
+fetchArtifact org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.jar.sha1
+fetchArtifact org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.pom
+fetchArtifact org/apache/maven/maven-archiver/2.5/maven-archiver-2.5.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.pom
+fetchArtifact org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.0.2/maven-artifact-2.0.2.pom
+fetchArtifact org/apache/maven/maven-artifact/2.0.2/maven-artifact-2.0.2.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.0.5/maven-artifact-2.0.5.pom
+fetchArtifact org/apache/maven/maven-artifact/2.0.5/maven-artifact-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.pom
+fetchArtifact org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom
+fetchArtifact org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.pom
+fetchArtifact org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.2.0/maven-artifact-2.2.0.pom
+fetchArtifact org/apache/maven/maven-artifact/2.2.0/maven-artifact-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom
+fetchArtifact org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.pom
+fetchArtifact org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0/maven-artifact-manager-2.0.pom
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0/maven-artifact-manager-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.2/maven-artifact-manager-2.0.2.pom
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.2/maven-artifact-manager-2.0.2.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.5/maven-artifact-manager-2.0.5.pom
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.5/maven-artifact-manager-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.pom
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.pom
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.pom
+fetchArtifact org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-artifact-manager/2.2.0/maven-artifact-manager-2.2.0.pom
+fetchArtifact org/apache/maven/maven-artifact-manager/2.2.0/maven-artifact-manager-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-compat/3.0/maven-compat-3.0.pom
+fetchArtifact org/apache/maven/maven-compat/3.0/maven-compat-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-core/2.0/maven-core-2.0.pom
+fetchArtifact org/apache/maven/maven-core/2.0/maven-core-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.pom
+fetchArtifact org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.pom
+fetchArtifact org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-core/3.0/maven-core-3.0.pom
+fetchArtifact org/apache/maven/maven-core/3.0/maven-core-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-error-diagnostics/2.0/maven-error-diagnostics-2.0.pom
+fetchArtifact org/apache/maven/maven-error-diagnostics/2.0/maven-error-diagnostics-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6.pom
+fetchArtifact org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-error-diagnostics/2.0.9/maven-error-diagnostics-2.0.9.pom
+fetchArtifact org/apache/maven/maven-error-diagnostics/2.0.9/maven-error-diagnostics-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-model/2.0/maven-model-2.0.pom
+fetchArtifact org/apache/maven/maven-model/2.0/maven-model-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-model/2.0.5/maven-model-2.0.5.pom
+fetchArtifact org/apache/maven/maven-model/2.0.5/maven-model-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.pom
+fetchArtifact org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom
+fetchArtifact org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.pom
+fetchArtifact org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-model/2.2.0/maven-model-2.2.0.pom
+fetchArtifact org/apache/maven/maven-model/2.2.0/maven-model-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom
+fetchArtifact org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom.sha1
+fetchArtifact org/apache/maven/maven-model/3.0/maven-model-3.0.pom
+fetchArtifact org/apache/maven/maven-model/3.0/maven-model-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.pom
+fetchArtifact org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-monitor/2.0/maven-monitor-2.0.pom
+fetchArtifact org/apache/maven/maven-monitor/2.0/maven-monitor-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6.pom
+fetchArtifact org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-monitor/2.0.9/maven-monitor-2.0.9.pom
+fetchArtifact org/apache/maven/maven-monitor/2.0.9/maven-monitor-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/10/maven-parent-10.pom
+fetchArtifact org/apache/maven/maven-parent/10/maven-parent-10.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/11/maven-parent-11.pom
+fetchArtifact org/apache/maven/maven-parent/11/maven-parent-11.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/13/maven-parent-13.pom
+fetchArtifact org/apache/maven/maven-parent/13/maven-parent-13.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/15/maven-parent-15.pom
+fetchArtifact org/apache/maven/maven-parent/15/maven-parent-15.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/16/maven-parent-16.pom
+fetchArtifact org/apache/maven/maven-parent/16/maven-parent-16.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/19/maven-parent-19.pom
+fetchArtifact org/apache/maven/maven-parent/19/maven-parent-19.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/20/maven-parent-20.pom
+fetchArtifact org/apache/maven/maven-parent/20/maven-parent-20.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/21/maven-parent-21.pom
+fetchArtifact org/apache/maven/maven-parent/21/maven-parent-21.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/23/maven-parent-23.pom
+fetchArtifact org/apache/maven/maven-parent/23/maven-parent-23.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/5/maven-parent-5.pom
+fetchArtifact org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/6/maven-parent-6.pom
+fetchArtifact org/apache/maven/maven-parent/6/maven-parent-6.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/7/maven-parent-7.pom
+fetchArtifact org/apache/maven/maven-parent/7/maven-parent-7.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/8/maven-parent-8.pom
+fetchArtifact org/apache/maven/maven-parent/8/maven-parent-8.pom.sha1
+fetchArtifact org/apache/maven/maven-parent/9/maven-parent-9.pom
+fetchArtifact org/apache/maven/maven-parent/9/maven-parent-9.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom
+fetchArtifact org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.pom
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.pom
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom
+fetchArtifact org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom
+fetchArtifact org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.pom
+fetchArtifact org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-descriptor/2.0/maven-plugin-descriptor-2.0.pom
+fetchArtifact org/apache/maven/maven-plugin-descriptor/2.0/maven-plugin-descriptor-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6.pom
+fetchArtifact org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-descriptor/2.0.9/maven-plugin-descriptor-2.0.9.pom
+fetchArtifact org/apache/maven/maven-plugin-descriptor/2.0.9/maven-plugin-descriptor-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-parameter-documenter/2.0/maven-plugin-parameter-documenter-2.0.pom
+fetchArtifact org/apache/maven/maven-plugin-parameter-documenter/2.0/maven-plugin-parameter-documenter-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6.pom
+fetchArtifact org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-parameter-documenter/2.0.9/maven-plugin-parameter-documenter-2.0.9.pom
+fetchArtifact org/apache/maven/maven-plugin-parameter-documenter/2.0.9/maven-plugin-parameter-documenter-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0/maven-plugin-registry-2.0.pom
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0/maven-plugin-registry-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.pom
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.pom
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.pom
+fetchArtifact org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-plugin-registry/2.2.0/maven-plugin-registry-2.2.0.pom
+fetchArtifact org/apache/maven/maven-plugin-registry/2.2.0/maven-plugin-registry-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-profile/2.0/maven-profile-2.0.pom
+fetchArtifact org/apache/maven/maven-profile/2.0/maven-profile-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-profile/2.0.5/maven-profile-2.0.5.pom
+fetchArtifact org/apache/maven/maven-profile/2.0.5/maven-profile-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.pom
+fetchArtifact org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.pom
+fetchArtifact org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.pom
+fetchArtifact org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-profile/2.2.0/maven-profile-2.2.0.pom
+fetchArtifact org/apache/maven/maven-profile/2.2.0/maven-profile-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-project/2.0/maven-project-2.0.pom
+fetchArtifact org/apache/maven/maven-project/2.0/maven-project-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-project/2.0.5/maven-project-2.0.5.pom
+fetchArtifact org/apache/maven/maven-project/2.0.5/maven-project-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.pom
+fetchArtifact org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom
+fetchArtifact org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.pom
+fetchArtifact org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-project/2.2.0/maven-project-2.2.0.pom
+fetchArtifact org/apache/maven/maven-project/2.2.0/maven-project-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.2/maven-repository-metadata-2.0.2.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.2/maven-repository-metadata-2.0.2.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.5/maven-repository-metadata-2.0.5.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.5/maven-repository-metadata-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/2.2.0/maven-repository-metadata-2.2.0.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/2.2.0/maven-repository-metadata-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.pom
+fetchArtifact org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-settings/2.0/maven-settings-2.0.pom
+fetchArtifact org/apache/maven/maven-settings/2.0/maven-settings-2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-settings/2.0.5/maven-settings-2.0.5.pom
+fetchArtifact org/apache/maven/maven-settings/2.0.5/maven-settings-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.pom
+fetchArtifact org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.pom
+fetchArtifact org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.pom.sha1
+fetchArtifact org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.pom
+fetchArtifact org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/maven-settings/2.2.0/maven-settings-2.2.0.pom
+fetchArtifact org/apache/maven/maven-settings/2.2.0/maven-settings-2.2.0.pom.sha1
+fetchArtifact org/apache/maven/maven-settings/3.0/maven-settings-3.0.pom
+fetchArtifact org/apache/maven/maven-settings/3.0/maven-settings-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.pom
+fetchArtifact org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.pom.sha1
+fetchArtifact org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.pom
+fetchArtifact org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.pom.sha1
+fetchArtifact org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.pom
+fetchArtifact org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar
+fetchArtifact org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
+fetchArtifact org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.jar
+fetchArtifact org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom
+fetchArtifact org/apache/maven/plugins/maven-compiler-plugin/2.5.1/maven-compiler-plugin-2.5.1.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.jar
+fetchArtifact org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
+fetchArtifact org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-gpg-plugin/1.4/maven-gpg-plugin-1.4.jar
+fetchArtifact org/apache/maven/plugins/maven-gpg-plugin/1.4/maven-gpg-plugin-1.4.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-gpg-plugin/1.4/maven-gpg-plugin-1.4.pom
+fetchArtifact org/apache/maven/plugins/maven-gpg-plugin/1.4/maven-gpg-plugin-1.4.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar
+fetchArtifact org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
+fetchArtifact org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-javadoc-plugin/2.8.1/maven-javadoc-plugin-2.8.1.jar
+fetchArtifact org/apache/maven/plugins/maven-javadoc-plugin/2.8.1/maven-javadoc-plugin-2.8.1.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-javadoc-plugin/2.8.1/maven-javadoc-plugin-2.8.1.pom
+fetchArtifact org/apache/maven/plugins/maven-javadoc-plugin/2.8.1/maven-javadoc-plugin-2.8.1.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-plugins/18/maven-plugins-18.pom
+fetchArtifact org/apache/maven/plugins/maven-plugins/18/maven-plugins-18.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-plugins/19/maven-plugins-19.pom
+fetchArtifact org/apache/maven/plugins/maven-plugins/19/maven-plugins-19.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom
+fetchArtifact org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom
+fetchArtifact org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-remote-resources-plugin/1.3/maven-remote-resources-plugin-1.3.jar
+fetchArtifact org/apache/maven/plugins/maven-remote-resources-plugin/1.3/maven-remote-resources-plugin-1.3.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-remote-resources-plugin/1.3/maven-remote-resources-plugin-1.3.pom
+fetchArtifact org/apache/maven/plugins/maven-remote-resources-plugin/1.3/maven-remote-resources-plugin-1.3.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar
+fetchArtifact org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
+fetchArtifact org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.jar
+fetchArtifact org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.pom
+fetchArtifact org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-site-plugin/3.1/maven-site-plugin-3.1.jar
+fetchArtifact org/apache/maven/plugins/maven-site-plugin/3.1/maven-site-plugin-3.1.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-site-plugin/3.1/maven-site-plugin-3.1.pom
+fetchArtifact org/apache/maven/plugins/maven-site-plugin/3.1/maven-site-plugin-3.1.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-source-plugin/2.1.2/maven-source-plugin-2.1.2.jar
+fetchArtifact org/apache/maven/plugins/maven-source-plugin/2.1.2/maven-source-plugin-2.1.2.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-source-plugin/2.1.2/maven-source-plugin-2.1.2.pom
+fetchArtifact org/apache/maven/plugins/maven-source-plugin/2.1.2/maven-source-plugin-2.1.2.pom.sha1
+fetchArtifact org/apache/maven/plugins/maven-surefire-plugin/2.12/maven-surefire-plugin-2.12.jar
+fetchArtifact org/apache/maven/plugins/maven-surefire-plugin/2.12/maven-surefire-plugin-2.12.jar.sha1
+fetchArtifact org/apache/maven/plugins/maven-surefire-plugin/2.12/maven-surefire-plugin-2.12.pom
+fetchArtifact org/apache/maven/plugins/maven-surefire-plugin/2.12/maven-surefire-plugin-2.12.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting/2.0/maven-reporting-2.0.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting/2.0/maven-reporting-2.0.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting/2.0.6/maven-reporting-2.0.6.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting/2.0.6/maven-reporting-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting/2.0.9/maven-reporting-2.0.9.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting/2.0.9/maven-reporting-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0/maven-reporting-api-2.0.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0/maven-reporting-api-2.0.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.jar.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting-api/3.0/maven-reporting-api-3.0.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-exec/1.0.2/maven-reporting-exec-1.0.2.jar
+fetchArtifact org/apache/maven/reporting/maven-reporting-exec/1.0.2/maven-reporting-exec-1.0.2.jar.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-exec/1.0.2/maven-reporting-exec-1.0.2.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting-exec/1.0.2/maven-reporting-exec-1.0.2.pom.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-impl/2.0.5/maven-reporting-impl-2.0.5.jar
+fetchArtifact org/apache/maven/reporting/maven-reporting-impl/2.0.5/maven-reporting-impl-2.0.5.jar.sha1
+fetchArtifact org/apache/maven/reporting/maven-reporting-impl/2.0.5/maven-reporting-impl-2.0.5.pom
+fetchArtifact org/apache/maven/reporting/maven-reporting-impl/2.0.5/maven-reporting-impl-2.0.5.pom.sha1
+fetchArtifact org/apache/maven/shared/file-management/1.2.1/file-management-1.2.1.jar
+fetchArtifact org/apache/maven/shared/file-management/1.2.1/file-management-1.2.1.jar.sha1
+fetchArtifact org/apache/maven/shared/file-management/1.2.1/file-management-1.2.1.pom
+fetchArtifact org/apache/maven/shared/file-management/1.2.1/file-management-1.2.1.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-artifact-resolver/1.0/maven-artifact-resolver-1.0.jar
+fetchArtifact org/apache/maven/shared/maven-artifact-resolver/1.0/maven-artifact-resolver-1.0.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-artifact-resolver/1.0/maven-artifact-resolver-1.0.pom
+fetchArtifact org/apache/maven/shared/maven-artifact-resolver/1.0/maven-artifact-resolver-1.0.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.0/maven-common-artifact-filters-1.0.jar
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.0/maven-common-artifact-filters-1.0.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.0/maven-common-artifact-filters-1.0.pom
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.0/maven-common-artifact-filters-1.0.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.jar
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.pom
+fetchArtifact org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-dependency-analyzer/1.4/maven-dependency-analyzer-1.4.jar
+fetchArtifact org/apache/maven/shared/maven-dependency-analyzer/1.4/maven-dependency-analyzer-1.4.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-dependency-analyzer/1.4/maven-dependency-analyzer-1.4.pom
+fetchArtifact org/apache/maven/shared/maven-dependency-analyzer/1.4/maven-dependency-analyzer-1.4.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
+fetchArtifact org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.pom
+fetchArtifact org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.0.2/maven-doxia-tools-1.0.2.jar
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.0.2/maven-doxia-tools-1.0.2.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.0.2/maven-doxia-tools-1.0.2.pom
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.0.2/maven-doxia-tools-1.0.2.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.4/maven-doxia-tools-1.4.jar
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.4/maven-doxia-tools-1.4.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.4/maven-doxia-tools-1.4.pom
+fetchArtifact org/apache/maven/shared/maven-doxia-tools/1.4/maven-doxia-tools-1.4.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.jar
+fetchArtifact org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.pom
+fetchArtifact org/apache/maven/shared/maven-filtering/1.0/maven-filtering-1.0.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.jar
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.pom
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.11/maven-invoker-2.0.11.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.9/maven-invoker-2.0.9.jar
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.9/maven-invoker-2.0.9.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.9/maven-invoker-2.0.9.pom
+fetchArtifact org/apache/maven/shared/maven-invoker/2.0.9/maven-invoker-2.0.9.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-plugin-testing-harness/1.1/maven-plugin-testing-harness-1.1.jar
+fetchArtifact org/apache/maven/shared/maven-plugin-testing-harness/1.1/maven-plugin-testing-harness-1.1.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-plugin-testing-harness/1.1/maven-plugin-testing-harness-1.1.pom
+fetchArtifact org/apache/maven/shared/maven-plugin-testing-harness/1.1/maven-plugin-testing-harness-1.1.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/10/maven-shared-components-10.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/10/maven-shared-components-10.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/11/maven-shared-components-11.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/11/maven-shared-components-11.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/12/maven-shared-components-12.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/12/maven-shared-components-12.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/15/maven-shared-components-15.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/15/maven-shared-components-15.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/16/maven-shared-components-16.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/16/maven-shared-components-16.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/17/maven-shared-components-17.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/17/maven-shared-components-17.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/19/maven-shared-components-19.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/19/maven-shared-components-19.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/7/maven-shared-components-7.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/7/maven-shared-components-7.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/8/maven-shared-components-8.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/8/maven-shared-components-8.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-components/9/maven-shared-components-9.pom
+fetchArtifact org/apache/maven/shared/maven-shared-components/9/maven-shared-components-9.pom.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar
+fetchArtifact org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.jar.sha1
+fetchArtifact org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.pom
+fetchArtifact org/apache/maven/shared/maven-shared-io/1.1/maven-shared-io-1.1.pom.sha1
+fetchArtifact org/apache/maven/surefire/maven-surefire-common/2.12/maven-surefire-common-2.12.jar
+fetchArtifact org/apache/maven/surefire/maven-surefire-common/2.12/maven-surefire-common-2.12.jar.sha1
+fetchArtifact org/apache/maven/surefire/maven-surefire-common/2.12/maven-surefire-common-2.12.pom
+fetchArtifact org/apache/maven/surefire/maven-surefire-common/2.12/maven-surefire-common-2.12.pom.sha1
+fetchArtifact org/apache/maven/surefire/surefire/2.12/surefire-2.12.pom
+fetchArtifact org/apache/maven/surefire/surefire/2.12/surefire-2.12.pom.sha1
+fetchArtifact org/apache/maven/surefire/surefire-api/2.12/surefire-api-2.12.jar
+fetchArtifact org/apache/maven/surefire/surefire-api/2.12/surefire-api-2.12.jar.sha1
+fetchArtifact org/apache/maven/surefire/surefire-api/2.12/surefire-api-2.12.pom
+fetchArtifact org/apache/maven/surefire/surefire-api/2.12/surefire-api-2.12.pom.sha1
+fetchArtifact org/apache/maven/surefire/surefire-booter/2.12/surefire-booter-2.12.jar
+fetchArtifact org/apache/maven/surefire/surefire-booter/2.12/surefire-booter-2.12.jar.sha1
+fetchArtifact org/apache/maven/surefire/surefire-booter/2.12/surefire-booter-2.12.pom
+fetchArtifact org/apache/maven/surefire/surefire-booter/2.12/surefire-booter-2.12.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon/1.0/wagon-1.0.pom
+fetchArtifact org/apache/maven/wagon/wagon/1.0/wagon-1.0.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon/1.0-alpha-6/wagon-1.0-alpha-6.pom
+fetchArtifact org/apache/maven/wagon/wagon/1.0-alpha-6/wagon-1.0-alpha-6.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon/1.0-beta-6/wagon-1.0-beta-6.pom
+fetchArtifact org/apache/maven/wagon/wagon/1.0-beta-6/wagon-1.0-beta-6.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon-provider-api/1.0/wagon-provider-api-1.0.pom
+fetchArtifact org/apache/maven/wagon/wagon-provider-api/1.0/wagon-provider-api-1.0.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon-provider-api/1.0-alpha-6/wagon-provider-api-1.0-alpha-6.pom
+fetchArtifact org/apache/maven/wagon/wagon-provider-api/1.0-alpha-6/wagon-provider-api-1.0-alpha-6.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.pom
+fetchArtifact org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon-providers/1.0/wagon-providers-1.0.pom
+fetchArtifact org/apache/maven/wagon/wagon-providers/1.0/wagon-providers-1.0.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon-ssh/1.0/wagon-ssh-1.0.jar
+fetchArtifact org/apache/maven/wagon/wagon-ssh/1.0/wagon-ssh-1.0.jar.sha1
+fetchArtifact org/apache/maven/wagon/wagon-ssh/1.0/wagon-ssh-1.0.pom
+fetchArtifact org/apache/maven/wagon/wagon-ssh/1.0/wagon-ssh-1.0.pom.sha1
+fetchArtifact org/apache/maven/wagon/wagon-ssh-common/1.0/wagon-ssh-common-1.0.jar
+fetchArtifact org/apache/maven/wagon/wagon-ssh-common/1.0/wagon-ssh-common-1.0.jar.sha1
+fetchArtifact org/apache/maven/wagon/wagon-ssh-common/1.0/wagon-ssh-common-1.0.pom
+fetchArtifact org/apache/maven/wagon/wagon-ssh-common/1.0/wagon-ssh-common-1.0.pom.sha1
+fetchArtifact org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar
+fetchArtifact org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar.sha1
+fetchArtifact org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.pom
+fetchArtifact org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.pom.sha1
+fetchArtifact org/apache/struts/struts-master/4/struts-master-4.pom
+fetchArtifact org/apache/struts/struts-master/4/struts-master-4.pom.sha1
+fetchArtifact org/apache/struts/struts-parent/1.3.8/struts-parent-1.3.8.pom
+fetchArtifact org/apache/struts/struts-parent/1.3.8/struts-parent-1.3.8.pom.sha1
+fetchArtifact org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar
+fetchArtifact org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar.sha1
+fetchArtifact org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.pom
+fetchArtifact org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.pom.sha1
+fetchArtifact org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar
+fetchArtifact org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar.sha1
+fetchArtifact org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.pom
+fetchArtifact org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.pom.sha1
+fetchArtifact org/apache/velocity/velocity/1.5/velocity-1.5.jar
+fetchArtifact org/apache/velocity/velocity/1.5/velocity-1.5.jar.sha1
+fetchArtifact org/apache/velocity/velocity/1.5/velocity-1.5.pom
+fetchArtifact org/apache/velocity/velocity/1.5/velocity-1.5.pom.sha1
+fetchArtifact org/apache/velocity/velocity/1.6.2/velocity-1.6.2.pom
+fetchArtifact org/apache/velocity/velocity/1.6.2/velocity-1.6.2.pom.sha1
+fetchArtifact org/apache/velocity/velocity/1.7/velocity-1.7.jar
+fetchArtifact org/apache/velocity/velocity/1.7/velocity-1.7.jar.sha1
+fetchArtifact org/apache/velocity/velocity/1.7/velocity-1.7.pom
+fetchArtifact org/apache/velocity/velocity/1.7/velocity-1.7.pom.sha1
+fetchArtifact org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar
+fetchArtifact org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar.sha1
+fetchArtifact org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.pom
+fetchArtifact org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.pom.sha1
+fetchArtifact org/apache/xbean/xbean/3.4/xbean-3.4.pom
+fetchArtifact org/apache/xbean/xbean/3.4/xbean-3.4.pom.sha1
+fetchArtifact org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.pom
+fetchArtifact org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.pom.sha1
+fetchArtifact org/beanshell/beanshell/2.0b4/beanshell-2.0b4.pom
+fetchArtifact org/beanshell/beanshell/2.0b4/beanshell-2.0b4.pom.sha1
+fetchArtifact org/beanshell/bsh/2.0b4/bsh-2.0b4.jar
+fetchArtifact org/beanshell/bsh/2.0b4/bsh-2.0b4.jar.sha1
+fetchArtifact org/beanshell/bsh/2.0b4/bsh-2.0b4.pom
+fetchArtifact org/beanshell/bsh/2.0b4/bsh-2.0b4.pom.sha1
+fetchArtifact org/codehaus/codehaus-parent/4/codehaus-parent-4.pom
+fetchArtifact org/codehaus/codehaus-parent/4/codehaus-parent-4.pom.sha1
+fetchArtifact org/codehaus/mojo/build-helper-maven-plugin/1.8/build-helper-maven-plugin-1.8.jar
+fetchArtifact org/codehaus/mojo/build-helper-maven-plugin/1.8/build-helper-maven-plugin-1.8.jar.sha1
+fetchArtifact org/codehaus/mojo/build-helper-maven-plugin/1.8/build-helper-maven-plugin-1.8.pom
+fetchArtifact org/codehaus/mojo/build-helper-maven-plugin/1.8/build-helper-maven-plugin-1.8.pom.sha1
+fetchArtifact org/codehaus/mojo/mojo-parent/30/mojo-parent-30.pom
+fetchArtifact org/codehaus/mojo/mojo-parent/30/mojo-parent-30.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom
+fetchArtifact org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom
+fetchArtifact org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/1.0.12/plexus-1.0.12.pom
+fetchArtifact org/codehaus/plexus/plexus/1.0.12/plexus-1.0.12.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom
+fetchArtifact org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/1.0.5/plexus-1.0.5.pom
+fetchArtifact org/codehaus/plexus/plexus/1.0.5/plexus-1.0.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom
+fetchArtifact org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom
+fetchArtifact org/codehaus/plexus/plexus/1.0.9/plexus-1.0.9.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom
+fetchArtifact org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/2.0.3/plexus-2.0.3.pom
+fetchArtifact org/codehaus/plexus/plexus/2.0.3/plexus-2.0.3.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/2.0.5/plexus-2.0.5.pom
+fetchArtifact org/codehaus/plexus/plexus/2.0.5/plexus-2.0.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/2.0.6/plexus-2.0.6.pom
+fetchArtifact org/codehaus/plexus/plexus/2.0.6/plexus-2.0.6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom
+fetchArtifact org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/3.0.1/plexus-3.0.1.pom
+fetchArtifact org/codehaus/plexus/plexus/3.0.1/plexus-3.0.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/3.1/plexus-3.1.pom
+fetchArtifact org/codehaus/plexus/plexus/3.1/plexus-3.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/3.2/plexus-3.2.pom
+fetchArtifact org/codehaus/plexus/plexus/3.2/plexus-3.2.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/3.3/plexus-3.3.pom
+fetchArtifact org/codehaus/plexus/plexus/3.3/plexus-3.3.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus/3.3.1/plexus-3.3.1.pom
+fetchArtifact org/codehaus/plexus/plexus/3.3.1/plexus-3.3.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.jar
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.pom
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.pom
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.pom
+fetchArtifact org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.0.1/plexus-archiver-2.0.1.pom
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.0.1/plexus-archiver-2.0.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.pom
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.3/plexus-archiver-2.3.jar
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.3/plexus-archiver-2.3.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.3/plexus-archiver-2.3.pom
+fetchArtifact org/codehaus/plexus/plexus-archiver/2.3/plexus-archiver-2.3.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-classworlds/1.2-alpha-6/plexus-classworlds-1.2-alpha-6.pom
+fetchArtifact org/codehaus/plexus/plexus-classworlds/1.2-alpha-6/plexus-classworlds-1.2-alpha-6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom
+fetchArtifact org/codehaus/plexus/plexus-classworlds/1.2-alpha-7/plexus-classworlds-1.2-alpha-7.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-classworlds/1.2-alpha-9/plexus-classworlds-1.2-alpha-9.pom
+fetchArtifact org/codehaus/plexus/plexus-classworlds/1.2-alpha-9/plexus-classworlds-1.2-alpha-9.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-classworlds/2.2.2/plexus-classworlds-2.2.2.pom
+fetchArtifact org/codehaus/plexus/plexus-classworlds/2.2.2/plexus-classworlds-2.2.2.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.pom
+fetchArtifact org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-compiler/1.9.1/plexus-compiler-1.9.1.pom
+fetchArtifact org/codehaus/plexus/plexus-compiler/1.9.1/plexus-compiler-1.9.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.jar
+fetchArtifact org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.pom
+fetchArtifact org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-compiler-javac/1.9.1/plexus-compiler-javac-1.9.1.jar
+fetchArtifact org/codehaus/plexus/plexus-compiler-javac/1.9.1/plexus-compiler-javac-1.9.1.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-compiler-javac/1.9.1/plexus-compiler-javac-1.9.1.pom
+fetchArtifact org/codehaus/plexus/plexus-compiler-javac/1.9.1/plexus-compiler-javac-1.9.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-compiler-manager/1.9.1/plexus-compiler-manager-1.9.1.jar
+fetchArtifact org/codehaus/plexus/plexus-compiler-manager/1.9.1/plexus-compiler-manager-1.9.1.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-compiler-manager/1.9.1/plexus-compiler-manager-1.9.1.pom
+fetchArtifact org/codehaus/plexus/plexus-compiler-manager/1.9.1/plexus-compiler-manager-1.9.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-compilers/1.9.1/plexus-compilers-1.9.1.pom
+fetchArtifact org/codehaus/plexus/plexus-compilers/1.9.1/plexus-compilers-1.9.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-component-annotations/1.5.4/plexus-component-annotations-1.5.4.pom
+fetchArtifact org/codehaus/plexus/plexus-component-annotations/1.5.4/plexus-component-annotations-1.5.4.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
+fetchArtifact org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.pom
+fetchArtifact org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-component-api/1.0-alpha-15/plexus-component-api-1.0-alpha-15.pom
+fetchArtifact org/codehaus/plexus/plexus-component-api/1.0-alpha-15/plexus-component-api-1.0-alpha-15.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
+fetchArtifact org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.12/plexus-components-1.1.12.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.12/plexus-components-1.1.12.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.14/plexus-components-1.1.14.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.14/plexus-components-1.1.14.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.15/plexus-components-1.1.15.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.15/plexus-components-1.1.15.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.17/plexus-components-1.1.17.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.17/plexus-components-1.1.17.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.19/plexus-components-1.1.19.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.19/plexus-components-1.1.19.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.20/plexus-components-1.1.20.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.20/plexus-components-1.1.20.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.6/plexus-components-1.1.6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.9/plexus-components-1.1.9.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.1.9/plexus-components-1.1.9.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.2/plexus-components-1.2.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.2/plexus-components-1.2.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-components/1.3/plexus-components-1.3.pom
+fetchArtifact org/codehaus/plexus/plexus-components/1.3/plexus-components-1.3.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-15/plexus-container-default-1.0-alpha-15.pom
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-15/plexus-container-default-1.0-alpha-15.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-20/plexus-container-default-1.0-alpha-20.pom
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-20/plexus-container-default-1.0-alpha-20.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-30/plexus-container-default-1.0-alpha-30.pom
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-30/plexus-container-default-1.0-alpha-30.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.pom
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.pom
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.5.5/plexus-container-default-1.5.5.pom
+fetchArtifact org/codehaus/plexus/plexus-container-default/1.5.5/plexus-container-default-1.5.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-15/plexus-containers-1.0-alpha-15.pom
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-15/plexus-containers-1.0-alpha-15.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-20/plexus-containers-1.0-alpha-20.pom
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-20/plexus-containers-1.0-alpha-20.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-30/plexus-containers-1.0-alpha-30.pom
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0-alpha-30/plexus-containers-1.0-alpha-30.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0.3/plexus-containers-1.0.3.pom
+fetchArtifact org/codehaus/plexus/plexus-containers/1.0.3/plexus-containers-1.0.3.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-containers/1.5.4/plexus-containers-1.5.4.pom
+fetchArtifact org/codehaus/plexus/plexus-containers/1.5.4/plexus-containers-1.5.4.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-containers/1.5.5/plexus-containers-1.5.5.pom
+fetchArtifact org/codehaus/plexus/plexus-containers/1.5.5/plexus-containers-1.5.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar
+fetchArtifact org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.pom
+fetchArtifact org/codehaus/plexus/plexus-i18n/1.0-beta-7/plexus-i18n-1.0-beta-7.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interactivity/1.0-alpha-6/plexus-interactivity-1.0-alpha-6.pom
+fetchArtifact org/codehaus/plexus/plexus-interactivity/1.0-alpha-6/plexus-interactivity-1.0-alpha-6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.pom
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-6/plexus-interactivity-api-1.0-alpha-6.jar
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-6/plexus-interactivity-api-1.0-alpha-6.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-6/plexus-interactivity-api-1.0-alpha-6.pom
+fetchArtifact org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-6/plexus-interactivity-api-1.0-alpha-6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.pom
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.12/plexus-interpolation-1.12.jar
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.12/plexus-interpolation-1.12.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.12/plexus-interpolation-1.12.pom
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.12/plexus-interpolation-1.12.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.pom
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.pom
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.pom
+fetchArtifact org/codehaus/plexus/plexus-interpolation/1.15/plexus-interpolation-1.15.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/1.0/plexus-io-1.0.jar
+fetchArtifact org/codehaus/plexus/plexus-io/1.0/plexus-io-1.0.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/1.0/plexus-io-1.0.pom
+fetchArtifact org/codehaus/plexus/plexus-io/1.0/plexus-io-1.0.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
+fetchArtifact org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.pom
+fetchArtifact org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.1/plexus-io-2.0.1.pom
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.1/plexus-io-2.0.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.pom
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.2/plexus-io-2.0.2.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.6/plexus-io-2.0.6.jar
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.6/plexus-io-2.0.6.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.6/plexus-io-2.0.6.pom
+fetchArtifact org/codehaus/plexus/plexus-io/2.0.6/plexus-io-2.0.6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-resources/1.0-alpha-5/plexus-resources-1.0-alpha-5.jar
+fetchArtifact org/codehaus/plexus/plexus-resources/1.0-alpha-5/plexus-resources-1.0-alpha-5.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-resources/1.0-alpha-5/plexus-resources-1.0-alpha-5.pom
+fetchArtifact org/codehaus/plexus/plexus-resources/1.0-alpha-5/plexus-resources-1.0-alpha-5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.2/plexus-utils-1.2.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.2/plexus-utils-1.2.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.3/plexus-utils-1.3.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.3/plexus-utils-1.3.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4/plexus-utils-1.4.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4/plexus-utils-1.4.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.2/plexus-utils-1.4.2.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.2/plexus-utils-1.4.2.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.10/plexus-utils-1.5.10.jar
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.10/plexus-utils-1.5.10.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.10/plexus-utils-1.5.10.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.10/plexus-utils-1.5.10.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.12/plexus-utils-1.5.12.jar
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.12/plexus-utils-1.5.12.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.12/plexus-utils-1.5.12.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.12/plexus-utils-1.5.12.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.7/plexus-utils-1.5.7.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.7/plexus-utils-1.5.7.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.jar
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
+fetchArtifact org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.10/plexus-utils-3.0.10.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.jar
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.9/plexus-utils-3.0.9.jar
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.9/plexus-utils-3.0.9.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.9/plexus-utils-3.0.9.pom
+fetchArtifact org/codehaus/plexus/plexus-utils/3.0.9/plexus-utils-3.0.9.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.pom
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.7/plexus-velocity-1.1.7.pom.sha1
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.jar.sha1
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.pom
+fetchArtifact org/codehaus/plexus/plexus-velocity/1.1.8/plexus-velocity-1.1.8.pom.sha1
+fetchArtifact org/eclipse/aether/aether/0.9.0.M2/aether-0.9.0.M2.pom
+fetchArtifact org/eclipse/aether/aether/0.9.0.M2/aether-0.9.0.M2.pom.sha1
+fetchArtifact org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
+fetchArtifact org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar.sha1
+fetchArtifact org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.pom
+fetchArtifact org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.pom.sha1
+fetchArtifact org/eclipse/jetty/jetty-parent/14/jetty-parent-14.pom
+fetchArtifact org/eclipse/jetty/jetty-parent/14/jetty-parent-14.pom.sha1
+fetchArtifact org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar
+fetchArtifact org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar.sha1
+fetchArtifact org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom
+fetchArtifact org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom.sha1
+fetchArtifact org/hamcrest/hamcrest-parent/1.1/hamcrest-parent-1.1.pom
+fetchArtifact org/hamcrest/hamcrest-parent/1.1/hamcrest-parent-1.1.pom.sha1
+fetchArtifact org/jdom/jdom/1.1/jdom-1.1.jar
+fetchArtifact org/jdom/jdom/1.1/jdom-1.1.jar.sha1
+fetchArtifact org/jdom/jdom/1.1/jdom-1.1.pom
+fetchArtifact org/jdom/jdom/1.1/jdom-1.1.pom.sha1
+fetchArtifact org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar
+fetchArtifact org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar.sha1
+fetchArtifact org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.pom
+fetchArtifact org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.pom.sha1
+fetchArtifact org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.jar
+fetchArtifact org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.jar.sha1
+fetchArtifact org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom
+fetchArtifact org/mortbay/jetty/jetty/6.1.25/jetty-6.1.25.pom.sha1
+fetchArtifact org/mortbay/jetty/jetty-parent/10/jetty-parent-10.pom
+fetchArtifact org/mortbay/jetty/jetty-parent/10/jetty-parent-10.pom.sha1
+fetchArtifact org/mortbay/jetty/jetty-parent/7/jetty-parent-7.pom
+fetchArtifact org/mortbay/jetty/jetty-parent/7/jetty-parent-7.pom.sha1
+fetchArtifact org/mortbay/jetty/jetty-util/6.1.25/jetty-util-6.1.25.jar
+fetchArtifact org/mortbay/jetty/jetty-util/6.1.25/jetty-util-6.1.25.jar.sha1
+fetchArtifact org/mortbay/jetty/jetty-util/6.1.25/jetty-util-6.1.25.pom
+fetchArtifact org/mortbay/jetty/jetty-util/6.1.25/jetty-util-6.1.25.pom.sha1
+fetchArtifact org/mortbay/jetty/project/6.1.25/project-6.1.25.pom
+fetchArtifact org/mortbay/jetty/project/6.1.25/project-6.1.25.pom.sha1
+fetchArtifact org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar
+fetchArtifact org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar.sha1
+fetchArtifact org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.pom
+fetchArtifact org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.pom.sha1
+fetchArtifact org/objenesis/objenesis/1.0/objenesis-1.0.jar
+fetchArtifact org/objenesis/objenesis/1.0/objenesis-1.0.jar.sha1
+fetchArtifact org/objenesis/objenesis/1.0/objenesis-1.0.pom
+fetchArtifact org/objenesis/objenesis/1.0/objenesis-1.0.pom.sha1
+fetchArtifact org/sonatype/aether/aether-api/1.7/aether-api-1.7.pom
+fetchArtifact org/sonatype/aether/aether-api/1.7/aether-api-1.7.pom.sha1
+fetchArtifact org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.pom
+fetchArtifact org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.pom.sha1
+fetchArtifact org/sonatype/aether/aether-parent/1.7/aether-parent-1.7.pom
+fetchArtifact org/sonatype/aether/aether-parent/1.7/aether-parent-1.7.pom.sha1
+fetchArtifact org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.pom
+fetchArtifact org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.pom.sha1
+fetchArtifact org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
+fetchArtifact org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar.sha1
+fetchArtifact org/sonatype/aether/aether-util/1.7/aether-util-1.7.pom
+fetchArtifact org/sonatype/aether/aether-util/1.7/aether-util-1.7.pom.sha1
+fetchArtifact org/sonatype/forge/forge-parent/10/forge-parent-10.pom
+fetchArtifact org/sonatype/forge/forge-parent/10/forge-parent-10.pom.sha1
+fetchArtifact org/sonatype/forge/forge-parent/3/forge-parent-3.pom
+fetchArtifact org/sonatype/forge/forge-parent/3/forge-parent-3.pom.sha1
+fetchArtifact org/sonatype/forge/forge-parent/4/forge-parent-4.pom
+fetchArtifact org/sonatype/forge/forge-parent/4/forge-parent-4.pom.sha1
+fetchArtifact org/sonatype/forge/forge-parent/5/forge-parent-5.pom
+fetchArtifact org/sonatype/forge/forge-parent/5/forge-parent-5.pom.sha1
+fetchArtifact org/sonatype/forge/forge-parent/6/forge-parent-6.pom
+fetchArtifact org/sonatype/forge/forge-parent/6/forge-parent-6.pom.sha1
+fetchArtifact org/sonatype/oss/oss-parent/6/oss-parent-6.pom
+fetchArtifact org/sonatype/oss/oss-parent/6/oss-parent-6.pom.sha1
+fetchArtifact org/sonatype/oss/oss-parent/7/oss-parent-7.pom
+fetchArtifact org/sonatype/oss/oss-parent/7/oss-parent-7.pom.sha1
+fetchArtifact org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar
+fetchArtifact org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar.sha1
+fetchArtifact org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.pom
+fetchArtifact org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.pom.sha1
+fetchArtifact org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
+fetchArtifact org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar.sha1
+fetchArtifact org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.pom
+fetchArtifact org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.pom.sha1
+fetchArtifact org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
+fetchArtifact org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar.sha1
+fetchArtifact org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.pom
+fetchArtifact org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.pom.sha1
+fetchArtifact org/sonatype/sisu/inject/guice-bean/1.4.2/guice-bean-1.4.2.pom
+fetchArtifact org/sonatype/sisu/inject/guice-bean/1.4.2/guice-bean-1.4.2.pom.sha1
+fetchArtifact org/sonatype/sisu/inject/guice-plexus/1.4.2/guice-plexus-1.4.2.pom
+fetchArtifact org/sonatype/sisu/inject/guice-plexus/1.4.2/guice-plexus-1.4.2.pom.sha1
+fetchArtifact org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
+fetchArtifact org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar.sha1
+fetchArtifact org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7.pom
+fetchArtifact org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7.pom.sha1
+fetchArtifact org/sonatype/sisu/sisu-inject/1.4.2/sisu-inject-1.4.2.pom
+fetchArtifact org/sonatype/sisu/sisu-inject/1.4.2/sisu-inject-1.4.2.pom.sha1
+fetchArtifact org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
+fetchArtifact org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar.sha1
+fetchArtifact org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.pom
+fetchArtifact org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.pom.sha1
+fetchArtifact org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.pom
+fetchArtifact org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.pom.sha1
+fetchArtifact org/sonatype/sisu/sisu-parent/1.4.2/sisu-parent-1.4.2.pom
+fetchArtifact org/sonatype/sisu/sisu-parent/1.4.2/sisu-parent-1.4.2.pom.sha1
+fetchArtifact org/sonatype/spice/spice-parent/10/spice-parent-10.pom
+fetchArtifact org/sonatype/spice/spice-parent/10/spice-parent-10.pom.sha1
+fetchArtifact org/sonatype/spice/spice-parent/12/spice-parent-12.pom
+fetchArtifact org/sonatype/spice/spice-parent/12/spice-parent-12.pom.sha1
+fetchArtifact org/sonatype/spice/spice-parent/16/spice-parent-16.pom
+fetchArtifact org/sonatype/spice/spice-parent/16/spice-parent-16.pom.sha1
+fetchArtifact org/sonatype/spice/spice-parent/17/spice-parent-17.pom
+fetchArtifact org/sonatype/spice/spice-parent/17/spice-parent-17.pom.sha1
+fetchArtifact org/vafer/jdependency/0.7/jdependency-0.7.jar
+fetchArtifact org/vafer/jdependency/0.7/jdependency-0.7.jar.sha1
+fetchArtifact org/vafer/jdependency/0.7/jdependency-0.7.pom
+fetchArtifact org/vafer/jdependency/0.7/jdependency-0.7.pom.sha1
+fetchArtifact oro/oro/2.0.8/oro-2.0.8.jar
+fetchArtifact oro/oro/2.0.8/oro-2.0.8.jar.sha1
+fetchArtifact oro/oro/2.0.8/oro-2.0.8.pom
+fetchArtifact oro/oro/2.0.8/oro-2.0.8.pom.sha1
+fetchArtifact sslext/sslext/1.2-0/sslext-1.2-0.jar
+fetchArtifact sslext/sslext/1.2-0/sslext-1.2-0.jar.sha1
+fetchArtifact sslext/sslext/1.2-0/sslext-1.2-0.pom
+fetchArtifact sslext/sslext/1.2-0/sslext-1.2-0.pom.sha1
+fetchArtifact velocity/velocity/1.5/velocity-1.5.jar
+fetchArtifact velocity/velocity/1.5/velocity-1.5.jar.sha1
+fetchArtifact velocity/velocity/1.5/velocity-1.5.pom
+fetchArtifact velocity/velocity/1.5/velocity-1.5.pom.sha1
+fetchArtifact xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
+fetchArtifact xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar.sha1
+fetchArtifact xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.pom
+fetchArtifact xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.pom.sha1
+fetchArtifact xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
+fetchArtifact xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar.sha1
+fetchArtifact xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.pom
+fetchArtifact xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.pom.sha1
+fetchArtifact xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
+fetchArtifact xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar.sha1
+fetchArtifact xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.pom
+fetchArtifact xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.pom.sha1
+fetchArtifact xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.pom
+fetchArtifact xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.pom.sha1
+
+stopNest
diff --git a/pkgs/applications/networking/cluster/mesos/mesos-deps.nix b/pkgs/applications/networking/cluster/mesos/mesos-deps.nix
new file mode 100644
index 000000000000..7f60dab2defc
--- /dev/null
+++ b/pkgs/applications/networking/cluster/mesos/mesos-deps.nix
@@ -0,0 +1,18 @@
+{stdenv, curl}:
+
+stdenv.mkDerivation {
+  name = "mesos-maven-deps";
+  builder = ./fetch-mesos-deps.sh;
+
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = "03qjq481ly5ajynlr9iqvrjra5fvv2jz4wp2f3in5vnxa61inrrk";
+
+  buildInputs = [ curl ];
+
+  # We borrow these environment variables from the caller to allow
+  # easy proxy configuration.  This is impure, but a fixed-output
+  # derivation like fetchurl is allowed to do so since its result is
+  # by definition pure.
+  impureEnvVars = ["http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy"];
+}
diff --git a/pkgs/applications/networking/cluster/spark/default.nix b/pkgs/applications/networking/cluster/spark/default.nix
new file mode 100644
index 000000000000..1e9fe918a2e5
--- /dev/null
+++ b/pkgs/applications/networking/cluster/spark/default.nix
@@ -0,0 +1,128 @@
+{ stdenv, fetchurl, jre, bash, simpleBuildTool, python27Packages }:
+
+stdenv.mkDerivation rec {
+  name    = "spark-${version}";
+  version = "0.9.1";
+
+  src = fetchurl {
+    url    = "http://d3kbcqa49mib13.cloudfront.net/${name}-bin-cdh4.tgz";
+    sha256 = "1k3954srx3km3ckmfi6wn8rldrljxc039g0pf5m3azgkmaz0gld5";
+  };
+
+  unpackPhase = ''tar zxf $src'';
+
+  untarDir = "${name}-bin-cdh4";
+  installPhase = ''
+    set -x
+    mkdir -p $out/lib $out/bin
+    mv ${untarDir} $out/lib
+
+    cat > $out/bin/spark-class <<EOF
+    #!${bash}/bin/bash
+    export JAVA_HOME=${jre}
+    export SPARK_HOME=$out/lib/${untarDir}
+
+    if [ -z "\$1" ]; then
+      echo "Usage: spark-class <class> [<args>]" >&2
+      exit 1
+    fi
+
+    export SPARK_MEM=\''${SPARK_MEM:-1024m}
+
+    JAVA_OPTS=""
+    JAVA_OPTS="\$JAVA_OPTS -Djava.library.path=\"\$SPARK_LIBRARY_PATH\""
+    JAVA_OPTS="\$JAVA_OPTS -Xms\$SPARK_MEM -Xmx\$SPARK_MEM"
+    export JAVA_OPTS
+
+    CLASSPATH=\`$out/lib/${untarDir}/bin/compute-classpath.sh\`
+    export CLASSPATH
+
+    exec ${jre}/bin/java -cp "\$CLASSPATH" \$JAVA_OPTS "\$@"
+    EOF
+    chmod +x $out/bin/spark-class
+
+    cat > $out/bin/spark-shell <<EOF
+    #!${bash}/bin/bash
+    set -o posix
+    export JAVA_HOME=${jre}
+    export SPARK_HOME=$out/lib/${untarDir}
+    for o in "\$@"; do
+      if [ "\$1" = "-c" -o "\$1" = "--cores" ]; then
+        shift
+        if [ -n "\$1" ]; then
+          OPTIONS="-Dspark.cores.max=\$1"
+          shift
+        fi
+      fi
+    done
+
+    exit_status=127
+    saved_stty=""
+
+    function restoreSttySettings() {
+      stty \$saved_stty
+      saved_stty=""
+    }
+
+    function onExit() {
+      if [[ "\$saved_stty" != "" ]]; then
+        restoreSttySettings
+      fi
+      exit \$exit_status
+    }
+
+    trap onExit INT
+
+    saved_stty=\$(stty -g 2>/dev/null)
+    if [[ ! \$? ]]; then
+      saved_stty=""
+    fi
+
+    $out/bin/spark-class \$OPTIONS org.apache.spark.repl.Main "\$@"
+
+    exit_status=\$?
+    onExit
+    EOF
+    chmod +x $out/bin/spark-shell
+
+    cat > $out/bin/pyspark <<EOF
+    #!${bash}/bin/bash
+    export JAVA_HOME=${jre}
+    export SPARK_HOME=$out/lib/${untarDir}
+    export PYTHONPATH=$out/lib/${untarDir}/python:\$PYTHONPATH
+    export OLD_PYTHONSTARTUP=\$PYTHONSTARTUP
+    export PYTHONSTARTUP=$out/lib/${untarDir}/python/pyspark/shell.py
+    export SPARK_MEM=\''${SPARK_MEM:-1024m}
+    exec ${python27Packages.ipythonLight}/bin/ipython \$@
+    EOF
+    chmod +x $out/bin/pyspark
+
+    cat > $out/bin/spark-upload-scala <<EOF
+    #!${bash}/bin/bash
+    export JAVA_HOME=${jre}
+    export SPARK_HOME=$out/lib/${untarDir}
+    export SPARK_MEM=\''${SPARK_MEM:-1024m}
+
+    CLASS=\$1; shift
+    exec ${simpleBuildTool}/bin/sbt package "run-main \$CLASS \$@"
+    EOF
+    chmod +x $out/bin/spark-upload-scala
+
+    cat > $out/bin/spark-upload-python <<EOF
+    #!${bash}/bin/bash
+    exec $out/bin/pyspark \$@
+    EOF
+    chmod +x $out/bin/spark-upload-python
+  '';
+
+  phases = "unpackPhase installPhase";
+
+  meta = {
+    description      = "Lightning-fast cluster computing";
+    homepage         = "http://spark.apache.org";
+    license          = stdenv.lib.licenses.asl20;
+    platforms        = stdenv.lib.platforms.all;
+    maintainers      = [ stdenv.lib.maintainers.thoughtpolice ];
+    repositories.git = git://git.apache.org/spark.git;
+  };
+}
diff --git a/pkgs/applications/networking/davmail/default.nix b/pkgs/applications/networking/davmail/default.nix
new file mode 100644
index 000000000000..3639f50c4393
--- /dev/null
+++ b/pkgs/applications/networking/davmail/default.nix
@@ -0,0 +1,25 @@
+{ fetchurl, stdenv, jre, glib, libXtst, gtk, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "davmail-4.5.0";
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/project/davmail/davmail/4.5.0/davmail-linux-x86_64-4.5.0-2292.tgz";
+    sha256 = "0ixg26s8535b4xf4i8jr0v3acwvaslmi2dvcxg2nmzkicvh6rfd4";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  meta = {
+    description = "A Java application which presents a Microsoft Exchange server as local CALDAV, IMAP and SMTP servers";
+    maintainers = [ stdenv.lib.maintainers.hinton ];
+    platforms = stdenv.lib.platforms.all;
+    homepage = "http://davmail.sourceforce.net/";
+    license = stdenv.lib.licenses.gpl2;
+  };
+
+  installPhase = ''
+  mkdir -p $out/bin
+  cp ./* $out/bin/ -R
+  wrapProgram $out/bin/davmail.sh --prefix PATH : ${jre}/bin --prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib
+   '';
+}
diff --git a/pkgs/applications/networking/dropbox-cli/default.nix b/pkgs/applications/networking/dropbox-cli/default.nix
index 194b7d92c403..51f3ae2ac8d9 100644
--- a/pkgs/applications/networking/dropbox-cli/default.nix
+++ b/pkgs/applications/networking/dropbox-cli/default.nix
@@ -1,31 +1,30 @@
-{ stdenv, coreutils, fetchurl, python, dropbox }:
-
+{ stdenv, pkgconfig, fetchurl, python, dropbox }:
+let
+  version = "1.6.2";
+in
 stdenv.mkDerivation {
-  # 1.6.0 because it's the only version mentioned in the script
-  name = "dropbox-cli-1.6.0";
+  name = "dropbox-cli-${version}";
 
   src = fetchurl {
-    # Note: dropbox doesn't version this file. Annoying.
-    url = "https://linux.dropbox.com/packages/dropbox.py";
-    sha256 = "0p1pg8bw6mlhqi5k8y3pgs7byg0kfvq57s53sh188lb5sxvlg7yz";
+    url = "https://linux.dropbox.com/packages/nautilus-dropbox-${version}.tar.bz2";
+    sha256 = "1r1kqvnf5a0skby6rr8bmxg128z97fz4gb1n7zlc1vyhqw4k3mb3";
   };
 
-  buildInputs = [ coreutils python ];
+  buildInputs = [ pkgconfig python ];
 
-  phases = "installPhase fixupPhase";
+  phases = "unpackPhase installPhase";
 
   installPhase = ''
-    mkdir -pv $out/bin/
-    cp $src $out/bin/dropbox-cli
-  '';
-
-  fixupPhase = ''
-    substituteInPlace $out/bin/dropbox-cli \
-      --replace "/usr/bin/python" ${python}/bin/python \
-      --replace "use dropbox help" "use dropbox-cli help" \
-      --replace "~/.dropbox-dist/dropboxd" ${dropbox}/bin/dropbox
-
-    chmod +x $out/bin/dropbox-cli
+    mkdir -p "$out/bin/" "$out/share/applications"
+    cp data/dropbox.desktop "$out/share/applications"
+    substitute "dropbox.in" "$out/bin/dropbox" \
+      --replace '@PACKAGE_VERSION@' ${version} \
+      --replace '@DESKTOP_FILE_DIR@' "$out/share/applications" \
+      --replace '@IMAGEDATA16@' '"too-lazy-to-fix"' \
+      --replace '@IMAGEDATA64@' '"too-lazy-to-fix"'
+
+    chmod +x "$out/bin/"*
+    patchShebangs "$out/bin"
   '';
 
   meta = {
diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix
index 99589a3d71b5..9ddcc5629b12 100644
--- a/pkgs/applications/networking/dropbox/default.nix
+++ b/pkgs/applications/networking/dropbox/default.nix
@@ -25,9 +25,9 @@ let
     else if stdenv.system == "i686-linux" then "ld-linux.so.2"
     else throw "Dropbox client for: ${stdenv.system} not supported!";
 
-  version = "2.4.3";
-  sha256 = if stdenv.system == "x86_64-linux" then "0g8iqgc18qbw8fvdjf0fhbal34rvwr5izrf5acfzqjg99dgih81r"
-    else if stdenv.system == "i686-linux" then "1nhmk319whj6cil6wg9hrfln9bxin3fnf6sxb0zg2ycfpnnqi0la"
+  version = "2.10.28";
+  sha256 = if stdenv.system == "x86_64-linux" then "0jrg9xy03yc7npjhng9wiyzidbq7s5n8g4fwynnm1yqfd69r3yac"
+    else if stdenv.system == "i686-linux" then "17vbikhdp5l2s8cnqmk8dln4dfzvrvgqls7av3ngf71bx3bj0fij"
     else throw "Dropbox client for: ${stdenv.system} not supported!";
 
   # relative location where the dropbox libraries are stored
@@ -56,10 +56,8 @@ in stdenv.mkDerivation {
   name = "dropbox-${version}-bin";
   src = fetchurl {
     name = "dropbox-${version}.tar.gz";
-    # using version-specific URL so if the version is no longer available,
-    # build will fail without having to finish downloading first
-    # url = "http://www.dropbox.com/download?plat=lnx.${arch}";
-    url = "http://dl-web.dropbox.com/u/17/dropbox-lnx.${arch}-${version}.tar.gz";
+    
+    url = "https://dl-web.dropbox.com/u/17/dropbox-lnx.${arch}-${version}.tar.gz";
     inherit sha256;
   };
 
@@ -70,25 +68,23 @@ in stdenv.mkDerivation {
   '';
 
   installPhase = ''
-    ensureDir "$out/${appdir}"
-    cp -r ".dropbox-dist/"* "$out/${appdir}/"
-    ensureDir "$out/bin"
+    mkdir -p "$out/${appdir}"
+    cp -r ".dropbox-dist/dropbox-lnx.${arch}-${version}"/* "$out/${appdir}/"
+    mkdir -p "$out/bin"
     ln -s "$out/${appdir}/dropbox" "$out/bin/dropbox"
 
     patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
       "$out/${appdir}/dropbox"
-
+    
     RPATH=${ldpath}:${gcc.gcc}/lib:$out/${appdir}
     echo "updating rpaths to: $RPATH"
     find "$out/${appdir}" -type f -a -perm +0100 \
       -print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \;
 
-    ensureDir "$out/share/applications"
+    mkdir -p "$out/share/applications"
     cp "${desktopItem}/share/applications/"* $out/share/applications
   '';
 
-  buildInputs = [ patchelf ];
-
   meta = {
     homepage = "http://www.dropbox.com";
     description = "Online stored folders (daemon version)";
diff --git a/pkgs/applications/networking/esniper/default.nix b/pkgs/applications/networking/esniper/default.nix
index 8208da621af0..9fd8e7412c20 100644
--- a/pkgs/applications/networking/esniper/default.nix
+++ b/pkgs/applications/networking/esniper/default.nix
@@ -1,16 +1,17 @@
 { stdenv, fetchurl, openssl, curl, coreutils, gawk, bash, which }:
 
 stdenv.mkDerivation {
-  name = "esniper-2.28.0";
+  name = "esniper-2.31.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/esniper/esniper-2-28-0.tgz";
-    sha256 = "c2b0ccb757616b32f2d6cf54a4a5e367405fa7bcd6e6ed11835fe4f8a06a016b";
+    url    = "mirror://sourceforge/esniper/esniper-2-31-0.tgz";
+    sha256 = "0xn6gdyr0c18khwcsi2brp49wkancrsrxxca7hvbawhbf263glih";
   };
 
-  buildInputs = [openssl curl];
+  buildInputs = [ openssl curl ];
 
   # Add support for CURL_CA_BUNDLE variable.
+  # Fix <http://sourceforge.net/p/esniper/bugs/648/>.
   patches = [ ./find-ca-bundle.patch ];
 
   postInstall = ''
@@ -19,12 +20,11 @@ stdenv.mkDerivation {
     chmod 555 "$out/bin/snipe"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Simple, lightweight tool for sniping eBay auctions";
-    homepage = "http://esnipe.rsourceforge.net";
-    license = "GPLv2";
-
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    homepage    = http://esnipe.rsourceforge.net;
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 simons ];
+    platforms   = platforms.all;
   };
 }
diff --git a/pkgs/applications/networking/feedreaders/newsbeuter/default.nix b/pkgs/applications/networking/feedreaders/newsbeuter/default.nix
index 3bca5cc91da1..e5f18f72cedc 100644
--- a/pkgs/applications/networking/feedreaders/newsbeuter/default.nix
+++ b/pkgs/applications/networking/feedreaders/newsbeuter/default.nix
@@ -1,23 +1,24 @@
-{ stdenv, fetchurl, sqlite, curl, pkgconfig, libxml2, stfl, json_c, ncurses
+{ stdenv, fetchurl, sqlite, curl, pkgconfig, libxml2, stfl, json-c-0-11, ncurses
 , gettext, libiconvOrEmpty, makeWrapper, perl }:
 
 stdenv.mkDerivation rec {
-  name = "newsbeuter-2.6";
+  name = "newsbeuter-2.8";
 
   src = fetchurl {
     url = "http://www.newsbeuter.org/downloads/${name}.tar.gz";
-    sha256 = "1hywz5206k0ykjklkjvnfy9fm4jfv9phz8dkzzwhfcjvqv9zv29i";
+    sha256 = "013qi8yghpms2qq1b3xbrlmfgpj0ybgk0qhj245ni4kpxila0wn8";
+
   };
 
   buildInputs
     # use gettext instead of libintlOrEmpty so we have access to the msgfmt
     # command
-    = [ pkgconfig sqlite curl libxml2 stfl json_c ncurses gettext perl ]
+    = [ pkgconfig sqlite curl libxml2 stfl json-c-0-11 ncurses gettext perl ]
       ++ libiconvOrEmpty
       ++ stdenv.lib.optional stdenv.isDarwin makeWrapper;
 
   preBuild = ''
-    sed -i -e 104,108d config.sh
+    sed -i -e 110,114d config.sh
     sed -i "1 s%^.*$%#!${perl}/bin/perl%" txt2h.pl
     export LDFLAGS=-lncursesw
   '';
diff --git a/pkgs/applications/networking/feedreaders/newsbeuter/dev.nix b/pkgs/applications/networking/feedreaders/newsbeuter/dev.nix
new file mode 100644
index 000000000000..4390360ff9e8
--- /dev/null
+++ b/pkgs/applications/networking/feedreaders/newsbeuter/dev.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchgit, sqlite, curl, pkgconfig, libxml2, stfl, json-c-0-11, ncurses
+, gettext, libiconvOrEmpty, makeWrapper, perl }:
+
+stdenv.mkDerivation rec {
+  name = "newsbeuter-dev-20140309";
+
+  src = fetchgit {
+    url = "https://github.com/akrennmair/newsbeuter.git";
+    rev = "1427bdb0705806368db39576a9b803df82fa0415";
+    sha256 = "b29a304a46bf56b439d0d35ea586f7fd0fbf1a5565dca95de76e774885d8b64b";
+  };
+
+  buildInputs
+    # use gettext instead of libintlOrEmpty so we have access to the msgfmt
+    # command
+    = [ pkgconfig sqlite curl libxml2 stfl json-c-0-11 ncurses gettext perl ]
+      ++ libiconvOrEmpty
+      ++ stdenv.lib.optional stdenv.isDarwin makeWrapper;
+
+  preBuild = ''
+    sed -i -e 110,114d config.sh
+    sed -i "1 s%^.*$%#!${perl}/bin/perl%" txt2h.pl
+    export LDFLAGS=-lncursesw
+  '';
+
+  NIX_CFLAGS_COMPILE =
+    "-I${libxml2}/include/libxml2 -I${json-c-0-11}/include/json-c";
+
+  NIX_LDFLAGS = "-lsqlite3 -lcurl -lxml2 -lstfl -ljson";
+
+  installPhase = ''
+    DESTDIR=$out prefix=\"\" make install
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    for prog in $out/bin/*; do
+      wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${stfl}/lib"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage    = http://www.newsbeuter.org;
+    description = "An open-source RSS/Atom feed reader for text terminals";
+    maintainers = with maintainers; [ lovek323 ];
+    license     = licenses.mit;
+    platforms   = platforms.unix;
+  };
+}
diff --git a/pkgs/applications/networking/ftp/filezilla/default.nix b/pkgs/applications/networking/ftp/filezilla/default.nix
index 24fdd1053417..5f695f80b199 100644
--- a/pkgs/applications/networking/ftp/filezilla/default.nix
+++ b/pkgs/applications/networking/ftp/filezilla/default.nix
@@ -1,30 +1,33 @@
-{ stdenv, fetchurl, dbus, gnutls2, wxGTK28, libidn, tinyxml, gettext, pkgconfig, xdg_utils, gtk2, sqlite }:
+{ stdenv, fetchurl, dbus, gnutls, wxGTK28, libidn, tinyxml, gettext
+, pkgconfig, xdg_utils, gtk2, sqlite }:
 
-let version = "3.6.0.2"; in
+let version = "3.8.1"; in
 stdenv.mkDerivation {
   name = "filezilla-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/project/filezilla/FileZilla_Client/${version}/FileZilla_${version}_src.tar.bz2";
-    sha256 = "01n6k1q21i21451rdx3rgc4hhxghdn5b0ldzpjsp44ipgww5wsjk";
+    sha256 = "0kqyz8yb15kbzx02l3riswg95prbp402k4672nwxrzs35049rg36";
   };
 
   configureFlags = [
     "--disable-manualupdatecheck"
   ];
 
-  buildInputs = [ dbus gnutls2 wxGTK28 libidn tinyxml gettext pkgconfig xdg_utils gtk2 sqlite ];
+  buildInputs = [
+    dbus gnutls wxGTK28 libidn tinyxml gettext pkgconfig xdg_utils gtk2 sqlite
+  ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = "http://filezilla-project.org/";
     description = "Graphical FTP, FTPS and SFTP client";
-    license = "GPLv2";
-
+    license = licenses.gpl2;
     longDescription = ''
       FileZilla Client is a free, open source FTP client. It supports
       FTP, SFTP, and FTPS (FTP over SSL/TLS). The client is available
       under many platforms, binaries for Windows, Linux and Mac OS X are
       provided.
     '';
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/ids/daq/default.nix b/pkgs/applications/networking/ids/daq/default.nix
index 92175bb23e9c..36571809a370 100644
--- a/pkgs/applications/networking/ids/daq/default.nix
+++ b/pkgs/applications/networking/ids/daq/default.nix
@@ -14,6 +14,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Data AcQuisition library (DAQ), for packet I/O";
     homepage = http://www.snort.org;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/networking/ids/snort/default.nix b/pkgs/applications/networking/ids/snort/default.nix
index b674f3a83fb2..858e99c245ba 100644
--- a/pkgs/applications/networking/ids/snort/default.nix
+++ b/pkgs/applications/networking/ids/snort/default.nix
@@ -14,6 +14,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Snort is an open source network intrusion prevention and detection system (IDS/IPS)";
     homepage = http://www.snort.org;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/amsn/default.nix b/pkgs/applications/networking/instant-messengers/amsn/default.nix
index fc7906b3e402..37c0b4a694dd 100644
--- a/pkgs/applications/networking/instant-messengers/amsn/default.nix
+++ b/pkgs/applications/networking/instant-messengers/amsn/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, which, tcl, tk, x11, libpng, libjpeg, makeWrapper}:
 
 stdenv.mkDerivation {
-  name = "amsn-0.98.4";
+  name = "amsn-0.98.9";
   src = fetchurl {
-    url = mirror://sourceforge/amsn/amsn-0.98.4-src.tar.gz;
-    sha256 = "1kcn1hc6bvgy4svf5l3j5psdrvsmy0p3r33fn7gzcinqdf3xfgqx";
+    url = mirror://sourceforge/amsn/amsn-0.98.9-src.tar.gz;
+    sha256 = "0b8ir7spxnsz8f7kvr9f1k91nsy8cb65q6jv2l55b04fl20x4z7r";
   };
 
   configureFlags = "--with-tcl=${tcl}/lib --with-tk=${tk}/lib --enable-static";
diff --git a/pkgs/applications/networking/instant-messengers/baresip/default.nix b/pkgs/applications/networking/instant-messengers/baresip/default.nix
index 61cd62fefd46..b878427e876a 100644
--- a/pkgs/applications/networking/instant-messengers/baresip/default.nix
+++ b/pkgs/applications/networking/instant-messengers/baresip/default.nix
@@ -4,11 +4,11 @@
 , gsm, speex, portaudio, spandsp, libuuid
 }:
 stdenv.mkDerivation rec {
-  version = "0.4.3";
+  version = "0.4.11";
   name = "baresip-${version}";
   src=fetchurl {
     url = "http://www.creytiv.com/pub/baresip-${version}.tar.gz";
-    sha256 = "03vpzn0c3mybnwn84ha3yci780qsjm669dwja1srj0hbrq81rbil";
+    sha256 = "1ql5h9ily9jncp9w302v3b2ldx613kc60zlqv0v0ln8hsm8q6bc5";
   };
   buildInputs = [zlib openssl libre librem pkgconfig
     cairo mpg123 gstreamer gst_ffmpeg gst_plugins_base gst_plugins_bad gst_plugins_good
@@ -41,5 +41,9 @@ stdenv.mkDerivation rec {
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [raskin];
     license = with stdenv.lib.licenses; bsd3;
+    inherit version;
+    downloadPage = "http://www.creytiv.com/pub/";
+    updateWalker = true;
+    downloadURLRegexp = "/baresip-.*[.]tar[.].*";
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
index 457d3441b3ab..ec614bf4b8c1 100644
--- a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
+++ b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = http://www.bitlbee.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
diff --git a/pkgs/applications/networking/instant-messengers/centerim/default.nix b/pkgs/applications/networking/instant-messengers/centerim/default.nix
index d746d54974af..54e2d813be8a 100644
--- a/pkgs/applications/networking/instant-messengers/centerim/default.nix
+++ b/pkgs/applications/networking/instant-messengers/centerim/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.centerim.org/;
     description = "Fork of CenterICQ, a curses instant messaging program";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/ekiga/autofoo.patch b/pkgs/applications/networking/instant-messengers/ekiga/autofoo.patch
new file mode 100644
index 000000000000..d15e8b6ccfd4
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/ekiga/autofoo.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -4,7 +4,7 @@
+ AC_PREREQ([2.53])
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_SRCDIR(src/ekiga.cpp)
+-AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar])
++AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar subdir-objects])
+ 
+ AM_MAINTAINER_MODE([enable])
+ AC_CONFIG_HEADERS([config.h])
diff --git a/pkgs/applications/networking/instant-messengers/ekiga/boost.patch b/pkgs/applications/networking/instant-messengers/ekiga/boost.patch
new file mode 100644
index 000000000000..9dad3d94f04b
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/ekiga/boost.patch
@@ -0,0 +1,31 @@
+--- a/m4/ax_boost_base.m4
++++ b/m4/ax_boost_base.m4
+@@ -33,7 +33,7 @@
+ #   and this notice are preserved. This file is offered as-is, without any
+ #   warranty.
+ 
+-#serial 20
++#serial 22
+ 
+ AC_DEFUN([AX_BOOST_BASE],
+ [
+@@ -91,9 +91,17 @@ if test "x$want_boost" = "xyes"; then
+     dnl are found, e.g. when only header-only libraries are installed!
+     libsubdirs="lib"
+     ax_arch=`uname -m`
+-    if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then
++    case $ax_arch in
++      x86_64|ppc64|s390x|sparc64|aarch64)
+         libsubdirs="lib64 lib lib64"
+-    fi
++        ;;
++    esac
++
++    dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
++    dnl them priority over the other paths since, if libs are found there, they
++    dnl are almost assuredly the ones desired.
++    AC_REQUIRE([AC_CANONICAL_HOST])
++    libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
+ 
+     dnl first we check the system location for boost libraries
+     dnl this location ist chosen if boost libraries are installed with the --layout=system option
diff --git a/pkgs/applications/networking/instant-messengers/ekiga/default.nix b/pkgs/applications/networking/instant-messengers/ekiga/default.nix
index 276df1ae7a15..07730a8c0ee1 100644
--- a/pkgs/applications/networking/instant-messengers/ekiga/default.nix
+++ b/pkgs/applications/networking/instant-messengers/ekiga/default.nix
@@ -1,71 +1,55 @@
-x@{builderDefsPackage
-  , cyrus_sasl, gettext, openldap, ptlib, opal, GConf, libXv, rarian, intltool
-  , perl, perlXMLParser, evolution_data_server, gnome_doc_utils, avahi
-  , libsigcxx, gtk, dbus_glib, libnotify, libXext, xextproto, automake
-  , autoconf, pkgconfig, libxml2, videoproto, unixODBC, db4, nspr, nss, zlib
-  , libXrandr, randrproto, which, libxslt, libtasn1, gmp, nettle
-  , ...}:
-builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    [];
+{ stdenv, fetchurl, cyrus_sasl, gettext, openldap, ptlib, opal, libXv, rarian, intltool
+, perl, perlXMLParser, evolution_data_server, gnome_doc_utils, avahi, autoreconfHook
+, libsigcxx, gtk, dbus_glib, libnotify, libXext, xextproto, gnome3, boost, libsecret
+, pkgconfig, libxml2, videoproto, unixODBC, db, nspr, nss, zlib, hicolor_icon_theme
+, libXrandr, randrproto, which, libxslt, libtasn1, gmp, nettle, sqlite, makeWrapper }:
 
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="ekiga";
-    baseVersion="3.2";
-    patchlevel="7";
-    version="${baseVersion}.${patchlevel}";
-    name="${baseName}-${version}";
-    url="mirror://gnome/sources/${baseName}/${baseVersion}/${name}.tar.bz2";
-    hash="13zxwfqhp7pisadx0hq50qwnj6d8r4dldvbs1ngydbwfnq4i6npj";
-  };
-in
-rec {
-  src = a.fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.hash;
+stdenv.mkDerivation rec {
+  name = "ekiga-4.0.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/ekiga/4.0/${name}.tar.xz";
+    sha256 = "5f4f491c9496cf65ba057a9345d6bb0278f4eca07bcda5baeecf50bfcd9a4a3b";
   };
 
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
+  buildInputs = [ cyrus_sasl gettext openldap ptlib opal libXv rarian intltool
+                  perl perlXMLParser evolution_data_server gnome_doc_utils avahi
+                  libsigcxx gtk dbus_glib libnotify libXext xextproto sqlite
+                  gnome3.libsoup
+                  hicolor_icon_theme gnome3.gnome_icon_theme boost autoreconfHook
+                  pkgconfig libxml2 videoproto unixODBC db nspr nss zlib libsecret
+                  libXrandr randrproto which libxslt libtasn1 gmp nettle makeWrapper ];
+
+  preAutoreconf = ''
+    substituteInPlace configure.ac --replace AM_GCONF_SOURCE_2 ""
+  '';
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["setVars" "doConfigure" "doMakeInstall"];
   configureFlags = [
     "--with-ldap-dir=${openldap}"
     "--with-libsasl2-dir=${cyrus_sasl}"
+    "--with-boost-libdir=${boost}/lib"
+    "--disable-gconf"
   ];
 
-  setVars = a.noDepEntry (''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${opal}/include/opal"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${evolution_data_server}/include/evolution-*)"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${GConf}/include/gconf/2"
+  enableParallelBuilding = true;
 
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lopal"
-    for i in ${evolution_data_server}/lib/lib*.so; do
-      file="$(basename "$i" .so)"
-      bn="''${file#lib}"
-      export NIX_LDFLAGS="$NIX_LDFLAGS -l$bn"
-    done
-  '');
+  patches = [ ./autofoo.patch ./boost.patch ];
 
-  meta = {
+  postInstall = ''
+    wrapProgram "$out"/bin/ekiga \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = with stdenv.lib; {
     description = "Ekiga SIP client";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
   };
+
   passthru = {
     updateInfo = {
       downloadPage = "mirror://gnome/sources/ekiga";
     };
   };
-}) x
+}
 
diff --git a/pkgs/applications/networking/instant-messengers/fuze/default.nix b/pkgs/applications/networking/instant-messengers/fuze/default.nix
new file mode 100644
index 000000000000..9ccada87fe2f
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/fuze/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchurl, dpkg, openssl, alsaLib, libXext, libXfixes, libXrandr
+, libjpeg, curl, libX11, libXmu, libXv, libXtst, qt4, mesa, zlib
+, gnome, libidn, rtmpdump, c-ares, openldap, makeWrapper, cacert
+}:
+assert stdenv.system == "x86_64-linux";
+let
+  curl_custom =
+    stdenv.lib.overrideDerivation curl (args: { 
+      configureFlags = args.configureFlags ++ ["--with-ca-bundle=${cacert}/etc/ca-bundle.crt"] ; 
+    } );
+in
+stdenv.mkDerivation {
+  name = "fuze-1.0.5";
+  src = fetchurl {
+    url = http://apt.fuzebox.com/apt/pool/lucid/main/f/fuzelinuxclient/fuzelinuxclient_1.0.5.lucid_amd64.deb;
+    sha256 = "0gvxc8qj526cigr1lif8vdn1aawj621camkc8kvps23r7zijhnqv";
+  };
+  buildInputs = [ dpkg makeWrapper ];
+  libPath =
+    stdenv.lib.makeLibraryPath [
+      openssl alsaLib libXext libXfixes libXrandr libjpeg curl_custom
+      libX11 libXmu libXv qt4 libXtst mesa stdenv.gcc.gcc zlib
+      gnome.GConf libidn rtmpdump c-ares openldap
+    ];
+  buildCommand = ''
+    dpkg-deb -x $src .
+    mkdir -p $out/lib $out/bin
+    cp -R usr/lib/fuzebox $out/lib
+
+    patchelf \
+      --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath $out/lib/fuzebox:$libPath \
+      $out/lib/fuzebox/FuzeLinuxApp
+
+    wrapProgram $out/lib/fuzebox/FuzeLinuxApp --prefix LD_LIBRARY_PATH : $libPath
+    for f in $out/lib/fuzebox/*.so.*; do
+      patchelf \
+        --set-rpath $out/lib/fuzebox:$libPath \
+        $f
+    done
+
+    ln -s ${openssl}/lib/libssl.so.1.0.0 $out/lib/fuzebox/libssl.so.0.9.8
+    ln -s ${openssl}/lib/libcrypto.so.1.0.0 $out/lib/fuzebox/libcrypto.so.0.9.8
+
+    ln -s $out/lib/fuzebox/FuzeLinuxApp $out/bin/fuze
+  '';
+
+  meta = {
+    description = "Fuze for Linux";
+    homepage = http://www.fuzebox.com;
+    license = "unknown";
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/gtmess/default.nix b/pkgs/applications/networking/instant-messengers/gtmess/default.nix
index 68973b4e47f5..64021c93bc83 100644
--- a/pkgs/applications/networking/instant-messengers/gtmess/default.nix
+++ b/pkgs/applications/networking/instant-messengers/gtmess/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Console MSN Messenger client for Linux and other unix systems";
     homepage = http://gtmess.sourceforge.net/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
index c0f76602b2bb..6da12905f560 100644
--- a/pkgs/applications/networking/instant-messengers/hipchat/default.nix
+++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
@@ -1,59 +1,96 @@
-{ stdenv
-, fetchurl
-, libtool
-, libXext
-, libSM
-, libICE
-, libX11
-, libXft
-, libXau
-, libXdmcp
-, libXrender
-, freetype
-, fontconfig
-, openssl
-}:
+{ stdenv, fetchurl, libtool, xlibs, freetype, fontconfig, openssl, glib
+, mesa, gstreamer, gst_plugins_base, dbus, alsaLib, zlib, libuuid
+, libxml2, libxslt, sqlite, libogg, libvorbis, xz, libcanberra
+, makeWrapper, libredirect, xkeyboard_config }:
 
 let
-  version = "1.94.407";
+
+  version = "2.2.1107";
 
   rpath = stdenv.lib.makeSearchPath "lib" [
     stdenv.glibc
-    stdenv.gcc.gcc
     libtool
-    libXext
-    libSM
-    libICE
-    libX11
-    libXft
-    libXau
-    libXdmcp
-    libXrender
+    xlibs.libXext
+    xlibs.libSM
+    xlibs.libICE
+    xlibs.libX11
+    xlibs.libXft
+    xlibs.libXau
+    xlibs.libXdmcp
+    xlibs.libXrender
+    xlibs.libXfixes
+    xlibs.libXcomposite
+    xlibs.libxcb
+    xlibs.libXi
     freetype
     fontconfig
     openssl
-  ];
+    glib
+    mesa
+    gstreamer
+    gst_plugins_base
+    dbus
+    alsaLib
+    zlib
+    libuuid
+    libxml2
+    libxslt
+    sqlite
+    libogg
+    libvorbis
+    xz
+    libcanberra
+  ] + ":${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}";
 
-  src = fetchurl {
-    url = "http://downloads.hipchat.com/linux/arch/hipchat-${version}-i686.pkg.tar.xz";
-    sha256 = "0kyjpa2ir066zqkvs1zmnx6kvl8v4jfl8h7bw110cgigwmiplk7k";
-  };
-in stdenv.mkDerivation {
+  src =
+    if stdenv.system == "x86_64-linux" then
+      fetchurl {
+        url = "http://downloads.hipchat.com/linux/arch/x86_64/hipchat-${version}-x86_64.pkg.tar.xz";
+        sha256 = "0lf780pxbh40m2i48cki072lrm75924cz3zgkmaxddmar3y13bwa";
+      }
+    else if stdenv.system == "i686-linux" then
+      fetchurl {
+        url = "http://downloads.hipchat.com/linux/arch/i686/hipchat-${version}-i686.pkg.tar.xz";
+        sha256 = "1k33670rpigdpy9jcacryc1i05ykp5yffcplmbm5q29ng54cn0zv";
+      }
+    else
+      throw "HipChat is not supported on ${stdenv.system}";
+
+in
+
+stdenv.mkDerivation {
   name = "hipchat-${version}";
 
+  inherit src;
+
+  buildInputs = [ makeWrapper ];
+
   buildCommand = ''
     tar xf ${src}
-    mkdir -p $out
-    mv opt/HipChat/lib $out
-    mv opt/HipChat/bin $out
+
+    mkdir -p $out/libexec/hipchat/bin
+    d=$out/libexec/hipchat/lib
+    rm -rfv opt/HipChat/lib/{libstdc++*,libz*,libuuid*,libxml2*,libxslt*,libsqlite*,libogg*,libvorbis*,liblzma*,libcanberra.*,libcanberra-*}
+    mv opt/HipChat/lib/ $d
     mv usr/share $out
+
     patchShebangs $out/bin
-    for file in $(find $out/lib -type f); do
-        patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 $file || true
-        patchelf --set-rpath ${rpath}:$out/lib $file || true
+
+    for file in $(find $d -type f); do
+        patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $file || true
+        patchelf --set-rpath ${rpath}:\$ORIGIN $file || true
     done
+
     substituteInPlace $out/share/applications/hipchat.desktop \
       --replace /opt/HipChat/bin $out/bin
+
+    makeWrapper $d/hipchat.bin $out/bin/hipchat \
+      --set HIPCHAT_LD_LIBRARY_PATH '"$LD_LIBRARY_PATH"' \
+      --set HIPCHAT_QT_PLUGIN_PATH '"$QT_PLUGIN_PATH"' \
+      --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
+      --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb
+
+    mv opt/HipChat/bin/linuxbrowserlaunch $out/libexec/hipchat/bin/
   '';
 
   meta = {
diff --git a/pkgs/applications/networking/instant-messengers/jitsi/default.nix b/pkgs/applications/networking/instant-messengers/jitsi/default.nix
new file mode 100644
index 000000000000..e6dd6569a55f
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/jitsi/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, makeDesktopItem, unzip, ant, jdk }:
+
+stdenv.mkDerivation rec {
+
+  name = "jitsi-${version}";
+  version = "2.4.4997";
+
+  src = fetchurl {
+    url = "https://download.jitsi.org/jitsi/src/jitsi-src-${version}.zip";
+    sha256 = "f1c2688d7d6bf1916fed3b8b105a785662980c5b297dcab3c9e7d272647ef825";
+  };
+
+  patches = [ ./jitsi.patch ];
+
+  jitsiItem = makeDesktopItem {
+    name = "Jitsi";
+    exec = "jitsi";
+    comment = "VoIP and Instant Messaging client";
+    desktopName = "Jitsi";
+    genericName = "Instant Messaging";
+    categories = "Application;Internet;";
+  };
+
+  buildInputs = [unzip ant jdk];
+
+  buildPhase = ''ant make'';
+
+  installPhase = ''
+    mkdir -p $out
+    cp -a lib $out/
+    cp -a sc-bundles $out/
+    mkdir $out/bin
+    cp resources/install/generic/run.sh $out/bin/jitsi
+    chmod +x $out/bin/jitsi
+    sed -i 's| java | ${jdk}/bin/java |' $out/bin/jitsi
+    patchShebangs $out
+  '';
+
+  meta = {
+    homepage = https://jitsi.org/;
+    description = "Open Source Video Calls and Chat";
+    license = stdenv.lib.licenses.lgpl21Plus.shortName;
+    platforms = stdenv.lib.platforms.linux;
+  };
+
+}
diff --git a/pkgs/applications/networking/instant-messengers/jitsi/jitsi.patch b/pkgs/applications/networking/instant-messengers/jitsi/jitsi.patch
new file mode 100644
index 000000000000..9163cecd175b
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/jitsi/jitsi.patch
@@ -0,0 +1,27 @@
+--- /home/dario/Downloads/jitsi/resources/install/generic/run.sh	2013-11-01 15:37:21.000000000 +0000
++++ jitsi/resources/install/generic/run.sh	2014-03-04 11:52:30.796397567 +0000
+@@ -1,4 +1,9 @@
+-mkdir -p $HOME/.sip-communicator/log
++#! /bin/bash
++# A modified version of the generic run.sh
++
++#mkdir -p $HOME/.sip-communicator/log
++
++cd "$( dirname "$( dirname "${BASH_SOURCE[0]}" )" )"
+ 
+ # Get architecture
+ ARCH=`uname -m | sed -e s/x86_64/64/ -e s/i.86/32/`
+@@ -6,10 +11,12 @@
+ # Additionnal JVM arguments
+ CLIENTARGS=""
+ 
++NATIVELIBS="lib/native/linux-64"
+ if [ $ARCH -eq 32 ]
+ then
+     CLIENTARGS="-client -Xmx256m"
++    NATIVELIBS="lib/native/linux"
+ fi
+ 
+ export PATH=$PATH:native
+-java $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
++exec java $CLIENTARGS -classpath "lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar:lib/" -Djava.library.path=$NATIVELIBS -Dfelix.config.properties=file:lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
diff --git a/pkgs/applications/networking/instant-messengers/kadu/cmake.patch b/pkgs/applications/networking/instant-messengers/kadu/cmake.patch
new file mode 100644
index 000000000000..bb2d2d39d25a
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/kadu/cmake.patch
@@ -0,0 +1,13 @@
+diff -ru kadu-0.12.2.orig/plugins/jabber_protocol/3rdparty/CMakeLists.txt kadu-0.12.2/plugins/jabber_protocol/3rdparty/CMakeLists.txt
+--- kadu-0.12.2.orig/plugins/jabber_protocol/3rdparty/CMakeLists.txt	2012-08-30 16:13:17.000000000 +0200
++++ kadu-0.12.2/plugins/jabber_protocol/3rdparty/CMakeLists.txt	2014-02-15 10:20:33.368716013 +0100
+@@ -26,7 +26,7 @@
+ 					get_filename_component (_basename ${_current_MOC} NAME_WE)
+ 					set (_header ${_abs_FILE})
+ 					set (_moc ${_abs_PATH}/${_current_MOC})
+-					QT4_CREATE_MOC_COMMAND (${_header} ${_moc} "${_moc_INCS}" "")
++					QT4_CREATE_MOC_COMMAND (${_header} ${_moc} "${_moc_INCS}" "" "")
+ 					MACRO_ADD_FILE_DEPENDENCIES (${_abs_FILE} ${_moc})
+ 				endforeach (_current_MOC_INC)
+ 			endif (_match)
+Only in kadu-0.12.2/plugins/jabber_protocol/3rdparty: CMakeLists.txt~
diff --git a/pkgs/applications/networking/instant-messengers/kadu/default.nix b/pkgs/applications/networking/instant-messengers/kadu/default.nix
index 03cbb1ce0737..a74460c3e39b 100644
--- a/pkgs/applications/networking/instant-messengers/kadu/default.nix
+++ b/pkgs/applications/networking/instant-messengers/kadu/default.nix
@@ -15,6 +15,10 @@ stdenv.mkDerivation {
 
   configureFlags = "CPPFLAGS=-DQT_NO_DEBUG";
 
+  preConfigure = ''
+    export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${phonon}/lib64/pkgconfig:${phonon}/lib32/pkgconfig"
+  '';
+
   cmakeFlags = "-DENABLE_AUTODOWNLOAD=OFF -DBUILD_DESCRIPTION='NixOS' -DCMAKE_BUILD_TYPE=Release";
 
   prePatch = ''
@@ -26,6 +30,7 @@ stdenv.mkDerivation {
     sed -i -e '/mpd_mediaplayer/d' \
            -e '/encryption_ng/d'   \
            -e '/encryption_ng_simlite/d' Plugins.cmake
+    patch -p1 < ${./cmake.patch}
   '';
 
   NIX_LDFLAGS="-lX11";
@@ -33,7 +38,7 @@ stdenv.mkDerivation {
   meta = {
     description = "An instant-messenger client for the gadu-gadu network (most popular polish IM network)";
     homepage = http://www.kadu.net/w/English:Main_Page;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.piotr ];
   };
diff --git a/pkgs/applications/networking/instant-messengers/linphone/default.nix b/pkgs/applications/networking/instant-messengers/linphone/default.nix
index c3af0ad0e340..be12c7e8e2ae 100644
--- a/pkgs/applications/networking/instant-messengers/linphone/default.nix
+++ b/pkgs/applications/networking/instant-messengers/linphone/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.linphone.org/;
     description = "Open Source video SIP softphone";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = stdenv.lib.platforms.gnu;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix
index 2e1b745790a4..a63468a9ee7e 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, pidgin} :
 
 stdenv.mkDerivation {
-  name = "pidgin-msn-pecan-0.1.0";
+  name = "pidgin-msn-pecan-0.1.4";
   src = fetchurl {
-    url = http://msn-pecan.googlecode.com/files/msn-pecan-0.1.0.tar.bz2;
-    sha256 = "06cgkdlv2brv2g5hpx8g8p6j296cnvd29l8fap30i1k0mznbjxf4";
+    url = http://msn-pecan.googlecode.com/files/msn-pecan-0.1.4.tar.bz2;
+    sha256 = "0d43z2ay9is1r2kkc9my8pz0fwdyzv7k19vdmbird18lg7rlbjd2";
   };
 
   meta = {
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix
index cf42dd5700ba..7cbc38ea0dc0 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix
@@ -14,6 +14,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.cypherpunks.ca/otr;
     description = "Plugin for Pidgin 2.x which implements OTR Messaging";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix
index 7f7d5abccfda..840416b7d175 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix
@@ -1,8 +1,10 @@
-args : with args; 
+args : with args;
+let version = "1.5.0";
+in
 rec {
   src = fetchurl {
-    url = mirror://sourceforge/pidgin-latex/pidgin-latex-1.2.1.tar.bz2;
-    sha256 = "19h76fwsx5y30l5wda2930k10r385aipngfljz5bdi7b9y52lii7";
+    url = "mirror://sourceforge/pidgin-latex/pidgin-latex_${version}.tar.bz2";
+    sha256 = "9c850aee90d7e59de834f83e09fa6e3e51b123f06e265ead70957608ada95441";
   };
 
   buildInputs = [texLive pkgconfig gtk imagemagick glib pidgin which];
@@ -33,8 +35,8 @@ rec {
 
   /* doConfigure should be specified separately */
   phaseNames = [ "preBuild" "doMakeInstall" "postInstall"];
-      
-  name = "pidgin-latex-1.2.1";
+
+  name = "pidgin-latex-${version}";
   meta = {
     description = "LaTeX rendering plugin for Pidgin IM";
     priority = "10";
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix
index 9c787867e5a1..b387ed350af2 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix
@@ -1,19 +1,20 @@
 { stdenv, fetchurl, pidgin, intltool, libxml2 }:
 
-let version = "1.12.0"; in
+let version = "1.18.1"; in
 
 stdenv.mkDerivation {
   name = "pidgin-sipe-${version}";
-  
+
   src = fetchurl {
     url = "mirror://sourceforge/sipe/pidgin-sipe-${version}.tar.gz";
-    sha256 = "12ki6n360v2ja961fzw4mwpgb8jdp9k21y5mbiab151867c862r6";
+    sha256 = "18ch7jpi7ki7xlpahi88xrnmnhc6dcq4hafm0z6d5nfjfp8ldal5";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "SIPE plugin for Pidgin IM";
     homepage = http://sipe.sourceforge.net/;
-    license = "GPLv2";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
   };
 
   postInstall = "find $out -ls; ln -s \$out/lib/purple-2 \$out/share/pidgin-sipe";
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix
index 544aa06877ad..a83589bf75e0 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   buildPhase  = "make libskype.so libskype_dbus.so";
 
   installPhase = ''
-    ensureDir $out/pixmaps/pidgin/protocols/{16,22,48} $out/bin $out/lib/pidgin
+    mkdir -p $out/pixmaps/pidgin/protocols/{16,22,48} $out/bin $out/lib/pidgin
     cp icons/16/skypeout.png $out/pixmaps/pidgin/protocols/16
     cp icons/22/skypeout.png $out/pixmaps/pidgin/protocols/22
     cp icons/48/skypeout.png $out/pixmaps/pidgin/protocols/48
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = https://github.com/novas0x2a/skype4pidgin;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     description = "Plugin to use a running skype account through pidgin";
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix
index b87db662f45e..348802fe16eb 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix
@@ -24,6 +24,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://tox.dhs.org/;
     description = "Tox plugin for Pidgin / libpurple";
-    license = "GPLv3";
+    license = stdenv.lib.licenses.gpl3;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
index d0652adcb0d6..6e6fd6d0eb6c 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
@@ -21,10 +21,10 @@
 } :
 
 stdenv.mkDerivation rec {
-  name = "pidgin-2.10.7";
+  name = "pidgin-2.10.9";
   src = fetchurl {
     url = "mirror://sourceforge/pidgin/${name}.tar.bz2";
-    sha256 = "14piyx4xpc3l8286x4nh5pna2wfyn9cv0qa29br1q3d2xja2k8zb";
+    sha256 = "06gka47myl9f5x0flkq74ml75akkf28rx9sl8pm3wqkzazc2wdnw";
   };
 
   inherit nss ncurses;
@@ -51,8 +51,11 @@ stdenv.mkDerivation rec {
   configureFlags="--with-nspr-includes=${nspr}/include/nspr --with-nspr-libs=${nspr}/lib --with-nss-includes=${nss}/include/nss --with-nss-libs=${nss}/lib --with-ncurses-headers=${ncurses}/include --disable-meanwhile --disable-nm --disable-tcl"
   + (lib.optionalString (gnutls != null) " --enable-gnutls=yes --enable-nss=no")
   ;
-  meta = {
+  meta = with stdenv.lib; {
     description = "Pidgin IM - XMPP(Jabber), AIM/ICQ, IRC, SIP etc client";
     homepage = http://pidgin.im;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.vcunat ];
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix b/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix
index c35101bb874f..326774dc1fe0 100644
--- a/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix
+++ b/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix
@@ -9,11 +9,12 @@ stdenv.mkDerivation rec {
 
   buildInputs = with pythonPackages; 
     [
-      python twisted urwid beautifulsoup wxPython distribute pygobject
-      wokkel pythonDBus pyfeed wrapPython
+      python twisted urwid beautifulsoup wxPython pygobject
+      wokkel pythonDBus pyfeed wrapPython setuptools
     ];
 
   configurePhase = ''
+    sed -i "/use_setuptools/d" setup.py
     sed -e "s@sys.prefix@'$out'@g" -i setup.py
     sed -e "1aexport PATH=\"\$PATH\":\"$out/bin\":\"${pythonPackages.twisted}/bin\"" -i src/sat.sh
     sed -e "1aexport PYTHONPATH=\"\$PYTHONPATHPATH\":\"$PYTHONPATH\":"$out/lib/${python.libPrefix}/site-packages"" -i src/sat.sh
diff --git a/pkgs/applications/networking/instant-messengers/sflphone/default.nix b/pkgs/applications/networking/instant-messengers/sflphone/default.nix
index 2401d796bfdc..fb14782ef9f6 100644
--- a/pkgs/applications/networking/instant-messengers/sflphone/default.nix
+++ b/pkgs/applications/networking/instant-messengers/sflphone/default.nix
@@ -14,7 +14,7 @@ let
 
   meta = {
     homepage = http://sflphone.org/;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     description = "Free software enterprise-class softphone for GNU/Linux";
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [viric];
@@ -75,8 +75,10 @@ rec {
     '';
 
     # gtk3 programs have the runtime dependency on XDG_DATA_DIRS
-    postInstall = ''
-      wrapProgram $out/bin/sflphone* --prefix XDG_DATA_DIRS ":" ${gtk}/share
+    preFixup = ''
+      for f in "$out/bin/sflphone" "$out/bin/sflphone-client-gnome"; do
+        wrapProgram $f --prefix XDG_DATA_DIRS ":" "${gtk}/share:$GSETTINGS_SCHEMAS_PATH"
+      done
     '';
 
     buildInputs = [ daemon pkgconfig gtk glib dbus_glib libnotify intltool makeWrapper ];
diff --git a/pkgs/applications/networking/instant-messengers/silc-client/default.nix b/pkgs/applications/networking/instant-messengers/silc-client/default.nix
index a4035604168f..4ce098e6ca46 100644
--- a/pkgs/applications/networking/instant-messengers/silc-client/default.nix
+++ b/pkgs/applications/networking/instant-messengers/silc-client/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://silcnet.org/;
     description = "Secure Internet Live Conferencing server";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix b/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix
index 2fa82e1251bc..713aa8f03744 100644
--- a/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix
+++ b/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://atdot.ch/scr/;
     description = "Open source tool to record your Skype calls on Linux";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [viric];
   };
diff --git a/pkgs/applications/networking/instant-messengers/skype/default.nix b/pkgs/applications/networking/instant-messengers/skype/default.nix
index ebd84ff47b89..32755306cc76 100644
--- a/pkgs/applications/networking/instant-messengers/skype/default.nix
+++ b/pkgs/applications/networking/instant-messengers/skype/default.nix
@@ -1,20 +1,18 @@
-{ stdenv, fetchurl, alsaLib, libXv, libXi, libXrender, libXrandr, zlib, glib
+{ stdenv, fetchurl, libXv, libXi, libXrender, libXrandr, zlib, glib
 , libXext, libX11, libXScrnSaver, libSM, qt4, libICE, freetype, fontconfig
-, pulseaudio, usePulseAudio, lib }:
+, pulseaudio, lib, ... }:
 
 assert stdenv.system == "i686-linux";
 
 stdenv.mkDerivation rec {
-  name = "skype-4.2.0.11";
+  name = "skype-4.3.0.37";
 
   src = fetchurl {
     url = "http://download.skype.com/linux/${name}.tar.bz2";
-    sha256 = "0kh66p50m3x4ql6j8ciz73c30npcizd00ya9qrhid711rar0mlw7";
+    sha256 = "0bc9kck99rcsqzxzw3j6vnw5byvr8c9wixrx609zp255g0wxr6cc";
   };
 
-  buildInputs =
-    lib.optional usePulseAudio pulseaudio ++ [
-    alsaLib
+  buildInputs = [
     stdenv.glibc
     stdenv.gcc.gcc
     libXv
@@ -27,6 +25,7 @@ stdenv.mkDerivation rec {
     libXi
     libXrender
     libXrandr
+    pulseaudio
     freetype
     fontconfig
     zlib
@@ -44,13 +43,13 @@ stdenv.mkDerivation rec {
       fullPath=$fullPath''${fullPath:+:}$i/lib
     done
 
-    dynlinker="$(cat $NIX_GCC/nix-support/dynamic-linker)"
+    patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+        --set-rpath "$fullPath" $out/libexec/skype/skype
 
     cat > $out/bin/skype << EOF
     #!${stdenv.shell}
     export PULSE_LATENCY_MSEC=60  # workaround for pulseaudio glitches
-    export LD_LIBRARY_PATH=$fullPath:$LD_LIBRARY_PATH
-    $dynlinker $out/libexec/skype/skype --resources=$out/libexec/skype "\$@"
+    $out/libexec/skype/skype --resources=$out/libexec/skype "\$@"
     EOF
 
     chmod +x $out/bin/skype
@@ -67,6 +66,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A proprietary voice-over-IP (VoIP) client";
     homepage = http://www.skype.com/;
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
index 108e549d01f6..eb052af13690 100644
--- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
+++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
@@ -1,49 +1,73 @@
-{ stdenv, fetchurl, zlib, glib, libpng, freetype, xorg, fontconfig, alsaLib }:
+{ stdenv, fetchurl, zlib, glib, libpng, freetype, xorg, fontconfig, alsaLib, makeWrapper, xlibs
+,  qt5, pulseaudio ? null, qt4, xkeyboard_config, libredirect }:
 
 let
 
+  arch = if stdenv.is64bit then "amd64" else "x86";
+ 
   libDir = if stdenv.is64bit then "lib64" else "lib";
 
   deps =
     [ zlib glib libpng freetype xorg.libSM xorg.libICE xorg.libXrender
-      xorg.libXrandr xorg.libXfixes xorg.libXcursor xorg.libXinerama
-      fontconfig xorg.libXext xorg.libX11 alsaLib
+      xorg.libXrandr xorg.libXfixes xorg.libXcursor xorg.libXinerama xlibs.libxcb
+      fontconfig xorg.libXext xorg.libX11 alsaLib qt5 pulseaudio
     ];
 
 in
 
-stdenv.mkDerivation {
-  name = "teamspeak-client-3.0.0-beta35";
+stdenv.mkDerivation rec {
+  name = "teamspeak-client-${version}";
+
+  version = "3.0.16";
 
   src = fetchurl {
-    url = http://ftp.4players.de/pub/hosted/ts3/releases/beta-35/TeamSpeak3-Client-linux_amd64-3.0.0-beta35.run;
-    sha256 = "0vygsvjs11lr5lv4x7awv7hvkycvmm9qs2vklfjs91w3f434cmrx";
+    urls = [
+      "http://dl.4players.de/ts/releases/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run"
+      "http://teamspeak.gameserver.gamed.de/ts3/releases/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run"
+      "http://files.teamspeak-services.com/releases/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run"
+    ];
+    sha256 = if stdenv.is64bit 
+                then "0gvphrmrkyy1g2nprvdk7cvawznzlv4smw0mlvzd4b9mvynln0v2"
+                else "1b3nbvfpd8lx3dig8z5yk6zjkbmsy6y938dhj1f562wc8adixciz";
   };
 
+  buildInputs = [ makeWrapper ];
+
   unpackPhase =
     ''
-      yes yes | sh $src
+      yes | sh $src
       cd TeamSpeak*
     '';
 
   buildPhase =
     ''
-      ls -l
-      for i in ts3client_linux_*; do
-        echo "patching $i..."
-        patchelf \
-          --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
-          --set-rpath ${stdenv.lib.makeLibraryPath deps}:$(cat $NIX_GCC/nix-support/orig-gcc)/${libDir} \
-          --force-rpath \
-          $i
-      done
+      mv ts3client_linux_${arch} ts3client
+      echo "patching ts3client..."
+      patchelf \
+        --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+        --set-rpath ${stdenv.lib.makeLibraryPath deps}:$(cat $NIX_GCC/nix-support/orig-gcc)/${libDir} \
+        --force-rpath \
+        ts3client
     '';
-    
 
   installPhase =
     ''
+      # Delete unecessary libraries - these are provided by nixos.
+      rm libQt*.so.*
+      rm qt.conf
+
+      # Install files.
       mkdir -p $out/lib/teamspeak
       mv * $out/lib/teamspeak/
+
+      # Make a symlink to the binary from bin.
+      mkdir -p $out/bin/
+      ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client
+
+      wrapProgram $out/bin/ts3client \
+        --set LD_PRELOAD "${libredirect}/lib/libredirect.so:$out/lib/teamspeak/libquazip.so.1" \
+        --set QT_PLUGIN_PATH "$out/lib/teamspeak/platforms" \
+        --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb
     '';
 
   dontStrip = true;
@@ -53,6 +77,7 @@ stdenv.mkDerivation {
     description = "The TeamSpeak voice communication tool";
     homepage = http://teamspeak.com/;
     license = "http://www.teamspeak.com/?page=downloads&type=ts3_linux_client_latest";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
 
diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/server.nix b/pkgs/applications/networking/instant-messengers/teamspeak/server.nix
new file mode 100644
index 000000000000..7a57cb8ad62c
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/teamspeak/server.nix
@@ -0,0 +1,99 @@
+{ stdenv, fetchurl, makeWrapper }:
+
+let
+
+  version = "3.0.10.3";
+
+  arch = if stdenv.is64bit then "amd64" else "x86";
+ 
+  libDir = if stdenv.is64bit then "lib64" else "lib";
+in
+
+stdenv.mkDerivation {
+  name = "teamspeak-server-${version}";
+
+  src = fetchurl {
+    urls = [
+       "http://dl.4players.de/ts/releases/${version}/teamspeak3-server_linux-${arch}-${version}.tar.gz"
+      "http://teamspeak.gameserver.gamed.de/ts3/releases/${version}/teamspeak3-server_linux-${arch}-${version}.tar.gz"
+    ];
+    sha256 = if stdenv.is64bit 
+      then "9606dd5c0c3677881b1aab833cb99f4f12ba08cc77ef4a97e9e282d9e10b0702"
+      else "8b8921e0df04bf74068a51ae06d744f25d759a8c267864ceaf7633eb3f81dbe5";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  buildPhase =
+    ''
+      mv ts3server_linux_${arch} ts3server
+      echo "patching ts3server"
+      patchelf \
+        --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+        --set-rpath $(cat $NIX_GCC/nix-support/orig-gcc)/${libDir} \
+        --force-rpath \
+        ts3server
+    '';
+
+  installPhase =
+    ''
+      # Delete unecessary libraries - these are provided by nixos.
+      #rm *.so*
+
+      # Install files.
+      mkdir -p $out/lib/teamspeak
+      mv * $out/lib/teamspeak/
+
+      # Make a symlink to the binary from bin.
+      mkdir -p $out/bin/
+      ln -s $out/lib/teamspeak/ts3server $out/bin/ts3server
+
+      wrapProgram $out/lib/teamspeak/ts3server --prefix LD_LIBRARY_PATH : $out/lib/teamspeak
+    '';
+
+  dontStrip = true;
+  dontPatchELF = true;
+  
+  meta = { 
+    description = "TeamSpeak voice communication server";
+    homepage = http://teamspeak.com/;
+    license = stdenv.lib.licenses.unfreeRedistributable;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.arobyn ];
+  };
+}
+
+/*
+License issues:
+Date: Mon, 10 Dec 2007 19:55:16 -0500
+From: TeamSpeak Sales <sales@tritoncia.com>
+To: 'Marc Weber' <marco-oweber@gmx.de>
+Subject: RE: teamspeak on nix?
+
+Yes, that would be fine.  As long as you are not renting servers or selling
+TeamSpeak then you are more than welcome to distribute it.
+
+Thank you,
+
+TeamSpeak Sales Team
+________________________________
+e-Mail: sales@tritoncia.com
+TeamSpeak: http://www.TeamSpeak.com
+Account Login: https://sales.TritonCIA.com/users
+
+
+
+-----Original Message-----
+From: Marc Weber [mailto:marco-oweber@gmx.de]
+Sent: Monday, December 10, 2007 5:03 PM
+To: sales@tritoncia.com
+Subject: teamspeak on nix?
+
+Hello,
+
+nix is very young software distribution system (http://nix.cs.uu.nl/)
+I'd like to ask wether you permit us to add teamspeak (server/ client?)
+
+Sincerly
+Marc Weber (small nix contributor)
+*/
diff --git a/pkgs/applications/networking/instant-messengers/telegram-cli/default.nix b/pkgs/applications/networking/instant-messengers/telegram-cli/default.nix
new file mode 100644
index 000000000000..b0302ba8e0bf
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/telegram-cli/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchgit, libconfig, lua5_2, openssl, readline, zlib
+}:
+
+stdenv.mkDerivation rec {
+  name = "telegram-cli";
+
+  src = fetchgit {
+    url = "https://github.com/vysheng/tg.git";
+    rev = "ac6079a00ac66bb37a3179a82af130b41ec39bc9";
+    sha256 = "1rpwnyzmqk7p97n5pd00m5c6rypc39mb3hs94qxxrdcpwpgcb73q";
+  };
+
+  buildInputs = [ libconfig lua5_2 openssl readline zlib ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ./telegram $out/bin/telegram-wo-key
+    cp ./tg.pub $out/
+    cat > $out/bin/telegram <<EOF
+    #!/usr/bin/env bash
+    $out/bin/telegram-wo-key -k $out/tg.pub
+    EOF
+    chmod +x $out/bin/telegram
+  '';
+
+  meta = {
+    description = "Command-line interface for Telegram messenger";
+    homepage = https://telegram.org/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
index 8863af259842..e8e76c10ea5e 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
@@ -1,20 +1,26 @@
-{ stdenv, fetchurl, pkgconfig, libxslt, telepathy_glib, libxml2, dbus_glib
+{ stdenv, fetchurl, pkgconfig, libxslt, telepathy_glib, libxml2, dbus_glib, dbus_daemon
 , sqlite, libsoup, libnice, gnutls }:
 
 stdenv.mkDerivation rec {
-  name = "telepathy-gabble-0.17.2";
+  name = "telepathy-gabble-0.18.2";
 
   src = fetchurl {
     url = "${meta.homepage}/releases/telepathy-gabble/${name}.tar.gz";
-    sha256 = "137sslbgh0326lmwihcr2ybljgq9mzsx5wnciilpx884si22wpk8";
+    sha256 = "00ag32ccbj0hmy41rb0fg9gp40m7zbq45r4yijnyslk2mpkvg7c9";
   };
 
-  nativeBuildInputs = [pkgconfig libxslt];
-  buildInputs = [ libxml2 dbus_glib sqlite libsoup libnice telepathy_glib gnutls ];
+  nativeBuildInputs = [ pkgconfig libxslt ];
+  buildInputs = [ libxml2 dbus_glib sqlite libsoup libnice telepathy_glib gnutls ]
+    ++ stdenv.lib.optional doCheck dbus_daemon;
 
-  configureFlags = "--with-ca-certificates=/etc/ca-bundle.crt";
+  configureFlags = "--with-ca-certificates=/etc/ssl/certs/ca-bundle.crt";
 
-  meta = {
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  meta = with stdenv.lib; {
     homepage = http://telepathy.freedesktop.org;
+    description = "Jabber/XMPP connection manager for the Telepathy framework";
+    platforms = stdenv.lib.platforms.gnu;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
index b2fd13837d79..ffc29a52aa1f 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "telepathy-haze";
-  name = "${pname}-0.7.0";
+  name = "${pname}-0.8.0";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
-    sha256 = "1gaj8518ilm3gnzqf3lmiqgnwkay8wfbsqngcz15whzji8sl608b";
+    sha256 = "1jgrp32p6rllj089ynbsk3n9xrvsvzmwzhf0ql05kkgj0nf08xiy";
   };
 
   buildInputs = [ glib telepathy_glib dbus_glib pidgin ];
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
index 527642348d25..173dfe9c929f 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, dbus_glib, libxml2, sqlite, telepathy_glib, pkgconfig
-, intltool, libxslt }:
+, intltool, libxslt, gobjectIntrospection, dbus_libs }:
 
 stdenv.mkDerivation rec {
   project = "telepathy-logger";
@@ -10,7 +10,10 @@ stdenv.mkDerivation rec {
     sha256 = "18i00l8lnp5dghqmgmpxnn0is2a20pkisxy0sb78hnd2dz0z6xnl";
   };
 
-  buildInputs = [ dbus_glib libxml2 sqlite telepathy_glib pkgconfig intltool ];
+  NIX_CFLAGS_COMPILE = "-I${dbus_glib}/include/dbus-1.0 -I${dbus_libs}/include/dbus-1.0";
+
+  buildInputs = [ dbus_glib libxml2 sqlite telepathy_glib pkgconfig intltool
+                  gobjectIntrospection dbus_libs ];
 
   nativeBuildInputs = [ libxslt ];
 
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
index 56abf34e1b39..b463ff2f2307 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
@@ -1,15 +1,29 @@
-{ stdenv, fetchurl, pkgconfig, telepathy_glib, libxslt }:
+{ stdenv, fetchurl, pkgconfig, telepathy_glib, libxslt, makeWrapper, upower }:
 
 stdenv.mkDerivation rec {
-  name = "${pname}-5.14.0";
+  name = "${pname}-5.16.2";
   pname = "telepathy-mission-control";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
-    sha256 = "0c4asjgk7pk39i8njf0q1df0mhisif83lq716ln6r0wja9zh9q2q";
+    sha256 = "1sk8f9jfaxgbsniz0n5hmrcwvxla3x8axjcnjbppg7nidk9gijrx";
   };
 
-  buildInputs = [ telepathy_glib ];
+  buildInputs = [ telepathy_glib makeWrapper upower ]; # ToDo: optional stuff missing
 
   nativeBuildInputs = [ pkgconfig libxslt ];
+
+  doCheck = true;
+
+  preFixup = ''
+    wrapProgram "$out/libexec/mission-control-5" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An account manager and channel dispatcher for the Telepathy framework";
+    homepage = http://telepathy.freedesktop.org/wiki/;
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+  };
 }
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
index a60e207b7527..538a8d7f6d2b 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "telepathy-rakia";
-  name = "${pname}-0.7.4";
+  name = "${pname}-0.8.0";
 
   src = fetchurl {
     url = "${meta.homepage}/releases/${pname}/${name}.tar.gz";
-    sha256 = "11cmmdq31kivm6nsv61hxy3hxnnmbd8sj55xqwx9hyqzybh70dyf";
+    sha256 = "18dxffa8hhjyvqkhhac05rrkx81vnncjrakg5ygikfp0j79vrbhv";
   };
 
   nativeBuildInputs = [pkgconfigUpstream libxslt python];
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
index 4300ac15c998..b1341af7a9d9 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "telepathy-salut";
-  name = "${pname}-0.8.0";
+  name = "${pname}-0.8.1";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
-    sha256 = "1kmmpwjbfph37bjvpkfphff8dzhr896i55knf311f778fbsgl17m";
+    sha256 = "13k112vrr3zghzr03pnbqc1id65qvpj0sn0virlbf4dmr2511fbh";
   };
 
   buildInputs = [ glib libxml2 telepathy_glib avahi libsoup libuuid gnutls
diff --git a/pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix b/pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix
deleted file mode 100644
index b46133e433e6..000000000000
--- a/pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation rec {
-  name = "tkabber-plugins-${version}";
-  version = "0.11.1";
-
-  src = fetchurl {
-    url = "http://files.jabber.ru/tkabber/tkabber-plugins-${version}.tar.gz";
-    sha256 = "0jxriqvsckbih5a4lpisxy6wjw022wsz5j5n171gz0q3xw19dbgz";
-  };
-
-  configurePhase = ''
-    sed -e "s@/usr/local@$out@" -i Makefile
-  '';
-
-  meta = {
-    homepage = "http://tkabber.jabber.ru/tkabber-plugins";
-    description = "Plugins for the Tkabber instant messenger";
-    license = stdenv.lib.licenses.gpl2;
-  };
-}
diff --git a/pkgs/applications/networking/instant-messengers/tkabber/default.nix b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
index fd989739c941..8b6b3893311e 100644
--- a/pkgs/applications/networking/instant-messengers/tkabber/default.nix
+++ b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
@@ -1,7 +1,24 @@
 { stdenv, fetchurl, tcl, tk, tcllib, tcltls, tclgpg
-, bwidget, makeWrapper, x11 }:
+, bwidget, makeWrapper, x11
+, withSitePlugins ? true
+, theme ? null
+}:
+
+with stdenv.lib;
 
 let
+  version = "1.0";
+
+  main = {
+    name = "tkabber";
+    sha256 = "49ee6e897dfe52ebac256531b54955e6b39223f606a9b8ad63a52475389db206";
+  };
+
+  plugins = {
+    name = "tkabber-plugins";
+    sha256 = "d61251dc664f0bfa8534e578096dede9a7bb7d4f2620489f8d2c43d36cd61ba9";
+  };
+
   tclLibraries = [ bwidget tcllib tcltls tclgpg ];
 
   getTclLibPath = p: "${p}/lib/${p.libPrefix}";
@@ -9,43 +26,47 @@ let
   tclLibPaths = stdenv.lib.concatStringsSep " "
     (map getTclLibPath tclLibraries);
 
-in stdenv.mkDerivation rec {
-  name = "tkabber-0.11.1";
+  mkTkabber = attrs: stdenv.mkDerivation (rec {
+    name = "${attrs.name}-${version}";
 
-  src = fetchurl {
-    url = "http://files.jabber.ru/tkabber/tkabber-0.11.1.tar.gz";
-    sha256 = "19xv555cm7a2gczdalf9srxm39hmsh0fbidhwxa74a89nqkbf4lv";
-  };
+    src = fetchurl {
+      url = "http://files.jabber.ru/tkabber/${name}.tar.xz";
+      inherit (attrs) sha256;
+    };
 
-  defaultTheme = "ocean-deep";
+    prePatch = ''
+      sed -e "s@/usr/local@$out@" -i Makefile
+    '';
+  } // removeAttrs attrs [ "name" "sha256" ]);
 
-  patchPhase = ''
+in mkTkabber (main // {
+  postPatch = ''
     substituteInPlace login.tcl --replace \
       "custom::defvar loginconf(sslcacertstore) \"\"" \
       "custom::defvar loginconf(sslcacertstore) \$env(OPENSSL_X509_CERT_FILE)"
-
+  '' + optionalString (theme != null) ''
+    themePath="$out/share/doc/tkabber/examples/xrdb/${theme}.xrdb"
     sed -i '/^if.*load_default_xrdb/,/^}$/ {
-        s@option readfile \(\[fullpath [^]]*\]\)@option readfile "'"$out/share/doc/tkabber/examples/xrdb/${defaultTheme}.xrdb"'"@
+      s@option readfile \(\[fullpath [^]]*\]\)@option readfile "'"$themePath"'"@
     }' tkabber.tcl
   '';
 
-  configurePhase = ''
-    mkdir -p $out/bin
-    sed -e "s@/usr/local@$out@" -i Makefile
-  '';
-
   postInstall = ''
-    wrapProgram $out/bin/tkabber \
-      --prefix PATH : "${tk}/bin" \
-      --set TCLLIBPATH '"${tclLibPaths}"' \
-      --set TKABBER_SITE_PLUGINS '$HOME/.nix-profile/share/tkabber-plugins'
+    for prog in $out/bin/*; do
+      wrapProgram "$prog" \
+        --prefix PATH : "${tk}/bin" \
+        --set TCLLIBPATH '"${tclLibPaths}"' \
+        ${optionalString withSitePlugins ''
+        --set TKABBER_SITE_PLUGINS '${mkTkabber plugins}/share/tkabber-plugins'
+        ''}
+    done
   '';
 
   buildInputs = [ tcl tk x11 makeWrapper ] ++ tclLibraries;
 
   meta = {
     homepage = "http://tkabber.jabber.ru/";
-    description = "A GUI client for the XMPP (Jabber) instant messaging protocol";
+    description = "A GUI XMPP (Jabber) client written in Tcl/Tk";
     license = stdenv.lib.licenses.gpl2;
   };
-}
+})
diff --git a/pkgs/applications/networking/instant-messengers/toxic/default.nix b/pkgs/applications/networking/instant-messengers/toxic/default.nix
index c2af1274a24c..b3e1ff74cfa5 100644
--- a/pkgs/applications/networking/instant-messengers/toxic/default.nix
+++ b/pkgs/applications/networking/instant-messengers/toxic/default.nix
@@ -1,9 +1,9 @@
 { stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses
-, libtoxcore, pkgconfig }:
+, libtoxcore, openal, libvpx, freealut, libconfig, pkgconfig }:
 
 let
-  version = "75d356e52a";
-  date = "20131011";
+  version = "7566aa9d26";
+  date = "20140728";
 in
 stdenv.mkDerivation rec {
   name = "toxic-${date}-${version}";
@@ -11,29 +11,20 @@ stdenv.mkDerivation rec {
   src = fetchurl {
     url = "https://github.com/Tox/toxic/tarball/${version}";
     name = "${name}.tar.gz";
-    sha256 = "14wyvms8l07sl88g8y6g2jv95sq7cnhbaqf4n32xxilch8rymq47";
+    sha256 = "13vns0qc0hxhab6rpz0irnzgv42mp3v1nrbwm90iymhf4xkc9nwa";
   };
 
-  preConfigure = ''
-    autoreconf -i
-  '';
+  makeFlags = [ "-Cbuild" "VERSION=${version}" ];
+  installFlags = [ "PREFIX=$(out)" ];
 
-  NIX_LDFLAGS = "-lsodium";
-
-  configureFlags = [
-    "--with-libtoxcore-headers=${libtoxcore}/include"
-    "--with-libtoxcore-libs=${libtoxcore}/lib" 
-    "--with-libsodium-headers=${libtoxcore}/include"
-    "--with-libsodium-libs=${libtoxcore}/lib" 
+  buildInputs = [
+    autoconf libtool automake libtoxcore libsodium ncurses openal libvpx
+    freealut libconfig pkgconfig
   ];
 
-  buildInputs = [ autoconf libtool automake libtoxcore libsodium ncurses pkgconfig ];
-
-  doCheck = true;
-
   meta = {
     description = "Reference CLI for Tox";
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = with stdenv.lib.maintainers; [ viric ];
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch b/pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch
new file mode 100644
index 000000000000..3d4c46b2431d
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/boost_regex.patch
@@ -0,0 +1,17 @@
+Index: twinkle-1.4.2/configure.in
+===================================================================
+--- twinkle-1.4.2.orig/configure.in	2013-07-25 11:07:54.160534950 -0400
++++ twinkle-1.4.2/configure.in	2013-07-25 11:07:59.000000000 -0400
+@@ -294,7 +294,11 @@
+ 	AC_CHECK_LIB(boost_regex-gcc, main, [
+ 		LIBS="-lboost_regex-gcc $LIBS"
+ 		echo "LIBS += -lboost_regex-gcc" >> $QT_INCL_PRO],
+-		[AC_MSG_ERROR([libboost_regex library is missing (boost package).])])])
++		[
++		AC_CHECK_LIB(boost_regex, main, [
++			LIBS="-lboost_regex $LIBS"
++			echo "LIBS += -lboost_regex" >> $QT_INCL_PRO],
++			[AC_MSG_ERROR([libboost_regex library is missing (boost package).])])])])
+ 
+ ms_CHECK_LRELEASE()
+ 	
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/default.nix b/pkgs/applications/networking/instant-messengers/twinkle/default.nix
index 0824210c4b56..2e6b904c134e 100644
--- a/pkgs/applications/networking/instant-messengers/twinkle/default.nix
+++ b/pkgs/applications/networking/instant-messengers/twinkle/default.nix
@@ -1,29 +1,40 @@
-{ stdenv, fetchurl, pkgconfig, commoncpp2, ccrtp, openssl, boost
+{ stdenv, fetchurl, pkgconfig, autoreconfHook, commoncpp2, ccrtp, openssl, boost
 , libsndfile, libxml2, libjpeg, readline, qt3, perl, file
 , alsaLib, speex, libzrtpcpp, xorg }:
-        
-stdenv.mkDerivation {
+
+stdenv.mkDerivation rec {
   name = "twinkle-1.4.2";
 
   src = fetchurl {
-    url = http://www.xs4all.nl/~mfnboer/twinkle/download/twinkle-1.4.2.tar.gz;
+    url = "http://www.xs4all.nl/~mfnboer/twinkle/download/${name}.tar.gz";
     sha256 = "19c9gqam78srsgv0463g7lfnv4mn5lvbxx3zl87bnm0vmk3qcxl0";
   };
 
+  patches = [ # all from Debian
+    ./newer-libccrtp.diff
+    ./libgsm.patch
+    ./localetime_r_conflict.diff
+    ./boost_regex.patch # modified not to use "-mt" suffix
+  ];
+
   configureFlags = "--with-extra-includes=${libjpeg}/include";
 
   buildInputs =
-    [ pkgconfig commoncpp2 ccrtp openssl boost libsndfile
+    [ pkgconfig autoreconfHook commoncpp2 openssl boost libsndfile
       libxml2 libjpeg readline qt3 perl file
       # optional ? :
-      alsaLib
-      speex libzrtpcpp xorg.libX11 xorg.libXaw xorg.libICE xorg.libXext
+      alsaLib speex
+      libzrtpcpp xorg.libX11 xorg.libXaw xorg.libICE xorg.libXext
     ];
 
-  meta = { 
-    homepage = http://www.xs4all.nl/~mfnboer/twinkle/index.html;
-    license = "GPL";
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+  NIX_CFLAGS_LINK = "-Wl,--as-needed -lboost_regex -lasound -lzrtpcpp -lspeex -lspeexdsp";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.twinklephone.com/;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.marcweber ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch b/pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch
new file mode 100644
index 000000000000..1574273feb53
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/libgsm.patch
@@ -0,0 +1,70 @@
+Index: twinkle-1.4.2/configure.in
+===================================================================
+--- twinkle-1.4.2.orig/configure.in	2013-07-25 11:07:54.264533206 -0400
++++ twinkle-1.4.2/configure.in	2013-07-25 11:07:54.256533340 -0400
+@@ -195,22 +195,33 @@
+ 
+ # This check does not work on all platforms
+ # Check if libgsm is available
+-# AC_CHECK_LIB(gsm, sf_open, [
+-#	AC_CHECK_HEADER(gsm.h, [],
+-#		[AC_MSG_ERROR([gsm header files missing (gsm.h)])])
+-#	AC_DEFINE(HAVE_GSM, 1, [Define to 1 if you have the <libgsm> library.])
+-#	GSM_LIBS="-lgsm"
+-#	echo "LIBS += -lgsm" >> $QT_INCL_PRO
+-#	have_gsm="yes" ], [
+-#	have_gsm="no"
+-#	GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
+-#	echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO ])
+-have_gsm="no"
+-GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
+-echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO
++AC_CHECK_LIB(gsm, sf_open, [
++	AC_CHECK_HEADER(gsm.h, [],
++		[AC_MSG_ERROR([gsm header files missing (gsm.h)])])
++	AC_DEFINE(HAVE_GSM, 1, [Define to 1 if you have the <libgsm> library.])
++	GSM_LIBS="-lgsm"
++	echo "LIBS += -lgsm" >> $QT_INCL_PRO
++	have_gsm="yes" ], [
++	have_gsm="no"
++	GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
++	echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO ])
++#have_gsm="no"
++#GSM_LIBS="\$(top_builddir)/src/audio/gsm/libgsm.a"
++#echo "LIBS += ../audio/gsm/libgsm.a" >> $QT_INCL_PRO
+ 
+ AC_SUBST(GSM_LIBS)
+ 
++# Check if libgsm is available
++AC_CHECK_LIB(gsm, sf_open, [
++	AC_CHECK_HEADER(gsm.h, [],
++		[AC_MSG_ERROR([gsm header files missing (gsm.h)])])
++	AC_DEFINE(HAVE_GSM, 1, [Define to 1 if you have the <libgsm> library.])
++	LIBS="-lgsm $LIBS"
++	echo "LIBS += -lgsm" >> $QT_INCL_PRO
++	have_gsm="yes" ], [
++	have_gsm="no"
++	echo "$(top_builddir)/src/audio/gsm/libgsm.a" >> $QT_INCL_PRO ])
++
+ # Check if ALSA is available
+ AC_CHECK_LIB(asound, main, [
+ 	AC_CHECK_HEADER(alsa/asoundlib.h, [],
+@@ -348,3 +359,4 @@
+ AC_MSG_RESULT([Speex:       $have_speex])
+ AC_MSG_RESULT([iLBC:        $have_ilbc])
+ AC_MSG_RESULT([ZRTP:        $have_zrtp])
++AC_MSG_RESULT([Libgsm dynamic link:	$have_gsm])
+Index: twinkle-1.4.2/src/twinkle_config.h.in
+===================================================================
+--- twinkle-1.4.2.orig/src/twinkle_config.h.in	2013-07-25 11:07:54.264533206 -0400
++++ twinkle-1.4.2/src/twinkle_config.h.in	2013-07-25 11:07:54.256533340 -0400
+@@ -19,6 +19,9 @@
+ /* Define to 1 if you have the <history.h> header file. */
+ #undef HAVE_HISTORY_H
+ 
++/* Define to 1 if you have the <libgsm> library. */
++#undef HAVE_GSM
++
+ /* Define to 1 if you have the <ilbc> library. */
+ #undef HAVE_ILBC
+ 
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff b/pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff
new file mode 100644
index 000000000000..3fbc2eb0cb1e
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/localetime_r_conflict.diff
@@ -0,0 +1,13 @@
+Index: twinkle-1.4.2/src/log.cpp
+===================================================================
+--- twinkle-1.4.2.orig/src/log.cpp	2009-01-18 09:35:28.000000000 -0500
++++ twinkle-1.4.2/src/log.cpp	2013-07-25 11:43:08.901209713 -0400
+@@ -161,7 +161,7 @@
+ 
+ 	gettimeofday(&t, NULL);
+ 	date = t.tv_sec;
+-	localtime_r(&date, &tm);
++	ost::localtime_r(&date, &tm);
+ 
+ 	*log_stream << "+++ ";
+ 	*log_stream << tm.tm_mday;
diff --git a/pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff b/pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff
new file mode 100644
index 000000000000..9d07b3dbd6ae
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/twinkle/newer-libccrtp.diff
@@ -0,0 +1,22 @@
+Index: twinkle-1.4.2/configure.in
+===================================================================
+--- twinkle-1.4.2.orig/configure.in	2013-07-25 11:09:16.000000000 -0400
++++ twinkle-1.4.2/configure.in	2013-07-25 11:11:59.512418187 -0400
+@@ -66,7 +66,7 @@
+ 
+ export PKG_CONFIG_PATH
+ 
+-PKG_CHECK_MODULES(CCRTP, libccrtp1 >= 1.6.0)
++PKG_CHECK_MODULES(CCRTP, libccrtp >= 1.6.0)
+ 
+ PKG_CHECK_MODULES(XML2, libxml-2.0)
+ # AC_CHECK_HEADER(libxml/tree.h, [],
+@@ -136,7 +136,7 @@
+ #echo "INCLUDEPATH += `$CCGNU2_CONFIG --includes`" | sed -e s/-I//g > $QT_INCL_PRO
+ # libccrtp1(ccrtp) depend from libccgnu2(commoncpp2) and
+ # should include above flags !
+-echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libccrtp1`" | sed -e s/-I//g >> $QT_INCL_PRO
++echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libccrtp`" | sed -e s/-I//g >> $QT_INCL_PRO
+ echo "INCLUDEPATH += `$PKG_CONFIG --cflags-only-I libxml-2.0`" | sed -e s/-I//g >> $QT_INCL_PRO
+ 
+ # get libraries specified on command line
diff --git a/pkgs/applications/networking/instant-messengers/utox/default.nix b/pkgs/applications/networking/instant-messengers/utox/default.nix
new file mode 100644
index 000000000000..823df5c27a28
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/utox/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, pkgconfig, libtoxcore, dbus, libvpx, libX11, openal, freetype, libv4l
+, libXrender, fontconfig, libXext, libXft }:
+
+
+stdenv.mkDerivation rec {
+  name = "utox-dev";
+
+  src = fetchFromGitHub {
+    owner = "notsecure";
+    repo = "uTox";
+    rev = "d70f9bfb4ff8a156ec35803da6226b0ac8c47961";
+    sha256 = "10cvsg0phv0jsrdl3zkk339c4bzn3xc82q1x90h6gcnrbg4vzmp0";
+  };
+
+  buildInputs = [ pkgconfig libtoxcore dbus libvpx libX11 openal freetype
+                  libv4l libXrender fontconfig libXext libXft ];
+
+  doCheck = false;
+  
+  makeFlags = "DESTDIR=$(out)";
+
+  meta = with stdenv.lib; {
+    description = "Lightweight Tox client";
+    license = licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ iElectric ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/vacuum/default.nix b/pkgs/applications/networking/instant-messengers/vacuum/default.nix
index 63f18ee7dc4c..ad8b677a2ec5 100644
--- a/pkgs/applications/networking/instant-messengers/vacuum/default.nix
+++ b/pkgs/applications/networking/instant-messengers/vacuum/default.nix
@@ -12,11 +12,11 @@ let
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
-    version="1.2.0";
+    version="1.2.3";
     baseName="vacuum-im";
     name="${baseName}-${version}";
     url="http://vacuum-im.googlecode.com/files/vacuum-${version}.tar.xz";
-    hash="55a2c27aaaf79c7a4de127c22d3845ede35970283d35ee57fd5ceca581b085fc";
+    hash="037k2b2kkp2ywkrshqa0fj18mkd2jq60x4x62kzbrsvb85qcbbxh";
   };
 in
 rec {
diff --git a/pkgs/applications/networking/iptraf/default.nix b/pkgs/applications/networking/iptraf/default.nix
index f0a6dbbe7e77..db1f2011f113 100644
--- a/pkgs/applications/networking/iptraf/default.nix
+++ b/pkgs/applications/networking/iptraf/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://iptraf.seul.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     description = "Console-based network statistics utility for Linux";
   };
 }
diff --git a/pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch b/pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch
deleted file mode 100644
index 5d48fc99a0da..000000000000
--- a/pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- bip-0.8.8/src/lex.l.orig
-+++ bip-0.8.8/src/lex.l
-@@ -16,7 +16,7 @@
- int linec;
- #include "util.h"
- extern list_t *root_list;
--void yyparse(void);
-+int yyparse(void);
- void free_conf(list_t*);
- int conf_error;
- typedef struct bip bip_t;
diff --git a/pkgs/applications/networking/irc/bip/default.nix b/pkgs/applications/networking/irc/bip/default.nix
index 89fdf0d8df85..6f816e1db170 100644
--- a/pkgs/applications/networking/irc/bip/default.nix
+++ b/pkgs/applications/networking/irc/bip/default.nix
@@ -2,8 +2,8 @@
 
 let
 
-  version = "0.8.8";
-  sha256 = "7ca3fb96f5ee6b76eb398d7ea45344ea24855344ced11632241a33353bba05d7";
+  version = "0.8.9";
+  sha256 = "0q942g9lyd8pjvqimv547n6vik5759r9npw3ws3bdj4ixxqhz59w";
 
   # fetches patches from a gentoo mirror
   fetchPatch =
@@ -25,19 +25,12 @@ in stdenv.mkDerivation {
 
   # includes an important security patch
   patches = map fetchPatch [
-    { file = "bip-0.8.8-configure.patch";
-      sha256 = "286e169745e6cd768f0cb95bbc9589ca2bda497eb06461174549b80a459d901c";
-    }
-    { file = "bip-CVE-2012-0806.patch";
-      sha256 = "e47523095ee1d717c762ca0195520026c6ea2c30d8adcf434d276d42f052d506";
-    }
     { file = "bip-freenode.patch";
       sha256 = "a67e582f89cc6a32d5bb48c7e8ceb647b889808c2c8798ae3eb27d88869b892f";
     }
   ];
 
   postPatch = ''
-    patch -p1 < ${./bip-0.8.8-yyparse.patch}
   '';
 
   configureFlags = [ "--disable-pie" ];
@@ -48,5 +41,7 @@ in stdenv.mkDerivation {
     description = "An IRC proxy (bouncer)";
     homepage = http://bip.milkypond.org/;
     license = stdenv.lib.licenses.gpl2;
+    downloadPage= "https://projects.duckcorp.org/projects/bip/files";
+    inherit version;
   };
 }
diff --git a/pkgs/applications/networking/irc/chatzilla/default.nix b/pkgs/applications/networking/irc/chatzilla/default.nix
index 5d16c979f6a2..2010d064f0d9 100644
--- a/pkgs/applications/networking/irc/chatzilla/default.nix
+++ b/pkgs/applications/networking/irc/chatzilla/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, unzip, xulrunner, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "chatzilla-0.9.88";
-  
+  name = "chatzilla-0.9.90.1";
+
   src = fetchurl {
     # Obtained from http://chatzilla.rdmsoft.com/xulrunner/.
-    url = "http://chatzilla.rdmsoft.com/xulrunner/download/${name}-xr.zip";
-    sha256 = "041jpjl7wnbhqm2f8bf2pwp6igjapmy74swac94h54n644wl5nz0";
+    url = "http://chatzilla.rdmsoft.com/xulrunner/download/${name}.en-US.xulapp";
+    sha256 = "0z38jig91h10cb14rvs30rpg2pgn3v890nyxyy8lxzbv5ncxmngw";
   };
 
   buildInputs = [ unzip makeWrapper ];
@@ -17,10 +17,14 @@ stdenv.mkDerivation rec {
 
     makeWrapper ${xulrunner}/bin/xulrunner $out/bin/chatzilla \
       --add-flags $out/libexec/chatzilla/application.ini
+
+    sed -i $out/libexec/chatzilla/application.ini -e 's/.*MaxVersion.*/MaxVersion=99.*/'
   '';
 
   meta = {
     homepage = http://chatzilla.hacksrus.com/;
     description = "Stand-alone version of Chatzilla, an IRC client";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/irc/hexchat/default.nix b/pkgs/applications/networking/irc/hexchat/default.nix
new file mode 100644
index 000000000000..f1cc7df19046
--- /dev/null
+++ b/pkgs/applications/networking/irc/hexchat/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pkgconfig, gtk, perl, python, gettext
+, libtool, pciutils, dbus_glib, libcanberra, libproxy
+, libsexy, enchant, libnotify, openssl
+, desktop_file_utils, hicolor_icon_theme
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.9.6.1";
+  name = "hexchat-${version}";
+
+  src = fetchurl {
+    url = "http://dl.hexchat.net/hexchat/${name}.tar.xz";
+    sha256 = "0w34jr1pqril6r011fwxv40m17bnb88q9cv5hf08mv0a9lygyrv2";
+  };
+
+  buildInputs = [
+    pkgconfig gtk perl python gettext
+    libtool pciutils dbus_glib libcanberra libproxy
+    libsexy libnotify openssl
+    desktop_file_utils hicolor_icon_theme
+  ];
+
+  configureFlags = [ "--enable-shm" "--enable-textfe" ];
+
+  meta = {
+    description = "A popular and easy to use graphical IRC (chat) client";
+    homepage = http://hexchat.github.io/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.romildo ];
+  };
+}
diff --git a/pkgs/applications/networking/irc/ii/default.nix b/pkgs/applications/networking/irc/ii/default.nix
index a283258d589a..224f639cc150 100644
--- a/pkgs/applications/networking/irc/ii/default.nix
+++ b/pkgs/applications/networking/irc/ii/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "ii-1.6";
+  name = "ii-1.7";
   
   src = fetchurl {
     url = "http://dl.suckless.org/tools/${name}.tar.gz";
-    sha256 = "0afccbcm7i9lfch5mwzs3l1ax79dg3g6rrw0z8rb7d2kn8wsckvr";
+    sha256 = "176cqwnn6h7w4kbfd66hzqa243l26pqp2b06bii0nmnm0rkaqwis";
   };
 
   installPhase = ''
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://tools.suckless.org/ii/;
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     description = "Irc it, simple FIFO based irc client";
   };
 }
diff --git a/pkgs/applications/networking/irc/irssi/fish/default.nix b/pkgs/applications/networking/irc/irssi/fish/default.nix
index 98d5afa0ba9f..64e3d216ac08 100644
--- a/pkgs/applications/networking/irc/irssi/fish/default.nix
+++ b/pkgs/applications/networking/irc/irssi/fish/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    ensureDir $out/lib/irssi/modules
+    mkdir -p $out/lib/irssi/modules
     cp src/.libs/libfish.so $out/lib/irssi/modules
   '';
   
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   
   meta = {
     homepage = https://github.com/falsovsky/FiSH-irssi;
-    license = "unfree"; # I can't find any mention of license
+    license = stdenv.lib.licenses.unfree; # I can't find any mention of license
     maintainers = with stdenv.lib.maintainers; [viric];
   };
 }
diff --git a/pkgs/applications/networking/irc/irssi/otr/default.nix b/pkgs/applications/networking/irc/irssi/otr/default.nix
index 00a9aa1fc683..4841aa8070e0 100644
--- a/pkgs/applications/networking/irc/irssi/otr/default.nix
+++ b/pkgs/applications/networking/irc/irssi/otr/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, libotr, automake, autoconf, libtool, glib, pkgconfig, irssi }:
 
 let
-  rev = "cab3fc915c";
+  rev = "640e98c74b";
 in
 with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "irssi-otr-20130601-${rev}";
+  name = "irssi-otr-20131007-${rev}";
   
   src = fetchurl {
     url = "https://github.com/cryptodotis/irssi-otr/tarball/${rev}";
     name = "${name}.tar.gz";
-    sha256 = "0kn9c562zfh36gpcrbpslwjjr78baagdwphczz2d608ndczm1vrk";
+    sha256 = "0d08ianzhy20w0ld8xx7hgrp9psg54l37619pcdpqyrnlzkkdalz";
   };
 
   patchPhase = ''
@@ -25,6 +25,6 @@ stdenv.mkDerivation rec {
   
   meta = {
     homepage = https://github.com/cryptodotis/irssi-otr;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/networking/irc/konversation/default.nix b/pkgs/applications/networking/irc/konversation/default.nix
index c4d2f4b3782b..7554ad7d1a8c 100644
--- a/pkgs/applications/networking/irc/konversation/default.nix
+++ b/pkgs/applications/networking/irc/konversation/default.nix
@@ -3,7 +3,7 @@
 
 let
   pn = "konversation";
-  v = "1.4";
+  v = "1.5";
 in
 
 stdenv.mkDerivation rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://kde/stable/${pn}/${v}/src/${name}.tar.xz";
-    sha256 = "030vsbb18dlzsnjl3fzyd1m9wvvksiyc1lm45abi4q6x4xd60knv";
+    sha256 = "0vsl34kiar7kbsgncycwd7f66f493fip6d635qlprqn1gqhycb9q";
   };
 
   buildInputs = [ cmake qt4 perl gettext libXScrnSaver kdelibs kdepimlibs
@@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Integrated IRC client for KDE";
+    repositories.git = git://anongit.kde.org/konversation;
     license = "GPL";
     inherit (kdelibs.meta) maintainers platforms;
   };
diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix
index 67ff1ca02c43..ba3d7b8c368a 100644
--- a/pkgs/applications/networking/irc/quassel/default.nix
+++ b/pkgs/applications/networking/irc/quassel/default.nix
@@ -4,21 +4,25 @@
 , withKDE ? stdenv.isLinux # enable KDE integration
 , ssl ? true # enable SSL support
 , previews ? false # enable webpage previews on hovering over URLs
-, stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon }:
+, tag ? "" # tag added to the package name
+, stdenv, fetchurl, cmake, makeWrapper, qt4, kdelibs, automoc4, phonon, dconf }:
 
 let
   edf = flag: feature: [("-D" + feature + (if flag then "=ON" else "=OFF"))];
 
 in with stdenv; mkDerivation rec {
 
-  name = "quassel-0.9.0";
+  version = "0.10.0";
+  name = "quassel${tag}-${version}";
 
   src = fetchurl {
-    url = "http://quassel-irc.org/pub/${name}.tar.bz2";
-    sha256 = "09v0igjkzan3hllk47w39hkav6v1419vpxn2lfd8473kwdmf0grf";
+    url = "http://quassel-irc.org/pub/quassel-${version}.tar.bz2";
+    sha256 = "08vwxkwnzlgnxn0wi6ga9fk8qgc6nklb236hsfnr5ad37bi8q8k8";
   };
 
-  buildInputs = [ cmake qt4 ]
+  enableParallelBuilding = true;
+
+  buildInputs = [ cmake makeWrapper qt4 ]
     ++ lib.optional withKDE kdelibs
     ++ lib.optional withKDE automoc4
     ++ lib.optional withKDE phonon;
@@ -36,6 +40,16 @@ in with stdenv; mkDerivation rec {
     ++ edf ssl "WITH_OPENSSL"
     ++ edf previews "WITH_WEBKIT"  ;
 
+  preFixup =
+    lib.optionalString client ''
+        wrapProgram "$out/bin/quasselclient" \
+          --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules"
+    '' +
+    lib.optionalString monolithic ''
+        wrapProgram "$out/bin/quassel" \
+          --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules"
+    '';
+
   meta = with stdenv.lib; {
     homepage = http://quassel-irc.org/;
     description = "Qt4/KDE4 distributed IRC client suppporting a remote daemon";
@@ -46,10 +60,9 @@ in with stdenv; mkDerivation rec {
       combination of screen and a text-based IRC client such
       as WeeChat, but graphical (based on Qt4/KDE4).
     '';
-    license = "GPLv3";
+    license = stdenv.lib.licenses.gpl3;
     maintainers = [ maintainers.phreedom ];
     repositories.git = https://github.com/quassel/quassel.git;
     inherit (qt4.meta) platforms;
   };
 }
-
diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix
index 01ba8c97d988..245619fddf07 100644
--- a/pkgs/applications/networking/irc/weechat/default.nix
+++ b/pkgs/applications/networking/irc/weechat/default.nix
@@ -3,31 +3,37 @@
 , pythonPackages, cacert, cmake, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  version = "0.4.2";
+  version = "1.0";
   name = "weechat-${version}";
 
   src = fetchurl {
     url = "http://weechat.org/files/src/${name}.tar.gz";
-    sha256 = "03ypji34kb5yrxqyn8dbrjm3j00pc8v7wfsip7d3l63nyx79df9v";
+    sha256 = "1z17wyrl5fp697qp44srpmzk79w37f5hm1r0krffbmga6sbzdj3x";
   };
 
   buildInputs = 
     [ ncurses perl python openssl aspell gnutls zlib curl pkgconfig
       libgcrypt ruby lua5 tcl guile pythonPackages.pycrypto makeWrapper
-      cacert cmake
-    ];
+      cacert cmake ]
+    ++ stdenv.lib.optional stdenv.isDarwin pythonPackages.pync;
+
+  NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix}";
 
   postInstall = ''
-       wrapProgram "$out/bin/weechat" \
-         --prefix PYTHONPATH : "$PYTHONPATH" \
-         --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages"
+    NIX_PYTHONPATH="$out/lib/${python.libPrefix}/site-packages"
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    NIX_PYTHONPATH+="${pythonPackages.pync}/lib/${python.libPrefix}/site-packages"
+  '' + ''
+     wrapProgram "$out/bin/weechat" \
+       --prefix PYTHONPATH : "$PYTHONPATH" \
+       --prefix PYTHONPATH : "$NIX_PYTHONPATH"
   '';
 
   meta = {
     homepage = http://www.weechat.org/;
     description = "A fast, light and extensible chat client";
     license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [ garbas the-kenny ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ lovek323 garbas the-kenny ];
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/networking/irc/weechat/devel.nix b/pkgs/applications/networking/irc/weechat/devel.nix
new file mode 100644
index 000000000000..34ca4b4d7c6e
--- /dev/null
+++ b/pkgs/applications/networking/irc/weechat/devel.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchgit, ncurses, openssl, perl, python, aspell, gnutls
+, zlib, curl , pkgconfig, libgcrypt, ruby, lua5, tcl, guile
+, pythonPackages, cacert, cmake, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  rev = "124b2668fe4e97e3926caea85ed2c9f7082c4df9";
+  version = "1.0-rev${rev}";
+  name = "weechat-${version}";
+
+  src = fetchgit {
+    inherit rev;
+    url = "git://github.com/weechat/weechat.git";
+    sha256 = "1xl5scyrxmyqaycpalhl3j50s65w2gjdm43vahd618yyykdffr8b";
+  };
+
+  buildInputs = 
+    [ ncurses perl python openssl aspell gnutls zlib curl pkgconfig
+      libgcrypt ruby lua5 tcl guile pythonPackages.pycrypto makeWrapper
+      cacert cmake ]
+    ++ stdenv.lib.optional stdenv.isDarwin pythonPackages.pync;
+
+  NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix}";
+
+  postInstall = ''
+    NIX_PYTHON_PATH="$out/lib/${python.libPrefix}/site-packages"
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    NIX_PYTHON_PATH+="${pythonPackages.pync}/lib/${python.libPrefix}/site-packages"
+  '' + ''
+     wrapProgram "$out/bin/weechat" \
+       --prefix PYTHONPATH : "$PYTHONPATH" \
+       --prefix PYTHONPATH : "$NIX_PYTHONPATH"
+  '';
+
+  meta = {
+    homepage    = http://www.weechat.org/;
+    description = "A fast, light and extensible chat client";
+    license     = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ lovek323 garbas the-kenny ];
+    platforms   = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/applications/networking/jmeter/default.nix b/pkgs/applications/networking/jmeter/default.nix
index c3212f6aa560..2d5e6b66bf05 100644
--- a/pkgs/applications/networking/jmeter/default.nix
+++ b/pkgs/applications/networking/jmeter/default.nix
@@ -1,10 +1,10 @@
 { fetchurl, stdenv, ant }:
 
 stdenv.mkDerivation rec {
-  name = "jmeter-2.9";
+  name = "jmeter-2.11";
   src = fetchurl {
-    url = "http://ftp.unicamp.br/pub/apache//jmeter/binaries/apache-jmeter-2.9.tgz";
-    sha256 = "14r3zn910m97jqrf6k5c4lwy214snaap2242qg76h65zk9qr20ni";
+    url = "http://ftp.unicamp.br/pub/apache//jmeter/binaries/apache-${name}.tgz";
+    sha256 = "1fr3sw06qncb6yygcf2lbnkxma4v1dbigpf39ajrm0isxbpyv944";
   };
 
   installPhase = ''
diff --git a/pkgs/applications/networking/mailreaders/mailpile/default.nix b/pkgs/applications/networking/mailreaders/mailpile/default.nix
new file mode 100644
index 000000000000..1e68d2e90b8d
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mailpile/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchgit, buildPythonPackage, pythonPackages }:
+
+buildPythonPackage rec {
+  name = "mailpile-dev";
+
+  src = fetchgit {
+    url = "https://github.com/pagekite/Mailpile.git";
+    rev = "6e19c1942541dbdefb5155db5f2583bf3ed22aeb";
+    sha256 = "04idlbjkasigq3vslcv33kg21rjyklm2yl8pyrf5h94lzabbl1fs";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [
+    pillow jinja2 spambayes pythonPackages."lxml-2.3.6" python.modules.readline or null];
+
+  meta = with stdenv.lib; {
+    description = "A modern, fast web-mail client with user-friendly encryption and privacy features";
+    homepage = https://www.mailpile.is/;
+    license = map (getAttr "shortName") [ licenses.asl20 licenses.agpl3 ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.iElectric ];
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/mutt/default.nix b/pkgs/applications/networking/mailreaders/mutt/default.nix
index fa006dc5f0db..9c397f27c46f 100644
--- a/pkgs/applications/networking/mailreaders/mutt/default.nix
+++ b/pkgs/applications/networking/mailreaders/mutt/default.nix
@@ -15,22 +15,16 @@ assert sslSupport -> openssl != null;
 assert saslSupport -> cyrus_sasl != null;
 
 let
-  gpgmePatch = fetchurl {
-    # Solution for gpgme >= 1.2: http://dev.mutt.org/trac/ticket/3300
-    url = "http://dev.mutt.org/trac/raw-attachment/ticket/3300/mutt-1.5.21-gpgme-init.patch";
-    sha256 = "1qa1c8gns4q3as1h2lk3x4di2k3hr804ar7xlc6xh9r0zjhzmlk4";
-  };
+  version = "1.5.23";
 in
 stdenv.mkDerivation rec {
-  name = "mutt-1.5.21";
+  name = "mutt-${version}";
   
   src = fetchurl {
-    url = "ftp://ftp.mutt.org/mutt/devel/${name}.tar.gz";
-    sha256 = "1864cwz240gh0zy56fb47qqzwyf6ghg01037rb4p2kqgimpg6h91";
+    url = "mirror://sourceforge/mutt/${name}.tar.gz";
+    sha256 = "0dzx4qk50pjfsb6cs5jahng96a52k12f7pm0sc78iqdrawg71w1s";
   };
 
-  patches = [ (if gpgmeSupport then gpgmePatch else null) ];
-
   buildInputs = [
     ncurses which perl
     (if headerCache then gdbm else null)
@@ -58,8 +52,11 @@ stdenv.mkDerivation rec {
     (if gpgmeSupport then "--enable-gpgme" else "--disable-gpgme")
   ];
 
-  meta = {
+  meta = with stdenv.lib; {
+    description = "A small but very powerful text-based mail client";
     homepage = http://www.mutt.org;
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ the-kenny ];
   };
 }
-
diff --git a/pkgs/applications/networking/mailreaders/mutt/mailpath.patch b/pkgs/applications/networking/mailreaders/mutt/mailpath.patch
new file mode 100644
index 000000000000..3fb9c7a5f7f9
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/mailpath.patch
@@ -0,0 +1,12 @@
+diff -r 8f62001989cc configure.ac
+--- a/configure.ac	Sat Feb 08 10:24:22 2014 -0800
++++ b/configure.ac	Wed Jul 02 12:34:40 2014 +0200
+@@ -473,6 +473,8 @@
+                                 mutt_cv_mailpath=/usr/spool/mail
+                         elif test -d /usr/mail; then
+                                 mutt_cv_mailpath=/usr/mail
++                        elif test -d /tmp; then
++                               mutt_cv_mailpath=/tmp
+                         fi])
+                 ])
+         if test "$mutt_cv_mailpath" = no; then
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index ebab3a42af67..7a1eddfa8690 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "notmuch-0.15.2";
+  name = "notmuch-0.18.1";
 
   src = fetchurl {
     url = "http://notmuchmail.org/releases/${name}.tar.gz";
-    sha256 = "03cwylm0y9xld0hn753v0hn62f96nagdmzxv8jlz8vdbh9iszs56";
+    sha256 = "1pdp9l7yv71d3fjb30qyccva8h03hvg88q4a00yi50v2j70kvmgj";
   };
 
   buildInputs = [ bash emacs gdb glib gmime gnupg pkgconfig talloc xapian ];
diff --git a/pkgs/applications/networking/mailreaders/sup/default.nix b/pkgs/applications/networking/mailreaders/sup/default.nix
index dd2837da40a6..8efda554d732 100644
--- a/pkgs/applications/networking/mailreaders/sup/default.nix
+++ b/pkgs/applications/networking/mailreaders/sup/default.nix
@@ -1,31 +1,40 @@
 { stdenv, fetchurl, ruby, rake, rubygems, makeWrapper, ncursesw_sup
 , xapian_ruby, gpgme, libiconvOrEmpty, mime_types, chronic, trollop, lockfile
-, gettext, iconv, locale, text, highline, rmail_sup, unicode, gnupg, which }:
+, gettext, iconv, locale, text, highline, rmail_sup, unicode, gnupg, which
+, bundler, git }:
 
 stdenv.mkDerivation rec {
-  version = "f27661b1656ae1f0d28fd89595b5a16f268d8d3d";
+  version = "0.18.0";
   name    = "sup-${version}";
-  
+
   meta = {
-    homepage = http://supmua.org;
     description = "A curses threads-with-tags style email client";
+    homepage    = http://supmua.org;
+    license     = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [ lovek323 ];
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
+    platforms   = stdenv.lib.platforms.unix;
   };
 
   dontStrip = true;
 
   src = fetchurl {
-    url    = "https://github.com/sup-heliotrope/sup/archive/${version}.tar.gz";
-    sha256 = "08fxf1knji3260d0mrp86x6yayp43iq7kc5rfay3hga8i2sckdia";
+    url    = "https://github.com/sup-heliotrope/sup/archive/release-${version}.tar.gz";
+    sha256 = "1dhg0i2v0ddhwi32ih5lc56x00kbaikd2wdplgzlshq0nljr9xy0";
   };
 
   buildInputs =
-    [ ruby rake rubygems makeWrapper gpgme ncursesw_sup xapian_ruby
-      libiconvOrEmpty ];
+    [ rake ruby rubygems makeWrapper gpgme ncursesw_sup xapian_ruby
+      libiconvOrEmpty git ];
+
+  phases = [ "unpackPhase" "buildPhase" "installPhase" ];
 
-  buildPhase = "rake gem";
+  buildPhase = ''
+    # the builder uses git to get a listing of the files
+    git init >/dev/null
+    git add .
+    git commit -m "message" >/dev/null
+    gem build sup.gemspec
+  '';
 
   installPhase = ''
     export HOME=$TMP/home; mkdir -pv "$HOME"
@@ -49,13 +58,13 @@ stdenv.mkDerivation rec {
     # Don't install some dependencies -- we have already installed
     # the dependencies but gem doesn't acknowledge this
     gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
-        --bindir "$out/bin" --no-rdoc --no-ri pkg/sup-999.gem \
-        --ignore-dependencies
+        --bindir "$out/bin" --no-rdoc --no-ri sup-${version}.gem \
+        --ignore-dependencies >/dev/null
 
     # specify ruby interpreter explicitly
     sed -i '1 s|^.*$|#!${ruby}/bin/ruby|' bin/sup-sync-back-maildir
 
-    cp bin/sup-sync-back-maildir "$out"/bin
+    cp bin/sup-sync-back-maildir "$out/bin"
 
     for prog in $out/bin/*; do
       wrapProgram "$prog" --prefix GEM_PATH : "$GEM_PATH" --prefix PATH : "${gnupg}/bin:${which}/bin"
diff --git a/pkgs/applications/networking/mailreaders/sylpheed/default.nix b/pkgs/applications/networking/mailreaders/sylpheed/default.nix
index 31e65a857df6..70d01f5df3ea 100644
--- a/pkgs/applications/networking/mailreaders/sylpheed/default.nix
+++ b/pkgs/applications/networking/mailreaders/sylpheed/default.nix
@@ -10,12 +10,14 @@ with stdenv.lib;
 assert sslSupport -> openssl != null;
 assert gpgSupport -> gpgme != null;
 
+let version = "3.4.1"; in
+
 stdenv.mkDerivation {
-  name = "sylpheed-3.2.0";
+  name = "sylpheed-${version}";
 
   src = fetchurl {
-    url = http://sylpheed.sraoss.jp/sylpheed/v3.2/sylpheed-3.2.0.tar.bz2;
-    sha256 = "1cdjwn1f8rgcxzfxj7j7qvacmaw4zfhnip81q4n5lj5d6rj7rssa";
+    url = "http://sylpheed.sraoss.jp/sylpheed/v3.4/sylpheed-${version}.tar.bz2";
+    sha256 = "11wpifvn8a0p4dqmvi7r61imqkgm6rjjp3h057c344vny37livbx";
   };
 
   buildInputs =
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
new file mode 100644
index 000000000000..15acd5af8dfd
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
@@ -0,0 +1,267 @@
+# This file is generated from generate_nix.rb
+# Execute the following command in a temporary directory to update the file.
+#
+# ruby generate_nix.rb > default.nix
+
+{ stdenv, fetchurl, config
+, gconf
+, alsaLib
+, at_spi2_atk
+, atk
+, cairo
+, cups
+, curl
+, dbus_glib
+, dbus_libs
+, fontconfig
+, freetype
+, gdk_pixbuf
+, glib
+, glibc
+, gst_plugins_base
+, gstreamer
+, gtk
+, kerberos
+, libX11
+, libXScrnSaver
+, libXext
+, libXinerama
+, libXrender
+, libXt
+, libcanberra
+, libgnome
+, libgnomeui
+, mesa
+, nspr
+, nss
+, pango
+}:
+
+let
+  version = "31.0";
+  sources = [
+    { locale = "nn-NO"; arch = "linux-i686"; sha256 = "a1e9954236de1d0581342fbb894b721528bc51a208d3bbedd4d8defbcc1cb50f"; }
+    { locale = "nn-NO"; arch = "linux-x86_64"; sha256 = "0fe9c22ad8cf575813ae8e476d985a3b951174df5beda67fd98e261f831252aa"; }
+    { locale = "lt"; arch = "linux-i686"; sha256 = "35fb5c44bc3ed25beec4f6172c44f75426579f27bd2302361870615bb1f62194"; }
+    { locale = "lt"; arch = "linux-x86_64"; sha256 = "3b04ffd5e1640c0138e5dab63a1059bd0342fff9f44547c6b34fbe6da810f911"; }
+    { locale = "ta-LK"; arch = "linux-i686"; sha256 = "2e8a1b96820216fda11c234d80a74d7326b49d7ac3f595f646aa10dccde61940"; }
+    { locale = "ta-LK"; arch = "linux-x86_64"; sha256 = "006f25951b4ac90b8d8d32491d260900dfcfb24c10cd4a10dbadf3840b4bcd4e"; }
+    { locale = "bn-BD"; arch = "linux-i686"; sha256 = "839e95de15a4e0287cfe36d70e07d1d40a1708016f615244a84553794ac76b4c"; }
+    { locale = "bn-BD"; arch = "linux-x86_64"; sha256 = "592a353df70c368c3c9855ead6d3b68433e7ebaaf42169108b9e74a83517230b"; }
+    { locale = "de"; arch = "linux-i686"; sha256 = "890bc1ee046ebf67079bd39ecb761a78fbf8cee8f72b32958ad18a0c3184b23b"; }
+    { locale = "de"; arch = "linux-x86_64"; sha256 = "7b52dfc2cea5bedae2ccfe11b0ec2d66edb81b76c2272c60f4bb247970384c9f"; }
+    { locale = "rm"; arch = "linux-i686"; sha256 = "6ab1e46650ff296719e498a1b9e5dad5c2f32e6be9d6fec12d1ab917a5f76872"; }
+    { locale = "rm"; arch = "linux-x86_64"; sha256 = "fdb170e3f546de759ef8a8aa85f6c3bf5152e121739cc27797c3065f4f85c183"; }
+    { locale = "nl"; arch = "linux-i686"; sha256 = "208be79ce95d45f4f69d8bf53d4e2f457410653a81117b4bd4d42bf14a1485dc"; }
+    { locale = "nl"; arch = "linux-x86_64"; sha256 = "2e562f9f59457d484ccfb1beb0129e2ca3ba4e5cbf5c955a65480836dc2e6567"; }
+    { locale = "sv-SE"; arch = "linux-i686"; sha256 = "07c7836bac31fa835c244dbe5eff19bad5dc5a9339cb8a94bd07d88f8590c867"; }
+    { locale = "sv-SE"; arch = "linux-x86_64"; sha256 = "7124de1e3cff7a5c17506f8e175aab1aaf96d4c9fd57824d6c0af110f47b1fbc"; }
+    { locale = "fy-NL"; arch = "linux-i686"; sha256 = "5d4e7f1f82b53161e84abf45f4a7210f0304399efed2df621c2e24cd5f1e1db0"; }
+    { locale = "fy-NL"; arch = "linux-x86_64"; sha256 = "814798f7dd066228ae73ce6bfdf430db4f0c4e905ce8a6670c73f894865dbf4e"; }
+    { locale = "si"; arch = "linux-i686"; sha256 = "35727d874cdeca69e18cedc109b6c3540c8dbb7450b2158cb1209cf00272cc38"; }
+    { locale = "si"; arch = "linux-x86_64"; sha256 = "0aa2232adc0e06c0a841a11155c2cd8f317b2f12b0e02c239ebe6150ad3bc278"; }
+    { locale = "vi"; arch = "linux-i686"; sha256 = "b45871e531b18a35f60240dc0417e5a9f08f8c9e3ea762a36e938425505df8b0"; }
+    { locale = "vi"; arch = "linux-x86_64"; sha256 = "a32dd96a41ed33a81c240c60c3538db45c1c4357ceaf37c8482a378a526c5454"; }
+    { locale = "br"; arch = "linux-i686"; sha256 = "3162753876da622895175afb60cd89be1ee343a10a45f9ac3feb3b306e161838"; }
+    { locale = "br"; arch = "linux-x86_64"; sha256 = "7c8d26a07d239f18f94f14696036974317ac1186072ba4482c315d02dcb97e5f"; }
+    { locale = "da"; arch = "linux-i686"; sha256 = "8cfaf98f3702b418bfd7692373b9f6e99a4b06e47a75a2df602e98d8f6acf761"; }
+    { locale = "da"; arch = "linux-x86_64"; sha256 = "6bd9ab36402f3391abc2e96f8786e16407736cf04d524e562736ac47279e2a26"; }
+    { locale = "fi"; arch = "linux-i686"; sha256 = "0a3e7c130197d4abcbf4d37eef51a946c11cf72707686f8c7a0caa9cc21e75c8"; }
+    { locale = "fi"; arch = "linux-x86_64"; sha256 = "8d4003960a8a7a496662b59834118c8712443761b867e5f54f3bf4a683715d22"; }
+    { locale = "he"; arch = "linux-i686"; sha256 = "5db77f9d117071feeddb5eadf74ea6332ccf9abaa441ba4d7b0a5f0f3781452d"; }
+    { locale = "he"; arch = "linux-x86_64"; sha256 = "46995a9f269f0385fc9ac9d31ee65d84e79ac81bd61892adaeb1afff991bcc82"; }
+    { locale = "zh-CN"; arch = "linux-i686"; sha256 = "73071beb9caa24aaac8eec9cfb01f7e333dc6ac438ab36e7f5afa7d850dbeb8e"; }
+    { locale = "zh-CN"; arch = "linux-x86_64"; sha256 = "a17cc26a51bbcff44837d74bdb35ba0ae10def6f4b536c4a67e9169221bd0afb"; }
+    { locale = "gl"; arch = "linux-i686"; sha256 = "4782b1f56c1f5fb1f802385d693a96b5013503e97e4d73e43fb90c3331aec839"; }
+    { locale = "gl"; arch = "linux-x86_64"; sha256 = "dbba59d0c697e6dc05bc2b554eed2c6040642cb1246a4119cd7c37b0451c6d4e"; }
+    { locale = "sl"; arch = "linux-i686"; sha256 = "b37a5eaf187d1c026990f55a3e993594a49bb689f1643d2f944c7f3c7cfd6819"; }
+    { locale = "sl"; arch = "linux-x86_64"; sha256 = "629132c5cc5f937fb504542662bb8aa7570eee1ae648087dbfb0c6dedadfa53c"; }
+    { locale = "cs"; arch = "linux-i686"; sha256 = "89e818736957569f91f7f329118b09a27b072c6d7c89f601eb02cd1d870c4088"; }
+    { locale = "cs"; arch = "linux-x86_64"; sha256 = "6a3a358227972a0eb60b1b531f322ebb2e604805bfb50b55d88cb8447b443105"; }
+    { locale = "ca"; arch = "linux-i686"; sha256 = "794b1e0be4bd6f8facebe3aa44f66a139a660d4fe75891f463adb5d7da7b32cb"; }
+    { locale = "ca"; arch = "linux-x86_64"; sha256 = "81b51a607844b229d026d9acec4ea1739c365a890857871260b6eca92a176e04"; }
+    { locale = "ar"; arch = "linux-i686"; sha256 = "924c5c47c76fc09f5a46176ef1a6e3466d783b8a4c08a5e660a03e0e84459116"; }
+    { locale = "ar"; arch = "linux-x86_64"; sha256 = "c46c2285a6f1c825e52ea6cd7dda31d6f67be15668ecf71883c55c9fa21a3fd5"; }
+    { locale = "tr"; arch = "linux-i686"; sha256 = "58a53bf3ad217b36beb9795f34349cfa3f10b7a39044f024c547be31b033ee28"; }
+    { locale = "tr"; arch = "linux-x86_64"; sha256 = "21d1f89810a284818c0a73e8abd5b51a9ea58b7db2b9bf6dd5e0119f4bfc13a3"; }
+    { locale = "ru"; arch = "linux-i686"; sha256 = "67cb3d38230d24c2a7615468ae2465e6f768904e3735ce31833dcba7b98023c5"; }
+    { locale = "ru"; arch = "linux-x86_64"; sha256 = "9e6b5351e96b9b2c57ce04fddaf9656adf84bc2a961a8ca614cec2f830d4e2a7"; }
+    { locale = "uk"; arch = "linux-i686"; sha256 = "80d0a09d93362f7eff9c7a20025080207a14c43e56b132c3962dd1d795d2a85c"; }
+    { locale = "uk"; arch = "linux-x86_64"; sha256 = "07d92405612e1000bc0b401481e94548877511ce224f19b23aa4fa192f21d489"; }
+    { locale = "fr"; arch = "linux-i686"; sha256 = "0d70e52c8dc5bf6f13c8ea2a5762cb94534ec54548c792ae181febc3d23c01cb"; }
+    { locale = "fr"; arch = "linux-x86_64"; sha256 = "2962de1886753b81684360ffbf97afa4d4371662a6f467ebc369e225d335745d"; }
+    { locale = "hr"; arch = "linux-i686"; sha256 = "6eacb202078be4de4a86c3fc957dbf482e32ab28805d719aa5d0d7f4fd832f48"; }
+    { locale = "hr"; arch = "linux-x86_64"; sha256 = "83ed10b7d9d74a28f9982a9d11840522f214ccb53ed599f9fce6ae26bd9d2298"; }
+    { locale = "el"; arch = "linux-i686"; sha256 = "227140594d1e12f2edf4e942327a8c64ab922796f7bda324eead8a299a6082ab"; }
+    { locale = "el"; arch = "linux-x86_64"; sha256 = "bc219c6795389fbdf20c4a84a61c350f376374285eff9aaedbc4893fdcbbdc24"; }
+    { locale = "et"; arch = "linux-i686"; sha256 = "4ac7de0edc1d2b084f38058f8c55e8c2fad0782a1f7f7ac69af5c6f28e2a71f9"; }
+    { locale = "et"; arch = "linux-x86_64"; sha256 = "cf026ebca03f6eb59b81073f754b9989f2023bb61d8dfaacbb28da3372abf43b"; }
+    { locale = "it"; arch = "linux-i686"; sha256 = "001f67664b02736aa757fa99ec00c8df023ead8f94113d1040092057031c4557"; }
+    { locale = "it"; arch = "linux-x86_64"; sha256 = "39fdd81738e0cea77c0f860f0e5253416daa6bd13f1e9feab4c6a52c6dd981f9"; }
+    { locale = "ja"; arch = "linux-i686"; sha256 = "0a5a830078e0774e81154f07055613d4b6dd6875be4ac976ac70883cfa0ed9cc"; }
+    { locale = "ja"; arch = "linux-x86_64"; sha256 = "a33890be6ac154862b7b80f864990b3bbad2db8adbf1d26bf2cd61b175db673e"; }
+    { locale = "bg"; arch = "linux-i686"; sha256 = "6f837f1c640c46dd99c4ab691ec6964e40b6d931830d4da604d4329c6d1ecde2"; }
+    { locale = "bg"; arch = "linux-x86_64"; sha256 = "a37294fbf0b358e5b9619aa36a20f92fc637a6b0697b8d607b958d256ce81225"; }
+    { locale = "nb-NO"; arch = "linux-i686"; sha256 = "2bbb5800b9a6d03545ca3dfc8f99f9f30c11e474ea360481f1f7e9610b0a87b0"; }
+    { locale = "nb-NO"; arch = "linux-x86_64"; sha256 = "e2a68f359f48a19437605b581bf9a8cf911feabfb2b15ec3724c60d1cbfe15ec"; }
+    { locale = "es-ES"; arch = "linux-i686"; sha256 = "976fbb88b1c75dc402b9eea76aef4d8a0886ee76bcf65d798a6ae8234b2b297a"; }
+    { locale = "es-ES"; arch = "linux-x86_64"; sha256 = "190679f7638b3697b236d971014f0da938aa2d664afb93e7f4d1c0fb51bfb46e"; }
+    { locale = "ro"; arch = "linux-i686"; sha256 = "530b19e48b0e49047746b2f5dd486cfb19930b1064478c465ce2acb21eac66ba"; }
+    { locale = "ro"; arch = "linux-x86_64"; sha256 = "0fe30abe10b4c97aef9ee40550205e0f269c5cfe76c08a36c8cf886a5af78558"; }
+    { locale = "en-GB"; arch = "linux-i686"; sha256 = "3f2d2784e3aa75cbd3ca0579d660b50b31e488253e52fedbfefc7c5448803967"; }
+    { locale = "en-GB"; arch = "linux-x86_64"; sha256 = "83e64293ed8d1ecf509e2617a71fed9583e4d4c3de3ae5b50175ad8c0f8322ae"; }
+    { locale = "gd"; arch = "linux-i686"; sha256 = "aa282b17eeeb185734f33d2ed9f287958d8a48ed82653d197426e3e3091ecba3"; }
+    { locale = "gd"; arch = "linux-x86_64"; sha256 = "c17db84f0cfd5525e4b8a08e300cabbbcd2bc45f59eb886e180eef0f8c4e45ef"; }
+    { locale = "be"; arch = "linux-i686"; sha256 = "909ae64789280db1a07b3b57dfa1a5d337fecd3bd59bacd3bab2eb72dbecb04f"; }
+    { locale = "be"; arch = "linux-x86_64"; sha256 = "9021a15bda3d4947e1ed6ee6666a252e3541b020d8d7eb58e854e426719f8d6d"; }
+    { locale = "pl"; arch = "linux-i686"; sha256 = "a3536d7e8bb429d562e7731fea8675dc9d442ca8e59cc72eb1b404da12d1d53a"; }
+    { locale = "pl"; arch = "linux-x86_64"; sha256 = "99cb049415e4837e615e1946409d1fd62966ae8eb843d89dfb61a6675b5b363f"; }
+    { locale = "pa-IN"; arch = "linux-i686"; sha256 = "06a17ca2ee8f44098252f24dae17589f32c80bd35e127a093c18161751a581fc"; }
+    { locale = "pa-IN"; arch = "linux-x86_64"; sha256 = "b8537b39f3e1242e3ed705ff919b01eb89ac72cf7c15ef0c44d258069c8ea317"; }
+    { locale = "ko"; arch = "linux-i686"; sha256 = "f2f1e9babb37f79121034f9b8cbc90fbf9f0fa1c152a7f0d7162aff6f6e33f1a"; }
+    { locale = "ko"; arch = "linux-x86_64"; sha256 = "60bc6bd468c820066e00f8108e0912df57a941b4150c06797a7958ec684c4969"; }
+    { locale = "sq"; arch = "linux-i686"; sha256 = "a88591a1850b56c68dd75b4ecff79a32d46dcb42f788d66bb46d45cd0f0d5672"; }
+    { locale = "sq"; arch = "linux-x86_64"; sha256 = "2bb7656dde363f3c3d3c8c8b4dbdb306f7e618491c917bc7c1b6e6f41d30fbf0"; }
+    { locale = "id"; arch = "linux-i686"; sha256 = "b396c752f7652e5ee31d6bec4bfb70b2d86438d966051f91e4d7a77ce5a924dc"; }
+    { locale = "id"; arch = "linux-x86_64"; sha256 = "1f0595e6953b0b6aa09577f180897760f8f85ba15e00e6ae3b12105c705cdac4"; }
+    { locale = "sk"; arch = "linux-i686"; sha256 = "4d3a4d283705889759dcb321e4b700896b132634005590e546bf6744e6187260"; }
+    { locale = "sk"; arch = "linux-x86_64"; sha256 = "456252e7bb5f29ef3c76afb2df0f406fcf93ef1c6df56d0f209bb85e91c8acce"; }
+    { locale = "en-US"; arch = "linux-i686"; sha256 = "ee93df33057576bd55bc80b71aeec7c6f487028f0fe52f679614811be5c71bae"; }
+    { locale = "en-US"; arch = "linux-x86_64"; sha256 = "7f7189250d76f970bfc1879b2ac6fe2d42bdcf3a652614fa4e080dcc636bbd4c"; }
+    { locale = "sr"; arch = "linux-i686"; sha256 = "cb389bd9712def87c06ffab3fc50b8fa58c773c6725fd0e0befec3e2ac957ef5"; }
+    { locale = "sr"; arch = "linux-x86_64"; sha256 = "8f9bf916357e7385dec5de9e4d58f6dfbe3c7fc6d2b66298304c3630189833e6"; }
+    { locale = "zh-TW"; arch = "linux-i686"; sha256 = "f89251f74b85c22a9f7b97b844a118e498698e205f733f1fb0d7a98787f973ee"; }
+    { locale = "zh-TW"; arch = "linux-x86_64"; sha256 = "019a15e1e83b6810de6a4d64deb3eba1a9c2a0c6f1c382582e356445e40d5bda"; }
+    { locale = "es-AR"; arch = "linux-i686"; sha256 = "ae1d03ddf4b424edc59e08c65a9fb20107311289e4faf8f06f14bc471b00d35f"; }
+    { locale = "es-AR"; arch = "linux-x86_64"; sha256 = "a19dce910ba5be35c0fd51be50bd96be3b3db84587f749ed9a108a14a3b732b7"; }
+    { locale = "ast"; arch = "linux-i686"; sha256 = "8cb4cb6a99955209026224a4cbbcab7b37b0b9fc38147eeaa439631be7750c08"; }
+    { locale = "ast"; arch = "linux-x86_64"; sha256 = "4520a3ae24cc7056eb87d48280999c2c3da6aa76b9182c291512dc80363efb27"; }
+    { locale = "ga-IE"; arch = "linux-i686"; sha256 = "8803a9477f6ac963bdacfd82f6e6b8aabb217fa6c39b311645e461f38cda3757"; }
+    { locale = "ga-IE"; arch = "linux-x86_64"; sha256 = "c8eae521293986be6d626302d91abbb88a12855565fd41c3614f7a5d7534f0cd"; }
+    { locale = "pt-BR"; arch = "linux-i686"; sha256 = "9ea7f173533757c99a9c2dfdceab5cc58e583f929a2e7db95184823a00319a0a"; }
+    { locale = "pt-BR"; arch = "linux-x86_64"; sha256 = "6b9775f8142273d118870887da2728da4732609395897513739df7b352a4989c"; }
+    { locale = "is"; arch = "linux-i686"; sha256 = "bcaeea579405f015fcdb78e16cfd92e4c0895614c5966a1a7049a4fe310b1c46"; }
+    { locale = "is"; arch = "linux-x86_64"; sha256 = "7de3a89ece968819fcd7f438aaa2f5762f9d936b20fb3c364467ac123b24182e"; }
+    { locale = "eu"; arch = "linux-i686"; sha256 = "af7f04ef648264f56dcb62e7e473586f3c5b13d3ecd2918278962f335dda7966"; }
+    { locale = "eu"; arch = "linux-x86_64"; sha256 = "8477854792552b471e4eb11f71c79b14544cf438e795feae3082c0f3a31e0c8a"; }
+    { locale = "hu"; arch = "linux-i686"; sha256 = "21db7e27557670796db9282174e7da04afe3a0c89b31e042f7bbd3992e4e08be"; }
+    { locale = "hu"; arch = "linux-x86_64"; sha256 = "8f05b160d346b45308ba0c7dbe531bce043f22abffd2a4d1200628669a3b4aa0"; }
+    { locale = "hy-AM"; arch = "linux-i686"; sha256 = "5e77c23bdb52dba7b663b574520972e2b78588e5143922c1e1837c0e0bd71a86"; }
+    { locale = "hy-AM"; arch = "linux-x86_64"; sha256 = "35e663dad586cce929baa1ec501b149ff586df15a687eb41a8cc619c542a625c"; }
+    { locale = "pt-PT"; arch = "linux-i686"; sha256 = "211322939ab3b4bfc3e6f0548356c9479db5deb687e1e2232f527462017dcd2d"; }
+    { locale = "pt-PT"; arch = "linux-x86_64"; sha256 = "0d50802a6fd7d9256591076c267759d39af91f680025b03ec6925e21c20494e4"; }
+  ];
+
+  arch = if stdenv.system == "i686-linux"
+    then "linux-i686"
+    else "linux-x86_64";
+
+  isPrefixOf = prefix: string:
+    builtins.substring 0 (builtins.stringLength prefix) string == prefix;
+
+  sourceMatches = locale: source:
+      (isPrefixOf source.locale locale) && source.arch == arch;
+
+  systemLocale = config.i18n.defaultLocale or "en-US";
+
+  defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources;
+
+  source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources;
+
+in
+
+stdenv.mkDerivation {
+  name = "thunderbird-bin-${version}";
+
+  src = fetchurl {
+    url = "http://download-installer.cdn.mozilla.net/pub/thunderbird/releases/${version}/${source.arch}/${source.locale}/thunderbird-${version}.tar.bz2";
+    inherit (source) sha256;
+  };
+
+  phases = "unpackPhase installPhase";
+
+  libPath = stdenv.lib.makeLibraryPath
+    [ stdenv.gcc.gcc
+      gconf
+      alsaLib
+      at_spi2_atk
+      atk
+      cairo
+      cups
+      curl
+      dbus_glib
+      dbus_libs
+      fontconfig
+      freetype
+      gdk_pixbuf
+      glib
+      glibc
+      gst_plugins_base
+      gstreamer
+      gtk
+      kerberos
+      libX11
+      libXScrnSaver
+      libXext
+      libXinerama
+      libXrender
+      libXt
+      libcanberra
+      libgnome
+      libgnomeui
+      mesa
+      nspr
+      nss
+      pango
+    ] + ":" + stdenv.lib.makeSearchPath "lib64" [
+      stdenv.gcc.gcc
+    ];
+
+  installPhase =
+    ''
+      mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}"
+      cp -r * "$prefix/usr/lib/thunderbird-bin-${version}"
+
+      mkdir -p "$out/bin"
+      ln -s "$prefix/usr/lib/thunderbird-bin-${version}/thunderbird" "$out/bin/"
+
+      for executable in \
+        thunderbird mozilla-xremote-client thunderbird-bin plugin-container \
+        updater
+      do
+        patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          "$out/usr/lib/thunderbird-bin-${version}/$executable"
+      done
+
+      for executable in \
+        thunderbird mozilla-xremote-client thunderbird-bin plugin-container \
+        updater libxul.so
+      do
+        patchelf --set-rpath "$libPath" \
+          "$out/usr/lib/thunderbird-bin-${version}/$executable"
+      done
+
+      # Create a desktop item.
+      mkdir -p $out/share/applications
+      cat > $out/share/applications/thunderbird.desktop <<EOF
+      [Desktop Entry]
+      Type=Application
+      Exec=$out/bin/thunderbird
+      Icon=$out/lib/thunderbird-bin-${version}/chrome/icons/default/default256.png
+      Name=Thunderbird
+      GenericName=Mail Reader
+      Categories=Application;Network;
+      EOF
+    '';
+
+  meta = with stdenv.lib; {
+    description = "Mozilla Thunderbird, a full-featured email client";
+    homepage = http://www.mozilla.org/thunderbird/;
+    license = {
+      shortName = "unfree"; # not sure
+      fullName = "unfree";
+      url = http://www.mozilla.org/en-US/foundation/trademarks/policy/;
+    };
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/generate_nix.rb b/pkgs/applications/networking/mailreaders/thunderbird-bin/generate_nix.rb
new file mode 100644
index 000000000000..e19425c8e175
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/generate_nix.rb
@@ -0,0 +1,210 @@
+version = if ARGV.empty?
+            "latest"
+          else
+            ARGV[0]
+          end
+
+base_path = "download-installer.cdn.mozilla.net/pub/thunderbird/releases"
+
+arches = ["linux-i686", "linux-x86_64"]
+
+arches.each do |arch|
+  system("wget", "--recursive", "--continue", "--no-parent", "--reject-regex", ".*\\?.*", "--reject", "xpi", "http://#{base_path}/#{version}/#{arch}/")
+end
+
+locales = Dir.glob("#{base_path}/#{version}/#{arches[0]}/*").map do |path|
+  File.basename(path)
+end
+
+locales.delete("index.html")
+locales.delete("xpi")
+
+real_version = Dir.glob("#{base_path}/#{version}/#{arches[0]}/#{locales[0]}/thunderbird-*")[0].match(/thunderbird-([0-9.]*)/)[1][0..-2]
+
+locale_arch_path_tuples = locales.flat_map do |locale|
+  arches.map do |arch|
+    path = Dir.glob("#{base_path}/#{version}/#{arch}/#{locale}/thunderbird-*")[0]
+
+    [locale, arch, path]
+  end
+end
+
+paths = locale_arch_path_tuples.map do |tuple| tuple[2] end
+
+hashes = IO.popen(["sha256sum", "--binary", *paths]) do |input|
+  input.each_line.map do |line|
+    $stderr.puts(line)
+
+    line.match(/^[0-9a-f]*/)[0]
+  end
+end
+
+
+puts(<<"EOH")
+# This file is generated from generate_nix.rb
+# Execute the following command in a temporary directory to update the file.
+#
+# ruby generate_nix.rb > default.nix
+
+{ stdenv, fetchurl, config
+, gconf
+, alsaLib
+, at_spi2_atk
+, atk
+, cairo
+, cups
+, curl
+, dbus_glib
+, dbus_libs
+, fontconfig
+, freetype
+, gdk_pixbuf
+, glib
+, glibc
+, gst_plugins_base
+, gstreamer
+, gtk
+, kerberos
+, libX11
+, libXScrnSaver
+, libXext
+, libXinerama
+, libXrender
+, libXt
+, libcanberra
+, libgnome
+, libgnomeui
+, mesa
+, nspr
+, nss
+, pango
+}:
+
+let
+  version = "#{real_version}";
+  sources = [
+EOH
+
+locale_arch_path_tuples.zip(hashes) do |tuple, hash|
+  locale, arch, path = tuple
+
+  puts(%Q|    { locale = "#{locale}"; arch = "#{arch}"; sha256 = "#{hash}"; }|)
+end
+
+puts(<<'EOF')
+  ];
+
+  arch = if stdenv.system == "i686-linux"
+    then "linux-i686"
+    else "linux-x86_64";
+
+  isPrefixOf = prefix: string:
+    builtins.substring 0 (builtins.stringLength prefix) string == prefix;
+
+  sourceMatches = locale: source:
+      (isPrefixOf source.locale locale) && source.arch == arch;
+
+  systemLocale = config.i18n.defaultLocale or "en-US";
+
+  defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources;
+
+  source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources;
+
+in
+
+stdenv.mkDerivation {
+  name = "thunderbird-bin-${version}";
+
+  src = fetchurl {
+    url = "http://download-installer.cdn.mozilla.net/pub/thunderbird/releases/${version}/${source.arch}/${source.locale}/thunderbird-${version}.tar.bz2";
+    inherit (source) sha256;
+  };
+
+  phases = "unpackPhase installPhase";
+
+  libPath = stdenv.lib.makeLibraryPath
+    [ stdenv.gcc.gcc
+      gconf
+      alsaLib
+      at_spi2_atk
+      atk
+      cairo
+      cups
+      curl
+      dbus_glib
+      dbus_libs
+      fontconfig
+      freetype
+      gdk_pixbuf
+      glib
+      glibc
+      gst_plugins_base
+      gstreamer
+      gtk
+      kerberos
+      libX11
+      libXScrnSaver
+      libXext
+      libXinerama
+      libXrender
+      libXt
+      libcanberra
+      libgnome
+      libgnomeui
+      mesa
+      nspr
+      nss
+      pango
+    ] + ":" + stdenv.lib.makeSearchPath "lib64" [
+      stdenv.gcc.gcc
+    ];
+
+  installPhase =
+    ''
+      mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}"
+      cp -r * "$prefix/usr/lib/thunderbird-bin-${version}"
+
+      mkdir -p "$out/bin"
+      ln -s "$prefix/usr/lib/thunderbird-bin-${version}/thunderbird" "$out/bin/"
+
+      for executable in \
+        thunderbird mozilla-xremote-client thunderbird-bin plugin-container \
+        updater
+      do
+        patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          "$out/usr/lib/thunderbird-bin-${version}/$executable"
+      done
+
+      for executable in \
+        thunderbird mozilla-xremote-client thunderbird-bin plugin-container \
+        updater libxul.so
+      do
+        patchelf --set-rpath "$libPath" \
+          "$out/usr/lib/thunderbird-bin-${version}/$executable"
+      done
+
+      # Create a desktop item.
+      mkdir -p $out/share/applications
+      cat > $out/share/applications/thunderbird.desktop <<EOF
+      [Desktop Entry]
+      Type=Application
+      Exec=$out/bin/thunderbird
+      Icon=$out/lib/thunderbird-bin-${version}/chrome/icons/default/default256.png
+      Name=Thunderbird
+      GenericName=Mail Reader
+      Categories=Application;Network;
+      EOF
+    '';
+
+  meta = with stdenv.lib; {
+    description = "Mozilla Thunderbird, a full-featured email client";
+    homepage = http://www.mozilla.org/thunderbird/;
+    license = {
+      shortName = "unfree"; # not sure
+      fullName = "unfree";
+      url = http://www.mozilla.org/en-US/foundation/trademarks/policy/;
+    };
+    platforms = platforms.linux;
+  };
+}
+EOF
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index 08758c55a4e4..c0c11ff1f1c3 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -1,9 +1,10 @@
-{ stdenv, fetchurl, pkgconfig, gtk, perl, python, zip, unzip
-, libIDL, dbus_glib, bzip2, alsaLib, nspr, yasm, mesa, nss
-, libnotify, cairo, pixman, fontconfig
-, libjpeg
-, pythonPackages
-
+{ stdenv, fetchurl, pkgconfig, m4, gtk, pango, perl, python, zip, libIDL
+, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xlibs
+, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
+, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
+, hunspell, libevent, libstartup_notification, libvpx
+, cairo, gstreamer, gst_plugins_base, icu
+, debugBuild ? false
 , # If you want the resulting program to call itself "Thunderbird"
   # instead of "Shredder", enable this option.  However, those
   # binaries may not be distributed without permission from the
@@ -12,58 +13,75 @@
   enableOfficialBranding ? false
 }:
 
-let version = "17.0.8"; in
+let version = "31.0"; in
+let verName = "${version}"; in
 
-stdenv.mkDerivation {
-  name = "thunderbird-${version}";
+stdenv.mkDerivation rec {
+  name = "thunderbird-${verName}";
 
   src = fetchurl {
-    url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.bz2";
-    sha1 = "4bcbb33f0b3ea050e805723680b5669d80438812";
+    url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/${verName}/source/thunderbird-${verName}.source.tar.bz2";
+    sha1 = "0fe6666fddd4db82ec2e389f30c5ea11d4f72be5";
   };
 
-  #enableParallelBuilding = true;
-
-  buildInputs =
-    [ pkgconfig perl python zip unzip bzip2 gtk dbus_glib alsaLib libIDL nspr
-      libnotify cairo pixman fontconfig yasm mesa nss
-      libjpeg pythonPackages.sqlite3
-    ];
+  buildInputs = # from firefox30Pkgs.xulrunner, but without gstreamer and libvpx
+    [ pkgconfig libpng gtk perl zip libIDL libjpeg zlib 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
+      hunspell libevent libstartup_notification cairo icu
+    ] ++ [ m4 ];
 
-  configureFlags =
-    [ "--enable-application=mail"
-      "--enable-optimize"
-      "--with-pthreads"
-      "--disable-debug"
-      "--enable-strip"
-      "--with-pthreads"
+  configureFlags = [ "--enable-application=mail" ]
+    # from firefox30Pkgs.commonConfigureFlags, but without gstreamer and libvpx
+    ++ [
       "--with-system-jpeg"
-      #"--with-system-png"
       "--with-system-zlib"
       "--with-system-bz2"
       "--with-system-nspr"
       "--with-system-nss"
-      # Broken: https://bugzilla.mozilla.org/show_bug.cgi?id=722975
-      #"--enable-system-cairo"
+      "--with-system-libevent"
+      #"--with-system-libvpx"
+      "--with-system-png"
+      "--with-system-icu"
+      "--enable-system-ffi"
+      "--enable-system-hunspell"
+      "--enable-system-pixman"
+      "--enable-system-sqlite"
+      "--enable-system-cairo"
+      "--disable-gstreamer"
+      "--enable-startup-notification"
+      # "--enable-content-sandbox"            # available since 26.0, but not much info available
+      # "--enable-content-sandbox-reporter"   # keeping disabled for now
       "--disable-crashreporter"
-      "--disable-necko-wifi"
-      "--disable-webm"
       "--disable-tests"
-      "--enable-calendar"
-      "--disable-ogg"
+      "--disable-necko-wifi" # maybe we want to enable this at some point
+      "--disable-installer"
+      "--disable-updater"
+      "--disable-pulseaudio"
+    ] ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
+                        else [ "--disable-debug" "--enable-release"
+                               "--enable-optimize" "--enable-strip" ])
+    ++ [
+      "--disable-javaxpcom"
+      "--enable-stdcxx-compat" # Avoid dependency on libstdc++ 4.7
     ]
     ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
 
-  # The Thunderbird Makefiles refer to the variables LIBXUL_DIST,
-  # prefix, and PREFIX in some places where they are not set.  In
-  # particular, there are some linker flags like
-  # `-rpath-link=$(LIBXUL_DIST)/bin'.  Since this expands to
-  # `-rpath-link=/bin', the build fails due to the purity checks in
-  # the ld wrapper.  So disable the purity check for now.
-  preBuild = "NIX_ENFORCE_PURITY=0";
+  configurePhase = ''
+    patchShebangs .
+
+    echo '${stdenv.lib.concatMapStrings (s : "ac_add_options ${s}\n") configureFlags}' > .mozconfig
+    echo "ac_add_options --prefix='$out'" >> .mozconfig
+    echo "mk_add_options MOZ_MAKE_FLAGS='-j$NIX_BUILD_CORES'" >> .mozconfig
+
+    make ${makeFlags} configure
+  '';
 
-  # This doesn't work:
-  #makeFlags = "LIBXUL_DIST=$(out) prefix=$(out) PREFIX=$(out)";
+  makeFlags = "-f client.mk";
+  buildFlags = "build";
 
   postInstall =
     ''
@@ -83,7 +101,7 @@ stdenv.mkDerivation {
     '';
 
   meta = with stdenv.lib; {
-    description = "Mozilla Thunderbird, a full-featured email client";
+    description = "A full-featured e-mail client";
     homepage = http://www.mozilla.org/thunderbird/;
     license =
       # Official branding implies thunderbird name and logo cannot be reuse,
diff --git a/pkgs/applications/networking/msmtp/default.nix b/pkgs/applications/networking/msmtp/default.nix
index 584fdcd170a7..2b42a275d8c7 100644
--- a/pkgs/applications/networking/msmtp/default.nix
+++ b/pkgs/applications/networking/msmtp/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl, pkgconfig, gnutls, gsasl, libidn }:
 
 stdenv.mkDerivation rec {
-  name = "msmtp-1.4.31";
+  name = "msmtp-1.4.32";
 
   src = fetchurl {
     url = "mirror://sourceforge/msmtp/${name}.tar.bz2";
-    sha256 = "0pr29kb7qsz4q6yfw5wvmw1wm4axi8kc97qhhmp50bx2bylzjyi4";
+    sha256 = "122z38pv4q03w3mbnhrhg4w85a51258sfdg2ips0b6cgwz3wbw1b";
   };
 
   buildInputs = [ openssl pkgconfig gnutls gsasl libidn ];
diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix
index 0981ab394496..7b9396ff5ffb 100644
--- a/pkgs/applications/networking/mumble/default.nix
+++ b/pkgs/applications/networking/mumble/default.nix
@@ -1,45 +1,54 @@
-{ stdenv, fetchurl, qt4, libvorbis, boost, speechd, protobuf, libsndfile,
- avahi, dbus, libcap, pkgconfig,
-jackSupport ? false, 
-jackaudio ? null }:
-
-
+{ stdenv, fetchurl, qt4, boost, protobuf, libsndfile
+, speex, libopus, avahi, pkgconfig
+, jackSupport ? false
+, jack2 ? null
+, speechdSupport ? false
+, speechd ? null
+}:
+
+assert jackSupport -> jack2 != null;
+assert speechdSupport -> speechd != null;
+
+let
+  optional = stdenv.lib.optional;
+  optionalString = stdenv.lib.optionalString;
+in
 stdenv.mkDerivation rec {
   name = "mumble-" + version;
-  version = "1.2.4";
+  version = "1.2.7";
 
   src = fetchurl {
     url = "mirror://sourceforge/mumble/${name}.tar.gz";
-    sha256 = "16wwj6gwcnyjlnzh7wk0l255ldxmbwx0wi652sdp20lsv61q7kx1";
+    sha256 = "0zjqkkdkcvgmqic6np87hj6b6f851lkzyd6y3cqj6zzacjvps31d";
   };
 
-  patchPhase = ''
-    patch -p1 < ${ ./mumble-jack-support.patch }
-  '';
+  patches = optional jackSupport ./mumble-jack-support.patch;
 
   configurePhase = ''
-    qmake CONFIG+=no-g15 CONFIG+=no-update \
-      CONFIG+=no-embed-qt-translations CONFIG+=no-ice \
-  '' 
-  + stdenv.lib.optionalString jackSupport ''
-    CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio
+    qmake CONFIG+=no-g15 CONFIG+=no-update CONFIG+=no-server \
+      CONFIG+=no-embed-qt-translations CONFIG+=packaged \
+      CONFIG+=bundled-celt CONFIG+=no-bundled-opus \
+      ${optionalString (!speechdSupport) "CONFIG+=no-speechd"} \
+      ${optionalString jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"} \
+      CONFIG+=no-bundled-speex
   '';
 
 
-  buildInputs = [ qt4 libvorbis boost speechd protobuf libsndfile avahi dbus
-    libcap pkgconfig ]
-    ++ (stdenv.lib.optional jackSupport jackaudio);
+  buildInputs = [ qt4 boost protobuf libsndfile speex
+    libopus avahi pkgconfig ]
+    ++ (optional jackSupport jack2)
+    ++ (optional speechdSupport speechd);
 
   installPhase = ''
     mkdir -p $out
     cp -r ./release $out/bin
   '';
 
-  meta = { 
-    homepage = http://mumble.sourceforge.net/;
+  meta = with stdenv.lib; { 
+    homepage = "http://mumble.sourceforge.net/";
     description = "Low-latency, high quality voice chat software";
-    license = "BSD";
-    platforms = with stdenv.lib.platforms; linux;
-    maintainers = with stdenv.lib.maintainers; [viric];
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ viric ];
   };
 }
diff --git a/pkgs/applications/networking/mumble/murmur.nix b/pkgs/applications/networking/mumble/murmur.nix
new file mode 100644
index 000000000000..17254aa2fdd5
--- /dev/null
+++ b/pkgs/applications/networking/mumble/murmur.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, qt4, boost, protobuf
+, avahi, libcap, pkgconfig
+, iceSupport ? false
+, zeroc_ice ? null
+}:
+
+assert iceSupport -> zeroc_ice != null;
+
+let
+  optional = stdenv.lib.optional;
+  optionalString = stdenv.lib.optionalString;
+in
+stdenv.mkDerivation rec {
+  name = "murmur-" + version;
+  version = "1.2.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mumble/mumble-${version}.tar.gz";
+    sha256 = "1zxnbwbd81p7lvscghlpkad8kynh9gbf1nhc092sp64pp37xwv47";
+  };
+
+  patchPhase = optional iceSupport ''
+    sed -i 's,/usr/share/Ice/,${zeroc_ice}/,g' src/murmur/murmur.pro
+  '';
+
+  configurePhase = ''
+    qmake CONFIG+=no-client CONFIG+=no-embed-qt \
+    ${optionalString (!iceSupport) "CONFIG+=no-ice"}
+  '';
+
+  buildInputs = [ qt4 boost protobuf avahi libcap pkgconfig ]
+    ++ optional iceSupport [ zeroc_ice ];
+
+  installPhase = ''
+    mkdir -p $out
+    cp -r ./release $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "http://mumble.sourceforge.net/";
+    description = "Low-latency, high quality voice chat software";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ viric ];
+  };
+}
diff --git a/pkgs/applications/networking/newsreaders/kwooty/default.nix b/pkgs/applications/networking/newsreaders/kwooty/default.nix
index 15b1c6c6b4ea..e49e2c6fe261 100644
--- a/pkgs/applications/networking/newsreaders/kwooty/default.nix
+++ b/pkgs/applications/networking/newsreaders/kwooty/default.nix
@@ -5,14 +5,14 @@
 , unrar, p7zip, par2cmdline, coreutils
 }:
 
-let version = "0.8.1";
+let version = "0.8.4";
     name = "kwooty-${version}";
 in stdenv.mkDerivation {
   inherit name;
   
   src = fetchurl {
     url = "mirror://sourceforge/kwooty/${name}.tar.gz";
-    sha256 = "746ed50ec3c067711932c89dc3ee5527c126f37c6922b3eda49535eb83c245e4";
+    sha256 = "0i3zmh7y52n5k0yn3xc6zjpjz75f48nly40n394i6sxy89psgfc2";
   };
 
   patches = [ ./searchPath.patch ];
diff --git a/pkgs/applications/networking/newsreaders/liferea/default.nix b/pkgs/applications/networking/newsreaders/liferea/default.nix
index 55e0ed88814f..a5216b2902a6 100644
--- a/pkgs/applications/networking/newsreaders/liferea/default.nix
+++ b/pkgs/applications/networking/newsreaders/liferea/default.nix
@@ -1,27 +1,56 @@
-{ stdenv, fetchurl, pkgconfig, intltool, glib, gtk2, gnome2 /*just GConf*/
-, libsoup, libunique, libxslt, webkit_gtk2, json_glib
-, libnotify /*optional*/ }:
+{ stdenv, fetchurl, pkgconfig, intltool, python, pygobject3
+, glib, gnome3, pango, libxml2, libxslt, sqlite, libsoup, glib_networking
+, webkitgtk, json_glib, gobjectIntrospection, gst_all_1
+, libnotify
+, makeWrapper
+}:
 
-let version = "1.8.15";
+let pname = "liferea";
+    version = "1.10.10";
 in
 stdenv.mkDerivation rec {
-  name = "liferea-${version}";
+  name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/liferea/Liferea%20Stable/${version}/${name}.tar.bz2";
-    sha256 = "12hhdl5biwcvr9ds7pdhhvlp4vggjix6xm4z5pnfaz53ai2dnc99";
+    url = "https://github.com/lwindolf/${pname}/releases/download/v${version}/${name}.tar.bz2";
+    sha256 = "0y01lhw0fn5m0j9ykz8x7i0wchjqbxp33cvvprsfxfwzz4x31jm4";
   };
 
-  buildInputs = [
-    pkgconfig intltool gtk2 gnome2.GConf
-    libsoup libunique libxslt webkit_gtk2 json_glib
+  buildInputs = with gst_all_1; [
+    pkgconfig intltool python
+    glib gnome3.gtk pango libxml2 libxslt sqlite libsoup
+    webkitgtk json_glib gobjectIntrospection gnome3.gsettings_desktop_schemas
+    gnome3.libpeas gnome3.dconf
+    gst-plugins-base gst-plugins-good gst-plugins-bad
+    gnome3.libgnome_keyring
     libnotify
+    makeWrapper
   ];
 
+  preFixup = ''
+    rm $out/share/icons/hicolor/icon-theme.cache
+
+    for f in "$out"/bin/*; do
+      wrapProgram "$f" \
+        --prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${pygobject3})" \
+        --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
+        --prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules:${glib_networking}/lib/gio/modules" \
+        --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:${gnome3.gnome_icon_theme}/share:${gnome3.gtk}/share:$out/share:$GSETTINGS_SCHEMAS_PATH"
+    done
+  '';
+
   meta = {
     description = "A GTK-based news feed agregator";
     homepage = http://lzone.de/liferea/;
-    maintainers = [ stdenv.lib.maintainers.vcunat ];
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [ vcunat romildo ];
     platforms = stdenv.lib.platforms.linux;
+
+    longDescription = ''
+      Liferea (Linux Feed Reader) is an RSS/RDF feed reader.
+      It's intended to be a clone of the Windows-only FeedReader.
+      It can be used to maintain a list of subscribed feeds,
+      browse through their items, and show their contents.
+    '';
   };
 }
diff --git a/pkgs/applications/networking/newsreaders/slrn/default.nix b/pkgs/applications/networking/newsreaders/slrn/default.nix
new file mode 100644
index 000000000000..c933460af43b
--- /dev/null
+++ b/pkgs/applications/networking/newsreaders/slrn/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl,
+slang, ncurses
+}:
+
+let version = "1.0.1"; in
+
+stdenv.mkDerivation {
+  name = "slrn-${version}";
+
+  src = fetchurl {
+    url = "http://www.jedsoft.org/slrn/download/slrn-1.0.1.tar.gz";
+    sha256 = "1rmaprfwvshzkv0c5vi43839cz3laqjpl306b9z0ghwyjdha1d06";
+  };
+
+  preConfigure = ''
+    sed -i -e "s|-ltermcap|-lncurses|" configure
+    sed -i autoconf/Makefile.in src/Makefile.in \
+      -e "s|/bin/cp|cp|"  \
+      -e "s|/bin/rm|rm|"
+  '';
+
+  configureFlags = "--with-slang=${slang}";
+
+  buildInputs = [ slang ncurses ];
+
+  meta = {
+    description = "The slrn (S-Lang read news) newsreader";
+    homepage = http://slrn.sourceforge.net/index.html;
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/applications/networking/notbit/default.nix b/pkgs/applications/networking/notbit/default.nix
new file mode 100644
index 000000000000..8a7d7d3aedcf
--- /dev/null
+++ b/pkgs/applications/networking/notbit/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchgit, autoconf, automake, pkgconfig, openssl }:
+
+stdenv.mkDerivation rec {
+  name = "notbit-git-faf0930";
+
+  src = fetchgit {
+    url = "git://github.com/bpeel/notbit";
+    rev = "faf09304bf723e75f3d98cca93cf45236ee9d6b6";
+    sha256 = "b229f87c4c5e901bfd8b13dffe31157126d98ed02118fff6553e8b58eb9ed030";
+  };
+
+  buildInputs = [ autoconf automake pkgconfig openssl ];
+
+  preConfigure = "autoreconf -vfi";
+
+  meta = with stdenv.lib; { 
+    homepage = http://busydoingnothing.co.uk/notbit/;
+    description = "A minimal bitmessage client";
+    license = licenses.mit;
+
+    # This is planned to change when the project officially supports other platforms
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix b/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix
new file mode 100644
index 000000000000..e4ca6d423cdc
--- /dev/null
+++ b/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, cmake, pkgconfig, qt4, boost, bzip2, libX11, pcre, libidn, lua5, miniupnpc, aspell, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "eiskaltdcpp-2.2.9";
+
+  src = fetchurl {
+    url = "https://eiskaltdc.googlecode.com/files/${name}.tar.xz";
+    sha256 = "3d9170645450f9cb0a605278b8646fec2110b9637910d86fd27cf245cbe24eaf";
+  };
+
+  buildInputs = [ cmake pkgconfig qt4 boost bzip2 libX11 pcre libidn lua5 miniupnpc aspell gettext ];
+
+  cmakeFlags = ''
+    -DUSE_ASPELL=ON
+    -DUSE_QT_QML=ON
+    -DFREE_SPACE_BAR_C=ON
+    -DUSE_MINIUPNP=ON
+    -DDBUS_NOTIFY=ON
+    -DUSE_JS=ON
+    -DPERL_REGEX=ON
+    -DUSE_CLI_XMLRPC=ON
+    -DWITH_SOUNDS=ON
+    -DLUA_SCRIPT=ON
+    -DWITH_LUASCRIPTS=ON
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A cross-platform program that uses the Direct Connect and ADC protocols";
+    homepage = https://code.google.com/p/eiskaltdc/;
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/applications/networking/p2p/freenet/default.nix b/pkgs/applications/networking/p2p/freenet/default.nix
index 67037a071327..4e7057116773 100644
--- a/pkgs/applications/networking/p2p/freenet/default.nix
+++ b/pkgs/applications/networking/p2p/freenet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, apacheAntOpenJDK, jre }:
+{ stdenv, fetchurl, ant, jdk }:
 
 let
   # The .gitmodules in freenet-official-20130413-eccc9b3198
@@ -14,7 +14,7 @@ let
   };
 in
 stdenv.mkDerivation {
-  name = "freenet-official-20130413-eccc9b3198";
+  name = "freenet-20130413-eccc9b3198";
 
   src = fetchurl {
     url = https://github.com/freenet/fred-official/tarball/eccc9b3198;
@@ -29,28 +29,28 @@ stdenv.mkDerivation {
     sed '/antcall.*-ext/d' -i build.xml
   '';
 
-  buildInputs = [ apacheAntOpenJDK jre ];
+  buildInputs = [ ant jdk ];
 
   buildPhase = "ant package-only";
 
   installPhase = ''
-    ensureDir $out/share/freenet $out/bin
+    mkdir -p $out/share/freenet $out/bin
     cp lib/bcprov.jar $out/share/freenet
     cp lib/freenet/freenet-ext.jar $out/share/freenet
     cp dist/freenet.jar $out/share/freenet
 
     cat <<EOF > $out/bin/freenet
     #!${stdenv.shell}
-    ${jre}/bin/java -cp $out/share/freenet/bcprov.jar:$out/share/freenet/freenet-ext.jar:$out/share/freenet/freenet.jar \\
+    ${jdk.jre}/bin/java -cp $out/share/freenet/bcprov.jar:$out/share/freenet/freenet-ext.jar:$out/share/freenet/freenet.jar \\
       -Xmx1024M freenet.node.NodeStarter
     EOF
     chmod +x $out/bin/freenet
   '';
 
-  meta = { 
+  meta = {
     description = "Decentralised and censorship-resistant network";
     homepage = https://freenetproject.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/networking/p2p/gnunet/default.nix b/pkgs/applications/networking/p2p/gnunet/default.nix
index 704dd5719c7e..6c28840f7e5f 100644
--- a/pkgs/applications/networking/p2p/gnunet/default.nix
+++ b/pkgs/applications/networking/p2p/gnunet/default.nix
@@ -1,20 +1,19 @@
-{ stdenv, fetchurl, libextractor, libmicrohttpd, libgcrypt
-, zlib, gmp, curl, libtool, adns, sqlite, pkgconfig
-, libxml2, ncurses, gettext, libunistring, libidn
-, makeWrapper }:
+{ stdenv, fetchurl, adns, curl, gettext, gmp, gnutls, libextractor
+, libgcrypt, libgnurl, libidn, libmicrohttpd, libtool, libunistring
+, makeWrapper, ncurses, pkgconfig, libxml2, sqlite, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "gnunet-0.9.5a";
+  name = "gnunet-0.10.1";
 
   src = fetchurl {
     url = "mirror://gnu/gnunet/${name}.tar.gz";
-    sha256 = "1mxy1ikv44fia3cybpmiw298x5371a2qh8hr7pi55yg1xqbhfq0x";
+    sha256 = "04wxzm3wkgqbn42b8ksr4cx6m5cckyig5cls1adh0nwdczwvnp7n";
   };
 
   buildInputs = [
-    libextractor libmicrohttpd libgcrypt gmp curl libtool
-    zlib adns sqlite libxml2 ncurses libidn
-    pkgconfig gettext libunistring makeWrapper
+    adns curl gettext gmp gnutls libextractor libgcrypt libgnurl libidn
+    libmicrohttpd libtool libunistring libxml2 makeWrapper ncurses
+    pkgconfig sqlite zlib
   ];
 
   preConfigure = ''
@@ -74,7 +73,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://gnunet.org/;
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = with stdenv.lib.maintainers; [ ludo viric ];
     platforms = stdenv.lib.platforms.gnu;
diff --git a/pkgs/applications/networking/p2p/gnunet/svn.nix b/pkgs/applications/networking/p2p/gnunet/svn.nix
index ed6c348706b9..25a51b3c9365 100644
--- a/pkgs/applications/networking/p2p/gnunet/svn.nix
+++ b/pkgs/applications/networking/p2p/gnunet/svn.nix
@@ -85,7 +85,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://gnunet.org/;
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     maintainers = with stdenv.lib.maintainers; [ ludo viric ];
     platforms = stdenv.lib.platforms.gnu;
diff --git a/pkgs/applications/networking/p2p/ktorrent/default.nix b/pkgs/applications/networking/p2p/ktorrent/default.nix
index b408f20b7110..e53fda089111 100644
--- a/pkgs/applications/networking/p2p/ktorrent/default.nix
+++ b/pkgs/applications/networking/p2p/ktorrent/default.nix
@@ -5,11 +5,11 @@ stdenv.mkDerivation rec {
   name = pname + "-" + version;
 
   pname = "ktorrent";
-  version = "4.2.1";
+  version = "4.3.1";
 
   src = fetchurl {
     url = "${meta.homepage}/downloads/${version}/${name}.tar.bz2";
-    sha256 = "1b6w7i1vvq8mlw9yrlxvb51hvaj6rpl8lv9b9zagyl3wcanz73zd";
+    sha256 = "66094f6833347afb0c49e332f0ec15ec48db652cbe66476840846ffd5ca0e4a1";
   };
 
   patches = [ ./find-workspace.diff ];
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "KDE integrated BtTorrent client";
-    homepage = http://ktorrent.org;
+    homepage = http://ktorrent.pwsp.net;
     maintainers = with stdenv.lib.maintainers; [ sander urkud ];
     inherit (libktorrent.meta) platforms;
   };
diff --git a/pkgs/applications/networking/p2p/ldcpp/default.nix b/pkgs/applications/networking/p2p/ldcpp/default.nix
index 1b601992aa6f..6f282b30fa14 100644
--- a/pkgs/applications/networking/p2p/ldcpp/default.nix
+++ b/pkgs/applications/networking/p2p/ldcpp/default.nix
@@ -33,6 +33,5 @@ stdenv.mkDerivation rec {
       [doScons doForceShare doPropagate]);
   meta = {
     description = "Linux DC++ - Direct Connect client";
-    inherit src;
   };
 }
diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix
index 2f739b056d4f..57ea62485310 100644
--- a/pkgs/applications/networking/p2p/mldonkey/default.nix
+++ b/pkgs/applications/networking/p2p/mldonkey/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, ocaml, zlib, bzip2, ncurses, file, gd, libpng }:
 
 stdenv.mkDerivation (rec {
-  name = "mldonkey-3.1.3";
+  name = "mldonkey-3.1.5";
   
   src = fetchurl {
     url = "mirror://sourceforge/mldonkey/${name}.tar.bz2";
-    sha256 = "1qnr0qzliw4aynf2zhmm5hmrc9bd5vhdq3bi8n88j4nc86gry9bw";
+    sha256 = "1jqik6b09p27ckssppfiqpph7alxbgpnf9w1s0lalmi3qyyd9ybl";
   };
   
   meta = {
diff --git a/pkgs/applications/networking/p2p/ncdc/default.nix b/pkgs/applications/networking/p2p/ncdc/default.nix
new file mode 100644
index 000000000000..5f7ad92f7cc6
--- /dev/null
+++ b/pkgs/applications/networking/p2p/ncdc/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, ncurses, zlib, bzip2, sqlite, pkgconfig, glib, gnutls }:
+
+let
+  version = "1.19.1";
+in
+stdenv.mkDerivation {
+  name = "ncdc-${version}";
+
+  src = fetchurl {
+    url = "http://dev.yorhel.nl/download/ncdc-${version}.tar.gz";
+    sha256 = "0iwx4b3x207sw11qqjfynpwnhryhixjzbgcy9l9zfisa8f0k7cm6";
+  };
+
+  buildInputs = [ ncurses zlib bzip2 sqlite pkgconfig glib gnutls ];
+
+  meta = {
+    description = "Modern and lightweight direct connect client with a friendly ncurses interface";
+    homepage = http://dev.yorhel.nl/ncdc;
+    license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.linux; # arbitrary
+    maintainers = [ stdenv.lib.maintainers.emery ];
+  };
+}
diff --git a/pkgs/applications/networking/p2p/qbittorrent/default.nix b/pkgs/applications/networking/p2p/qbittorrent/default.nix
new file mode 100644
index 000000000000..0ba160c8a917
--- /dev/null
+++ b/pkgs/applications/networking/p2p/qbittorrent/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, qt4, which, dbus_libs, boost, libtorrentRasterbar
+, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "qbittorrent-3.1.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qbittorrent/${name}.tar.xz";
+    sha256 = "16m3l8qjcj63brzrdn82cbijvz8fcxfgpibi4g5g6sbissjkwsww";
+  };
+
+  buildInputs = [ qt4 which dbus_libs boost libtorrentRasterbar
+    pkgconfig ];
+
+  configureFlags = "--with-libboost-inc=${boost}/include "
+    + "--with-libboost-lib=${boost}/lib";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Free Software alternative to µtorrent";
+    homepage = http://www.qbittorrent.org/;
+    maintainers = with stdenv.lib.maintainers; [ viric ];
+  };
+}
diff --git a/pkgs/applications/networking/p2p/retroshare/0.6.nix b/pkgs/applications/networking/p2p/retroshare/0.6.nix
new file mode 100644
index 000000000000..6ea7089b3fb0
--- /dev/null
+++ b/pkgs/applications/networking/p2p/retroshare/0.6.nix
@@ -0,0 +1,58 @@
+{ stdenv, fetchsvn, cmake, qt, libupnp, gpgme, gnome3, glib, libssh, pkgconfig, protobuf, bzip2
+, libXScrnSaver, speex, curl, libxml2, libxslt, sqlcipher }:
+
+stdenv.mkDerivation {
+  name = "retroshare-0.6-svn-7445";
+
+  src = fetchsvn {
+    url = svn://svn.code.sf.net/p/retroshare/code/trunk;
+    rev = 7445;
+    sha256 = "1dqh65bn21g7ix752ddrr10kijjdwjgjipgysyxnm90zjmdlx3cc";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${glib}/include/glib-2.0 -I${glib}/lib/glib-2.0/include -I${libxml2}/include/libxml2 -I${sqlcipher}/include/sqlcipher";
+
+  patchPhase = ''
+    # Fix build error
+    sed -i 's/UpnpString_get_String(es_event->PublisherUrl)/es_event->PublisherUrl/' \
+      libretroshare/src/upnp/UPnPBase.cpp
+    # Extensions get installed 
+    sed -i "s,/usr/lib/retroshare/extensions6/,$out/share/retroshare," \
+      libretroshare/src/rsserver/rsinit.cc
+    # Where to find the bootstrap DHT bdboot.txt
+    sed -i "s,/usr/share/RetroShare,$out/share/retroshare," \
+      libretroshare/src/rsserver/rsaccounts.cc
+  '';
+
+  #  sed -i "s,LIBS +=.*sqlcipher.*,LIBS += -lsqlcipher," \
+  #    retroshare-gui/src/retroshare-gui.pro \
+  #    retroshare-nogui/src/retroshare-nogui.pro
+
+  buildInputs = [ speex qt libupnp gpgme gnome3.libgnome_keyring glib libssh pkgconfig
+                  protobuf bzip2 libXScrnSaver curl libxml2 libxslt sqlcipher ];
+
+  configurePhase = ''
+    qmake PREFIX=$out DESTDIR=$out RetroShare.pro
+  '';
+
+  postInstall = ''
+    mkdir -p $out/bin
+    mv $out/retroshare-nogui $out/bin
+    mv $out/RetroShare $out/bin
+
+    # plugins
+    mkdir -p $out/share/retroshare
+    mv $out/lib* $out/share/retroshare
+
+    # BT DHT bootstrap
+    cp libbitdht/src/bitdht/bdboot.txt $out/share/retroshare
+  '';
+
+  meta = with stdenv.lib; {
+    description = "";
+    homepage = http://retroshare.sourceforge.net/;
+    #license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.iElectric ];
+  };
+}
diff --git a/pkgs/applications/networking/p2p/retroshare/default.nix b/pkgs/applications/networking/p2p/retroshare/default.nix
index d4e3aa91cc0b..a139531b19a6 100644
--- a/pkgs/applications/networking/p2p/retroshare/default.nix
+++ b/pkgs/applications/networking/p2p/retroshare/default.nix
@@ -1,28 +1,54 @@
-{stdenv, fetchurl, qt, libupnp, gpgme, libgnome_keyring, glib}:
-
-throw "still fails to build"
+{ stdenv, fetchurl, cmake, qt, libupnp, gpgme, gnome3, glib, libssh, pkgconfig, protobuf, bzip2
+, libXScrnSaver, speex, curl, libxml2, libxslt }:
 
 stdenv.mkDerivation {
-  name = "retroshare-0.5.1d";
+  name = "retroshare-0.5.5c";
 
   src = fetchurl {
-    url = mirror://sourceforge/retroshare/RetroShare-v0.5.1d.tar.gz;
-    sha256 = "15971wxx8djwcxn170jyn0mlh7cfzqsf031aa849wr9z234gwrcn";
+    url = mirror://sourceforge/project/retroshare/RetroShare/0.5.5c/retroshare_0.5.5-0.7068.tar.gz;
+    sha256 = "0l2n4pr1hq66q6qa073hrdx3s3d7iw54z8ay1zy82zhk2rwhsavp";
   };
 
-  buildInputs = [ qt libupnp gpgme libgnome_keyring glib ];
-
-  buildPhase = ''
-    cd libbitdht/src
-    qmake libbitdht.pro PREFIX=$out
-    make
-    cd ../..
-    cd libretroshare/src
-    qmake libretroshare.pro PREFIX=$out
-    make
-    cd ../../src
-    qmake libretroshare.pro PREFIX=$out
-    make
+  NIX_CFLAGS_COMPILE = "-I${glib}/include/glib-2.0 -I${glib}/lib/glib-2.0/include -I${libxml2}/include/libxml2";
+
+  patchPhase = ''
+    sed -i 's/UpnpString_get_String(es_event->PublisherUrl)/es_event->PublisherUrl/' \
+      libretroshare/src/upnp/UPnPBase.cpp
+    # Extensions get installed 
+    sed -i "s,/usr/lib/retroshare/extensions/,$out/share/retroshare," \
+      libretroshare/src/rsserver/rsinit.cc
+    # For bdboot.txt
+    sed -i "s,/usr/share/RetroShare,$out/share/retroshare," \
+      libretroshare/src/rsserver/rsinit.cc
+  '';
+
+  buildInputs = [ speex qt libupnp gpgme gnome3.libgnome_keyring glib libssh pkgconfig
+                  protobuf bzip2 libXScrnSaver curl libxml2 libxslt ];
+
+  sourceRoot = "retroshare-0.5.5/src";
+
+  configurePhase = ''
+    qmake PREFIX=$out DESTDIR=$out RetroShare.pro
   '';
 
+  postInstall = ''
+    mkdir -p $out/bin
+    mv $out/retroshare-nogui $out/bin
+    mv $out/RetroShare $out/bin
+
+    # plugins
+    mkdir -p $out/share/retroshare
+    mv $out/lib* $out/share/retroshare
+
+    # BT DHT bootstrap
+    cp libbitdht/src/bitdht/bdboot.txt $out/share/retroshare
+  '';
+
+  meta = with stdenv.lib; {
+    description = "";
+    homepage = http://retroshare.sourceforge.net/;
+    #license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.iElectric ];
+  };
 }
diff --git a/pkgs/applications/networking/p2p/transmission-remote-gtk/default.nix b/pkgs/applications/networking/p2p/transmission-remote-gtk/default.nix
index 894b1363cd04..8fa5cb6c2ee6 100644
--- a/pkgs/applications/networking/p2p/transmission-remote-gtk/default.nix
+++ b/pkgs/applications/networking/p2p/transmission-remote-gtk/default.nix
@@ -1,15 +1,21 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, json_glib, curl }:
+{ stdenv, makeWrapper, fetchurl, pkgconfig, intltool, gtk3, json_glib, curl }:
 
 
 stdenv.mkDerivation rec {
-  name = "transmission-remote-gtk-1.0.1";
+  name = "transmission-remote-gtk-1.1.1";
 
   src = fetchurl {
     url = "http://transmission-remote-gtk.googlecode.com/files/${name}.tar.gz";
-    sha256 = "b1ae032dd52b2d7975656913e4fe39e7f74d29ef8138292d8b82318ff9afed6f";
+    sha256 = "1jbh2pm4i740cmzqd2r7zxnqqipvv2v2ndmnmk53nqrxcbgc4nlz";
   };
 
-  buildInputs = [ pkgconfig intltool gtk json_glib curl ];
+  buildInputs = [ makeWrapper pkgconfig intltool gtk3 json_glib curl ];
+
+  preFixup = ''
+    wrapProgram "$out/bin/transmission-remote-gtk" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+    rm $out/share/icons/hicolor/icon-theme.cache
+  '';
 
   meta = {
    description = "GTK remote control for the Transmission BitTorrent client";
diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix
index cb439ddb4624..874de7d51929 100644
--- a/pkgs/applications/networking/p2p/transmission/default.nix
+++ b/pkgs/applications/networking/p2p/transmission/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper
-, openssl, curl, libevent, inotifyTools
+, openssl, curl, libevent, inotifyTools, systemd
 , enableGTK3 ? false, gtk3
 }:
 
 let
-  version = "2.82";
+  version = "2.84";
 in
 
 with { inherit (stdenv.lib) optional optionals optionalString; };
@@ -14,11 +14,12 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://download.transmissionbt.com/files/transmission-${version}.tar.xz";
-    sha256 = "08imy28hpjxwdzgvhm66hkfyzp8qnnqr4jhv3rgshryzhw86b5ir";
+    sha256 = "1sxr1magqb5s26yvr5yhs1f7bmir8gl09niafg64lhgfnhv1kz59";
   };
 
   buildInputs = [ pkgconfig intltool file openssl curl libevent inotifyTools ]
-    ++ optionals enableGTK3 [ gtk3 makeWrapper ];
+    ++ optionals enableGTK3 [ gtk3 makeWrapper ]
+    ++ optional stdenv.isLinux systemd;
 
   preConfigure = ''
     sed -i -e 's|/usr/bin/file|${file}/bin/file|g' configure
@@ -27,10 +28,10 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--with-systemd-daemon" ]
     ++ optional enableGTK3 "--with-gtk";
 
-  postInstall = optionalString enableGTK3 /* gsettings schemas for file dialogues */ ''
+  preFixup = optionalString enableGTK3 /* gsettings schemas for file dialogues */ ''
     rm "$out/share/icons/hicolor/icon-theme.cache"
     wrapProgram "$out/bin/transmission-gtk" \
-      --prefix XDG_DATA_DIRS : "${gtk3}/share"
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
   '';
 
   meta = with stdenv.lib; {
@@ -48,7 +49,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = http://www.transmissionbt.com/;
     license = licenses.gpl2; # parts are under MIT
-    maintainers = with maintainers; [ astsmtl vcunat ];
+    maintainers = with maintainers; [ astsmtl vcunat wizeman ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/p2p/tribler/default.nix b/pkgs/applications/networking/p2p/tribler/default.nix
index 5fa19c71d9a1..5bc228f9a6b9 100644
--- a/pkgs/applications/networking/p2p/tribler/default.nix
+++ b/pkgs/applications/networking/p2p/tribler/default.nix
@@ -44,6 +44,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://www.tribler.org/;
     description = "A completely decentralised P2P filesharing client based on the Bittorrent protocol";
-    license = "LGPLv2.1";
+    license = stdenv.lib.licenses.lgpl21;
   };
 }
diff --git a/pkgs/applications/networking/p2p/twister/default.nix b/pkgs/applications/networking/p2p/twister/default.nix
new file mode 100644
index 000000000000..36f83a0611bf
--- /dev/null
+++ b/pkgs/applications/networking/p2p/twister/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, python
+, boost, db, openssl, geoip, libiconv, miniupnpc
+, srcOnly, fetchgit
+}:
+
+let
+  twisterHTML = srcOnly {
+    name = "twister-html";
+    src = fetchgit {
+      url = "git://github.com/miguelfreitas/twister-html.git";
+      rev = "891f7bf24e1c3df7ec5e1db23c765df2d7c2d5a9";
+      sha256 = "0d96rfkpwxyiz32k2pd6a64r2kr3600qgp9v73ddcpq593wf11qb";
+    };
+  };
+
+in stdenv.mkDerivation rec {
+  name = "twister-${version}";
+  version = "0.9.22";
+
+  src = fetchurl {
+    url = "https://github.com/miguelfreitas/twister-core/"
+        + "archive/v${version}.tar.gz";
+    sha256 = "1haq0d7ypnazs599g4kcq1x914fslc04wazqj54rlvjdp7yx4j3f";
+  };
+
+  configureFlags = [
+    "--with-libgeoip"
+    "--with-libiconv"
+    "--with-boost=${boost}"
+    "--disable-deprecated-functions"
+    "--enable-tests"
+    "--enable-python-binding"
+  ];
+
+  buildInputs = [
+    autoconf automake libtool pkgconfig python
+    boost db openssl geoip libiconv miniupnpc
+  ];
+
+  postPatch = ''
+    sed -i -e '/-htmldir/s|(default: [^)]*)|(default: ${twisterHTML})|' \
+      src/init.cpp
+    sed -i -e '/GetDataDir.*html/s|path *= *[^;]*|path = "${twisterHTML}"|' \
+      src/util.cpp
+  '';
+
+  preConfigure = ''
+    sh autotool.sh
+  '';
+
+  installPhase = ''
+    install -vD twisterd "$out/bin/twisterd"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://www.twister.net.co/";
+    description = "Peer-to-peer microblogging";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/applications/networking/pjsip/default.nix b/pkgs/applications/networking/pjsip/default.nix
index 558394199f45..4d08e1cc60a1 100644
--- a/pkgs/applications/networking/pjsip/default.nix
+++ b/pkgs/applications/networking/pjsip/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "SIP stack and media stack for presence, im, and multimedia communication";
     homepage = http://pjsip.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix
index 8f89d70405ad..8785837fbb93 100644
--- a/pkgs/applications/networking/remote/freerdp/default.nix
+++ b/pkgs/applications/networking/remote/freerdp/default.nix
@@ -61,7 +61,5 @@ stdenv.mkDerivation rec {
     homepage = http://www.freerdp.com/;
 
     license = "free-non-copyleft";
-
-    maintainers = [ stdenv.lib.maintainers.shlevy ];
   };
 }
diff --git a/pkgs/applications/networking/remote/freerdp/unstable.nix b/pkgs/applications/networking/remote/freerdp/unstable.nix
index ef8ddf8b0e3b..a8388b4829af 100644
--- a/pkgs/applications/networking/remote/freerdp/unstable.nix
+++ b/pkgs/applications/networking/remote/freerdp/unstable.nix
@@ -25,7 +25,7 @@ assert printerSupport -> cups != null;
 let rev = "ec6effcb1e7759551cf31f5b18d768afc67db97d"; in
 
 stdenv.mkDerivation rec {
-  name = "freerdp-1.1pre${rev}";
+  name = "freerdp-1.1pre-${stdenv.lib.strings.substring 0 7 rev}";
 
   src = fetchgit {
     url = git://github.com/FreeRDP/FreeRDP.git;
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
 
     license = "free-non-copyleft";
 
-    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    broken = true;  # fails to build
   };
 }
 
diff --git a/pkgs/applications/networking/remote/rdesktop/default.nix b/pkgs/applications/networking/remote/rdesktop/default.nix
index c8c72160b341..9ba9e3aa3fc4 100644
--- a/pkgs/applications/networking/remote/rdesktop/default.nix
+++ b/pkgs/applications/networking/remote/rdesktop/default.nix
@@ -2,17 +2,21 @@
 
 stdenv.mkDerivation (rec {
   pname = "rdesktop";
-  version = "1.7.1";
+  version = "1.8.1";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${pname}/${name}.tar.gz";
-    sha256 = "0yc4xz95w40m8ailpjgqp9h7bkc758vp0dlq4nj1pvr3xfnl7sni";
+    sha256 = "0il248cdsxvwjsl4bswf27ld9r1a7d48jf6bycr86kf3i55q7k3n";
   };
 
   buildInputs = [openssl libX11];
 
-  configureFlags = [ "--with-openssl=${openssl}" ];
+  configureFlags = [
+    "--with-openssl=${openssl}"
+    "--disable-credssp"
+    "--disable-smartcard"
+  ];
 
   meta = {
     description = "rdesktop is an open source client for Windows Terminal Services";
diff --git a/pkgs/applications/networking/remote/remmina/default.nix b/pkgs/applications/networking/remote/remmina/default.nix
index b2b24a2565c6..8fb929d53e10 100644
--- a/pkgs/applications/networking/remote/remmina/default.nix
+++ b/pkgs/applications/networking/remote/remmina/default.nix
@@ -1,8 +1,21 @@
 { stdenv, fetchurl, cmake, pkgconfig, makeWrapper
 , glib, gtk, gettext, libxkbfile, libgnome_keyring, libX11
-, freerdp, libssh, libgcrypt, gnutls }:
+, freerdp, libssh, libgcrypt, gnutls, makeDesktopItem }:
 
-let version = "1.0.0"; in
+let
+  version = "1.0.0";
+  
+  desktopItem = makeDesktopItem {
+    name = "remmina";
+    desktopName = "Remmina";
+    genericName = "Remmina Remote Desktop Client";
+    exec = "remmina";
+    icon = "remmina";
+    comment = "Connect to remote desktops";
+    categories = "GTK;GNOME;X-GNOME-NetworkSettings;Network;";
+  };
+
+in
 
 stdenv.mkDerivation {
   name = "remmina-${version}";
@@ -18,14 +31,21 @@ stdenv.mkDerivation {
 
   cmakeFlags = "-DWITH_VTE=OFF -DWITH_TELEPATHY=OFF -DWITH_AVAHI=OFF";
 
+  patches = [ ./lgthread.patch ];
+
   postInstall = ''
+    mkdir -pv $out/share/applications
+    mkdir -pv $out/share/icons
+    cp ${desktopItem}/share/applications/* $out/share/applications
+    cp -r $out/share/remmina/icons/* $out/share/icons
     wrapProgram $out/bin/remmina --prefix LD_LIBRARY_PATH : "${libX11}/lib"
   '';
 
-  meta = {
-    license = "GPLv2";
+  meta = with stdenv.lib; {
+    license = stdenv.lib.licenses.gpl2;
     homepage = "http://remmina.sourceforge.net/";
     description = "Remmina is a remote desktop client written in GTK+";
     maintainers = [];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/remote/remmina/lgthread.patch b/pkgs/applications/networking/remote/remmina/lgthread.patch
new file mode 100644
index 000000000000..2d8e60f75726
--- /dev/null
+++ b/pkgs/applications/networking/remote/remmina/lgthread.patch
@@ -0,0 +1,16 @@
+Fix [undefined reference to `g_thread_init'] as suggested by
+http://ragnermagalhaes.blogspot.ru/2007/09/undefined-reference-to-gthreadinit.html
+
+diff -ru FreeRDP-Remmina-356c033.orig/remmina/CMakeLists.txt FreeRDP-Remmina-356c033/remmina/CMakeLists.txt
+--- FreeRDP-Remmina-356c033.orig/remmina/CMakeLists.txt	2013-11-05 12:43:27.660276912 +0400
++++ FreeRDP-Remmina-356c033/remmina/CMakeLists.txt	2013-11-05 12:53:39.607018349 +0400
+@@ -132,6 +132,8 @@
+ 	endif()
+ endif()
+ 
++set( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lgthread-2.0" )
++
+ add_subdirectory(po)
+ add_subdirectory(icons)
+ add_subdirectory(desktop)
+
diff --git a/pkgs/applications/networking/remote/ssvnc/default.nix b/pkgs/applications/networking/remote/ssvnc/default.nix
index b2c9b7c3e73a..f142395aa57b 100644
--- a/pkgs/applications/networking/remote/ssvnc/default.nix
+++ b/pkgs/applications/networking/remote/ssvnc/default.nix
@@ -1,8 +1,9 @@
-{ stdenv, fetchurl, imake, zlib, openjdk, libX11, libXt, libXmu, libXaw, libXext, libXpm, openjpeg, openssl }:
+{ stdenv, fetchurl, imake, zlib, openjdk, libX11, libXt, libXmu
+, libXaw, libXext, libXpm, openjpeg, openssl, tcl, tk }:
 
-let version = "1.0.29"; in
 stdenv.mkDerivation rec {
   name = "ssvnc-${version}";
+  version = "1.0.29";
 
   src = fetchurl {
     url = "mirror://sourceforge/ssvnc/${name}.src.tar.gz";
@@ -13,10 +14,14 @@ stdenv.mkDerivation rec {
 
   configurePhase = "makeFlags=PREFIX=$out";
 
+  postInstall = ''
+    sed -i -e 's|exec wish|exec ${tk}/bin/wish|' $out/lib/ssvnc/util/ssvnc.tcl
+  '';
+
   meta = {
     description = "VNC viewer that adds encryption security to VNC connections";
     homepage = "http://www.karlrunge.com/x11vnc/ssvnc.html";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.edwtjo ];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/networking/remote/teamviewer/8.nix b/pkgs/applications/networking/remote/teamviewer/8.nix
index 8113e33e0a72..459ae9fab82b 100644
--- a/pkgs/applications/networking/remote/teamviewer/8.nix
+++ b/pkgs/applications/networking/remote/teamviewer/8.nix
@@ -1,26 +1,20 @@
-{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper
-, bash }:
+{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wineUnstable, makeWrapper, libXau
+, bash, patchelf }:
 
-# Work in progress.
-
-# It doesn't want to start unless teamviewerd is running as root.
-# I haven't tried to make the daemon run.
-
-assert stdenv.system == "i686-linux";
 let
-  topath = "${wine}/bin";
+  topath = "${wineUnstable}/bin";
 
   toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") 
-    [ stdenv.gcc.gcc libX11 libXtst libXext libXdamage libXfixes wine ]);
+    [ stdenv.gcc.gcc libX11 libXtst libXext libXdamage libXfixes wineUnstable ]);
 in
 stdenv.mkDerivation {
   name = "teamviewer-8.0.17147";
   src = fetchurl {
-    url = "http://download.teamviewer.com/download/teamviewer_linux_x64.deb";
-    sha256 = "01iynk954pphl5mq4avs843xyzvdfzng1lpsy7skgwvw0k9cx5ab";
+    url = "http://download.teamviewer.com/download/version_8x/teamviewer_linux_x64.deb";
+    sha256 = "0s5m15f99rdmspzwx3gb9mqd6jx1bgfm0d6rfd01k9rf7gi7qk0k";
   };
 
-  buildInputs = [ makeWrapper ];
+  buildInputs = [ makeWrapper patchelf ];
 
   unpackPhase = ''
     ar x $src
@@ -36,14 +30,18 @@ stdenv.mkDerivation {
     #!${bash}/bin/sh
     export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
     export PATH=${topath}\''${PATH:+:\$PATH}
-    $out/share/teamviewer8/tv_bin/script/teamviewer
+    $out/share/teamviewer8/tv_bin/script/teamviewer "\$@"
     EOF
     chmod +x $out/bin/teamviewer
+
+    patchelf --set-rpath "${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib:${libX11}/lib:${libXext}/lib:${libXau}/lib:${libXdamage}/lib:${libXfixes}/lib" $out/share/teamviewer8/tv_bin/teamviewerd
+    patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" $out/share/teamviewer8/tv_bin/teamviewerd
+    ln -s $out/share/teamviewer8/tv_bin/teamviewerd $out/bin/
   '';
 
   meta = {
     homepage = "http://www.teamviewer.com";
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
     description = "Desktop sharing application, providing remote support and online meetings";
   };
 }
diff --git a/pkgs/applications/networking/remote/teamviewer/default.nix b/pkgs/applications/networking/remote/teamviewer/default.nix
index 8c6295197643..65ddd7305c83 100644
--- a/pkgs/applications/networking/remote/teamviewer/default.nix
+++ b/pkgs/applications/networking/remote/teamviewer/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper
-, bash }:
+, bash, findutils, coreutils }:
 
 assert stdenv.system == "i686-linux";
 let
@@ -11,7 +11,7 @@ in
 stdenv.mkDerivation {
   name = "teamviewer-7.0.9377";
   src = fetchurl {
-    url = "http://www.teamviewer.com/download/version_7x/teamviewer_linux.tar.gz";
+    url = "http://download.teamviewer.com/download/version_7x/teamviewer_linux.tar.gz";
     sha256 = "1f8934jqj093m1z56yl6k2ah6njkk6pz1rjvpqnryi29pp5piaiy";
   };
 
@@ -31,6 +31,13 @@ stdenv.mkDerivation {
 
     cat > $out/bin/teamviewer << EOF
     #!${bash}/bin/sh
+    # Teamviewer puts symlinks to nix store paths in ~/.teamviewer. When those
+    # paths become garbage collected, teamviewer crashes upon start because of
+    # those broken symlinks. An easy workaround to this behaviour is simply to
+    # delete all symlinks before we start teamviewer. Teamviewer will fixup the
+    # symlinks, just like it did the first time the user ran it.
+    ${findutils}/bin/find "\$HOME"/.teamviewer/*/*/"Program Files/TeamViewer/" -type l -print0 | ${findutils}/bin/xargs -0 ${coreutils}/bin/rm
+
     export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
     export PATH=${topath}\''${PATH:+:\$PATH}
     $out/share/teamviewer/wrapper wine "c:\Program Files\TeamViewer\Version7\TeamViewer.exe" "\$@"
@@ -40,7 +47,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://www.teamviewer.com";
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
     description = "Desktop sharing application, providing remote support and online meetings";
   };
 }
diff --git a/pkgs/applications/networking/seafile-client/default.nix b/pkgs/applications/networking/seafile-client/default.nix
new file mode 100644
index 000000000000..e9036ba92614
--- /dev/null
+++ b/pkgs/applications/networking/seafile-client/default.nix
@@ -0,0 +1,39 @@
+{stdenv, fetchurl, writeScript, pkgconfig, cmake, qt4, seafile-shared, ccnet, makeWrapper}:
+
+stdenv.mkDerivation rec
+{
+  version = "3.0.4";
+  name = "seafile-client-${version}";
+
+  src = fetchurl
+  {
+    url = "https://github.com/haiwen/seafile-client/archive/v${version}.tar.gz";
+    sha256 = "10iz45y8j5f9smi0srxw62frb97vhr0w938v8w3rsjcw9qq366a2";
+  };
+
+  buildInputs = [ pkgconfig cmake qt4 seafile-shared makeWrapper ];
+
+  builder = writeScript "${name}-builder.sh" ''
+    source $stdenv/setup
+
+    tar xvfz $src
+    cd seafile-client-*
+
+    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DCMAKE_INSTALL_PREFIX="$out" .
+    make -j1
+
+    make install
+
+    wrapProgram $out/bin/seafile-applet \
+      --suffix PATH : ${ccnet}/bin:${seafile-shared}/bin
+    '';
+
+  meta =
+  {
+    homepage = "https://github.com/haiwen/seafile-clients";
+    description = "Desktop client for Seafile, the Next-generation Open Source Cloud Storage";
+    license = stdenv.lib.licenses.asl20;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.calrama ];
+  };
+}
diff --git a/pkgs/applications/networking/sniffers/etherape/default.nix b/pkgs/applications/networking/sniffers/etherape/default.nix
index 3b9b8cce9e7c..f5104665562d 100644
--- a/pkgs/applications/networking/sniffers/etherape/default.nix
+++ b/pkgs/applications/networking/sniffers/etherape/default.nix
@@ -2,10 +2,10 @@
 , gnomedocutils, scrollkeeper, libxslt }:
 
 stdenv.mkDerivation rec {
-  name = "etherape-0.9.12";
+  name = "etherape-0.9.13";
   src = fetchurl {
     url = "mirror://sourceforge/etherape/${name}.tar.gz";
-    sha256 = "0ici0aqw2r221lc3rhrdcnvavbhcj0ybwawgrhh399i74w7wf14k";
+    sha256 = "1xq93k1slyak8mgwrw5kymq0xn0kl8chvfcvaablgki4p0l2lg9a";
   };
 
   configureFlags = [ "--disable-scrollkeeper" ];
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://etherape.sourceforge.net/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index 599229753b5e..272bae14a12a 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -1,25 +1,30 @@
-{ stdenv, fetchurl, perl, pkgconfig, gtk, libpcap, flex, bison
-, gnutls, libgcrypt, glib, zlib, libxml2, libxslt, adns, geoip
-, heimdal, python, lynx, lua5
-, makeDesktopItem
+{ stdenv, fetchurl, pkgconfig, perl, flex, bison, libpcap, libnl, c-ares
+, gnutls, libgcrypt, geoip, heimdal, lua5, gtk, makeDesktopItem, python
+, libcap
 }:
 
-let version = "1.8.7"; in
+let version = "1.11.2"; in
 
 stdenv.mkDerivation {
   name = "wireshark-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/wireshark/wireshark-${version}.tar.bz2";
-    sha256 = "0hm8zisy5dg7sfhh7rvgnpffq2qcw0syd8k5kns8j0j13sf44zjw";
+    sha256 = "077hjnmqn44s8dx3pc38bxps5liicjnhzrnf6ky2x60m2cp7ngr3";
   };
 
-  buildInputs =
-    [ perl pkgconfig gtk libpcap flex bison gnutls libgcrypt
-      glib zlib libxml2 libxslt adns geoip heimdal python lynx lua5
-    ];
+  buildInputs = [
+    bison flex perl pkgconfig libpcap lua5 heimdal libgcrypt gnutls
+    geoip libnl c-ares gtk python libcap
+  ];
 
-  configureFlags = "--disable-usr-local --with-ssl --enable-threads --enable-packet-editor";
+  patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
+
+  preConfigure = ''
+    sed -re 's/g_memmove/memmove/' -i $(grep -rl g_memmove .)
+  '';
+
+  configureFlags = "--disable-usr-local --disable-silent-rules --with-gtk2 --without-gtk3 --without-qt --with-ssl";
 
   desktopItem = makeDesktopItem {
     name = "Wireshark";
@@ -34,10 +39,12 @@ stdenv.mkDerivation {
   postInstall = ''
     mkdir -p "$out"/share/applications/
     mkdir -p "$out"/share/icons/
-    cp "$desktopItem"/share/applications/* "$out"/share/applications/
+    cp "$desktopItem/share/applications/"* "$out/share/applications/"
     cp image/wsicon.svg "$out"/share/icons/wireshark.svg
   '';
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://www.wireshark.org/;
     description = "a powerful network protocol analyzer";
@@ -50,6 +57,6 @@ stdenv.mkDerivation {
     '';
 
     platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    maintainers = with stdenv.lib.maintainers; [ simons bjornfor ];
   };
 }
diff --git a/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch b/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch
new file mode 100644
index 000000000000..9c517cc0e421
--- /dev/null
+++ b/pkgs/applications/networking/sniffers/wireshark/wireshark-lookup-dumpcap-in-path.patch
@@ -0,0 +1,62 @@
+From 188e8858243b2278239261aaaaea7ad07476d561 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
+Date: Sun, 13 Apr 2014 15:17:24 +0200
+Subject: [PATCH] Lookup dumpcap in PATH
+
+NixOS patch: Look for dumpcap in PATH first, because there may be a
+dumpcap setuid-wrapper that we want to use instead of the default
+non-setuid dumpcap binary.
+
+Also change execv() to execvp() because we've set argv[0] to "dumpcap"
+and have to enable PATH lookup. Wireshark is not a setuid program, so
+looking in PATH is not a security issue.
+---
+ capture_sync.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/capture_sync.c b/capture_sync.c
+index eb05fae..efb5675 100644
+--- a/capture_sync.c
++++ b/capture_sync.c
+@@ -326,8 +326,18 @@ init_pipe_args(int *argc) {
+     argv = (char **)g_malloc(sizeof (char *));
+     *argv = NULL;
+ 
+-    /* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */
+-    exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap", progfile_dir);
++    /*
++     * NixOS patch: Look for dumpcap in PATH first, because there may be a
++     * dumpcap setuid-wrapper that we want to use instead of the default
++     * non-setuid dumpcap binary.
++     */
++    if (system("command -v dumpcap >/dev/null") == 0) {
++        /* Found working dumpcap */
++        exename = g_strdup_printf("dumpcap");
++    } else {
++        /* take Wireshark's absolute program path and replace "Wireshark" with "dumpcap" */
++        exename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "dumpcap", progfile_dir);
++    }
+ 
+     /* Make that the first argument in the argument list (argv[0]). */
+     argv = sync_pipe_add_arg(argv, argc, exename);
+@@ -649,7 +659,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi
+          */
+         dup2(sync_pipe[PIPE_WRITE], 2);
+         ws_close(sync_pipe[PIPE_READ]);
+-        execv(argv[0], argv);
++        execvp(argv[0], argv);
+         g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
+                    argv[0], g_strerror(errno));
+         sync_pipe_errmsg_to_parent(2, errmsg, "");
+@@ -879,7 +889,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd,
+         dup2(sync_pipe[PIPE_WRITE], 2);
+         ws_close(sync_pipe[PIPE_READ]);
+         ws_close(sync_pipe[PIPE_WRITE]);
+-        execv(argv[0], argv);
++        execvp(argv[0], argv);
+         g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s",
+                    argv[0], g_strerror(errno));
+         sync_pipe_errmsg_to_parent(2, errmsg, "");
+-- 
+1.9.0
+
diff --git a/pkgs/applications/networking/spideroak/default.nix b/pkgs/applications/networking/spideroak/default.nix
new file mode 100644
index 000000000000..403630e25e55
--- /dev/null
+++ b/pkgs/applications/networking/spideroak/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchurl, makeWrapper, glib
+, fontconfig, patchelf, libXext, libX11
+, freetype, libXrender
+}:
+
+let
+  arch = if stdenv.system == "x86_64-linux" then "x86_64"
+    else if stdenv.system == "i686-linux" then "i386"
+    else throw "Spideroak client for: ${stdenv.system} not supported!";
+
+  interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
+    else if stdenv.system == "i686-linux" then "ld-linux.so.2"
+    else throw "Spideroak client for: ${stdenv.system} not supported!";
+
+  sha256 = if stdenv.system == "x86_64-linux" then "0ax5ij3fwq3q9agf7qkw2zg53fcd82llg734pq3swzpn3z1ajs38"
+    else if stdenv.system == "i686-linux" then "18hvgx8bvd2khnqfn434gd4mflv0w5y8kvim72rvya2kwxsyf3i1"
+    else throw "Spideroak client for: ${stdenv.system} not supported!";
+
+  ldpath = stdenv.lib.makeSearchPath "lib" [
+    glib fontconfig libXext libX11 freetype libXrender 
+  ];
+
+  version = "5.1.6";
+
+in stdenv.mkDerivation {
+  name = "spideroak-${version}";
+  
+  src = fetchurl {
+    name = "spideroak-${version}-${arch}";
+    url = "https://spideroak.com/getbuild?platform=slackware&arch=${arch}&version=${version}";
+    inherit sha256;
+  };
+
+  sourceRoot = ".";
+
+  unpackCmd = "tar -xzf $curSrc";
+
+  installPhase = ''
+    ensureDir "$out"
+    cp -r "./"* "$out"
+    ensureDir "$out/bin"
+    rm "$out/usr/bin/SpiderOak"
+
+    patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
+      "$out/opt/SpiderOak/lib/SpiderOak"
+
+    RPATH=$out/opt/SpiderOak/lib:${ldpath}
+    makeWrapper $out/opt/SpiderOak/lib/SpiderOak $out/bin/spideroak --set LD_LIBRARY_PATH $RPATH \
+      --set QT_PLUGIN_PATH $out/opt/SpiderOak/lib/plugins/ \
+      --set SpiderOak_EXEC_SCRIPT $out/bin/spideroak
+  '';
+
+  buildInputs = [ patchelf makeWrapper ];
+
+  meta = {
+    homepage = "https://spideroak.com";
+    description = "Secure online backup and sychronization";
+    license = stdenv.lib.licenses.unfree;
+    maintainers = with stdenv.lib.maintainers; [ amorsillo ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix
index 5447b21009ff..00a00530df44 100644
--- a/pkgs/applications/networking/sync/rsync/default.nix
+++ b/pkgs/applications/networking/sync/rsync/default.nix
@@ -6,30 +6,38 @@
 assert enableACLs -> acl != null;
 
 stdenv.mkDerivation rec {
-  name = "rsync-3.0.9";
+  name = "rsync-${version}";
+  version = "3.1.0";
 
   mainSrc = fetchurl {
-    url = http://rsync.samba.org/ftp/rsync/src/rsync-3.0.9.tar.gz;
-    sha256 = "01bw4klqsrlhh3i9lazd485sd9qx5djvnwa21lj2h3a9sn6hzw9h";
+    url = "http://rsync.samba.org/ftp/rsync/src/rsync-${version}.tar.gz";
+    sha256 = "0kirw8wglqvwi1v8bwxp373g03xg857h59j5k3mmgff9gzvj7jl1";
   };
 
   patchesSrc = fetchurl {
-    url = http://rsync.samba.org/ftp/rsync/rsync-patches-3.0.9.tar.gz;
-    sha256 = "0c1e9b56e99667dfc47641124460bac61a04c5d2ee89f575c6bc78c7a69005a9";
+    url = "http://rsync.samba.org/ftp/rsync/rsync-patches-${version}.tar.gz";
+    sha256 = "0sl8aadpjblvbb05vgais40z90yzhr09rwz0cykjdiv452gli75p";
   };
 
   srcs = [mainSrc] ++ stdenv.lib.optional enableCopyDevicesPatch patchesSrc;
-  patches = [] ++ stdenv.lib.optional enableCopyDevicesPatch "./patches/copy-devices.diff";
+  patches = [(fetchurl {
+      url = "https://git.samba.org/?p=rsync.git;a=commitdiff_plain;h=0dedfbce2c1b851684ba658861fe9d620636c56a";
+      sha256 = "0j1pqmwsqc5mh815x28izi4baki2y2r5q8k7ma1sgs4xsgjc4rk8";
+      name = "CVE-2014-2855.patch";
+    })]
+    ++ stdenv.lib.optional enableCopyDevicesPatch "./patches/copy-devices.diff";
 
   buildInputs = stdenv.lib.optional enableACLs acl;
   nativeBuildInputs = [perl];
 
+  configureFlags = "--with-nobody-group=nogroup";
+
   meta = {
     homepage = http://samba.anu.edu.au/rsync/;
     description = "A fast incremental file transfer utility";
     license = stdenv.lib.licenses.gpl3Plus;
 
     platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    maintainers = [ stdenv.lib.maintainers.simons stdenv.lib.maintainers.emery ];
   };
 }
diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
index 35dd2d2a7d02..4ac5e8300ca8 100644
--- a/pkgs/applications/networking/sync/unison/default.nix
+++ b/pkgs/applications/networking/sync/unison/default.nix
@@ -3,10 +3,10 @@
 
 stdenv.mkDerivation (rec {
 
-  name = "unison-2.40.63";
+  name = "unison-2.40.102";
   src = fetchurl {
-    url = "http://www.seas.upenn.edu/~bcpierce/unison/download/releases/${name}/${name}.tar.gz";
-    sha256 = "17fd2bg5jxwbib87j6j2bjpwdm66whqm1fq46v70hfby79j00vkf";
+    url = "http://www.seas.upenn.edu/~bcpierce/unison/download/releases/stable/${name}.tar.gz";
+    sha256 = "0m78q5vnsric1virvkmxxx32ipaq0cnj0kbirdbg36395gq94jix";
   };
 
   buildInputs = [ ocaml makeWrapper ncurses ];
@@ -32,7 +32,7 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = http://www.cis.upenn.edu/~bcpierce/unison/;
     description = "Bidirectional file synchronizer";
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix
new file mode 100644
index 000000000000..226b7f6d097b
--- /dev/null
+++ b/pkgs/applications/networking/syncthing/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, fetchgit, go }:
+
+stdenv.mkDerivation rec {
+  name = "syncthing-${version}";
+  version = "0.8.15";
+
+  src = fetchgit {
+    url = "git://github.com/calmh/syncthing.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "0xv8kaji60zqxws72srh5hdi9fyvaipdcsawp6gcyahhr3cz0ddq";
+  };
+
+  buildInputs = [ go ];
+
+  buildPhase = ''
+    mkdir -p "./dependencies/src/github.com/calmh/syncthing"
+
+    for a in auto buffers cid discover files lamport protocol scanner \
+            logger beacon config xdr upnp model osutil versioner; do
+        cp -r "./$a" "./dependencies/src/github.com/calmh/syncthing"
+    done
+
+    export GOPATH="`pwd`/Godeps/_workspace:`pwd`/dependencies"
+
+    go test -cpu=1,2,4 ./...
+
+    mkdir ./bin
+
+    go build -o ./bin/syncthing -ldflags "-w -X main.Version v${version}" ./cmd/syncthing
+    go build -o ./bin/stcli -ldflags "-w -X main.Version v${version}" ./cmd/stcli
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -r ./bin $out
+  '';
+
+  meta = {
+    homepage = http://syncthing.net/;
+    description = "Syncthing replaces Dropbox and BitTorrent Sync with something open, trustworthy and decentralized";
+    license = with stdenv.lib.licenses; mit;
+    maintainers = with stdenv.lib.maintainers; [ matejc ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/vnstat/default.nix b/pkgs/applications/networking/vnstat/default.nix
index 57afefd7dcdd..6d4306044a41 100644
--- a/pkgs/applications/networking/vnstat/default.nix
+++ b/pkgs/applications/networking/vnstat/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://humdi.net/vnstat/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     description = "Console-based network statistics utility for Linux";
   };
 }
diff --git a/pkgs/applications/networking/yafc/default.nix b/pkgs/applications/networking/yafc/default.nix
index bdbb53d1675f..2e60b9aa3228 100644
--- a/pkgs/applications/networking/yafc/default.nix
+++ b/pkgs/applications/networking/yafc/default.nix
@@ -1,18 +1,18 @@
-{stdenv, fetchurl, readline, libssh, intltool}:
+{stdenv, fetchurl, readline, libssh, intltool, libbsd}:
 
 stdenv.mkDerivation rec {
-  name = "yafc-1.2.3";
+  name = "yafc-1.3.2";
   src = fetchurl {
-    url = "https://github.com/downloads/sebastinas/yafc/${name}.tar.xz";
-    sha256 = "11h5r9ragfpil338kq981wxnifacflqfwgydhmy00b3fbdlnxzsi";
+    url = "http://www.yafc-ftp.com/upload/${name}.tar.xz";
+    sha256 = "0rrhik00xynxg5s3ffqlyynvy8ssv8zfaixkpb77baxa274gnbd7";
   };
 
-  buildInputs = [ readline libssh intltool ];
+  buildInputs = [ readline libssh intltool libbsd ];
 
   meta = {
     description = "ftp/sftp client with readline, autocompletion and bookmarks";
     homepage = http://www.yafc-ftp.com;
     maintainers = [ stdenv.lib.maintainers.page ];
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/networking/znc/default.nix b/pkgs/applications/networking/znc/default.nix
index a43d8fa9d11d..fdd02aac0b5e 100644
--- a/pkgs/applications/networking/znc/default.nix
+++ b/pkgs/applications/networking/znc/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, openssl, pkgconfig
+{ stdenv, fetchurl, openssl, pkgconfig
 , withPerl ? false, perl
 , withPython ? false, python3
 , withTcl ? false, tcl
@@ -7,10 +7,11 @@
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "znc-1.0";
+  name = "znc-1.4";
+
   src = fetchurl {
     url = "http://znc.in/releases/${name}.tar.gz";
-    sha256 = "0ah6890ngvj97kah3x7fd8yzi6dpdgrxw1b2skj2cyv98bd3jmd8";
+    sha256 = "0lkv58pq4d5lzcyx8v8anzinx0sx0zw0js4jij13jb8qxp88zsc6";
   };
 
   buildInputs = [ openssl pkgconfig ]
@@ -24,11 +25,11 @@ stdenv.mkDerivation rec {
     + optionalString withTcl "--enable-tcl --with-tcl=${tcl}/lib "
     + optionalString withCyrus "--enable-cyrus ";
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Advanced IRC bouncer";
     homepage = http://wiki.znc.in/ZNC;
-    maintainers = [ stdenv.lib.maintainers.viric ];
-    license = "ASL2.0";
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = with maintainers; [ viric ];
+    license = licenses.asl20;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/applications/networking/znc/modules.nix b/pkgs/applications/networking/znc/modules.nix
index ba6d36a3c76c..478900bae4c9 100644
--- a/pkgs/applications/networking/znc/modules.nix
+++ b/pkgs/applications/networking/znc/modules.nix
@@ -10,7 +10,7 @@ let
     inherit buildPhase;
     inherit installPhase;
 
-    meta.platforms = stdenv.lib.platforms.unix;
+    meta = a.meta // { platforms = stdenv.lib.platforms.unix; };
     passthru.module_name = module_name;
   });
 
@@ -30,7 +30,7 @@ in rec {
       description = "Push notification service module for ZNC";
       homepage = https://github.com/jreese/znc-push;
       repositories.git = https://github.com/jreese/znc-push.git;
-      license = stdenv.lib.license.mit;
+      license = stdenv.lib.licenses.mit;
       maintainers = [ stdenv.lib.maintainers.offline ];
     };
   };
diff --git a/pkgs/applications/office/abiword/default.nix b/pkgs/applications/office/abiword/default.nix
index 0e5a6afcdc5f..d9b3627507eb 100644
--- a/pkgs/applications/office/abiword/default.nix
+++ b/pkgs/applications/office/abiword/default.nix
@@ -27,7 +27,10 @@ stdenv.mkDerivation {
       libgsf enchant wv libjpeg
     ];
 
-  meta = {
-    description = "Word processing program, similar to Microsof Word";
+  meta = with stdenv.lib; {
+    description = "Word processing program, similar to Microsoft Word";
+    homepage = http://www.abisource.com/;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/office/calligra/default.nix b/pkgs/applications/office/calligra/default.nix
index 137e7be019fa..e87053d53264 100644
--- a/pkgs/applications/office/calligra/default.nix
+++ b/pkgs/applications/office/calligra/default.nix
@@ -6,11 +6,11 @@
  }:
 
 stdenv.mkDerivation rec {
-  name = "calligra-2.7.2";
+  name = "calligra-2.7.5";
 
   src = fetchurl {
     url = "mirror://kde/stable/${name}/${name}.tar.xz";
-    sha256 = "1awnvv62fp5bjhi6fys37s6lpzxaig4v15m1zjlgxq82ig61w6sq";
+    sha256 = "0png8ac10xywxsml1z18as18kc9k9162l6an67hi6lgx0rv27ldi";
   };
 
   nativeBuildInputs = [ cmake perl pkgconfig ];
diff --git a/pkgs/applications/office/eventlist/default.nix b/pkgs/applications/office/eventlist/default.nix
index f126d6bfba65..c260220aad4d 100644
--- a/pkgs/applications/office/eventlist/default.nix
+++ b/pkgs/applications/office/eventlist/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
       Incidences can be filtered, added, edited, deleted via context menu.
     '';
     homepage = "http://kde-look.org/content/show.php/Eventlist?content=107779";
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
 	  };
 }
diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix
index eddaf8f33e7c..9c255f493d3f 100644
--- a/pkgs/applications/office/gnucash/default.nix
+++ b/pkgs/applications/office/gnucash/default.nix
@@ -1,7 +1,7 @@
 { fetchurl, stdenv, pkgconfig, libxml2, gconf, glib, gtk, libgnomeui, libofx
 , libgtkhtml, gtkhtml, libgnomeprint, goffice, enchant, gettext, libbonoboui
 , intltool, perl, guile, slibGuile, swig, isocodes, bzip2, makeWrapper, libglade
-, libgsf, libart_lgpl
+, libgsf, libart_lgpl, perlPackages, aqbanking, gwenhywfar
 }:
 
 /* If you experience GConf errors when running GnuCash on NixOS, see
@@ -10,34 +10,42 @@
  */
 
 stdenv.mkDerivation rec {
-  name = "gnucash-2.4.13";
+  name = "gnucash-2.4.15";
 
   src = fetchurl {
     url = "mirror://sourceforge/gnucash/${name}.tar.bz2";
-    sha256 = "0j4m00a3r1hcrhkfjkx3sgi2r4id4wrc639i4s00j35rx80540pn";
+    sha256 = "058mgfwic6a2g7jq6iip5hv45md1qaxy25dj4lvlzjjr141wm4gx";
   };
 
   buildInputs = [
     pkgconfig libxml2 gconf glib gtk libgnomeui libgtkhtml gtkhtml
     libgnomeprint goffice enchant gettext intltool perl guile slibGuile
     swig isocodes bzip2 makeWrapper libofx libglade libgsf libart_lgpl
+    perlPackages.DateManip perlPackages.FinanceQuote aqbanking gwenhywfar
   ];
 
-  configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3 --disable-dbi --enable-ofx";
+  configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3 --disable-dbi --enable-ofx --enable-aqbanking";
 
   postInstall = ''
-    sed -i $out/bin/update-gnucash-gconf                                \
+    # Auto-updaters don't make sense in Nix.
+    rm $out/bin/gnc-fq-update
+
+    sed -i $out/bin/update-gnucash-gconf \
        -e 's|--config-source=[^ ]* --install-schema-file|--makefile-install-rule|'
-    for prog in "$out/bin/"*
+
+    for prog in $(echo "$out/bin/"*)
     do
+      # Don't wrap the gnc-fq-* scripts, since gnucash calls them as
+      # "perl <script>', i.e. they must be Perl scripts.
+      if [[ $prog =~ gnc-fq ]]; then continue; fi
       wrapProgram "$prog"                                               \
         --set SCHEME_LIBRARY_PATH "$SCHEME_LIBRARY_PATH"                \
         --prefix GUILE_LOAD_PATH ":" "$GUILE_LOAD_PATH"                 \
         --prefix LD_LIBRARY_PATH ":" "${libgnomeui}/lib/libglade/2.0"   \
         --prefix LD_LIBRARY_PATH ":" "${libbonoboui}/lib/libglade/2.0"  \
+        --prefix PERL5LIB ":" "$PERL5LIB"                               \
         --set GCONF_CONFIG_SOURCE 'xml::~/.gconf'                       \
-        --prefix PATH ":" "${gconf}/bin"                                \
-        --suffix PATH ":" "$out/bin"
+        --prefix PATH ":" "$out/bin:${perl}/bin:${gconf}/bin"
     done
   '';
 
@@ -62,7 +70,7 @@ stdenv.mkDerivation rec {
       accounting principles to ensure balanced books and accurate reports.
     '';
 
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     homepage = http://www.gnucash.org/;
 
diff --git a/pkgs/applications/office/gnumeric/default.nix b/pkgs/applications/office/gnumeric/default.nix
index 1bdc41d1fb57..2b2fd87cf430 100644
--- a/pkgs/applications/office/gnumeric/default.nix
+++ b/pkgs/applications/office/gnumeric/default.nix
@@ -1,26 +1,38 @@
-{ stdenv, fetchurl
-, bzip2, glib, goffice, gtk3, intltool, libglade, libgsf, libxml2
-, pango, pkgconfig, scrollkeeper, zlib
+{ stdenv, fetchurl, pkgconfig, intltool, perl, perlXMLParser
+, goffice, makeWrapper, gtk3, gnome_icon_theme
 }:
 
 stdenv.mkDerivation rec {
-  name = "gnumeric-1.12.0";
+  name = "gnumeric-1.12.12";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnumeric/1.12/${name}.tar.xz";
-    sha256 = "037b53d909e5d1454b2afda8c4fb1e7838e260343e36d4e36245f4a5d0e04111";
+    sha256 = "096i9x6b4i6x24vc4lsxx8fg2n2pjs2jb6x3bkg3ppa2c60w1jq0";
   };
 
+  preConfigure = ''sed -i 's/\(SUBDIRS.*\) doc/\1/' Makefile.in''; # fails when installing docs
+
   configureFlags = "--disable-component";
 
+  # ToDo: optional libgda, python, introspection?
   buildInputs = [
-    bzip2 glib goffice gtk3 intltool libglade libgsf libxml2
-    pango pkgconfig scrollkeeper zlib
+    pkgconfig intltool perl perlXMLParser
+    goffice gtk3 makeWrapper
   ];
 
-  meta = {
+  preFixup = ''
+    for f in "$out"/bin/gnumeric-*; do
+      wrapProgram $f \
+        --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
+    done
+    rm $out/share/icons/hicolor/icon-theme.cache
+  '';
+
+  meta = with stdenv.lib; {
     description = "The GNOME Office Spreadsheet";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     homepage = http://projects.gnome.org/gnumeric/;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.vcunat ];
   };
 }
diff --git a/pkgs/applications/office/hledger-interest/default.nix b/pkgs/applications/office/hledger-interest/default.nix
index d53a8fe63e29..2cff99dcc278 100644
--- a/pkgs/applications/office/hledger-interest/default.nix
+++ b/pkgs/applications/office/hledger-interest/default.nix
@@ -1,3 +1,5 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, Cabal, hledgerLib, mtl, time }:
 
 cabal.mkDerivation (self: {
@@ -12,9 +14,6 @@ cabal.mkDerivation (self: {
     description = "computes interest for a given account";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = with self.stdenv.lib.maintainers; [ simons ];
   };
 })
diff --git a/pkgs/applications/office/hledger-irr/default.nix b/pkgs/applications/office/hledger-irr/default.nix
index 1f4dd165c50e..e6a7b2a72c29 100644
--- a/pkgs/applications/office/hledger-irr/default.nix
+++ b/pkgs/applications/office/hledger-irr/default.nix
@@ -1,9 +1,11 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, Cabal, hledgerLib, statistics, time }:
 
 cabal.mkDerivation (self: {
   pname = "hledger-irr";
-  version = "0.1.1.2";
-  sha256 = "1mh1lzhnxc8ps8n5j37wrmbqafwdyap60j8rqr6xdfa2syfyq8i2";
+  version = "0.1.1.4";
+  sha256 = "0nqd8br86d71dpwq7p8956q74pgqdimid42xikp9zvf632x2s8ax";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ Cabal hledgerLib statistics time ];
@@ -11,6 +13,6 @@ cabal.mkDerivation (self: {
     description = "computes the internal rate of return of an investment";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.simons ];
+    maintainers = with self.stdenv.lib.maintainers; [ simons ];
   };
 })
diff --git a/pkgs/applications/office/homebank/default.nix b/pkgs/applications/office/homebank/default.nix
index 2994ba729e6a..007e093378da 100644
--- a/pkgs/applications/office/homebank/default.nix
+++ b/pkgs/applications/office/homebank/default.nix
@@ -2,7 +2,7 @@
 
 let
    download_root = "http://homebank.free.fr/public/";
-   name = "homebank-4.4";
+   name = "homebank-4.5.5";
    lastrelease = download_root + name + ".tar.gz";
    oldrelease = download_root + "old/" + name + ".tar.gz";
 in
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     urls = [ lastrelease oldrelease ];
-    sha256 = "1lp7vhimn7aa2b4ik857w7d7rbbqcwlsffk8s8lw4fjyaxrr7f0k";
+    sha256 = "05k4497qsb6fzr662h9yxz1amsavd287wh0sabrpr9jdbh3jcfkg";
   };
 
   buildInputs = [ pkgconfig gtk libofx intltool ];
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Free, easy, personal accounting for everyone";
     homepage = http://homebank.free.fr/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/office/impressive/default.nix b/pkgs/applications/office/impressive/default.nix
index f1de422fa249..fad2167fb7ac 100644
--- a/pkgs/applications/office/impressive/default.nix
+++ b/pkgs/applications/office/impressive/default.nix
@@ -2,7 +2,7 @@
 , xpdf, pil, pyopengl, pygame
 , setuptools, mesa, freeglut }:
 
-let version = "0.10.2";
+let version = "0.10.3";
 in
  stdenv.mkDerivation {
     # This project was formerly known as KeyJNote.
@@ -12,7 +12,7 @@ in
 
     src = fetchurl {
       url = "mirror://sourceforge/impressive/Impressive-${version}.tar.gz";
-      sha256 = "1py36h9085ycxj3qnmqdps0dfghlr5qb2i62l0ynzngn55dgz950";
+      sha256 = "0ppr9bckswpi3gav56dhrk91ibxvqbfhpxmm0zikzpxhdlvnaj5v";
     };
 
     # Note: We need to have `setuptools' in the path to be able to use
@@ -71,7 +71,7 @@ in
 
       homepage = http://impressive.sourceforge.net/;
 
-      license = "GPLv2";
+      license = stdenv.lib.licenses.gpl2;
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
       platforms = stdenv.lib.platforms.mesaPlatforms;
diff --git a/pkgs/applications/office/keepnote/default.nix b/pkgs/applications/office/keepnote/default.nix
index 514b8fd3151e..409da36b2640 100644
--- a/pkgs/applications/office/keepnote/default.nix
+++ b/pkgs/applications/office/keepnote/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, buildPythonPackage, pythonPackages, pygtk }:
 
 buildPythonPackage {
-  name = "keepnote-0.6.5";
+  name = "keepnote-0.7.8";
   namePrefix = "";
 
   src = fetchurl {
-    url = http://rasm.ods.org/keepnote/download/keepnote-0.6.5.tar.gz;
-    sha256 = "0kipcy90r50z4m9p8pyy9wi4dknsiwdrgy974xgakris2rh4lafw";
+    url = "http://keepnote.org/download/keepnote-0.7.8.tar.gz";
+    sha256 = "0nhkkv1n0lqf3zn17pxg5cgryv1wwlj4hfmhixwd76rcy8gs45dh";
   };
 
   propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk ];
@@ -17,6 +17,6 @@ buildPythonPackage {
   meta = {
     description = "Note taking application";
     homepage = http://rasm.ods.org/keepnote;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/office/kmymoney/default.nix b/pkgs/applications/office/kmymoney/default.nix
index d55c66a26246..87e3bfd53126 100644
--- a/pkgs/applications/office/kmymoney/default.nix
+++ b/pkgs/applications/office/kmymoney/default.nix
@@ -1,20 +1,22 @@
 { stdenv, fetchurl, cmake, kdelibs, automoc4, kdepimlibs, gettext, pkgconfig
-, shared_mime_info, perl, boost, gpgme, gmpxx, libalkimia, libofx, libical }:
+, shared_mime_info, perl, boost, gpgme, gmpxx, libalkimia, libofx, libical
+, doxygen }:
 
 stdenv.mkDerivation rec {
-  name = "kmymoney-4.6.2";
+  name = "kmymoney-4.6.4";
 
   src = fetchurl {
-    url = "mirror://sourceforge/kmymoney2/${name}.tar.bz2";
-    sha256 = "0x9bl4h2mk8dv49nnn7drv528fnl5ynvvyy7q4m22k0d5yxarn5d";
+    url = "mirror://sourceforge/kmymoney2/${name}.tar.xz";
+    sha256 = "04n0lgi2yrx67bgjzbdbcm10pxs7l53srmp240znzw59njnjyll9";
   };
 
-  buildInputs = [ kdepimlibs perl boost gpgme gmpxx libalkimia libofx libical ];
+  buildInputs = [ kdepimlibs perl boost gpgme gmpxx libalkimia libofx libical
+                  doxygen ];
   nativeBuildInputs = [ cmake automoc4 gettext shared_mime_info pkgconfig ];
 
   KDEDIRS = libalkimia;
 
-  patches = [ ./qgpgme.patch ./qt-4.8.patch ];
+  patches = [ ./qgpgme.patch ];
 
   meta = {
     homepage = http://kmymoney2.sourceforge.net/;
diff --git a/pkgs/applications/office/kmymoney/qt-4.8.patch b/pkgs/applications/office/kmymoney/qt-4.8.patch
deleted file mode 100644
index 7e9a44337cd9..000000000000
--- a/pkgs/applications/office/kmymoney/qt-4.8.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Christoph Feck <christoph@maxiom.de>
-Date: Thu, 10 Nov 2011 11:34:20 +0000
-Subject: Fix compile with Qt 4.8
-X-Git-Url: http://quickgit.kde.org/?p=kmymoney.git&amp;a=commitdiff&amp;h=8324cfb9657d8c03f83691402386e8c5bfb29981
----
-Fix compile with Qt 4.8
-
-Sideported commits f42a0a3d878afebb298609c9886851858c56cc15 and
-fe74b25bf3b78c42e95569fe467a397876bc9c04 from massif-visualizer
----
-
-
---- a/libkdchart/src/KDChartBackgroundAttributes.cpp
-+++ b/libkdchart/src/KDChartBackgroundAttributes.cpp
-@@ -22,6 +22,7 @@
- 
- #include "KDChartBackgroundAttributes.h"
- #include <QPixmap>
-+#include <QVariant>
- 
- #include <KDABLibFakes>
- 
-@@ -150,7 +151,7 @@ QDebug operator<<(QDebug dbg, const KDCh
- 	<< "visible="<<ba.isVisible()
- 	<< "brush="<<ba.brush()
- 	<< "pixmapmode="<<ba.pixmapMode()
--	<< "pixmap="<<ba.pixmap()
-+	<< "pixmap="<<QVariant(ba.pixmap())
- 	<< ")";
-     return dbg;
- }
-
diff --git a/pkgs/applications/office/ledger/2.6.3.nix b/pkgs/applications/office/ledger/2.6.3.nix
index ca71ceeca66c..69015dfb2d7b 100644
--- a/pkgs/applications/office/ledger/2.6.3.nix
+++ b/pkgs/applications/office/ledger/2.6.3.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, emacs, gmp, pcre, expat }:
 
 stdenv.mkDerivation rec {
-  name = "ledger-2.6.3";
+  name = "ledger2-2.6.3";
 
   src = fetchurl {
     url = "https://github.com/downloads/ledger/ledger/${name}.tar.gz";
diff --git a/pkgs/applications/office/ledger/3.0.nix b/pkgs/applications/office/ledger/3.0.nix
index 8b74dbad6f8e..21f77ea1ea45 100644
--- a/pkgs/applications/office/ledger/3.0.nix
+++ b/pkgs/applications/office/ledger/3.0.nix
@@ -1,28 +1,28 @@
-{ stdenv, fetchgit, cmake, boost, gmp, mpfr, libedit, python, texinfo }:
+{ stdenv, fetchgit, cmake, boost, gmp, mpfr, libedit, python
+, texinfo, gnused }:
 
 let
-  rev = "0ec4291";
+  rev = "a0c5addbbd";
 in
+
 stdenv.mkDerivation {
-  name = "ledger3-2013.08.${rev}";
+  name = "ledger-3.0.2.${rev}";
 
   src = fetchgit {
-    url = "https://github.com/ledger/ledger.git";
+    url = "git://github.com/ledger/ledger.git";
     inherit rev;
-    sha256 = "1y4rcbx8y2fxkdc7i06n1i5jf3cq05bvzpb8498mis2gwfmkw470";
+    sha256 = "1yr4i8gpby67j4vl7xk109dwb14z8a424nwgva8rbms8115w4ps5";
   };
 
-  buildInputs = [ cmake boost gmp mpfr libedit python texinfo ];
+  buildInputs = [ cmake boost gmp mpfr libedit python texinfo gnused ];
 
-  # Tests on Darwin are failing
-  doCheck = !stdenv.isDarwin;
   enableParallelBuilding = true;
 
   # Skip byte-compiling of emacs-lisp files because this is currently
   # broken in ledger...
   postInstall = ''
     mkdir -p $out/share/emacs/site-lisp/
-    cp -v $src/lisp/*.el $out/share/emacs/site-lisp/
+    cp -v "$src/lisp/"*.el $out/share/emacs/site-lisp/
   '';
 
   meta = {
@@ -38,6 +38,6 @@ stdenv.mkDerivation {
     '';
 
     platforms = stdenv.lib.platforms.all;
-    maintainers = with stdenv.lib.maintainers; [ simons the-kenny ];
+    maintainers = with stdenv.lib.maintainers; [ simons the-kenny jwiegley ];
   };
 }
diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix
index 8aaf1839f92a..41cf1ebc33df 100644
--- a/pkgs/applications/office/libreoffice/default.nix
+++ b/pkgs/applications/office/libreoffice/default.nix
@@ -6,88 +6,63 @@
 
 { stdenv, fetchurl, pam, python3, tcsh, libxslt, perl, ArchiveZip
 , CompressZlib, zlib, libjpeg, expat, pkgconfigUpstream, freetype, libwpd
-, libxml2, db4, sablotron, curl, libXaw, fontconfig, libsndfile, neon
+, libxml2, db, sablotron, curl, fontconfig, libsndfile, neon
 , bison, flex, zip, unzip, gtk, libmspack, getopt, file, cairo, which
-, icu, boost, jdk, ant, libXext, libX11, libXtst, libXi, cups
-, libXinerama, openssl, gperf, cppunit, GConf, ORBit2, poppler
+, icu, boost, jdk, ant, cups, xorg
+, openssl, gperf, cppunit, GConf, ORBit2, poppler
 , librsvg, gnome_vfs, gstreamer, gst_plugins_base, mesa
 , autoconf, automake, openldap, bash, hunspell, librdf_redland, nss, nspr
 , libwpg, dbus_glib, glibc, qt4, kde4, clucene_core, libcdr, lcms, vigra
 , unixODBC, mdds, saneBackends, mythes, libexttextcat, libvisio
 , fontsConf, pkgconfig, libzip, bluez5, libtool, maven
+, libatomic_ops, graphite2, harfbuzz
+, librevenge, libe-book, libmwaw, glm, glew
 , langs ? [ "en-US" "en-GB" "ca" "ru" "eo" "fr" "nl" "de" "sl" ]
 }:
 
 let
   langsSpaces = stdenv.lib.concatStringsSep " " langs;
   major = "4";
-  minor = "0";
-  patch = "5";
-  tweak = "2";
+  minor = "3";
+  patch = "0";
+  tweak = "4";
   subdir = "${major}.${minor}.${patch}";
   version = "${subdir}${if tweak == "" then "" else "."}${tweak}";
 
-  # configure phase dependency
-  liborcus = stdenv.mkDerivation rec {
-     version = "0.3.0";
-     name = "liborcus-${version}";
-
-     src = fetchurl {
-       url = "http://dev-www.libreoffice.org/src/8755aac23317494a9028569374dc87b2-liborcus_0.3.0.tar.bz2";
-       sha256 = "0xrw13s390mcpm50apclydl38sw2sdq27csrr1k0d39jna2990ih";
-     };
-
-     configureFlags = "--disable-werror";
-
-     buildInputs = [ zlib boost mdds pkgconfig libixion libzip ];
-  };
-
-  # configure phase dependency
-  liblangtag = stdenv.mkDerivation rec {
-     version = "0.4.0";
-     name = "liblangtag-${version}";
-
-     src = fetchurl {
-       url = "http://dev-www.libreoffice.org/src/54e578c91b1b68e69c72be22adcb2195-${name}.tar.bz2";
-       sha256 = "1bjb0fxjmvzxlhr5by9wgisf6w5yvy6wgfzfkjyw6igk39fivdyb";
-     };
-
-     buildInputs = [ libtool pkgconfig libxml2 ];
-  };
-  
-  # doesn't work with srcs versioning
-  libmspub = stdenv.mkDerivation rec {
-     version = "0.0.6";
-     name = "libmspub-${version}";
-
-     src = fetchurl {
-       url = "http://dev-www.libreoffice.org/src/${name}.tar.gz";
-       sha256 = "1zdcvnm0dpac5yqdv34hq9j38cnhyqzyjgb19iyp54ajnwfjhmcq";
-     };
-
-     configureFlags = "--disable-werror";
- 
-     buildInputs = [ zlib libwpd libwpg pkgconfig boost icu ];  
-  };
-
   # doesn't exist in srcs
+  # 0.8 version is in 0.7.0 tarball
   libixion = stdenv.mkDerivation rec {
-     version = "0.5.0";
+     version = "0.7.0";
      name = "libixion-${version}";
 
      src = fetchurl {
        url = "http://kohei.us/files/ixion/src/${name}.tar.bz2";
-       sha256 = "010k33bfkckx28r4rdk5mkd0mmayy5ng9ja0j0zg0z237gcfgrzb";
+       sha256 = "10amvz7fzr1kcy3svfspkdykmspqgpjdmk44cyr406wi7v4lwnf9";
      };
 
      configureFlags = "--with-boost=${boost}";
 
-     buildInputs = [ boost mdds pkgconfig ];  
+     buildInputs = [ boost mdds pkgconfig ];
   };
 
-  fetchThirdParty = {name, md5}: fetchurl {
+  fetchThirdParty = {name, md5, brief, subDir ? ""}: fetchurl {
     inherit name md5;
-    url = "http://dev-www.libreoffice.org/src/${md5}-${name}";
+    url = if brief then
+            "http://dev-www.libreoffice.org/src/${subDir}${name}"
+          else
+            "http://dev-www.libreoffice.org/src/${subDir}${md5}-${name}";
+  };
+
+  # Can't find Boost inside LO build
+  liborcus = stdenv.mkDerivation rec {
+    name = "liborcus-0.7.0";
+    src = fetchThirdParty (stdenv.lib.findFirst 
+      (x: x.name == "${name}.tar.bz2")
+      ("Error: update liborcus version inside LO expression")
+      (import ./libreoffice-srcs.nix));
+    configureFlags = "--with-boost=${boost}";
+
+    buildInputs = [ boost mdds pkgconfig zlib libixion ];
   };
 
   fetchSrc = {name, sha256}: fetchurl {
@@ -104,14 +79,14 @@ let
 
     translations = fetchSrc {
       name = "translations";
-      sha256 = "0x96wlwr5m7w4k3ygydzak3ycq35hjq60vfi6nfxczlr8pfjyjxv";
+      sha256 = "1l445284mih0c7d6v3ps1piy5pbjvisyrjjvlrqizvwxqm7bxpr1";
     };
 
     # TODO: dictionaries
 
     help = fetchSrc {
       name = "help";
-      sha256 = "0nab5jcgrrgn0v1yrm18nl9avp4vifbas48l1absz3jmzf9wka7b";
+      sha256 = "0avsc11d4nmycsxvadr0xcd8z9506sjcc89hgmliqlmhmw48ax7y";
     };
 
   };
@@ -121,7 +96,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${version}.tar.xz";
-    sha256 = "195g1iab7j2x7sl326xbq7vya412ns57xrwpv9hqdrb7iiz2n8la";
+    sha256 = "1r605nwjdq20qd96chqic1bjkw7y36wmpg2lzzvv5sz6gw12rzi8";
   };
 
   # Openoffice will open libcups dynamically, so we link it directly
@@ -135,7 +110,7 @@ stdenv.mkDerivation rec {
 
   postUnpack = ''
     mkdir -v $sourceRoot/src
-  '' + (stdenv.lib.concatMapStrings (f: "ln -sv ${f} $sourceRoot/src/${f.outputHash}-${f.name}\n") srcs.third_party)
+  '' + (stdenv.lib.concatMapStrings (f: "ln -sv ${f} $sourceRoot/src/${f.outputHash}-${f.name}\nln -sv ${f} $sourceRoot/src/${f.name}\n") srcs.third_party)
   + ''
     ln -sv ${srcs.help} $sourceRoot/src/${srcs.help.name}
     tar xf $sourceRoot/src/${srcs.help.name} -C $sourceRoot/../
@@ -149,6 +124,7 @@ stdenv.mkDerivation rec {
       -e 's,! */usr/bin/perl,!${perl}/bin/perl,' -e 's,! */usr/bin/env perl,!${perl}/bin/perl,' \
       -e 's,! */usr/bin/python,!${python3}/bin/${python3.executable},' -e 's,! */usr/bin/env python,!${python3}/bin/${python3.executable},'
     #sed -i 's,ANT_OPTS+="\(.*\)",ANT_OPTS+=\1,' apache-commons/java/*/makefile.mk
+
   '';
 
   QT4DIR = qt4;
@@ -162,6 +138,17 @@ stdenv.mkDerivation rec {
       "--with-parallelism=$NIX_BUILD_CORES"
       "--with-lang=${langsSpaces}"
     );
+
+    chmod a+x ./bin/unpack-sources
+    # It is used only as an indicator of the proper current directory
+    touch solenv/inc/target.mk
+  '';
+
+  # fetch_Download_item tries to interpret the name as a variable name
+  # Let it do so…
+  postConfigure = ''
+    sed -e '1ilibreoffice-translations-${version}.tar.xz=libreoffice-translations-${version}.tar.xz' -i Makefile
+    sed -e '1ilibreoffice-help-${version}.tar.xz=libreoffice-help-${version}.tar.xz' -i Makefile
   '';
 
   makeFlags = "SHELL=${bash}/bin/bash";
@@ -172,9 +159,6 @@ stdenv.mkDerivation rec {
     # This is required as some cppunittests require fontconfig configured
     export FONTCONFIG_FILE=${fontsConf}
 
-    # Fix sysui: wants to create a tar for root
-    sed -i -e 's,--own.*root,,' sysui/desktop/slackware/makefile.mk
-
     # This to aovid using /lib:/usr/lib at linking
     sed -i '/gb_LinkTarget_LDFLAGS/{ n; /rpath-link/d;}' solenv/gbuild/platform/unxgcc.mk
 
@@ -199,7 +183,7 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [
-    "--with-vender=NixOS"
+    "--with-vendor=NixOS"
 
     # Without these, configure does not finish
     "--without-junit"
@@ -219,14 +203,13 @@ stdenv.mkDerivation rec {
     "--without-doxygen"
 
     # I imagine this helps. Copied from go-oo.
-    "--disable-epm"
-    "--disable-mathmldtd"
+    # Modified on every upgrade, though
     "--disable-kde"
     "--disable-postgresql-sdbc"
     "--with-package-format=native"
-    "--with-jdk-home=${jdk}"
-    "--with-ant-home=${ant}"
-    "--without-afms"
+    "--enable-epm"
+    "--with-jdk-home=${jdk}/lib/openjdk"
+    "--with-ant-home=${ant}/lib/ant"
     "--without-fonts"
     "--without-myspell-dicts"
     "--without-ppds"
@@ -235,10 +218,16 @@ stdenv.mkDerivation rec {
     "--without-system-jars"
     "--without-system-altlinuxhyph"
     "--without-system-lpsolve"
-    "--without-system-graphite"
     "--without-system-npapi-headers"
     "--without-system-libcmis"
-    "--without-system-mozilla"
+
+    "--without-system-libetonyek"
+    "--without-system-libfreehand"
+    "--without-system-libodfgen"
+    "--without-system-libabw"
+    "--without-system-firebird"
+    "--without-system-liblangtag"
+    "--without-system-libmspub"
   ];
 
   checkPhase = ''
@@ -246,23 +235,27 @@ stdenv.mkDerivation rec {
     make slowcheck
   '';
 
-  buildInputs =
+  buildInputs = with xorg;
     [ ant ArchiveZip autoconf automake bison boost cairo clucene_core
-      CompressZlib cppunit cups curl db4 dbus_glib expat file flex fontconfig
+      CompressZlib cppunit cups curl db dbus_glib expat file flex fontconfig
       freetype GConf getopt gnome_vfs gperf gst_plugins_base gstreamer gtk
       hunspell icu jdk kde4.kdelibs lcms libcdr libexttextcat unixODBC libjpeg
       libmspack librdf_redland librsvg libsndfile libvisio libwpd libwpg libX11
-      libXaw libXext libXi libXinerama libxml2 libxslt libXtst mdds mesa mythes
+      libXaw libXext libXi libXinerama libxml2 libxslt libXtst
+      libXdmcp libpthreadstubs mesa mythes
       neon nspr nss openldap openssl ORBit2 pam perl pkgconfigUpstream poppler
       python3 sablotron saneBackends tcsh unzip vigra which zip zlib
-      mdds bluez5 glibc libmspub libixion liborcus liblangtag
+      mdds bluez5 glibc libixion
+      libxshmfence libatomic_ops graphite2 harfbuzz
+      librevenge libe-book libmwaw glm glew
+      liborcus
     ];
 
   meta = with stdenv.lib; {
     description = "LibreOffice is a comprehensive, professional-quality productivity suite, a variant of openoffice.org";
     homepage = http://libreoffice.org/;
     license = licenses.lgpl3;
-    maintainers = [ maintainers.viric ];
+    maintainers = [ maintainers.viric maintainers.raskin ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh b/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
index ab6c4e3fb079..e5a867463bfc 100755
--- a/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
+++ b/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
@@ -6,15 +6,39 @@ cat <<EOF
 [
 EOF
 
-read file
-while read file; do
-  if [[ "$file" == @* ]]; then
-    break
-  fi
+write_entry(){
   echo '{'
-  echo "  name = \"${file:33}\";"
-  echo "  md5 = \"${file:0:32}\";"
+  echo "  name = \"${name}\";"
+  echo "  md5 = \"${md5}\";"
+  echo "  brief = ${brief};"
   echo '}'
+}
+
+while read line; do
+  case "$line" in
+    \#*)
+      echo Skipping comment: "$line" >&2;
+      ;;
+    *_MD5SUM\ :=*)
+      read tbline;
+      line=${line##* };
+      tbline=${tbline##* };
+      md5=$line
+      name=$tbline;
+      brief=true;
+      write_entry;
+      ;;
+    *_TARBALL\ :=*)
+      line=${line##* };
+      md5=${line:0:32};
+      name=${line:33};
+      brief=false;
+      write_entry;
+      ;;
+    *)
+      echo Skipping: "$line" >&2;
+      ;;
+  esac
 done
 
 echo ']'
diff --git a/pkgs/applications/office/libreoffice/libreoffice-srcs.nix b/pkgs/applications/office/libreoffice/libreoffice-srcs.nix
index 6ed1a5e2c639..4e7dacfe0a96 100644
--- a/pkgs/applications/office/libreoffice/libreoffice-srcs.nix
+++ b/pkgs/applications/office/libreoffice/libreoffice-srcs.nix
@@ -1,114 +1,523 @@
 [
 {
-  name = "glibc-2.1.3-stub.tar.gz";
-  md5 = "4a660ce8466c9df01f19036435425c3a";
+  name = "libabw-0.1.0.tar.bz2";
+  md5 = "9317e967c8fa8ff50e049744c4b33c87";
+  brief = true;
 }
 {
-  name = "ucpp-1.3.2.tar.gz";
-  md5 = "0168229624cfac409e766913506961a8";
+  name = "commons-codec-1.6-src.tar.gz";
+  md5 = "2e482c7567908d334785ce7d69ddfff7";
+  brief = false;
 }
 {
-  name = "commons-logging-1.1.1-src.tar.gz";
-  md5 = "3c219630e4302863a9a83d0efde889db";
+  name = "commons-codec-1.9-src.zip";
+  md5 = "048751f3271906db5126ab76870444c4";
+  brief = false;
 }
 {
-  name = "liblayout-0.2.10.zip";
-  md5 = "db60e4fde8dd6d6807523deb71ee34dc";
+  name = "commons-httpclient-3.1-src.tar.gz";
+  md5 = "2c9b0f83ed5890af02c0df1c1776f39b";
+  brief = false;
 }
 {
-  name = "hsqldb_1_8_0.zip";
-  md5 = "17410483b5b5f267aa18b7e00b65e6e0";
+  name = "commons-lang-2.4-src.tar.gz";
+  md5 = "625ff5f2f968dd908bca43c9469d6e6b";
+  brief = false;
 }
 {
-  name = "rhino1_5R5.zip";
-  md5 = "798b2ffdc8bcfe7bca2cf92b62caf685";
+  name = "commons-lang3-3.3.1-src.tar.gz";
+  md5 = "8ab049135b2d15313da5d9f0656894a1";
+  brief = false;
+}
+{
+  name = "commons-logging-1.1.3-src.tar.gz";
+  md5 = "e8e197d628436490886d17cffa108fe3";
+  brief = false;
+}
+{
+  name = "apr-1.4.8.tar.gz";
+  md5 = "eff9d741b0999a9bbab96862dd2a2a3d";
+  brief = true;
+}
+{
+  name = "apr-util-1.5.3.tar.gz";
+  md5 = "71a11d037240b292f824ba1eb537b4e3";
+  brief = true;
+}
+{
+  name = "boost_1_55_0.tar.bz2";
+  md5 = "d6eef4b4cacb2183f2bf265a5a03a354";
+  brief = false;
 }
 {
   name = "bsh-2.0b1-src.tar.gz";
   md5 = "ea570af93c284aa9e5621cd563f54f4d";
+  brief = false;
 }
 {
-  name = "xmlsec1-1.2.14.tar.gz";
-  md5 = "1f24ab1d39f4a51faf22244c94a6203f";
+  name = "cairo-1.10.2.tar.gz";
+  md5 = "f101a9e88b783337b20b2e26dfd26d5f";
+  brief = false;
 }
 {
-  name = "librepository-1.1.6.zip";
-  md5 = "8ce2fcd72becf06c41f7201d15373ed9";
+  name = "libcdr-0.1.0.tar.bz2";
+  md5 = "0e2f56934c8872ec4a254cd4bb1d7cf6";
+  brief = true;
 }
 {
-  name = "libbase-1.1.6.zip";
-  md5 = "eeb2c7ddf0d302fba4bfc6e97eac9624";
+  name = "clucene-core-2.3.3.4.tar.gz";
+  md5 = "48d647fbd8ef8889e5a7f422c1bfda94";
+  brief = false;
 }
 {
-  name = "lp_solve_5.5.tar.gz";
-  md5 = "26b3e95ddf3d9c077c480ea45874b3b8";
+  name = "libcmis-0.4.1.tar.gz";
+  md5 = "22f8a85daf4a012180322e1f52a7563b";
+  brief = false;
 }
 {
-  name = "libloader-1.1.6.zip";
-  md5 = "97b2d4dba862397f446b217e2b623e71";
+  name = "CoinMP-1.7.6.tgz";
+  md5 = "1cce53bf4b40ae29790d2c5c9f8b1129";
+  brief = true;
+}
+{
+  name = "collada2gltf-master-cb1d97788a.tar.bz2";
+  md5 = "4b87018f7fff1d054939d19920b751a0";
+  brief = false;
+}
+{
+  name = "cppunit-1.13.1.tar.gz";
+  md5 = "ac4781e01619be13461bb2d562b94a7b";
+  brief = false;
+}
+{
+  name = "ConvertTextToNumber-1.3.2.oxt";
+  md5 = "451ccf439a36a568653b024534669971";
+  brief = false;
+}
+{
+  name = "curl-7.36.0.tar.bz2";
+  md5 = "e6d1f9d1b59da5062109ffe14e0569a4";
+  brief = true;
+}
+{
+  name = "libe-book-0.1.1.tar.bz2";
+  md5 = "c25a881d21abc5b4da19205db513cc22";
+  brief = true;
+}
+{
+  name = "epm-3.7.tar.gz";
+  md5 = "3ade8cfe7e59ca8e65052644fed9fca4";
+  brief = false;
+}
+{
+  name = "libetonyek-0.1.1.tar.bz2";
+  md5 = "805f941b06448212a988cb65f0691a7a";
+  brief = true;
+}
+{
+  name = "expat-2.1.0.tar.gz";
+  md5 = "dd7dab7a5fea97d2a6a43f511449b7cd";
+  brief = false;
+}
+{
+  name = "Firebird-2.5.2.26540-0.tar.bz2";
+  md5 = "21154d2004e025c8a3666625b0357bb5";
+  brief = true;
+}
+{
+  name = "fontconfig-2.8.0.tar.gz";
+  md5 = "77e15a92006ddc2adbb06f840d591c0e";
+  brief = false;
+}
+{
+  name = "crosextrafonts-20130214.tar.gz";
+  md5 = "368f114c078f94214a308a74c7e991bc";
+  brief = false;
+}
+{
+  name = "crosextrafonts-carlito-20130920.tar.gz";
+  md5 = "c74b7223abe75949b4af367942d96c7a";
+  brief = false;
+}
+{
+  name = "dejavu-fonts-ttf-2.34.zip";
+  md5 = "a4e565e220b5de082c23995e256e3c12";
+  brief = false;
 }
 {
-  name = "graphite2-1.2.0.tgz";
-  md5 = "f5ef3f7f10fa8c3542c6a085a233080b";
+  name = "gentiumbasic-fonts-1.10.zip";
+  md5 = "35efabc239af896dfb79be7ebdd6e6b9";
+  brief = false;
 }
 {
-  name = "jakarta-tomcat-5.0.30-src.tar.gz";
-  md5 = "2a177023f9ea8ec8bd00837605c5df1b";
+  name = "liberation-fonts-ttf-1.07.4.tar.gz";
+  md5 = "134d8262145fc793c6af494dcace3e71";
+  brief = false;
+}
+{
+  name = "liberation-fonts-ttf-2.00.1.tar.gz";
+  md5 = "5c781723a0d9ed6188960defba8e91cf";
+  brief = false;
+}
+{
+  name = "LinLibertineG-20120116.zip";
+  md5 = "e7a384790b13c29113e22e596ade9687";
+  brief = false;
+}
+{
+  name = "open-sans-font-ttf-1.10.tar.gz";
+  md5 = "7a15edea7d415ac5150ea403e27401fd";
+  brief = false;
+}
+{
+  name = "pt-serif-font-1.0000W.tar.gz";
+  md5 = "c3c1a8ba7452950636e871d25020ce0d";
+  brief = false;
+}
+{
+  name = "source-code-font-1.009.tar.gz";
+  md5 = "0279a21fab6f245e85a6f85fea54f511";
+  brief = false;
+}
+{
+  name = "source-sans-font-1.036.tar.gz";
+  md5 = "1e9ddfe25ac9577da709d7b2ea36f939";
+  brief = false;
+}
+{
+  name = "libfreehand-0.1.0.tar.bz2";
+  md5 = "5f029fef73e42a2c2ae4524a7513f97d";
+  brief = true;
+}
+{
+  name = "freetype-2.4.8.tar.bz2";
+  md5 = "dbf2caca1d3afd410a29217a9809d397";
+  brief = false;
+}
+{
+  name = "glew-1.10.0.zip";
+  md5 = "594eb47b4b1210e25438d51825404d5a";
+  brief = false;
+}
+{
+  name = "glm-0.9.4.6-libreoffice.zip";
+  md5 = "bae83fa5dc7f081768daace6e199adc3";
+  brief = false;
+}
+{
+  name = "graphite2-1.2.4.tgz";
+  md5 = "2ef839348fe28e3b923bf8cced440227";
+  brief = true;
+}
+{
+  name = "harfbuzz-0.9.23.tar.bz2";
+  md5 = "a4a9b548577e2ee22f0887937da5fd6c";
+  brief = true;
+}
+{
+  name = "hsqldb_1_8_0.zip";
+  md5 = "17410483b5b5f267aa18b7e00b65e6e0";
+  brief = false;
+}
+{
+  name = "hunspell-1.3.2.tar.gz";
+  md5 = "3121aaf3e13e5d88dfff13fb4a5f1ab8";
+  brief = false;
 }
 {
   name = "hyphen-2.8.4.tar.gz";
   md5 = "a2f6010987e1c601274ab5d63b72c944";
+  brief = false;
 }
 {
-  name = "libserializer-1.1.6.zip";
-  md5 = "f94d9870737518e3b597f9265f4e9803";
+  name = "icu4c-53_1-src.tgz";
+  md5 = "b73baa6fbdfef197608d1f69300919b9";
+  brief = false;
 }
 {
-  name = "commons-lang-2.3-src.tar.gz";
-  md5 = "2ae988b339daec234019a7066f96733e";
+  name = "flow-engine-0.9.4.zip";
+  md5 = "ba2930200c9f019c2d93a8c88c651a0f";
+  brief = false;
 }
 {
-  name = "libxml-1.1.7.zip";
-  md5 = "ace6ab49184e329db254e454a010f56d";
+  name = "flute-1.1.6.zip";
+  md5 = "d8bd5eed178db6e2b18eeed243f85aa8";
+  brief = false;
 }
 {
-  name = "commons-httpclient-3.1-src.tar.gz";
-  md5 = "2c9b0f83ed5890af02c0df1c1776f39b";
+  name = "libbase-1.1.6.zip";
+  md5 = "eeb2c7ddf0d302fba4bfc6e97eac9624";
+  brief = false;
 }
 {
-  name = "commons-codec-1.3-src.tar.gz";
-  md5 = "af3c3acf618de6108d65fcdc92b492e1";
+  name = "libfonts-1.1.6.zip";
+  md5 = "3bdf40c0d199af31923e900d082ca2dd";
+  brief = false;
 }
 {
   name = "libformula-1.1.7.zip";
   md5 = "3404ab6b1792ae5f16bbd603bd1e1d03";
+  brief = false;
 }
 {
-  name = "libcmis-0.3.0.tar.gz";
-  md5 = "b2371dc7cf4811c9d32146eec913d296";
+  name = "liblayout-0.2.10.zip";
+  md5 = "db60e4fde8dd6d6807523deb71ee34dc";
+  brief = false;
 }
 {
-  name = "swingExSrc.zip";
-  md5 = "35c94d2df8893241173de1d16b6034c0";
+  name = "libloader-1.1.6.zip";
+  md5 = "97b2d4dba862397f446b217e2b623e71";
+  brief = false;
 }
 {
-  name = "flow-engine-0.9.4.zip";
-  md5 = "ba2930200c9f019c2d93a8c88c651a0f";
+  name = "librepository-1.1.6.zip";
+  md5 = "8ce2fcd72becf06c41f7201d15373ed9";
+  brief = false;
+}
+{
+  name = "libserializer-1.1.6.zip";
+  md5 = "f94d9870737518e3b597f9265f4e9803";
+  brief = false;
+}
+{
+  name = "libxml-1.1.7.zip";
+  md5 = "ace6ab49184e329db254e454a010f56d";
+  brief = false;
 }
 {
   name = "sacjava-1.3.zip";
   md5 = "39bb3fcea1514f1369fcfc87542390fd";
+  brief = false;
 }
 {
-  name = "libwps-0.2.7.tar.bz2";
-  md5 = "d197bd6211669a2fa4ca648faf04bcb1";
+  name = "jpegsrc.v9a.tar.gz";
+  md5 = "3353992aecaee1805ef4109aadd433e7";
+  brief = true;
 }
 {
-  name = "libfonts-1.1.6.zip";
-  md5 = "3bdf40c0d199af31923e900d082ca2dd";
+  name = "language-subtag-registry-2014-04-10.tar.bz2";
+  md5 = "49c94710f7858b1969d74ff72e6aac84";
+  brief = true;
 }
 {
-  name = "flute-1.1.6.zip";
-  md5 = "d8bd5eed178db6e2b18eeed243f85aa8";
+  name = "JLanguageTool-1.7.0.tar.bz2";
+  md5 = "b63e6340a02ff1cacfeadb2c42286161";
+  brief = false;
+}
+{
+  name = "lcms2-2.6.tar.gz";
+  md5 = "f4c08d38ceade4a664ebff7228910a33";
+  brief = true;
+}
+{
+  name = "libatomic_ops-7_2d.zip";
+  md5 = "c0b86562d5aa40761a87134f83e6adcf";
+  brief = true;
+}
+{
+  name = "libeot-0.01.tar.bz2";
+  md5 = "aa24f5dd2a2992f4a116aa72af817548";
+  brief = true;
+}
+{
+  name = "libexttextcat-3.4.3.tar.bz2";
+  md5 = "ae330b9493bd4503ac390106ff6060d7";
+  brief = false;
+}
+{
+  name = "libgltf-0.0.0.tar.bz2";
+  md5 = "3d9ea1f2828c46f8ba94b88a87b3326d";
+  brief = false;
+  subDir = "libgltf/";
+}
+{
+  name = "liblangtag-0.5.1.tar.bz2";
+  md5 = "36271d3fa0d9dec1632029b6d7aac925";
+  brief = false;
+}
+{
+  name = "xmlsec1-1.2.14.tar.gz";
+  md5 = "1f24ab1d39f4a51faf22244c94a6203f";
+  brief = false;
+}
+{
+  name = "libxml2-2.9.1.tar.gz";
+  md5 = "9c0cfef285d5c4a5c80d00904ddab380";
+  brief = false;
+}
+{
+  name = "libxslt-1.1.28.tar.gz";
+  md5 = "9667bf6f9310b957254fdcf6596600b7";
+  brief = false;
+}
+{
+  name = "lp_solve_5.5.tar.gz";
+  md5 = "26b3e95ddf3d9c077c480ea45874b3b8";
+  brief = false;
+}
+{
+  name = "mariadb-native-client-1.0.0.tar.bz2";
+  md5 = "05f84c95b610c21c5fd510d10debcabf";
+  brief = false;
+}
+{
+  name = "mdds_0.10.3.tar.bz2";
+  md5 = "aa5ca9d1ed1082890835afab26400a39";
+  brief = false;
+}
+{
+  name = "libmspub-0.1.1.tar.bz2";
+  md5 = "1d489c4932109e72495b1df8b69e5f11";
+  brief = true;
+}
+{
+  name = "libmwaw-0.3.1.tar.bz2";
+  md5 = "6f1ac4a0e24131c422e1e91f07718fb6";
+  brief = true;
+}
+{
+  name = "mysql-connector-c++-1.1.0.tar.gz";
+  md5 = "0981bda6548a8c8233ffce2b6e4b2a23";
+  brief = false;
+}
+{
+  name = "mythes-1.2.3.tar.gz";
+  md5 = "46e92b68e31e858512b680b3b61dc4c1";
+  brief = false;
+}
+{
+  name = "neon-0.29.5.tar.gz";
+  md5 = "ff369e69ef0f0143beb5626164e87ae2";
+  brief = false;
+}
+{
+  name = "nss-3.15.3-with-nspr-4.10.2.tar.gz";
+  md5 = "06beb053e257d9e22641339c905c6eba";
+  brief = false;
+}
+{
+  name = "libodfgen-0.1.1.tar.bz2";
+  md5 = "c22c83c17cda0754382ada4e116594b7";
+  brief = true;
+}
+{
+  name = "OpenCOLLADA-master-6509aa13af.tar.bz2";
+  md5 = "4ca8a6ef0afeefc864e9ef21b9f14bd6";
+  brief = true;
+}
+{
+  name = "openldap-2.4.31.tgz";
+  md5 = "804c6cb5698db30b75ad0ff1c25baefd";
+  brief = false;
+}
+{
+  name = "openssl-1.0.1h.tar.gz";
+  md5 = "8d6d684a9430d5cc98a62a5d8fbda8cf";
+  brief = false;
+}
+{
+  name = "liborcus-0.7.0.tar.bz2";
+  md5 = "7681383be6ce489d84c1c74f4e7f9643";
+  brief = false;
+}
+{
+  name = "pixman-0.24.4.tar.bz2";
+  md5 = "c63f411b3ad147db2bcce1bf262a0e02";
+  brief = false;
+}
+{
+  name = "libpng-1.5.18.tar.gz";
+  md5 = "5266905cef49d1224437465ad4d67fd9";
+  brief = true;
+}
+{
+  name = "poppler-0.22.5.tar.gz";
+  md5 = "1cd27460f7e3379d1eb109cfd7bcdb39";
+  brief = false;
+}
+{
+  name = "postgresql-9.2.1.tar.bz2";
+  md5 = "c0b4799ea9850eae3ead14f0a60e9418";
+  brief = false;
+}
+{
+  name = "Python-3.3.5.tgz";
+  md5 = "803a75927f8f241ca78633890c798021";
+  brief = true;
+}
+{
+  name = "raptor2-2.0.9.tar.gz";
+  md5 = "4ceb9316488b0ea01acf011023cf7fff";
+  brief = false;
+}
+{
+  name = "rasqal-0.9.30.tar.gz";
+  md5 = "b12c5f9cfdb6b04efce5a4a186b8416b";
+  brief = false;
+}
+{
+  name = "redland-1.0.16.tar.gz";
+  md5 = "32f8e1417a64d3c6f2c727f9053f55ea";
+  brief = false;
+}
+{
+  name = "librevenge-0.0.1.tar.bz2";
+  md5 = "69c367c6b0a360411965a1c409a0b6c1";
+  brief = true;
+}
+{
+  name = "rhino1_5R5.zip";
+  md5 = "798b2ffdc8bcfe7bca2cf92b62caf685";
+  brief = false;
+}
+{
+  name = "serf-1.2.1.tar.bz2";
+  md5 = "4f8e76c9c6567aee1d66aba49f76a58b";
+  brief = true;
+}
+{
+  name = "swingExSrc.zip";
+  md5 = "35c94d2df8893241173de1d16b6034c0";
+  brief = false;
+}
+{
+  name = "ucpp-1.3.2.tar.gz";
+  md5 = "0168229624cfac409e766913506961a8";
+  brief = false;
+}
+{
+  name = "vigra1.6.0.tar.gz";
+  md5 = "d62650a6f908e85643e557a236ea989c";
+  brief = false;
+}
+{
+  name = "libvisio-0.1.0.tar.bz2";
+  md5 = "931588332ba44682c9cd5eefbd358ab4";
+  brief = true;
+}
+{
+  name = "libwpd-0.10.0.tar.bz2";
+  md5 = "0773d79a1f240ef9f4f20242b13c5bb7";
+  brief = true;
+}
+{
+  name = "libwpg-0.3.0.tar.bz2";
+  md5 = "17da9770cb8b317b7633f9807b32b71a";
+  brief = true;
+}
+{
+  name = "libwps-0.3.0.tar.bz2";
+  md5 = "d4d77d08b9048bae3b8ec8df11f80efd";
+  brief = true;
+}
+{
+  name = "xsltml_2.1.2.zip";
+  md5 = "a7983f859eafb2677d7ff386a023bc40";
+  brief = false;
+}
+{
+  name = "zlib-1.2.8.tar.gz";
+  md5 = "44d667c142d7cda120332623eab69f40";
+  brief = true;
 }
 ]
diff --git a/pkgs/applications/office/mmex/default.nix b/pkgs/applications/office/mmex/default.nix
index d56f4bed0ce9..2940569ef659 100644
--- a/pkgs/applications/office/mmex/default.nix
+++ b/pkgs/applications/office/mmex/default.nix
@@ -28,7 +28,7 @@ in
     meta = {
       description = "Easy-to-use personal finance software";
       homepage = http://www.codelathe.com/mmex;
-      license = "GPLv2+";
+      license = stdenv.lib.licenses.gpl2Plus;
       maintainers = with stdenv.lib.maintainers; [viric];
       platforms = with stdenv.lib.platforms; linux;
     };
diff --git a/pkgs/applications/office/scribus/default.nix b/pkgs/applications/office/scribus/default.nix
index a4f5821c54c0..4026031de084 100644
--- a/pkgs/applications/office/scribus/default.nix
+++ b/pkgs/applications/office/scribus/default.nix
@@ -3,11 +3,11 @@
 , zlib, libpng, xorg, cairo, podofo, aspell, boostHeaders, cmake }:
 
 stdenv.mkDerivation rec {
-  name = "scribus-1.4.1";
+  name = "scribus-1.4.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/scribus/scribus/${name}.tar.xz";
-    sha256 = "1n67z2bk5ca2sxvv43jvj7yygfr4d2x5yc69zk70v38prm0gqlv8";
+    sha256 = "1zxgl2g299rllfy5ihs5skicpv7zcmz149ahraami69gqcag6bn7";
   };
 
   enableParallelBuilding = true;
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
     platforms = stdenv.lib.platforms.linux;
     description = "Desktop Publishing (DTP) and Layout program for Linux";
     homepage = http://www.scribus.net;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/office/todo.txt-cli/default.nix b/pkgs/applications/office/todo.txt-cli/default.nix
new file mode 100644
index 000000000000..eb4c31ed9d27
--- /dev/null
+++ b/pkgs/applications/office/todo.txt-cli/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl }:
+let
+  version = "2.10";
+in stdenv.mkDerivation {
+  name = "todo.txt-cli-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/ginatrapani/todo.txt-cli/releases/download/v${version}/todo.txt_cli-${version}.tar.gz";
+    sha256 = "1agn4zzbizrrylvbfi053b5mpb39bvl1gzziw08xibzfdyi1g55m";
+  };
+
+  installPhase = ''
+    install -vd $out/bin
+    install -vm 755 todo.sh $out/bin
+    install -vd $out/etc/bash_completion.d
+    install -vm 644 todo_completion $out/etc/bash_completion.d/todo
+    install -vd $out/etc/todo
+    install -vm 644 todo.cfg $out/etc/todo/config
+  '';
+
+  meta = {
+    description = "Simple plaintext todo list manager";
+    homepage = "http://todotxt.com";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/office/zotero/default.nix b/pkgs/applications/office/zotero/default.nix
new file mode 100644
index 000000000000..0a5ef9099044
--- /dev/null
+++ b/pkgs/applications/office/zotero/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, bash, xulrunner }:
+
+assert (stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux");
+
+let
+  version = "4.0.21.2";
+  arch = if stdenv.system == "x86_64-linux"
+           then "linux-x86_64"
+           else "linux-i686";
+in
+stdenv.mkDerivation {
+  name = "zotero-${version}";
+
+  src = fetchurl {
+    url = "https://download.zotero.org/standalone/${version}/Zotero-${version}_${arch}.tar.bz2";
+    sha256 = if stdenv.system == "x86_64-linux"
+               then "1df101j2qwdp001m8x3ihbzz2j23x43804k8ww749y09d1ydb4dx"
+               else "1bcrpl6gdxlygd5ppyrhw42q24kjcakma3qv6mpzgp91phkf6g30";
+  };
+
+  # Strip the bundled xulrunner
+  prePatch = ''rm -fr run-zotero.sh zotero xulrunner/'';
+
+  inherit bash xulrunner;
+  installPhase = ''
+    mkdir -p "$out/libexec/zotero"
+    cp -vR * "$out/libexec/zotero/"
+
+    mkdir -p "$out/bin"
+    substituteAll "${./zotero.sh}" "$out/bin/zotero"
+    chmod +x "$out/bin/zotero"
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = "$out/bin/zotero --version";
+
+  meta = with stdenv.lib; {
+    homepage = "https://www.zotero.org";
+    description = "Collect, organize, cite, and share your research sources";
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ttuegel ];
+  };
+}
diff --git a/pkgs/applications/office/zotero/zotero.sh b/pkgs/applications/office/zotero/zotero.sh
new file mode 100644
index 000000000000..c80d5e8189ea
--- /dev/null
+++ b/pkgs/applications/office/zotero/zotero.sh
@@ -0,0 +1,3 @@
+#!@bash@/bin/bash
+
+exec "@xulrunner@/bin/xulrunner" "@out@/libexec/zotero/application.ini" "${@}"
diff --git a/pkgs/applications/science/astronomy/celestia/default.nix b/pkgs/applications/science/astronomy/celestia/default.nix
index d7814aa5b78f..d4da5c113c99 100644
--- a/pkgs/applications/science/astronomy/celestia/default.nix
+++ b/pkgs/applications/science/astronomy/celestia/default.nix
@@ -65,6 +65,8 @@ stdenv.mkDerivation {
     )
   '';
 
+  installPhase = ''make MKDIR_P="mkdir -p" install'';
+
   enableParallelBuilding = true;
 
   meta = {
diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix
index a2cc07b0a61c..696890f95f1e 100644
--- a/pkgs/applications/science/astronomy/gravit/default.nix
+++ b/pkgs/applications/science/astronomy/gravit/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://gravit.slowchop.com";
     description = "A beautiful OpenGL-based gravity simulator";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
 
     longDescription = ''
       Gravit is a gravity simulator which runs under Linux, Windows and
diff --git a/pkgs/applications/science/astronomy/stellarium/default.nix b/pkgs/applications/science/astronomy/stellarium/default.nix
index 04c82b21e859..6b84143d0138 100644
--- a/pkgs/applications/science/astronomy/stellarium/default.nix
+++ b/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -1,14 +1,11 @@
-{stdenv, fetchurl, cmake, freetype, libpng, mesa, gettext, openssl, qt4, perl, libiconv}:
+{ stdenv, fetchurl, cmake, freetype, libpng, mesa, gettext, openssl, qt4, perl, libiconv }:
 
-let
-  name = "stellarium-0.12.1";
-in
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation rec {
+  name = "stellarium-0.12.4";
 
   src = fetchurl {
     url = "mirror://sourceforge/stellarium/${name}.tar.gz";
-    sha256 = "02qfp56mkg3bqggv3ndx8v6zfswg51gkczwiqy5c9y4rw28hazla";
+    sha256 = "11367hv9niyz9v47lf31vjsqkgc8da0vy2nhiyxgmk1i49p1pbhg";
   };
 
   buildInputs = [ cmake freetype libpng mesa gettext openssl qt4 perl libiconv ];
diff --git a/pkgs/applications/science/astronomy/xplanet/default.nix b/pkgs/applications/science/astronomy/xplanet/default.nix
index 816119a3b925..bdb93c992262 100644
--- a/pkgs/applications/science/astronomy/xplanet/default.nix
+++ b/pkgs/applications/science/astronomy/xplanet/default.nix
@@ -2,15 +2,17 @@
 , libjpeg, netpbm}:
 
 stdenv.mkDerivation rec {
-  name = "xplanet-1.2.2";
+  name = "xplanet-1.3.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/xplanet/${name}.tar.gz";
-    sha256 = "1jnkrly9njkibxqbg5im4pq9cqjzwmki6jzd318dvlfmnicqr3vg";
+    sha256 = "0hml2v228wi2r61m1pgka7h96rl92b6apk0iigm62miyp4mp9ys4";
   };
 
   buildInputs = [ pkgconfig freetype pango libpng libtiff giflib libjpeg netpbm ];
 
+  patches = [ ./giflib.patch ];
+
   meta = {
     description = "Renders an image of the earth or other planets into the X root window";
     homepage = http://xplanet.sourceforge.net;
diff --git a/pkgs/applications/science/astronomy/xplanet/giflib.patch b/pkgs/applications/science/astronomy/xplanet/giflib.patch
new file mode 100644
index 000000000000..aaf024198fbc
--- /dev/null
+++ b/pkgs/applications/science/astronomy/xplanet/giflib.patch
@@ -0,0 +1,130 @@
+diff -wbBur xplanet-1.3.0/src/libimage/gif.c /home/sergej/tmp/BUILD/staging-i686/sergej/build/xplanet/src/xplanet-1.3.0/src/libimage/gif.c
+--- xplanet-1.3.0/src/libimage/gif.c	2006-03-26 01:50:51.000000000 +0300
++++ /home/sergej/tmp/BUILD/staging-i686/sergej/build/xplanet/src/xplanet-1.3.0/src/libimage/gif.c	2013-07-30 18:21:17.412474692 +0400
+@@ -20,7 +20,7 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+-
++#define FALSE 0
+ #include <gif_lib.h>
+ 
+ /*
+@@ -42,11 +42,11 @@
+     int color_index;
+     unsigned char *ptr = NULL;
+ 
+-    infile = DGifOpenFileName(filename);
++    infile = DGifOpenFileName(filename, NULL);
+ 
+     if (infile == NULL)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+@@ -54,7 +54,7 @@
+     {
+         if (DGifGetRecordType(infile, &record_type) == GIF_ERROR) 
+         {
+-            PrintGifError();
++            printf("%s\n", GifErrorString(GIF_ERROR));
+             return(0);
+         }
+ 
+@@ -63,7 +63,7 @@
+         case IMAGE_DESC_RECORD_TYPE:
+             if (DGifGetImageDesc(infile) == GIF_ERROR)
+             {
+-                PrintGifError();
++                printf("%s\n", GifErrorString(GIF_ERROR));
+                 return(0);
+             }
+ 
+@@ -107,14 +107,14 @@
+             GifByteType *ext;
+             if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR) 
+             {
+-                PrintGifError();
++                printf("%s\n", GifErrorString(GIF_ERROR));
+                 return(0);
+             }
+             while (ext != NULL) 
+             {
+                 if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR) 
+                 {
+-                    PrintGifError();
++                    printf("%s\n", GifErrorString(GIF_ERROR));
+                     return(0);
+                 }
+             }
+@@ -178,7 +178,7 @@
+         return(0);
+     }
+ 
+-    colormap = MakeMapObject(colormap_size, NULL);
++    colormap = GifMakeMapObject(colormap_size, NULL);
+ 
+     for (i = 0; i < width * height; i++)
+     {
+@@ -187,10 +187,10 @@
+         blue[i]  = (GifByteType) rgb[3*i+2];
+     }
+   
+-    if (QuantizeBuffer(width, height, &colormap_size, red, green, blue,   
++    if (GifQuantizeBuffer(width, height, &colormap_size, red, green, blue,   
+                        buffer, colormap->Colors) == GIF_ERROR)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+@@ -198,24 +198,24 @@
+     free(green);
+     free(blue);
+ 
+-    outfile = EGifOpenFileName((char *) filename, FALSE);
++    outfile = EGifOpenFileName((char *) filename, FALSE, NULL);
+     if (outfile == NULL)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+     if (EGifPutScreenDesc(outfile, width, height, colormap_size, 0, colormap)
+         == GIF_ERROR)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+     if (EGifPutImageDesc(outfile, 0, 0, width, height, FALSE, NULL)
+         == GIF_ERROR)
+     {
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+         return(0);
+     }
+ 
+@@ -224,7 +224,7 @@
+     {
+         if (EGifPutLine(outfile, ptr, width) == GIF_ERROR)
+         {
+-            PrintGifError();
++            printf("%s\n", GifErrorString(GIF_ERROR));
+             return(0);
+         }
+         ptr += width;
+@@ -233,7 +233,7 @@
+     EGifSpew(outfile);
+ 
+     if (EGifCloseFile(outfile) == GIF_ERROR) 
+-        PrintGifError();
++        printf("%s\n", GifErrorString(GIF_ERROR));
+ 
+     free(buffer);
+ 
diff --git a/pkgs/applications/science/biology/arb/default.nix b/pkgs/applications/science/biology/arb/default.nix
index 279091f21bd2..2f622e94057b 100644
--- a/pkgs/applications/science/biology/arb/default.nix
+++ b/pkgs/applications/science/biology/arb/default.nix
@@ -81,5 +81,6 @@ stdenv.mkDerivation {
     pkgMaintainer = "http://BioLib.open-bio.org/";
     homepage    = http://www.arb-home.de/;
     priority    = "10";   # because it includes binaries of clustal etc.
+    broken = true;
   };
 }
diff --git a/pkgs/applications/science/biology/plink/default.nix b/pkgs/applications/science/biology/plink/default.nix
index fa6dcaa82ede..009e12aa02f0 100644
--- a/pkgs/applications/science/biology/plink/default.nix
+++ b/pkgs/applications/science/biology/plink/default.nix
@@ -18,7 +18,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Whole genome association toolkit";
     homepage = "http://pngu.mgh.harvard.edu/~purcell/plink/";
-    license = "GNUv2";
+    license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.all;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/science/chemistry/avogadro/default.nix b/pkgs/applications/science/chemistry/avogadro/default.nix
index e45f5b645fd9..1e9f3ee521b1 100644
--- a/pkgs/applications/science/chemistry/avogadro/default.nix
+++ b/pkgs/applications/science/chemistry/avogadro/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, cmake, qt4, zlib, eigen, openbabel, pkgconfig, mesa, libX11 }:
+{ stdenv, fetchurl, cmake, qt4, zlib, eigen, openbabel, pkgconfig, mesa, libX11, doxygen }:
 
 stdenv.mkDerivation rec {
-  name = "avogadro-1.0.3";
+  name = "avogadro-1.1.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/avogadro/${name}.tar.bz2";
-    sha256 = "0s44r78vm7hf4cs13d2qki3gf178gjj1ihph6rs04g6s4figvdpg";
+    sha256 = "050ag9p4vg7jg8hj1wqfv7lsm6ar2isxjw2vw85s49vsl7g7nvzy";
   };
 
   buildInputs = [ qt4 eigen zlib openbabel mesa libX11 ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig doxygen ];
 
   NIX_CFLAGS_COMPILE = "-include ${mesa}/include/GL/glu.h";
 
diff --git a/pkgs/applications/science/electronics/archimedes/default.nix b/pkgs/applications/science/electronics/archimedes/default.nix
index f22ef09a9839..a6a5f68755a4 100644
--- a/pkgs/applications/science/electronics/archimedes/default.nix
+++ b/pkgs/applications/science/electronics/archimedes/default.nix
@@ -1,17 +1,17 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "archimedes-2.0.0";
+  name = "archimedes-2.0.1";
 
   src = fetchurl {
     url = "mirror://gnu/archimedes/${name}.tar.gz";
-    sha256 = "1ajg4xvk5slv05fsbikrina9g4bmhx8gykk249yz21pir67sdk4x";
+    sha256 = "0jfpnd3pns5wxcxbiw49v5sgpmm5b4v8s4q1a5292hxxk2hzmb3z";
   };
 
   meta = {
     description = "GNU package for semiconductor device simulations";
     homepage = http://www.gnu.org/software/archimedes;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/science/electronics/caneda/default.nix b/pkgs/applications/science/electronics/caneda/default.nix
index d135fb094345..404ffc5010b4 100644
--- a/pkgs/applications/science/electronics/caneda/default.nix
+++ b/pkgs/applications/science/electronics/caneda/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Open source EDA software focused on easy of use and portability";
     homepage = http://caneda.tuxfamily.org;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/science/electronics/gtkwave/default.nix b/pkgs/applications/science/electronics/gtkwave/default.nix
index bb4b969f0621..c761f6196424 100644
--- a/pkgs/applications/science/electronics/gtkwave/default.nix
+++ b/pkgs/applications/science/electronics/gtkwave/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, gtk, gperf, pkgconfig, bzip2, tcl, tk, judy, xz}:
 stdenv.mkDerivation rec {
-  name = "gtkwave-3.3.39";
+  name = "gtkwave-3.3.53";
 
   src = fetchurl {
     url = "mirror://sourceforge/gtkwave/${name}.tar.gz";
-    sha256 = "1va506anlbpbha7l6h94s44xjdy6ch22iv629swn4bh5m3qi33bg";
+    sha256 = "1jmrk2p2azjca250h2bi4c8v0cp1gqd3c027dx18sxy3cgw1fsp1";
   };
 
   buildInputs = [ gtk gperf pkgconfig bzip2 tcl tk judy xz ];
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Wave viewer for Unix and Win32";
     homepage = http://gtkwave.sourceforge.net;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index cc53611493d0..1fc97abef927 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, fetchurl, fetchbzr, unzip, cmake, mesa, gtk, wxGTK, zlib, libX11, 
-gettext, cups } : 
+{ stdenv, fetchurl, fetchbzr, cmake, mesa, wxGTK, zlib, libX11, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "kicad-20130325";
+  name = "kicad-20131025";
 
-  src = fetchurl {
-    url = "http://iut-tice.ujf-grenoble.fr/cao/kicad-sources-stable_2013-03-25_BZR4005.zip";
-    sha256 = "0hg2aiis14am7mmpimcxnxvhy7c7fr5rgzlk6rjv44d9m0f9957m";
+  src = fetchbzr {
+    url = "https://code.launchpad.net/~kicad-stable-committers/kicad/stable";
+    rev = 4024;
+    sha256 = "1sv1l2zpbn6439ccz50p05hvqg6j551aqra551wck9h3929ghly5";
   };
 
   srcLibrary = fetchbzr {
     url = "http://bazaar.launchpad.net/~kicad-lib-committers/kicad/library";
-    revision = 220;
-    sha256 = "0l2lblgnm51n2w1p4ifpwdvq04rxgq73zrfxlhqa9zdlyh4rcddb";
+    rev = 293;
+    sha256 = "1wn9a4nhqyjzzfkq6xm7ag8n5n10xy7gkq6i7yry7wxini7pzv1i";
   };
 
-  cmakeFlags = "-DKICAD_TESTING_VERSION=ON";
+  cmakeFlags = "-DKICAD_STABLE_VERSION=ON";
 
   # They say they only support installs to /usr or /usr/local,
   # so we have to handle this.
@@ -23,9 +23,9 @@ stdenv.mkDerivation rec {
     sed -i -e 's,/usr/local/kicad,'$out,g common/gestfich.cpp
   '';
 
-  enableParallelBuilding = true;
+  #enableParallelBuilding = true; # often fails on Hydra: fatal error: pcb_plot_params_lexer.h: No such file or directory
 
-  buildInputs = [ unzip cmake mesa wxGTK zlib libX11 gettext ];
+  buildInputs = [ cmake mesa wxGTK zlib libX11 gettext ];
 
   postInstall = ''
     mkdir library
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Free Software EDA Suite";
     homepage = "http://www.kicad-pcb.org/";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/science/electronics/ngspice/default.nix b/pkgs/applications/science/electronics/ngspice/default.nix
index 579492248ea3..493af97d1567 100644
--- a/pkgs/applications/science/electronics/ngspice/default.nix
+++ b/pkgs/applications/science/electronics/ngspice/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, readline, bison, libX11, libICE, libXaw, libXext}:
 
 stdenv.mkDerivation {
-  name = "ng-spice-rework-24";
+  name = "ng-spice-rework-25";
 
   src = fetchurl {
-    url = "mirror://sourceforge/ngspice/ngspice-24.tar.gz";
-    sha256 = "0rgh75hbqrsljz767whbj65wi6369yc286v0qk8jxnv2da7p9ll6";
+    url = "mirror://sourceforge/ngspice/ngspice-25.tar.gz";
+    sha256 = "03hlxwvl2j1wlb5yg4swvmph9gja37c2gqvwvzv6z16vg2wvn06h";
   };
 
   buildInputs = [ readline libX11 bison libICE libXaw libXext ];
diff --git a/pkgs/applications/science/electronics/pulseview/default.nix b/pkgs/applications/science/electronics/pulseview/default.nix
new file mode 100644
index 000000000000..07724d932541
--- /dev/null
+++ b/pkgs/applications/science/electronics/pulseview/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, cmake, glib, qt4, boost, libsigrok
+, libsigrokdecode, libserialport, libzip, udev, libusb1, libftdi
+}:
+
+stdenv.mkDerivation rec {
+  name = "pulseview-0.2.0";
+
+  src = fetchurl {
+    url = "http://sigrok.org/download/source/pulseview/${name}.tar.gz";
+    sha256 = "1pf1dgwd9j586nqmni6gqf3qxrsmawcmi9wzqfzqkjci18xd7dgy";
+  };
+
+  buildInputs = [ pkgconfig cmake glib qt4 boost libsigrok
+    libsigrokdecode libserialport libzip udev libusb1 libftdi
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Qt-based LA/scope/MSO GUI for sigrok (a signal analysis software suite)";
+    homepage = http://sigrok.org/;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/science/electronics/qfsm/default.nix b/pkgs/applications/science/electronics/qfsm/default.nix
index 0f24784e9e57..160c530e722e 100644
--- a/pkgs/applications/science/electronics/qfsm/default.nix
+++ b/pkgs/applications/science/electronics/qfsm/default.nix
@@ -18,7 +18,6 @@ stdenv.mkDerivation rec {
     description = "Graphical editor for finite state machines";
     homepage = "http://qfsm.sourceforge.net/";
     license = stdenv.lib.licenses.gpl3Plus;
-    maintainers = [ stdenv.lib.maintainers.simons ];
-    platforms = stdenv.lib.platforms.linux;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/science/electronics/qucs/default.nix b/pkgs/applications/science/electronics/qucs/default.nix
index e434c97db2b0..dd3eaecc7441 100644
--- a/pkgs/applications/science/electronics/qucs/default.nix
+++ b/pkgs/applications/science/electronics/qucs/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Integrated circuit simulator";
     homepage = http://qucs.sourceforge.net;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix
index 7c04c85fdb7e..30e882a7f38e 100644
--- a/pkgs/applications/science/electronics/tkgate/1.x.nix
+++ b/pkgs/applications/science/electronics/tkgate/1.x.nix
@@ -1,7 +1,9 @@
-{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc, which, yacc, flex, imake, xproto, gccmakedep }:
-
-assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+{ stdenv, fetchurl, tcl, tk, libX11, glibc, which, yacc, flex, imake, xproto, gccmakedep }:
 
+let
+  libiconvInc = stdenv.lib.optionalString stdenv.isLinux "${glibc}/include";
+  libiconvLib = stdenv.lib.optionalString stdenv.isLinux "${glibc}/lib";
+in
 stdenv.mkDerivation rec {
   name = "tkgate-1.8.7";
 
@@ -10,13 +12,13 @@ stdenv.mkDerivation rec {
     sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs";
   };
 
-  buildInputs = [ tcl tk libX11 libiconvOrLibc which yacc flex imake xproto gccmakedep ];
+  buildInputs = [ tcl tk libX11 which yacc flex imake xproto gccmakedep ];
 
   patchPhase = ''
     sed -i config.h \
       -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "8.5"|' \
-      -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvOrLibc}/include ${libX11}/include"|' \
-      -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib ${libX11}/lib"|' \
+      -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvInc} ${libX11}/include"|' \
+      -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvLib} ${libX11}/lib"|' \
       \
       -e '20 i #define TCL_LIBRARY "${tcl}/lib"' \
       -e '20 i #define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"' \
@@ -31,8 +33,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
     homepage = "http://www.tkgate.org/";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ stdenv.lib.maintainers.simons ];
-    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/science/electronics/tkgate/2.x.nix b/pkgs/applications/science/electronics/tkgate/2.x.nix
index 756fe7052d83..108986ddefe4 100644
--- a/pkgs/applications/science/electronics/tkgate/2.x.nix
+++ b/pkgs/applications/science/electronics/tkgate/2.x.nix
@@ -1,7 +1,9 @@
-{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc }:
-
-assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+{ stdenv, fetchurl, tcl, tk, libX11, glibc }:
 
+let
+  libiconvInc = stdenv.lib.optionalString stdenv.isLinux "${glibc}/include";
+  libiconvLib = stdenv.lib.optionalString stdenv.isLinux "${glibc}/lib";
+in
 stdenv.mkDerivation rec {
   name = "tkgate-2.0-b10";
 
@@ -16,8 +18,8 @@ stdenv.mkDerivation rec {
 
   patchPhase = ''
     sed -i configure \
-      -e 's|TKGATE_INCDIRS=.*|TKGATE_INCDIRS="${tcl}/include ${tk}/include ${libiconvOrLibc}/include"|' \
-      -e 's|TKGATE_LIBDIRS=.*|TKGATE_LIBDIRS="${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib"|'
+      -e 's|TKGATE_INCDIRS=.*|TKGATE_INCDIRS="${tcl}/include ${tk}/include ${libiconvInc}"|' \
+      -e 's|TKGATE_LIBDIRS=.*|TKGATE_LIBDIRS="${tcl}/lib ${tk}/lib ${libiconvLib}"|'
     sed -i options.h \
       -e 's|.* #define TCL_LIBRARY .*|#define TCL_LIBRARY "${tcl}/${tcl.libdir}"|' \
       -e 's|.* #define TK_LIBRARY .*|#define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"|'
@@ -26,8 +28,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
     homepage = "http://www.tkgate.org/";
-    license = "GPLv2+";
-    maintainers = [ stdenv.lib.maintainers.simons ];
-    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl2Plus;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/science/electronics/verilog/default.nix b/pkgs/applications/science/electronics/verilog/default.nix
index a4c803e2952c..e68d2a4ab91a 100644
--- a/pkgs/applications/science/electronics/verilog/default.nix
+++ b/pkgs/applications/science/electronics/verilog/default.nix
@@ -1,19 +1,20 @@
 {stdenv, fetchurl, gperf, flex, bison}:
 
 stdenv.mkDerivation rec {
-  name = "verilog-0.9.3";
+  name = "verilog-0.9.7";
 
   src = fetchurl {
     url = "mirror://sourceforge/iverilog/${name}.tar.gz";
-    sha256 = "dd68c8ab874a93805d1e93fa76ee1e91fc0c7b20822ded3e57b6536cd8c0d1ba";
+    sha256 = "0m3liqw7kq24vn7k8wvi630ljz0awz23r3sd4rcklk7vgghp4pks";
   };
 
   buildInputs = [ gperf flex bison ];
 
   meta = {
     description = "Icarus Verilog compiler";
+    repositories.git = https://github.com/steveicarus/iverilog.git;
     homepage = http://www.icarus.com;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [winden];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/science/electronics/xoscope/default.nix b/pkgs/applications/science/electronics/xoscope/default.nix
index 54aae9e7d3bf..df7d053d93bd 100644
--- a/pkgs/applications/science/electronics/xoscope/default.nix
+++ b/pkgs/applications/science/electronics/xoscope/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Oscilloscope through the sound card";
     homepage = http://xoscope.sourceforge.net;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/science/geometry/tetgen/default.nix b/pkgs/applications/science/geometry/tetgen/default.nix
index a43ec3b0eb9f..ddfb92def958 100644
--- a/pkgs/applications/science/geometry/tetgen/default.nix
+++ b/pkgs/applications/science/geometry/tetgen/default.nix
@@ -4,8 +4,8 @@ stdenv.mkDerivation rec {
   name = "tetgen-1.4.3";
 
   src = fetchurl {
-    url = http://tetgen.berlios.de/files/tetgen1.4.3.tar.gz;
-    sha256 = "159i0vdjz7abb8bycz47ax4fqlzc82kv19sygqnrkr86qm4g43wy";
+    url = "${meta.homepage}/files/tetgen1.4.3.tar.gz";
+    sha256 = "0d70vjqdapmy1ghlsxjlvl5z9yp310zw697bapc4zxmp0sxi29wm";
   };
 
   installPhase = ''
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator";
-    homepage = "http://tetgen.berlios.de/";
-    license = "MIT";
+    homepage = "http://tetgen.org/";
+    license = stdenv.lib.licenses.mit;
   };
 }
diff --git a/pkgs/applications/science/logic/abc/default.nix b/pkgs/applications/science/logic/abc/default.nix
new file mode 100644
index 000000000000..30c36ae29dc8
--- /dev/null
+++ b/pkgs/applications/science/logic/abc/default.nix
@@ -0,0 +1,27 @@
+{ fetchhg, stdenv, readline }:
+
+stdenv.mkDerivation rec {
+  name = "abc-verifier-${version}";
+  version = "140509"; # YYMMDD
+
+  src = fetchhg {
+    url    = "https://bitbucket.org/alanmi/abc";
+    rev    = "03e221443d71e49e56cbc37f1907ee3b0ff3e7c9";
+    sha256 = "0ahrqg718y7xpv939f6x8w1kqh7wsja4pw8hca7j67j0qjdgb4lm";
+  };
+
+  buildInputs = [ readline ];
+  enableParallelBuilding = true;
+  installPhase = ''
+    mkdir -p $out/bin
+    mv abc $out/bin
+  '';
+
+  meta = {
+    description = "Sequential Logic Synthesis and Formal Verification";
+    homepage    = "www.eecs.berkeley.edu/~alanmi/abc/abc.htm";
+    license     = stdenv.lib.licenses.mit;
+    platforms   = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/science/logic/alt-ergo/default.nix b/pkgs/applications/science/logic/alt-ergo/default.nix
new file mode 100644
index 000000000000..2a95d0cd65bb
--- /dev/null
+++ b/pkgs/applications/science/logic/alt-ergo/default.nix
@@ -0,0 +1,23 @@
+{ fetchurl, stdenv, ocaml, ocamlPackages, gmp }:
+
+stdenv.mkDerivation rec {
+  name = "alt-ergo-${version}";
+  version = "0.95.2";
+
+  src = fetchurl {
+    url    = "http://alt-ergo.ocamlpro.com/download_manager.php?target=${name}.tar.gz";
+    name   = "${name}.tar.gz";
+    sha256 = "1b7f0rh3jgm67g0x2m3wv7gnnqmz9cjlrfm136z56ihlkhsd8v2s";
+  };
+
+  buildInputs = with ocamlPackages;
+    [ ocaml findlib ocamlgraph zarith lablgtk gmp ];
+
+  meta = {
+    description = "Alt-Ergo is a high-performance theorem prover and SMT solver";
+    homepage    = "http://alt-ergo.ocamlpro.com/";
+    license     = stdenv.lib.licenses.cecill-c; # LGPL-2 compatible
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/science/logic/boolector/default.nix b/pkgs/applications/science/logic/boolector/default.nix
new file mode 100644
index 000000000000..3879ee8ef470
--- /dev/null
+++ b/pkgs/applications/science/logic/boolector/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, zlib, useV16 ? false }:
+
+let
+  v15 = rec {
+    name    = "boolector-${version}";
+    version = "1.5.118";
+    src = fetchurl {
+      url    = "http://fmv.jku.at/boolector/${name}-with-sat-solvers.tar.gz";
+      sha256 = "17j7q02rryvfwgvglxnhx0kv8hxwy8wbhzawn48lw05i98vxlmk9";
+    };
+  };
+
+  v16 = rec {
+    name    = "boolector-${version}";
+    version = "1.6.0";
+    src = fetchurl {
+      url    = "http://fmv.jku.at/boolector/${name}-with-sat-solvers.tar.gz";
+      sha256 = "0jka4r6bc3i24axgdp6qbq6gjadwz9kvi11s2c5sbwmdnjd7cp85";
+    };
+  };
+
+  boolectorPkg = if useV16 then v16 else v15;
+  license = with stdenv.lib.licenses; if useV16 then unfreeRedistributable else gpl3;
+in
+stdenv.mkDerivation (boolectorPkg // {
+  buildInputs = [ zlib ];
+  enableParallelBuilding = false;
+
+  buildPhase = "./build.sh";
+
+  installPhase = ''
+    mkdir -p $out/bin $out/lib $out/include
+    cp boolector/boolector      $out/bin
+    cp boolector/deltabtor      $out/bin
+    cp boolector/synthebtor     $out/bin
+    cp boolector/libboolector.a $out/lib
+    cp boolector/boolector.h    $out/include
+  '';
+
+  meta = {
+    inherit license;
+    description = "An extremely fast SMT solver for bit-vectors and arrays";
+    homepage    = "http://fmv.jku.at/boolector";
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+})
diff --git a/pkgs/applications/science/logic/coq/HEAD.nix b/pkgs/applications/science/logic/coq/HEAD.nix
new file mode 100644
index 000000000000..8e6fde6bc240
--- /dev/null
+++ b/pkgs/applications/science/logic/coq/HEAD.nix
@@ -0,0 +1,57 @@
+# - coqide compilation can be disabled by setting lablgtk to null;
+
+{stdenv, fetchgit, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null}:
+
+let 
+  version = "8.5pre-8bc01590";
+  buildIde = lablgtk != null;
+  ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else "";
+  idePath = if buildIde then ''
+    CAML_LD_LIBRARY_PATH=${lablgtk}/lib/ocaml/3.12.1/site-lib/stublibs
+  '' else "";
+in
+
+stdenv.mkDerivation {
+  name = "coq-${version}";
+
+  src = fetchgit {
+    url = git://scm.gforge.inria.fr/coq/coq.git;
+    rev = "8bc0159095cb0230a50c55a1611c8b77134a6060";
+    sha256 = "1cp4hbk9jw78y03vwz099yvixax161h60hsbyvwiwz2z5czjxzcv";
+  };
+
+  buildInputs = [ pkgconfig ocaml findlib camlp5 ncurses lablgtk ];
+
+  postPatch = ''
+    UNAME=$(type -tp uname)
+    RM=$(type -tp rm)
+    substituteInPlace configure --replace "/bin/uname" "$UNAME"
+    substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM"
+  '';
+
+  preConfigure = ''
+    buildFlagsArray=(${idePath})
+    configureFlagsArray=(
+      -opt
+      ${ideFlags}
+    )
+  '';
+
+  prefixKey = "-prefix ";
+
+  buildFlags = "revision coq coqide";
+
+  meta = {
+    description = "Coq proof assistant";
+    longDescription = ''
+      Coq is a formal proof management system.  It provides a formal language
+      to write mathematical definitions, executable algorithms and theorems
+      together with an environment for semi-interactive development of
+      machine-checked proofs.
+    '';
+    homepage = "http://coq.inria.fr";
+    license = "LGPL";
+    maintainers = with stdenv.lib.maintainers; [ roconnor thoughtpolice ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix
index b4a7a203a3c4..678ec6a4b049 100644
--- a/pkgs/applications/science/logic/coq/default.nix
+++ b/pkgs/applications/science/logic/coq/default.nix
@@ -3,7 +3,7 @@
 {stdenv, fetchurl, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null}:
 
 let 
-  version = "8.4pl2";
+  version = "8.4pl4";
   buildIde = lablgtk != null;
   ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else "";
   idePath = if buildIde then ''
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://coq.inria.fr/distrib/V${version}/files/coq-${version}.tar.gz";
-    sha256 = "1n52pky7bb45irk2jw6f4rd3kvy8lm2yfldjwdhiic0kyqw9lwgv";
+    sha256 = "00bzf4kfbd0g279jrr8ynzvb9wqcly3wi577bkrxivhrg2msxhq6";
   };
 
   buildInputs = [ pkgconfig ocaml findlib camlp5 ncurses lablgtk ];
@@ -54,7 +54,7 @@ stdenv.mkDerivation {
     '';
     homepage = "http://coq.inria.fr";
     license = "LGPL";
-    maintainers = [ stdenv.lib.maintainers.roconnor ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ roconnor thoughtpolice ];
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/science/logic/cvc3/default.nix b/pkgs/applications/science/logic/cvc3/default.nix
index 9bb8f8cde4ca..07b87e3cf073 100644
--- a/pkgs/applications/science/logic/cvc3/default.nix
+++ b/pkgs/applications/science/logic/cvc3/default.nix
@@ -12,10 +12,10 @@ let
     ++ [(a.lib.overrideDerivation x.gmp (y: {dontDisableStatic=true;}))];
   sourceInfo = rec {
     baseName="cvc3";
-    version="2.2";
+    version="2.4.1";
     name="${baseName}-${version}";
     url="http://www.cs.nyu.edu/acsys/cvc3/releases/${version}/${name}.tar.gz";
-    hash="1dw12d5vrixfr6l9j6j7026vrr22zb433xyl6n5yxx4hgfywi0ji";
+    hash="1xxcwhz3y6djrycw8sm6xz83wb4hb12rd1n0skvc7fng0rh1snym";
   };
 in
 rec {
diff --git a/pkgs/applications/science/logic/ekrhyper/default.nix b/pkgs/applications/science/logic/ekrhyper/default.nix
index c90099f495a2..e1eb9a2dcc3b 100644
--- a/pkgs/applications/science/logic/ekrhyper/default.nix
+++ b/pkgs/applications/science/logic/ekrhyper/default.nix
@@ -3,11 +3,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="ekrhyper";
-    version="1_4_30072013";
+    version="1_4_21022014";
     name="${baseName}-${version}";
-    hash="0ashsblm477r7dmq9f33wajkbr29rbyyc919mifdgrrdy6zlc663";
-    url="http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_1_4_30072013.tar.gz";
-    sha256="0ashsblm477r7dmq9f33wajkbr29rbyyc919mifdgrrdy6zlc663";
+    hash="14xaaxyvfli1nd4vd9fp4j1s8k76z2bhazxzzc7br3q6hc6b8ivw";
+    url="http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_1_4_21022014.tar.gz";
+    sha256="14xaaxyvfli1nd4vd9fp4j1s8k76z2bhazxzzc7br3q6hc6b8ivw";
   };
   buildInputs = [
     ocaml perl
diff --git a/pkgs/applications/science/logic/hol/default.nix b/pkgs/applications/science/logic/hol/default.nix
index 2e1647b6c71d..dc8e975ce1d1 100644
--- a/pkgs/applications/science/logic/hol/default.nix
+++ b/pkgs/applications/science/logic/hol/default.nix
@@ -46,11 +46,11 @@ stdenv.mkDerivation {
     #sed -ie "/compute/,999 d" tools/build-sequence # for testing
 
     poly < tools/smart-configure.sml
-
+    
     bin/build ${kernelFlag} -symlink
 
     mkdir -p "$out/bin"
-    ln -st $out/bin  "$out/src/${holsubdir}/bin/"*
+    ln -st $out/bin  $out/src/${holsubdir}/bin/*
     # ln -s $out/src/hol4.${version}/bin $out/bin
   '';
 
diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix
index d6c1c0c18781..3e6440ea9773 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -1,19 +1,20 @@
-{stdenv, fetchsvn, writeScript, ocaml, findlib, camlp5}:
+{ stdenv, fetchsvn, writeScript, ocaml, findlib, camlp5 }:
 
 let
   start_script = ''
     #!/bin/sh
     cd "$out/lib/hol_light"
-    exec ${ocaml}/bin/ocaml -I "camlp5 -where" -init make.ml
+    exec ${ocaml}/bin/ocaml -I \`${camlp5}/bin/camlp5 -where\` -init make.ml
   '';
 in
+stdenv.mkDerivation rec {
+  name     = "hol_light-${version}";
+  version  = "189";
 
-stdenv.mkDerivation {
-  name = "hol_light-20130324";
   src = fetchsvn {
     url = http://hol-light.googlecode.com/svn/trunk;
-    rev = "157";
-    sha256 = "0d0pbnkw2gb11dn30ggfl91lhdxv86kd1fyiqn170w08n0gi805f";
+    rev = version;
+    sha256 = "1v10l64rs7da2kag3wlb651i09pn83icy9n5z84j8h1iwlxzajdh";
   };
 
   buildInputs = [ ocaml findlib camlp5 ];
@@ -27,16 +28,9 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Interactive theorem prover based on Higher-Order Logic";
-    longDescription = ''
-      HOL Light is a computer program to help users prove interesting
-      mathematical theorems completely formally in Higher-Order Logic.  It sets
-      a very exacting standard of correctness, but provides a number of
-      automated tools and pre-proved mathematical theorems (e.g., about
-      arithmetic, basic set theory and real analysis) to save the user work.
-      It is also fully programmable, so users can extend it with new theorems
-      and inference rules without compromising its soundness.
-    '';
-    homepage = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
-    license = stdenv.lib.licenses.bsd2;
+    homepage    = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
+    license     = stdenv.lib.licenses.bsd2;
+    platforms   = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/applications/science/logic/iprover/default.nix b/pkgs/applications/science/logic/iprover/default.nix
index 2fb9678b8329..e03b33fa43cc 100644
--- a/pkgs/applications/science/logic/iprover/default.nix
+++ b/pkgs/applications/science/logic/iprover/default.nix
@@ -2,9 +2,9 @@ x@{builderDefsPackage
   , ocaml, eprover
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
@@ -38,7 +38,7 @@ rec {
     echo -e "#! /bin/sh\\n$out/bin/iproveropt --clausifier \"${eprover}/bin/eprover\" --clausifier_options \" --tstp-format --silent --cnf \" \"\$@\"" > "$out"/bin/iprover
     chmod a+x  "$out"/bin/iprover
   '') ["defEnsureDir" "minInit" "doMake"];
-      
+
   meta = {
     description = "An automated first-order logic theorem prover";
     maintainers = with a.lib.maintainers;
@@ -47,7 +47,8 @@ rec {
     ];
     platforms = with a.lib.platforms;
       linux;
-    license = "GPLv3";
+    license = with a.lib.licenses;
+      gpl3;
   };
   passthru = {
     updateInfo = {
@@ -55,4 +56,3 @@ rec {
     };
   };
 }) x
-
diff --git a/pkgs/applications/science/logic/leo2/default.nix b/pkgs/applications/science/logic/leo2/default.nix
index 913171827af1..8f673eb0f15a 100644
--- a/pkgs/applications/science/logic/leo2/default.nix
+++ b/pkgs/applications/science/logic/leo2/default.nix
@@ -1,5 +1,5 @@
 x@{builderDefsPackage
-  , ocaml, eprover
+  , ocaml, eprover, zlib
   , ...}:
 builderDefsPackage
 (a :  
@@ -11,16 +11,16 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="leo2";
-    version="1.2.8";
+    version = "1.6.2";
     name="${baseName}_v${version}";
-    url="http://www.ags.uni-sb.de/~leo/${name}.tgz";
-    hash="d46a94f5991623386eb9061cfb0d748e258359a8c690fded173d45303e0e9e3a";
+    url="page.mi.fu-berlin.de/cbenzmueller/leo/leo2_v${version}.tgz";
+    hash="d46a94f5991623386eb9061cfb0d748e258359a8c690fded173d35303e0e9e3a";
   };
 in
 rec {
   src = a.fetchurl {
     url = sourceInfo.url;
-    sha256 = sourceInfo.hash;
+    sha256 = "1wjpmizb181iygnd18lx7p77fwaci2clgzs5ix5j51cc8f3pazmv";
   };
 
   name = "${sourceInfo.baseName}-${sourceInfo.version}";
@@ -43,6 +43,10 @@ rec {
     echo -e "e = ${eprover}/bin/eprover\\nepclextract = ${eprover}/bin/epclextract" > "$out/etc/leoatprc"
   '') ["minInit" "doMake" "defEnsureDir"];
 
+  makeFlags = [
+    "SHELL=${a.stdenv.shell}"
+  ];
+
   meta = {
     description = "A high-performance typed higher order prover";
     maintainers = with a.lib.maintainers;
@@ -52,11 +56,9 @@ rec {
     platforms = with a.lib.platforms;
       linux;
     license = "BSD";
-  };
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://www.ags.uni-sb.de/~leo/download.html";
-    };
+    inherit (sourceInfo) version;
+    homepage = "http://page.mi.fu-berlin.de/cbenzmueller/leo/";
+    downloadPage = "http://page.mi.fu-berlin.de/cbenzmueller/leo/download.html";
   };
 }) x
 
diff --git a/pkgs/applications/science/logic/leo2/default.upstream b/pkgs/applications/science/logic/leo2/default.upstream
new file mode 100644
index 000000000000..52b8ed1cdaa2
--- /dev/null
+++ b/pkgs/applications/science/logic/leo2/default.upstream
@@ -0,0 +1,6 @@
+url http://page.mi.fu-berlin.de/cbenzmueller/leo/download.html
+version_link '[.]tgz'
+version '.*_v([0-9.]+)[.][a-z0-9]+$' '\1'
+do_overwrite () {
+  do_overwrite_just_version
+}
diff --git a/pkgs/applications/science/logic/logisim/default.nix b/pkgs/applications/science/logic/logisim/default.nix
index ab46efa9a961..c71ed73a9925 100644
--- a/pkgs/applications/science/logic/logisim/default.nix
+++ b/pkgs/applications/science/logic/logisim/default.nix
@@ -27,6 +27,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://ozark.hendrix.edu/~burch/logisim";
     description = "Educational tool for designing and simulating digital logic circuits";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/science/logic/ltl2ba/default.nix b/pkgs/applications/science/logic/ltl2ba/default.nix
new file mode 100644
index 000000000000..cdadd18ac9f5
--- /dev/null
+++ b/pkgs/applications/science/logic/ltl2ba/default.nix
@@ -0,0 +1,24 @@
+{ fetchurl, stdenv }:
+
+stdenv.mkDerivation rec {
+  name = "ltl2ba-${version}";
+  version = "1.1";
+
+  src = fetchurl {
+    url    = "http://www.lsv.ens-cachan.fr/~gastin/ltl2ba/${name}.tar.gz";
+    sha256 = "16z0gc7a9dkarwn0l6rvg5jdhw1q4qyn4501zlchy0zxqddz0sx6";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv ltl2ba $out/bin
+  '';
+
+  meta = {
+    description = "fast translation from LTL formulae to Buchi automata";
+    homepage    = "http://www.lsv.ens-cachan.fr/~gastin/ltl2ba";
+    license     = stdenv.lib.licenses.gpl2Plus;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/science/logic/matita/130312.nix b/pkgs/applications/science/logic/matita/130312.nix
index f77e9d34a2a8..9e98c8db3947 100644
--- a/pkgs/applications/science/logic/matita/130312.nix
+++ b/pkgs/applications/science/logic/matita/130312.nix
@@ -60,7 +60,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://matita.cs.unibo.it/;
     description = "Matita is an experimental, interactive theorem prover";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
   };
 }
diff --git a/pkgs/applications/science/logic/matita/default.nix b/pkgs/applications/science/logic/matita/default.nix
index 0713ff09e929..f601f97de62e 100644
--- a/pkgs/applications/science/logic/matita/default.nix
+++ b/pkgs/applications/science/logic/matita/default.nix
@@ -48,7 +48,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://matita.cs.unibo.it/;
     description = "Matita is an experimental, interactive theorem prover";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
   };
 }
diff --git a/pkgs/applications/science/logic/minisat/default.nix b/pkgs/applications/science/logic/minisat/default.nix
index 1f29b3aa1a11..e91ff67fc9cc 100644
--- a/pkgs/applications/science/logic/minisat/default.nix
+++ b/pkgs/applications/science/logic/minisat/default.nix
@@ -2,9 +2,9 @@ x@{builderDefsPackage
   , zlib
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
@@ -36,7 +36,7 @@ rec {
   setVars = a.fullDepEntry (''
     export MROOT=$PWD/../
   '') ["doUnpack"];
-      
+
   meta = {
     description = "A compact and readable SAT-solver";
     maintainers = with a.lib.maintainers;
@@ -45,7 +45,7 @@ rec {
     ];
     platforms = with a.lib.platforms;
       linux;
-    license = "MIT";
+    license = a.stdenv.lib.licenses.mit;
     homepage = "http://minisat.se/";
   };
   passthru = {
@@ -54,4 +54,3 @@ rec {
     };
   };
 }) x
-
diff --git a/pkgs/applications/science/logic/opensmt/default.nix b/pkgs/applications/science/logic/opensmt/default.nix
index 430537fd57ff..62e11651175f 100644
--- a/pkgs/applications/science/logic/opensmt/default.nix
+++ b/pkgs/applications/science/logic/opensmt/default.nix
@@ -3,9 +3,9 @@ x@{builderDefsPackage
   , gmpxx, flex, bison
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
@@ -30,17 +30,14 @@ rec {
 
   /* doConfigure should be removed if not needed */
   phaseNames = ["doAutotools" "doConfigure" "doMakeInstall"];
-      
+
   meta = {
     description = "A satisfiability modulo theory (SMT) solver";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = "GPLv3";
+    maintainers = [ a.lib.maintainers.raskin ];
+    platforms = a.lib.platforms.linux;
+    license = a.stdenv.lib.licenses.gpl3;
     homepage = "http://code.google.com/p/opensmt/";
+    broken = true;
   };
   passthru = {
     updateInfo = {
@@ -48,4 +45,3 @@ rec {
     };
   };
 }) x
-
diff --git a/pkgs/applications/science/logic/picosat/default.nix b/pkgs/applications/science/logic/picosat/default.nix
index 970daf739fca..6c2cce0ea4b1 100644
--- a/pkgs/applications/science/logic/picosat/default.nix
+++ b/pkgs/applications/science/logic/picosat/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://fmv.jku.at/picosat/;
     description = "SAT solver with proof and core support";
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
   };
 }
diff --git a/pkgs/applications/science/logic/prooftree/default.nix b/pkgs/applications/science/logic/prooftree/default.nix
new file mode 100644
index 000000000000..caaf4a94a1ed
--- /dev/null
+++ b/pkgs/applications/science/logic/prooftree/default.nix
@@ -0,0 +1,40 @@
+{stdenv, fetchurl, pkgconfig, ocaml, findlib, camlp5, ncurses, lablgtk ? null}:
+
+stdenv.mkDerivation (rec {
+  name = "prooftree-${version}";
+  version = "0.12";
+
+  src = fetchurl {
+    url = "http://askra.de/software/prooftree/releases/prooftree-${version}.tar.gz";
+    sha256 = "08yp66j05pdkdpv9xkfqymqy82mir5xbwfh9mkzhh219xkps4b4m";
+  };
+
+  buildInputs = [ pkgconfig ocaml findlib camlp5 ncurses lablgtk ];
+
+  dontAddPrefix = true;
+  configureFlags = [ "--prefix" "$(out)" ];
+
+  meta = {
+    description = "Prooftree is a program for proof-tree visualization";
+    longDescription = ''
+      Prooftree is a program for proof-tree visualization during interactive
+      proof development in a theorem prover. It is currently being developed
+      for Coq and Proof General. Prooftree helps against getting lost between
+      different subgoals in interactive proof development. It clearly shows
+      where the current subgoal comes from and thus helps in developing the
+      right plan for solving it.
+
+      Prooftree uses different colors for the already proven subgoals, the
+      current branch in the proof and the still open subgoals. Sequent texts
+      are not displayed in the proof tree itself, but they are shown as a
+      tool-tip when the mouse rests over a sequent symbol. Long proof commands
+      are abbreviated in the tree display, but show up in full length as
+      tool-tip. Both, sequents and proof commands, can be shown in the display
+      below the tree (on single click) or in a separate window (on double or
+      shift-click).
+    '';
+    homepage = http://askra.de/software/prooftree;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.jwiegley ];
+  };
+})
diff --git a/pkgs/applications/science/logic/ssreflect/default.nix b/pkgs/applications/science/logic/ssreflect/default.nix
index 6377db9c8955..a784e5fe1b6e 100644
--- a/pkgs/applications/science/logic/ssreflect/default.nix
+++ b/pkgs/applications/science/logic/ssreflect/default.nix
@@ -6,7 +6,7 @@
 
 let
   pname = "ssreflect";
-  version = "1.4";
+  version = "1.5";
   name = "${pname}-${version}";
   webpage = http://www.msr-inria.inria.fr/Projects/math-components;
 in
@@ -15,8 +15,8 @@ stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url = "http://ssr.msr-inria.inria.fr/FTP/${name}-coq8.4.tar.gz";
-    sha256 = "1ysx29xw09i86lq0d92z9cnyx133jfgq4qddy3501000fn7xwi7h";
+    url = "http://ssr.msr-inria.inria.fr/FTP/${name}.tar.gz";
+    sha256 = "0hm1ha7sxqfqhc7iwhx6zdz3nki4rj5nfd3ab24hmz8v7mlpinds";
   };
 
   buildInputs = [ ocaml camlp5 coq makeWrapper ];
diff --git a/pkgs/applications/science/logic/stp/default.nix b/pkgs/applications/science/logic/stp/default.nix
new file mode 100644
index 000000000000..cfe96bc6983a
--- /dev/null
+++ b/pkgs/applications/science/logic/stp/default.nix
@@ -0,0 +1,23 @@
+{stdenv, cmake, boost, bison, flex, fetchgit, perl, zlib}: 
+stdenv.mkDerivation rec {
+  version = "2014.01.07";
+  name = "stp-${version}";
+  src = fetchgit {
+    url    = "git://github.com/stp/stp";
+    rev    = "3aa11620a823d617fc033d26aedae91853d18635";
+    sha256 = "832520787f57f63cf47364d080f30ad10d6d6e00f166790c19b125be3d6dd45c";
+  };
+  buildInputs = [ cmake boost bison flex perl zlib ];
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+  patchPhase = ''
+      sed -e 's,^export(PACKAGE.*,,' -i CMakeLists.txt
+      patch -p1 < ${./fixbuild.diff}
+      patch -p1 < ${./fixrefs.diff}
+  '';
+  meta = {
+    description = ''Simple Theorem Prover'';
+    maintainers = with stdenv.lib.maintainers; [mornfall];
+    platforms = with stdenv.lib.platforms; linux;
+    license = with stdenv.lib.licenses; mit;
+  };
+}
diff --git a/pkgs/applications/science/logic/stp/fixbuild.diff b/pkgs/applications/science/logic/stp/fixbuild.diff
new file mode 100644
index 000000000000..01782cb4f40b
--- /dev/null
+++ b/pkgs/applications/science/logic/stp/fixbuild.diff
@@ -0,0 +1,45 @@
+diff --git a/src/libstp/CMakeLists.txt b/src/libstp/CMakeLists.txt
+index 83bd03a..9c0304b 100644
+--- a/src/libstp/CMakeLists.txt
++++ b/src/libstp/CMakeLists.txt
+@@ -23,6 +23,15 @@ set(stp_lib_targets
+     printer
+ )
+ 
++include_directories(${CMAKE_SOURCE_DIR}/src/AST/)
++include_directories(${CMAKE_BINARY_DIR}/src/AST/)
++
++add_library(globalstp OBJECT
++    ../main/Globals.cpp
++    ${CMAKE_CURRENT_BINARY_DIR}/../main/GitSHA1.cpp
++)
++add_dependencies(globalstp ASTKind_header)
++
+ # Create list of objects and gather list of
+ # associated public headers.
+ set(stp_lib_objects "")
+@@ -31,6 +40,7 @@ foreach(target ${stp_lib_targets})
+     list(APPEND stp_lib_objects $<TARGET_OBJECTS:${target}>)
+ 
+     get_target_property(TARGETS_PUBLIC_HEADERS ${target} PUBLIC_HEADER)
++    set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+     if (EXISTS "${TARGETS_PUBLIC_HEADERS}")
+         list(APPEND stp_public_headers "${TARGETS_PUBLIC_HEADERS}")
+         message("Adding public header(s) ${TARGETS_PUBLIC_HEADERS} to target libstp")
+diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt
+index 0735137..73039f5 100644
+--- a/src/main/CMakeLists.txt
++++ b/src/main/CMakeLists.txt
+@@ -3,12 +3,6 @@ include_directories(${CMAKE_BINARY_DIR}/src/AST/)
+ 
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/GitSHA1.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/GitSHA1.cpp" @ONLY)
+ 
+-add_library(globalstp OBJECT
+-    Globals.cpp
+-    ${CMAKE_CURRENT_BINARY_DIR}/GitSHA1.cpp
+-)
+-add_dependencies(globalstp ASTKind_header)
+-
+ # -----------------------------------------------------------------------------
+ # Create binary
+ # -----------------------------------------------------------------------------
diff --git a/pkgs/applications/science/logic/stp/fixrefs.diff b/pkgs/applications/science/logic/stp/fixrefs.diff
new file mode 100644
index 000000000000..60ad4949f076
--- /dev/null
+++ b/pkgs/applications/science/logic/stp/fixrefs.diff
@@ -0,0 +1,192 @@
+commit 53b6043e25b2eba264faab845077fbf6736cf22f
+Author: Petr Rockai <me@mornfall.net>
+Date:   Tue Jan 7 13:30:07 2014 +0100
+
+    aig: Comment out unused functions with undefined references in them.
+
+diff --git a/src/extlib-abc/aig/aig/aigPart.c b/src/extlib-abc/aig/aig/aigPart.c
+index a4cc116..5bd5f08 100644
+--- a/src/extlib-abc/aig/aig/aigPart.c
++++ b/src/extlib-abc/aig/aig/aigPart.c
+@@ -869,6 +869,7 @@ Vec_Ptr_t * Aig_ManMiterPartitioned( Aig_Man_t * p1, Aig_Man_t * p2, int nPartSi
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ Aig_Man_t * Aig_ManChoicePartitioned( Vec_Ptr_t * vAigs, int nPartSize )

+ {

+     extern int Cmd_CommandExecute( void * pAbc, char * sCommand );

+@@ -981,6 +982,7 @@ Aig_Man_t * Aig_ManChoicePartitioned( Vec_Ptr_t * vAigs, int nPartSize )
+     Aig_ManMarkValidChoices( pAig );

+     return pAig;

+ }

++#endif

+ 

+ 

+ ////////////////////////////////////////////////////////////////////////

+diff --git a/src/extlib-abc/aig/aig/aigShow.c b/src/extlib-abc/aig/aig/aigShow.c
+index ae8fa8b..f04eedc 100644
+--- a/src/extlib-abc/aig/aig/aigShow.c
++++ b/src/extlib-abc/aig/aig/aigShow.c
+@@ -326,6 +326,7 @@ void Aig_WriteDotAig( Aig_Man_t * pMan, char * pFileName, int fHaig, Vec_Ptr_t *
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ void Aig_ManShow( Aig_Man_t * pMan, int fHaig, Vec_Ptr_t * vBold )

+ {

+     extern void Abc_ShowFile( char * FileNameDot );

+@@ -347,7 +348,7 @@ void Aig_ManShow( Aig_Man_t * pMan, int fHaig, Vec_Ptr_t * vBold )
+     // visualize the file 

+     Abc_ShowFile( FileNameDot );

+ }

+-

++#endif

+ 

+ ////////////////////////////////////////////////////////////////////////

+ ///                       END OF FILE                                ///

+diff --git a/src/extlib-abc/aig/dar/darRefact.c b/src/extlib-abc/aig/dar/darRefact.c
+index d744b4f..23fc3d5 100644
+--- a/src/extlib-abc/aig/dar/darRefact.c
++++ b/src/extlib-abc/aig/dar/darRefact.c
+@@ -340,6 +340,7 @@ printf( "\n" );
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ int Dar_ManRefactorTryCuts( Ref_Man_t * p, Aig_Obj_t * pObj, int nNodesSaved, int Required )

+ {

+     Vec_Ptr_t * vCut;

+@@ -428,6 +429,7 @@ int Dar_ManRefactorTryCuts( Ref_Man_t * p, Aig_Obj_t * pObj, int nNodesSaved, in
+     }

+     return p->GainBest;

+ }

++#endif

+ 

+ /**Function*************************************************************

+ 

+@@ -461,6 +463,7 @@ int Dar_ObjCutLevelAchieved( Vec_Ptr_t * vCut, int nLevelMin )
+   SeeAlso     []

+  

+ ***********************************************************************/

++#if 0

+ int Dar_ManRefactor( Aig_Man_t * pAig, Dar_RefPar_t * pPars )

+ {

+ //    Bar_Progress_t * pProgress;

+@@ -583,6 +586,7 @@ p->timeOther = p->timeTotal - p->timeCuts - p->timeEval;
+     return 1;

+ 

+ }

++#endif

+ 

+ ////////////////////////////////////////////////////////////////////////

+ ///                       END OF FILE                                ///

+diff --git a/src/extlib-abc/aig/dar/darScript.c b/src/extlib-abc/aig/dar/darScript.c
+index e60df00..1b9c24f 100644
+--- a/src/extlib-abc/aig/dar/darScript.c
++++ b/src/extlib-abc/aig/dar/darScript.c
+@@ -64,6 +64,7 @@ Aig_Man_t * Dar_ManRewriteDefault( Aig_Man_t * pAig )
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )

+ //alias rwsat       "st; rw -l; b -l; rw -l; rf -l"

+ {

+@@ -108,7 +109,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
+ 

+     return pAig;

+ }

+-

++#endif

+ 

+ /**Function*************************************************************

+ 

+@@ -121,6 +122,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, int fVerbose )

+ //alias compress2   "b -l; rw -l; rwz -l; b -l; rwz -l; b -l"

+ {

+@@ -180,6 +182,7 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
+ 

+     return pAig;

+ }

++#endif

+ 

+ /**Function*************************************************************

+ 

+@@ -192,6 +195,7 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, int fVerbose )

+ //alias compress2   "b -l; rw -l; rf -l; b -l; rw -l; rwz -l; b -l; rfz -l; rwz -l; b -l"

+ {

+@@ -285,6 +289,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
+     }

+     return pAig;

+ }

++#endif

+ 

+ /**Function*************************************************************

+ 

+@@ -297,6 +302,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ Vec_Ptr_t * Dar_ManChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, int fVerbose )

+ //alias resyn    "b; rw; rwz; b; rwz; b"

+ //alias resyn2   "b; rw; rf; b; rw; rwz; b; rfz; rwz; b"

+@@ -311,6 +317,7 @@ Vec_Ptr_t * Dar_ManChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateL
+     Vec_PtrPush( vAigs, pAig );

+     return vAigs;

+ }

++#endif

+ 

+ /**Function*************************************************************

+ 

+diff --git a/src/extlib-abc/aig/kit/kitAig.c b/src/extlib-abc/aig/kit/kitAig.c
+index de301f2..7e5df0f 100644
+--- a/src/extlib-abc/aig/kit/kitAig.c
++++ b/src/extlib-abc/aig/kit/kitAig.c
+@@ -95,6 +95,7 @@ Aig_Obj_t * Kit_GraphToAig( Aig_Man_t * pMan, Aig_Obj_t ** pFanins, Kit_Graph_t
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ Aig_Obj_t * Kit_TruthToAig( Aig_Man_t * pMan, Aig_Obj_t ** pFanins, unsigned * pTruth, int nVars, Vec_Int_t * vMemory )

+ {

+     Aig_Obj_t * pObj;

+@@ -113,6 +114,7 @@ Aig_Obj_t * Kit_TruthToAig( Aig_Man_t * pMan, Aig_Obj_t ** pFanins, unsigned * p
+     Kit_GraphFree( pGraph );

+     return pObj;

+ }

++#endif

+ 

+ ////////////////////////////////////////////////////////////////////////

+ ///                       END OF FILE                                ///

+diff --git a/src/extlib-abc/aig/kit/kitGraph.c b/src/extlib-abc/aig/kit/kitGraph.c
+index 39ef587..0485c66 100644
+--- a/src/extlib-abc/aig/kit/kitGraph.c
++++ b/src/extlib-abc/aig/kit/kitGraph.c
+@@ -349,6 +349,7 @@ unsigned Kit_GraphToTruth( Kit_Graph_t * pGraph )
+   SeeAlso     []

+ 

+ ***********************************************************************/

++#if 0

+ Kit_Graph_t * Kit_TruthToGraph( unsigned * pTruth, int nVars, Vec_Int_t * vMemory )

+ {

+     Kit_Graph_t * pGraph;

+@@ -365,6 +366,7 @@ Kit_Graph_t * Kit_TruthToGraph( unsigned * pTruth, int nVars, Vec_Int_t * vMemor
+     pGraph = Kit_SopFactor( vMemory, RetValue, nVars, vMemory );

+     return pGraph;

+ }

++#endif

+ 

+ /**Function*************************************************************

+ 

diff --git a/pkgs/applications/science/logic/tptp/default.nix b/pkgs/applications/science/logic/tptp/default.nix
index 5c8cb7203245..ef00b135c271 100644
--- a/pkgs/applications/science/logic/tptp/default.nix
+++ b/pkgs/applications/science/logic/tptp/default.nix
@@ -11,15 +11,19 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="TPTP";
-    version="5.4.0";
+    version="6.0.0";
     name="${baseName}-${version}";
-    url="http://www.cs.miami.edu/~tptp/TPTP/Distribution/TPTP-v${version}.tgz";
-    hash="0rvrmh3vw4bk7mj29bx1pi76g2bsqyc13gsnpa1cbjs5pzyhm780";
+    urls=
+    [
+    "http://www.cs.miami.edu/~tptp/TPTP/Distribution/TPTP-v${version}.tgz"
+    "http://www.cs.miami.edu/~tptp/TPTP/Archive/TPTP-v${version}/TPTP-v${version}.tgz"
+    ];
+    hash="0jnjkqdz937c7mkxvh9wc3byw5h1k19jss058fbzdxxc2hkwq1af";
   };
 in
 rec {
   src = a.fetchurl {
-    url = sourceInfo.url;
+    urls = sourceInfo.urls;
     sha256 = sourceInfo.hash;
   };
 
@@ -74,8 +78,7 @@ rec {
     # A GiB of data. Installation is unpacking and editing a few files.
     # No sense in letting Hydra build it.
     # Also, it is unclear what is covered by "verbatim" - we will edit configs
-    platforms = with a.lib.platforms;
-      [];
+    hydraPlatforms = [];
     license = "verbatim-redistribution";
   };
   passthru = {
diff --git a/pkgs/applications/science/logic/twelf/default.nix b/pkgs/applications/science/logic/twelf/default.nix
new file mode 100644
index 000000000000..c6c7e4d9c1a7
--- /dev/null
+++ b/pkgs/applications/science/logic/twelf/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, pkgconfig, smlnj, rsync }:
+
+stdenv.mkDerivation rec {
+  name = "twelf-${version}";
+  version = "1.7.1";
+
+  src = fetchurl {
+    url = "http://twelf.plparty.org/releases/twelf-src-${version}.tar.gz";
+    sha256 = "0fi1kbs9hrdrm1x4k13angpjasxlyd1gc3ys8ah54i75qbcd9c4i";
+  };
+
+  buildInputs = [ pkgconfig smlnj rsync ];
+
+  buildPhase = ''
+    export SMLNJ_HOME=${smlnj}
+    make smlnj
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    rsync -av bin/* $out/bin/
+
+    mkdir -p $out/share/emacs/site-lisp/twelf/
+    rsync -av emacs/ $out/share/emacs/site-lisp/twelf/
+
+    mkdir -p $out/share/twelf/examples
+    rsync -av examples/ $out/share/twelf/examples/
+    mkdir -p $out/share/twelf/vim
+    rsync -av vim/ $out/share/twelf/vim/
+  '';
+
+  meta = {
+    description = "Twelf logic proof assistant";
+    longDescription = ''
+      Twelf is a language used to specify, implement, and prove properties of
+      deductive systems such as programming languages and logics. Large
+      research projects using Twelf include the TALT typed assembly language,
+      a foundational proof-carrying-code system, and a type safety proof for
+      Standard ML.
+    '';
+    homepage = http://twelf.org/wiki/Main_Page;
+    license = "MIT";
+    maintainers = with stdenv.lib.maintainers; [ jwiegley ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/applications/science/logic/verifast/default.nix b/pkgs/applications/science/logic/verifast/default.nix
new file mode 100644
index 000000000000..7ab08cf8799f
--- /dev/null
+++ b/pkgs/applications/science/logic/verifast/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, gtk, gdk_pixbuf, atk, pango, glib, cairo, freetype
+, fontconfig, libxml2, gnome2 }:
+
+let
+  libPath = stdenv.lib.makeLibraryPath
+    [ stdenv.gcc.libc stdenv.gcc.gcc gtk gdk_pixbuf atk pango glib cairo
+      freetype fontconfig libxml2 gnome2.gtksourceview
+    ] + ":${stdenv.gcc.gcc}/lib64";
+
+  patchExe = x: ''
+    patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath} ${x}
+  '';
+in
+stdenv.mkDerivation rec {
+  name    = "verifast-${version}";
+  version = "14.5";
+
+  src = fetchurl {
+    url    = "http://people.cs.kuleuven.be/~bart.jacobs/verifast/${name}-x64.tar.gz";
+    sha256 = "03y1s6s2j9vqgiad0vbxriipsypxaylxxd3q36n9rvrc3lf9xra9";
+  };
+
+  dontStrip = true;
+  phases = "unpackPhase installPhase";
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -R bin $out/libexec
+
+    ${patchExe "$out/libexec/verifast-core"}
+    ${patchExe "$out/libexec/vfide-core"}
+    ln -s $out/libexec/verifast-core $out/bin/verifast
+    ln -s $out/libexec/vfide-core    $out/bin/vfide
+  '';
+
+  meta = {
+    description = "Verification for C and Java programs via separation logic";
+    homepage    = "http://people.cs.kuleuven.be/~bart.jacobs/verifast/";
+    license     = stdenv.lib.licenses.msrla;
+    platforms   = [ "x86_64-linux" ];
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/science/logic/why3/default.nix b/pkgs/applications/science/logic/why3/default.nix
new file mode 100644
index 000000000000..71ff1cc7fb47
--- /dev/null
+++ b/pkgs/applications/science/logic/why3/default.nix
@@ -0,0 +1,22 @@
+{ fetchurl, stdenv, ocaml, ocamlPackages, coq }:
+
+stdenv.mkDerivation rec {
+  name    = "why3-${version}";
+  version = "0.83";
+
+  src = fetchurl {
+    url    = "https://gforge.inria.fr/frs/download.php/33490/${name}.tar.gz";
+    sha256 = "1jcs5vj91ppbgh4q4hch89b63wgakjhg35pm3r4jwhp377lnggya";
+  };
+
+  buildInputs = with ocamlPackages;
+    [ coq ocaml findlib lablgtk ocamlgraph zarith ];
+
+  meta = {
+    description = "why is a software verification platform";
+    homepage    = "http://why3.lri.fr/";
+    license     = stdenv.lib.licenses.lgpl21;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/science/logic/yices/default.nix b/pkgs/applications/science/logic/yices/default.nix
new file mode 100644
index 000000000000..5a1a4ef19922
--- /dev/null
+++ b/pkgs/applications/science/logic/yices/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl }:
+
+let
+  libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.libc ];
+in
+stdenv.mkDerivation rec {
+  name    = "yices-${version}";
+  version = "2.2.1";
+
+  src =
+    if stdenv.system == "i686-linux"
+    then fetchurl {
+      url = "http://yices.csl.sri.com/cgi-bin/yices2-newdownload.cgi?file=yices-2.2.1-i686-pc-linux-gnu-static-gmp.tar.gz&accept=I+accept";
+      name = "yices-${version}-i686.tar.gz";
+      sha256 = "12jzk3kqlbqa5x6rl92cpzj7dch7gm7fnbj72wifvwgdj4zyhrra";
+    }
+    else fetchurl {
+      url = "http://yices.csl.sri.com/cgi-bin/yices2-newdownload.cgi?file=yices-2.2.1-x86_64-unknown-linux-gnu-static-gmp.tar.gz&accept=I+accept";
+      name = "yices-${version}-x86_64.tar.gz";
+      sha256 = "0fpmihf6ykcg4qbsimkamgcwp4sl1xyxmz7q28ily91rd905ijaj";
+    };
+
+  buildPhase = false;
+  installPhase = ''
+    mkdir -p $out/bin $out/lib $out/include
+    cd bin     && mv * $out/bin     && cd ..
+    cd lib     && mv * $out/lib     && cd ..
+    cd include && mv * $out/include && cd ..
+
+    patchelf --set-rpath ${libPath} $out/lib/libyices.so.${version}
+  '';
+
+  meta = {
+    description = "Yices is a high-performance theorem prover and SMT solver";
+    homepage    = "http://yices.csl.sri.com";
+    license     = stdenv.lib.licenses.unfreeRedistributable;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix
new file mode 100644
index 000000000000..7a87cb5e8be0
--- /dev/null
+++ b/pkgs/applications/science/logic/z3/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, python, unzip, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "z3-${version}";
+  version = "4.3.1";
+  src = fetchurl {
+    url    = "http://download-codeplex.sec.s-msft.com/Download/SourceControlFileDownload.ashx\?ProjectName\=z3\&changeSetId\=89c1785b73225a1b363c0e485f854613121b70a7";
+    name   = "${name}.zip";
+    sha256 = "3b94465c52ec174350d8707dd6a1fb0cef42f0fa23f148cc1808c14f3c2c7f76";
+  };
+
+  buildInputs = [ python unzip autoreconfHook ];
+  enableParallelBuilding = true;
+
+  # The zip file doesn't unpack a directory, just the code itself.
+  unpackPhase = "mkdir ${name} && cd ${name} && unzip $src";
+  postConfigure = ''
+    python scripts/mk_make.py
+    cd build
+  '';
+
+  # z3's install phase is stupid because it tries to calculate the
+  # python package store location itself, meaning it'll attempt to
+  # write files into the nix store, and fail.
+  soext = if stdenv.system == "x86_64-darwin" then ".dylib" else ".so";
+  installPhase = ''
+    mkdir -p $out/bin $out/lib/${python.libPrefix}/site-packages $out/include
+    cp ../src/api/z3.h        $out/include
+    cp ../src/api/z3_api.h    $out/include
+    cp ../src/api/z3_v1.h     $out/include
+    cp ../src/api/z3_macros.h $out/include
+    cp ../src/api/c++/z3++.h  $out/include
+    cp z3                     $out/bin
+    cp libz3${soext}          $out/lib
+    cp libz3${soext}          $out/lib/${python.libPrefix}/site-packages
+    cp z3*.pyc                $out/lib/${python.libPrefix}/site-packages
+  '';
+
+  meta = {
+    description = "Z3 is a high-performance theorem prover and SMT solver";
+    homepage    = "http://z3.codeplex.com";
+    license     = stdenv.lib.licenses.msrla;
+    platforms   = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 6c8ec9e68c53..edba65146a66 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -2,14 +2,15 @@
 , libjpeg, libpng, libtiff, ncurses, pango, pcre, perl, readline, tcl
 , texLive, tk, xz, zlib, less, texinfo, graphviz, icu, pkgconfig, bison
 , imake, which, jdk, atlas
+, withRecommendedPackages ? true
 }:
 
 stdenv.mkDerivation rec {
-  name = "R-3.0.2";
+  name = "R-3.1.0";
 
   src = fetchurl {
     url = "http://cran.r-project.org/src/base/R-3/${name}.tar.gz";
-    sha256 = "0jq2vk6bgksbvgmdjvv7vfj6llp091d0nhl5j825aya4c2nhavlm";
+    sha256 = "1qjzbw341bvi1h4jwbvdkvq8j0z9l3m85mpgrlfw0n2cz2806s4a";
   };
 
   buildInputs = [ blas bzip2 gfortran liblapack libX11 libXmu libXt
@@ -23,6 +24,7 @@ stdenv.mkDerivation rec {
   preConfigure = ''
     configureFlagsArray=(
       --disable-lto
+      --with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
       --with-blas="-L${atlas}/lib -lf77blas -latlas"
       --with-lapack="-L${liblapack}/lib -llapack"
       --with-readline
@@ -36,6 +38,7 @@ stdenv.mkDerivation rec {
       --with-system-pcre
       --with-system-xz
       --with-ICU
+      --enable-R-shlib
       AR=$(type -p ar)
       AWK=$(type -p gawk)
       CC=$(type -p gcc)
@@ -81,7 +84,7 @@ stdenv.mkDerivation rec {
       user-defined recursive functions and input and output facilities.
     '';
 
-    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/applications/science/math/content/default.nix b/pkgs/applications/science/math/content/default.nix
index 87c047c29957..177efd667a39 100644
--- a/pkgs/applications/science/math/content/default.nix
+++ b/pkgs/applications/science/math/content/default.nix
@@ -93,5 +93,6 @@ rec {
       a.lib.maintainers.raskin
     ];
     platforms = a.lib.platforms.linux;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix
index 55ea4c6216c6..fdf5c1bd8315 100644
--- a/pkgs/applications/science/math/eukleides/default.nix
+++ b/pkgs/applications/science/math/eukleides/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Geometry Drawing Language";
     homepage = "http://www.eukleides.org/";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
 
     longDescription = ''
       Eukleides is a computer language devoted to elementary plane
diff --git a/pkgs/applications/science/math/fricas/default.nix b/pkgs/applications/science/math/fricas/default.nix
new file mode 100644
index 000000000000..1817c43ed7be
--- /dev/null
+++ b/pkgs/applications/science/math/fricas/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, sbcl, libX11, libXpm, libICE, libSM, libXt, libXau, libXdmcp }:
+
+stdenv.mkDerivation rec {
+  name = "fricas-1.2.2";
+
+  src = fetchurl {
+    url    = "http://sourceforge.net/projects/fricas/files/fricas/1.2.2/${name}-full.tar.bz2";
+    sha256 = "87db64a1fd4211f3b776793acea931b4271d2e7a28396414c7d7397d833defe1";
+  };
+
+  buildInputs = [ sbcl libX11 libXpm libICE libSM libXt libXau libXdmcp ];
+
+  dontStrip = true;
+
+  meta = {
+    homepage = http://fricas.sourceforge.net/;
+    description = "Fricas CAS";
+    license = stdenv.lib.licenses.bsd3;
+
+    hydraPlatforms = stdenv.lib.platforms.linux;
+    maintainers = stdenv.lib.maintainers.sprock;
+  };
+}
diff --git a/pkgs/applications/science/math/gap/default.nix b/pkgs/applications/science/math/gap/default.nix
index f76640567f60..0700251c3a82 100644
--- a/pkgs/applications/science/math/gap/default.nix
+++ b/pkgs/applications/science/math/gap/default.nix
@@ -1,10 +1,10 @@
 x@{builderDefsPackage
-  , pari ? null 
+  , pari ? null
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
@@ -38,20 +38,20 @@ rec {
   phaseNames = ["doConfigure" "doMake" "doDeploy"];
 
   doDeploy = a.fullDepEntry ''
-    ensureDir "$out/bin" "$out/share/gap/"
+    mkdir -p "$out/bin" "$out/share/gap/"
 
     cp -r . "$out/share/gap/build-dir"
 
     tar xf "${pkgSrc}" -C "$out/share/gap/build-dir/pkg"
 
-    ${if a.pari != null then 
-      ''sed -e '2iexport PATH=$PATH:${pari}/bin' -i "$out/share/gap/build-dir/bin/gap.sh" '' 
+    ${if a.pari != null then
+      ''sed -e '2iexport PATH=$PATH:${pari}/bin' -i "$out/share/gap/build-dir/bin/gap.sh" ''
     else ""}
-    sed -e "/GAP_DIR=/aGAP_DIR='$out/share/gap/build-dir/'" -i "$out/share/gap/build-dir/bin/gap.sh" 
+    sed -e "/GAP_DIR=/aGAP_DIR='$out/share/gap/build-dir/'" -i "$out/share/gap/build-dir/bin/gap.sh"
 
     ln -s "$out/share/gap/build-dir/bin/gap.sh" "$out/bin"
   '' ["doMake" "minInit" "defEnsureDir"];
-      
+
   meta = {
     description = "Computational discrete algebra system";
     maintainers = with a.lib.maintainers;
@@ -60,8 +60,8 @@ rec {
     ];
     platforms = with a.lib.platforms;
       linux;
-    license = "GPLv2";
+    license = with a.lib.licenses;
+      gpl2;
     homepage = "http://gap-system.org/";
   };
 }) x
-
diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix
index a056a32c64c2..c4352c46f92e 100644
--- a/pkgs/applications/science/math/glsurf/default.nix
+++ b/pkgs/applications/science/math/glsurf/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   src = fetchdarcs {
     url = "http://lama.univ-savoie.fr/~raffalli/GlSurf";
-    tag = "3.3";
+    rev = "3.3";
     sha256 = ""; md5="";
   };
 
diff --git a/pkgs/applications/science/math/jags/default.nix b/pkgs/applications/science/math/jags/default.nix
index 3043df15da74..a93386149bd4 100644
--- a/pkgs/applications/science/math/jags/default.nix
+++ b/pkgs/applications/science/math/jags/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, gfortran, liblapack, blas}:
 
 stdenv.mkDerivation rec {
-  name = "JAGS-2.2.0";
+  name = "JAGS-3.4.0";
   src = fetchurl {
     url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz";
-    sha256 = "016xml4k99lmdwwjiabxin95k9p3q2zh4pcci8wwcqwlq5y205b6";
+    sha256 = "0ayqsz9kkmbss7mxlwr34ch2z1vsb65lryjzqpprab1ccyiaksib";
   };
   buildInputs = [gfortran liblapack blas];
 
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
index cedb491cc8b9..d4d352c95bbb 100644
--- a/pkgs/applications/science/math/mathematica/default.nix
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -18,10 +18,8 @@
 
 let
   platform =
-    if stdenv.system == "i686-linux" then
+    if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then
       "Linux"
-    else if stdenv.system == "x86_64-linux" then
-      "Linux-x86-64"
     else
       throw "Mathematica requires i686-linux or x86_64 linux";
 in
@@ -121,6 +119,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Wolfram Mathematica computational software system";
     homepage = "http://www.wolfram.com/mathematica/";
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
   };
 }
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index b8f7f2e65b66..096796a859d0 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.31.2";
+  version = "5.33.0";
 
   searchPath =
     stdenv.lib.makeSearchPath "bin"
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "12j5irwfckl5583h7lwh0wrp0c65q7mqzcsri2v086j50xvvv398";
+    sha256 = "13axm11xw0f3frx5b0qdidi7igkn1524fzz77s9rbpl2yy2nrbz2";
   };
 
   buildInputs = [sbcl texinfo perl makeWrapper];
@@ -40,7 +40,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Maxima computer algebra system";
     homepage = "http://maxima.sourceforge.net";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
 
     longDescription = ''
       Maxima is a fairly complete computer algebra system written in
diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix
index 5fda04fed4f3..576a28b054f4 100644
--- a/pkgs/applications/science/math/pari/default.nix
+++ b/pkgs/applications/science/math/pari/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, gmp, readline }:
 
 stdenv.mkDerivation rec {
-  name = "pari-2.5.4";
+  name = "pari-2.5.5";
 
   src = fetchurl {
     url = "http://pari.math.u-bordeaux.fr/pub/pari/unix/${name}.tar.gz";
-    sha256 = "0gpsj5n8d1gyl7nq2y915sscs3d334ryrv8qgjdwqf3cr95f2dwz";
+    sha256 = "058nw1fhggy7idii4f124ami521lv3izvngs9idfz964aks8cvvn";
   };
 
   buildInputs = [gmp readline];
diff --git a/pkgs/applications/science/math/pssp/default.nix b/pkgs/applications/science/math/pssp/default.nix
index 587f41fe998b..0a9e0e4735d0 100644
--- a/pkgs/applications/science/math/pssp/default.nix
+++ b/pkgs/applications/science/math/pssp/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "pspp-0.8.1";
+  name = "pspp-0.8.2";
 
   src = fetchurl {
     url = "mirror://gnu/pspp/${name}.tar.gz";
-    sha256 = "0qhxsdbwxd3cn1shc13wxvx2lg32lp4z6sz24kv3jz7p5xfi8j7x";
+    sha256 = "1w7h3dglgx0jlq1wb605b8pgfsk2vr1q2q2rj7bsajh9ihbcsixr";
   };
 
   buildInputs = [ libxml2 readline zlib perl cairo gtk gsl pkgconfig
diff --git a/pkgs/applications/science/math/sage/default.nix b/pkgs/applications/science/math/sage/default.nix
new file mode 100644
index 000000000000..ced8b6f95bb6
--- /dev/null
+++ b/pkgs/applications/science/math/sage/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, m4, perl, gfortran, texLive, ffmpeg, tk
+, imagemagick, liblapack
+}:
+
+stdenv.mkDerivation rec {
+  name = "sage-6.1.1";
+
+  src = fetchurl {
+    url = "http://mirrors.xmission.com/sage/src/sage-6.1.1.tar.gz";
+    sha256 = "0kbzs0l9q7y34jv3f8rd1c2mrjsjkdgaw6mfdwjlpg9g4gghmq5y";
+  };
+
+  buildInputs = [ m4 perl gfortran texLive ffmpeg tk imagemagick liblapack ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    export SAGE_NUM_THREADS=$NIX_BUILD_CORES
+    sed -i 's/if ! [ -d "$HOME" ]/if [ -d "$HOME" ]/' src/bin/sage-env
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i "s/ld_version = try_run('ld  -v')/ld_version = 'Apple'/" \
+      build/pkgs/atlas/configuration.py
+  '';
+
+  meta = {
+    homepage = http://www.scilab.org/;
+    description = "Scientific software package for numerical computations (Matlab lookalike)";
+    # see http://www.scilab.org/legal
+    license = "SciLab";
+  };
+}
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix
index 5c5dfae8200f..1afb510e9948 100644
--- a/pkgs/applications/science/math/singular/default.nix
+++ b/pkgs/applications/science/math/singular/default.nix
@@ -3,9 +3,9 @@ x@{builderDefsPackage
   , coreutils
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
@@ -38,9 +38,9 @@ rec {
     rm -rf "$out/LIB"
     cp -r Singular/LIB "$out"
     mkdir -p "$out/bin"
-    ln -s "$out"/*/Singular "$out/bin"
+    ln -s "$out/"*/Singular "$out/bin"
   '') ["minInit" "defEnsureDir"];
-      
+
   meta = {
     description = "A CAS for polynomial computations";
     maintainers = with a.lib.maintainers;
@@ -49,7 +49,7 @@ rec {
     ];
     platforms = with a.lib.platforms;
       linux;
-    license = "GPLv3"; # Or GPLv2 at your option - but not GPLv4
+    license = a.stdenv.lib.licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
     homepage = "http://www.singular.uni-kl.de/index.php";
   };
   passthru = {
@@ -58,4 +58,3 @@ rec {
     };
   };
 }) x
-
diff --git a/pkgs/applications/science/math/sloane/default.nix b/pkgs/applications/science/math/sloane/default.nix
new file mode 100644
index 000000000000..b3bde7874cab
--- /dev/null
+++ b/pkgs/applications/science/math/sloane/default.nix
@@ -0,0 +1,28 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, ansiTerminal, cereal, downloadCurl, filepath, HTTP
+, network, optparseApplicative, terminalSize, text, zlib
+}:
+
+cabal.mkDerivation (self: {
+  pname = "sloane";
+  version = "1.9.1";
+  sha256 = "0scnvir7il8ldy3g846xmrdkk2rxnlsiyqak0jvcarf2qi251x5i";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    ansiTerminal cereal downloadCurl filepath HTTP network
+    optparseApplicative terminalSize text zlib
+  ];
+  postInstall = ''
+    mkdir -p $out/share/man/man1
+    cp sloane.1 $out/share/man/man1/
+  '';
+  meta = {
+    homepage = "http://github.com/akc/sloane";
+    description = "A command line interface to Sloane's On-Line Encyclopedia of Integer Sequences";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.akc ];
+  };
+})
diff --git a/pkgs/applications/science/math/weka/default.nix b/pkgs/applications/science/math/weka/default.nix
index 8471c46c8d75..66609fa58341 100644
--- a/pkgs/applications/science/math/weka/default.nix
+++ b/pkgs/applications/science/math/weka/default.nix
@@ -27,6 +27,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://www.cs.waikato.ac.nz/ml/weka/";
     description = "Collection of machine learning algorithms for data mining tasks";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/science/math/wxmaxima/default.nix b/pkgs/applications/science/math/wxmaxima/default.nix
index 01be4ba7e6c6..75448b6965cd 100644
--- a/pkgs/applications/science/math/wxmaxima/default.nix
+++ b/pkgs/applications/science/math/wxmaxima/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Cross platform GUI for the computer algebra system Maxima";
-    license = "GPL2";
+    license = stdenv.lib.licenses.gpl2;
     homepage = http://wxmaxima.sourceforge.net;
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/applications/science/math/yacas/default.nix b/pkgs/applications/science/math/yacas/default.nix
index acc4740eb6b4..2c9d63be1b4d 100644
--- a/pkgs/applications/science/math/yacas/default.nix
+++ b/pkgs/applications/science/math/yacas/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   meta = { 
       description = "Easy to use, general purpose Computer Algebra System";
       homepage = http://yacas.sourceforge.net/;
-      license = "GPLv2+";
+      license = stdenv.lib.licenses.gpl2Plus;
       maintainers = with stdenv.lib.maintainers; [viric];
       platforms = with stdenv.lib.platforms; all;
   };
diff --git a/pkgs/applications/science/misc/boinc/default.nix b/pkgs/applications/science/misc/boinc/default.nix
index 0bc5c3cb7c7c..7020de0bca88 100644
--- a/pkgs/applications/science/misc/boinc/default.nix
+++ b/pkgs/applications/science/misc/boinc/default.nix
@@ -3,12 +3,12 @@ mesa, libXmu, libXi, freeglut, libjpeg, libtool, wxGTK, xcbutil,
 sqlite, gtk, patchelf, libXScrnSaver, libnotify, libX11, libxcb }:
 
 stdenv.mkDerivation rec {
-  name = "boinc-7.0.44";
+  name = "boinc-7.2.42";
 
   src = fetchgit {
     url = "git://boinc.berkeley.edu/boinc-v2.git";
-    rev = "7c449b1fb8a681ceb27d6895751b62a2b3adf0f2";
-    sha256 = "0hdramyl9nip3gadp7xiaz8ngyld15i93d8ai1nsd04bmrvdfqia";
+    rev = "dd0d630882547c123ca0f8fda7a62e058d60f6a9";
+    sha256 = "1zifpi3mjgaj68fba6kammp3x7z8n2x164zz6fj91xfiapnan56j";
   };
 
   buildInputs = [ libtool automake autoconf m4 pkgconfig curl mesa libXmu libXi
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://boinc.berkeley.edu/;
 
-    license = "LGPLv2+";
+    license = stdenv.lib.licenses.lgpl2Plus;
 
     platforms = stdenv.lib.platforms.linux;  # arbitrary choice
   };
diff --git a/pkgs/applications/science/misc/fityk/default.nix b/pkgs/applications/science/misc/fityk/default.nix
new file mode 100644
index 000000000000..db79839ba669
--- /dev/null
+++ b/pkgs/applications/science/misc/fityk/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, wxGTK30, boost, lua, zlib, bzip2, xylib, readline, gnuplot }:
+
+let
+  name    = "fityk";
+  version = "1.2.9";
+in
+stdenv.mkDerivation {
+  name = "${name}-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/wojdyr/fityk/releases/download/v${version}/${name}-${version}.tar.bz2";
+    sha256 = "1gl938nd2jyya8b3gzbagm1jab2mkc9zvr6zsg5d0vkfdqlk0pv1";
+  };
+
+  buildInputs = [wxGTK30 boost lua zlib bzip2 xylib readline gnuplot ];
+
+  meta = {
+    description = "Fityk -- curve fitting and peak fitting software";
+    license = "GPL2";
+    homepage = http://fityk.nieto.pl/;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/misc/golly/default.nix b/pkgs/applications/science/misc/golly/default.nix
index a380f05b0915..9d198cd5c7f8 100644
--- a/pkgs/applications/science/misc/golly/default.nix
+++ b/pkgs/applications/science/misc/golly/default.nix
@@ -1,11 +1,11 @@
-x@{builderDefsPackage, 
+x@{builderDefsPackage,
   wxGTK, perl, python, zlib
   , ...}:
 builderDefsPackage
-(a :  
-let 
+(a :
+let
   s = import ./src-for-default.nix;
-  helperArgNames = ["builderDefsPackage"] ++ 
+  helperArgNames = ["builderDefsPackage"] ++
     [];
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
@@ -26,7 +26,7 @@ rec {
     export NIX_LDFLAGS="$NIX_LDFLAGS -l$pythonLib"
     echo "Flags: $NIX_LDFLAGS"
   '';
-      
+
   meta = {
     description = "Cellular automata simulation program";
     maintainers = with a.lib.maintainers;
@@ -35,7 +35,7 @@ rec {
     ];
     platforms = with a.lib.platforms;
       linux;
-    license = "GPLv2";
+    license = with a.lib.licenses;
+      gpl2;
   };
 }) x
-
diff --git a/pkgs/applications/science/misc/megam/default.nix b/pkgs/applications/science/misc/megam/default.nix
new file mode 100644
index 000000000000..a0ee505dc97f
--- /dev/null
+++ b/pkgs/applications/science/misc/megam/default.nix
@@ -0,0 +1,46 @@
+{ fetchurl, stdenv, ocaml, makeWrapper, ncurses }:
+
+let version = "0.92"; in
+stdenv.mkDerivation rec {
+  name = "megam-${version}";
+
+  src = fetchurl {
+    url = "http://hal3.name/megam/megam_src.tgz";
+    sha256 = "dc0e9f59ff8513449fe3bd40b260141f89c88a4edf6ddc8b8a394c758e49724e";
+  };
+
+  patches = [ ./ocaml-includes.patch ./ocaml-3.12.patch ];
+  
+  buildInputs = [ ocaml ncurses ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  makeFlags = "CAML_INCLUDES=${ocaml}/lib/ocaml/caml";
+
+  # see https://bugzilla.redhat.com/show_bug.cgi?id=435559
+  dontStrip = true;
+
+  installPhase = ''
+    mkdir -pv $out/bin
+    cp -Rv megam $out/bin
+  '';
+
+
+  meta = {
+    description = "MEGA Model Optimization Package";
+
+    longDescription =
+      ''  The software here is an implementation of maximum likelihood
+          and maximum a posterior optimization of the parameters of
+          these models.  The algorithms used are much more efficient
+          than the iterative scaling techniques used in almost every
+          other maxent package out there.  '';
+
+    homepage = http://www.umiacs.umd.edu/~hal/megam;
+
+    license = "non-commercial";
+
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+  };
+}
diff --git a/pkgs/applications/science/misc/megam/ocaml-3.12.patch b/pkgs/applications/science/misc/megam/ocaml-3.12.patch
new file mode 100644
index 000000000000..8265acf6e4a7
--- /dev/null
+++ b/pkgs/applications/science/misc/megam/ocaml-3.12.patch
@@ -0,0 +1,12 @@
+diff -ru megam_0.92/Makefile megam_0.92-b/Makefile
+--- megam_0.92/Makefile	2007-10-08 18:06:04.000000000 +0100
++++ megam_0.92-b/Makefile	2013-11-25 10:14:20.000000000 +0000
+@@ -59,7 +59,7 @@
+ 
+ WITHUNIX =unix.cma -cclib -lunix
+ 
+-WITHSTR =str.cma -cclib -lstr
++WITHSTR =str.cma -cclib -lcamlstr
+ 
+ WITHBIGARRAY =bigarray.cma -cclib -lbigarray
+ 
diff --git a/pkgs/applications/science/misc/megam/ocaml-includes.patch b/pkgs/applications/science/misc/megam/ocaml-includes.patch
new file mode 100644
index 000000000000..b3a56643448c
--- /dev/null
+++ b/pkgs/applications/science/misc/megam/ocaml-includes.patch
@@ -0,0 +1,21 @@
+diff -ru megam_0.92/Makefile megam_0.92-b/Makefile
+--- megam_0.92/Makefile	2007-10-08 18:06:04.000000000 +0100
++++ megam_0.92-b/Makefile	2013-11-25 10:14:20.000000000 +0000
+@@ -41,7 +41,7 @@
+ #
+ # The Caml compilers. #
+ # You may fix here the path to access the Caml compiler on your machine
+-CAMLC = ocamlc -g
++CAMLC = ocamlc -g $(WITHCLIBS)
+ CAMLOPT = ocamlopt -unsafe -ccopt -O4 -ccopt -ffast-math -inline 99999 
+ CAMLDEP = ocamldep
+ CAMLLEX = ocamllex
+@@ -70,7 +70,7 @@
+ WITHDBM =dbm.cma -cclib -lmldbm -cclib -lndbm
+ 
+ #WITHCLIBS =-I /usr/lib/ocaml/3.09.2/caml
+-WITHCLIBS =-I /usr/lib/ocaml/caml
++WITHCLIBS =-I $(CAML_INCLUDES) 
+ 
+ ################ End of user's variables #####################
+ 
diff --git a/pkgs/applications/science/misc/root/cmake.patch b/pkgs/applications/science/misc/root/cmake.patch
new file mode 100644
index 000000000000..b6efd7444fe9
--- /dev/null
+++ b/pkgs/applications/science/misc/root/cmake.patch
@@ -0,0 +1,11 @@
+--- cmake/modules/RootBuildOptions.cmake	1969-12-31 20:30:01.000000000 -0330
++++ cmake/modules/RootBuildOptions.cmake	2014-01-10 14:09:29.424937408 -0330
+@@ -149,7 +149,7 @@
+ 
+ #---General Build options----------------------------------------------------------------------
+ # use, i.e. don't skip the full RPATH for the build tree
+-set(CMAKE_SKIP_BUILD_RPATH  FALSE)
++set(CMAKE_SKIP_BUILD_RPATH  TRUE)
+ # when building, don't use the install RPATH already (but later on when installing)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 
+ # add the automatically determined parts of the RPATH
diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix
new file mode 100644
index 000000000000..1227e76ac0c5
--- /dev/null
+++ b/pkgs/applications/science/misc/root/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, cmake, mesa, libX11, gfortran, libXpm, libXft, libXext, zlib }:
+
+stdenv.mkDerivation rec {
+  name = "root-${version}";
+  version = "5.34.15";
+
+  src = fetchurl {
+    url = "ftp://root.cern.ch/root/root_v${version}.source.tar.gz";
+    sha256 = "1bkiggcyya39a794d3d2rzzmmkbdymf86hbqhh0l1pl4f38xvp6i";
+  };
+
+  buildInputs = [ cmake gfortran mesa libX11 libXpm libXft libXext zlib ];
+
+  # CMAKE_INSTALL_RPATH_USE_LINK_PATH is set to FALSE in
+  # <rootsrc>/cmake/modules/RootBuildOptions.cmake.
+  # This patch sets it to TRUE.
+  patches = [ ./cmake.patch ];
+  patchFlags = "-p0";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://root.cern.ch/drupal/";
+    description = "A data analysis framework";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/misc/simgrid/default.nix b/pkgs/applications/science/misc/simgrid/default.nix
index 5fdede1abcdf..29a7caf769be 100644
--- a/pkgs/applications/science/misc/simgrid/default.nix
+++ b/pkgs/applications/science/misc/simgrid/default.nix
@@ -1,20 +1,19 @@
-{ fetchurl, stdenv, cmake, perl, ruby }:
+{ fetchurl, stdenv, cmake, perl, ruby, boost, lua5_1, graphviz, libsigcxx
+, libunwind, elfutils
+}:
 
 stdenv.mkDerivation rec {
-  name = "simgrid-3.5";
+  version = "3.11.1";
+  name = "simgrid-${version}";
 
   src = fetchurl {
-    url = "https://gforge.inria.fr/frs/download.php/28017/${name}.tar.gz";
-    sha256 = "1vd4pvrcyii1nfwyca3kpbwshbc965lfpn083zd8rigg6ydchq8y";
+    url = "https://gforge.inria.fr/frs/download.php/33686/${name}.tar.gz";
+    sha256 = "0mkrzxpf42lmn96khfl1791vram67r2nqsgmppd2yil889nyz5kp";
   };
 
-  /* FIXME: Ruby currently disabled because of this:
-
-     Linking C shared library ../src/.libs/libsimgrid.so
-     ld: cannot find -lruby-1.8.7-p72
-
-   */
-  buildInputs = [ cmake perl /* ruby */ ];
+  buildInputs = [ cmake perl ruby boost lua5_1 graphviz libsigcxx libunwind
+    elfutils
+    ];
 
   preConfigure =
     # Make it so that libsimgrid.so will be found when running programs from
@@ -22,8 +21,17 @@ stdenv.mkDerivation rec {
     '' export LD_LIBRARY_PATH="$PWD/src/.libs"
        export cmakeFlags="-Dprefix=$out"
 
-       # Enable tracing.
-       export cmakeFlags="$cmakeFlags -Denable_tracing=on"
+       export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE
+         -isystem $(echo "${libsigcxx}/lib/"sigc++*/include)
+	 -isystem $(echo "${libsigcxx}/include"/sigc++* )
+	 "
+       export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$(echo "${libsigcxx}/lib/"sigc++*)"
+
+       # Enable more functionality.
+       export cmakeFlags="$cmakeFlags -Denable_tracing=on -Denable_jedule=on
+         -Denable_latency_bound_tracking=on -Denable_lua=on
+	 -Denable_ns3=on -Denable_gtnets=on
+	 "
     '';
 
   makeFlags = "VERBOSE=1";
@@ -45,6 +53,7 @@ stdenv.mkDerivation rec {
   patchPhase =
     '' for i in "src/smpi/"*
        do
+         test -f "$i" &&
          sed -i "$i" -e's|/bin/bash|/bin/sh|g'
        done
 
@@ -71,7 +80,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://simgrid.gforge.inria.fr/;
 
-    license = "LGPLv2+";
+    license = stdenv.lib.licenses.lgpl2Plus;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix
index e58183a4f40b..da6e0cb2805d 100644
--- a/pkgs/applications/science/misc/tulip/default.nix
+++ b/pkgs/applications/science/misc/tulip/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://tulip.labri.fr/;
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
diff --git a/pkgs/applications/science/misc/vite/default.nix b/pkgs/applications/science/misc/vite/default.nix
index 4c1cf318b5a2..2e25ff582ee9 100644
--- a/pkgs/applications/science/misc/vite/default.nix
+++ b/pkgs/applications/science/misc/vite/default.nix
@@ -44,5 +44,7 @@ stdenv.mkDerivation {
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+
+    broken = true;
   };
 }
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
index de4bb171497c..b9abf7b55b48 100644
--- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -6,11 +6,11 @@
 
 
 stdenv.mkDerivation {
-  name = "gromacs-4.5.5";
+  name = "gromacs-4.6.5";
 
   src = fetchurl {
-    url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.5.5.tar.gz";
-    md5 = "6a87e7cdfb25d81afa9fea073eb28468";
+    url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.6.5.tar.gz";
+    sha256 = "02ggrplh8fppqib86y3rfk4qm08yddlrb1yjgzl138b3b4qjy957";
   };
 
   buildInputs = [cmake fftw];
diff --git a/pkgs/applications/science/spyder/default.nix b/pkgs/applications/science/spyder/default.nix
index cd2bd4fecf3d..1079a153ca16 100644
--- a/pkgs/applications/science/spyder/default.nix
+++ b/pkgs/applications/science/spyder/default.nix
@@ -8,12 +8,12 @@
 }:
 
 buildPythonPackage rec {
-  name = "spyder-2.1.13.1";
+  name = "spyder-2.2.5";
   namePrefix = "";
 
   src = fetchurl {
     url = "https://spyderlib.googlecode.com/files/${name}.zip";
-    sha256 = "1sg88shvw6k2v5428k13mah4pyqng43856rzr6ypz5qgwn0677ya";
+    sha256 = "1bxc5qs2bqc21s6kxljsfxnmwgrgnyjfr9mkwzg9njpqsran3bp2";
   };
 
   buildInputs = [ unzip ];
@@ -52,6 +52,6 @@ buildPythonPackage rec {
     homepage = https://code.google.com/p/spyderlib/;
     license = licenses.mit;
     platforms = platforms.linux;
-    maintainers = [maintainers.bjornfor];
+    maintainers = [ maintainers.bjornfor ];
   };
 }
diff --git a/pkgs/applications/search/doodle/default.nix b/pkgs/applications/search/doodle/default.nix
index a6b3ac7ccfdf..3a9df1505742 100644
--- a/pkgs/applications/search/doodle/default.nix
+++ b/pkgs/applications/search/doodle/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://grothoff.org/christian/doodle/;
     description = "Tool to quickly index and search documents on a computer";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/taxes/aangifte-2005/builder.sh b/pkgs/applications/taxes/aangifte-2005/builder.sh
deleted file mode 100644
index 8d284176d444..000000000000
--- a/pkgs/applications/taxes/aangifte-2005/builder.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-source $stdenv/setup
-
-buildPhase() {
-    for i in bin/*; do
-        patchelf \
-            --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
-            --set-rpath $libX11/lib:$libXext/lib \
-            $i
-    done
-}
-
-installPhase() {
-    mkdir -p $out
-    cp -prvd * $out/
-}
-
-genericBuild
diff --git a/pkgs/applications/taxes/aangifte-2005/default.nix b/pkgs/applications/taxes/aangifte-2005/default.nix
deleted file mode 100644
index 03ba20b11dae..000000000000
--- a/pkgs/applications/taxes/aangifte-2005/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{stdenv, fetchurl, libX11, libXext}:
-
-stdenv.mkDerivation {
-  name = "aangifte2005-1";
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2005_linux.tar.gz;
-    md5 = "9cc709b8ad041f4b20154ff1491d0436";
-  };
-
-  inherit libX11 libXext;
-}
diff --git a/pkgs/applications/taxes/aangifte-2006/default.nix b/pkgs/applications/taxes/aangifte-2006/default.nix
index 8bf5ddeee40d..72d6999fa1d7 100644
--- a/pkgs/applications/taxes/aangifte-2006/default.nix
+++ b/pkgs/applications/taxes/aangifte-2006/default.nix
@@ -14,5 +14,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Elektronische aangifte IB 2006";
     url = "http://www.belastingdienst.nl/download/1341.html";
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/taxes/aangifte-2007/default.nix b/pkgs/applications/taxes/aangifte-2007/default.nix
index 3cd472b51c25..15c826feb6e7 100644
--- a/pkgs/applications/taxes/aangifte-2007/default.nix
+++ b/pkgs/applications/taxes/aangifte-2007/default.nix
@@ -17,5 +17,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Elektronische aangifte IB 2007";
     url = "http://www.belastingdienst.nl/download/1341.html";
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/taxes/aangifte-2008/default.nix b/pkgs/applications/taxes/aangifte-2008/default.nix
index 85d5b3045be0..905471cb76b8 100644
--- a/pkgs/applications/taxes/aangifte-2008/default.nix
+++ b/pkgs/applications/taxes/aangifte-2008/default.nix
@@ -18,5 +18,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Elektronische aangifte IB 2008 (Dutch Tax Return Program)";
     url = http://www.belastingdienst.nl/particulier/aangifte2008/aangifte_2008/aangifte_2008.html;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/taxes/aangifte-2009/default.nix b/pkgs/applications/taxes/aangifte-2009/default.nix
index eeeb4a1d1e53..9aa7a8172711 100644
--- a/pkgs/applications/taxes/aangifte-2009/default.nix
+++ b/pkgs/applications/taxes/aangifte-2009/default.nix
@@ -33,5 +33,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Elektronische aangifte IB 2009 (Dutch Tax Return Program)";
     url = http://www.belastingdienst.nl/particulier/aangifte2009/download/;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/taxes/aangifte-2010/default.nix b/pkgs/applications/taxes/aangifte-2010/default.nix
index 65ff561ee9ef..23338c01ec3e 100644
--- a/pkgs/applications/taxes/aangifte-2010/default.nix
+++ b/pkgs/applications/taxes/aangifte-2010/default.nix
@@ -33,5 +33,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Elektronische aangifte IB 2010 (Dutch Tax Return Program)";
     url = http://www.belastingdienst.nl/particulier/aangifte2009/download/;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/taxes/aangifte-2011/default.nix b/pkgs/applications/taxes/aangifte-2011/default.nix
index 0bffad95d50b..e5bc233affa0 100644
--- a/pkgs/applications/taxes/aangifte-2011/default.nix
+++ b/pkgs/applications/taxes/aangifte-2011/default.nix
@@ -33,5 +33,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Elektronische aangifte IB 2011 (Dutch Tax Return Program)";
     url = http://www.belastingdienst.nl/particulier/aangifte2009/download/;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/taxes/aangifte-2012/default.nix b/pkgs/applications/taxes/aangifte-2012/default.nix
index 8f36fd485ddd..544fe4ec55f9 100644
--- a/pkgs/applications/taxes/aangifte-2012/default.nix
+++ b/pkgs/applications/taxes/aangifte-2012/default.nix
@@ -34,5 +34,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Elektronische aangifte IB 2012 (Dutch Tax Return Program)";
     url = http://www.belastingdienst.nl/particulier/aangifte2012/download/;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/applications/taxes/aangifte-2013/default.nix b/pkgs/applications/taxes/aangifte-2013/default.nix
new file mode 100644
index 000000000000..5cf90320adc7
--- /dev/null
+++ b/pkgs/applications/taxes/aangifte-2013/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, makeWrapper, xdg_utils, libX11, libXext, libSM }:
+
+stdenv.mkDerivation {
+  name = "aangifte2013-1";
+
+  src = fetchurl {
+    url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2013_linux.tar.gz;
+    sha256 = "05biqxz39gwln960xj31yg8s2chdn9vs0lzm4rlcwcavxy8lam1c";
+  };
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  buildInputs = [ makeWrapper ];
+
+  buildPhase =
+    ''
+      for i in bin/*; do
+          patchelf \
+              --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+              --set-rpath ${stdenv.lib.makeLibraryPath [ libX11 libXext libSM ]}:$(cat $NIX_GCC/nix-support/orig-gcc)/lib \
+              $i
+      done
+    '';
+
+  installPhase =
+    ''
+      mkdir -p $out
+      cp -prvd * $out/
+      wrapProgram $out/bin/ib2013ux --prefix PATH : ${xdg_utils}/bin \
+                                    --prefix LD_PRELOAD : $(cat $NIX_GCC/nix-support/orig-gcc)/lib/libgcc_s.so.1
+    '';
+
+  meta = {
+    description = "Elektronische aangifte IB 2013 (Dutch Tax Return Program)";
+    url = http://www.belastingdienst.nl/wps/wcm/connect/bldcontentnl/themaoverstijgend/programmas_en_formulieren/aangifteprogramma_2013_linux;
+    license = stdenv.lib.licenses.unfree;
+    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = [];
+  };
+}
diff --git a/pkgs/applications/version-management/arch/default.nix b/pkgs/applications/version-management/arch/default.nix
index 350b842a0953..3dd8b9f860df 100644
--- a/pkgs/applications/version-management/arch/default.nix
+++ b/pkgs/applications/version-management/arch/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "tla-1.3.5";
   
   src = fetchurl {
-    url = "mirror://gnu/gnu-arch/" + name + ".tar.gz";
+    url = "ftp://ftp.gnu.org/old-gnu/gnu-arch/" + name + ".tar.gz";
     sha256 = "01mfzj1i6p4s8191cgd5850hds1zls88hkf9rb6qx1vqjv585aj0";
   };
 
diff --git a/pkgs/applications/version-management/bazaar/add_certificates.patch b/pkgs/applications/version-management/bazaar/add_certificates.patch
new file mode 100644
index 000000000000..332f42aa89cc
--- /dev/null
+++ b/pkgs/applications/version-management/bazaar/add_certificates.patch
@@ -0,0 +1,11 @@
+diff -ru orig/bzrlib/transport/http/_urllib2_wrappers.py bzr-2.6.0/bzrlib/transport/http/_urllib2_wrappers.py
+--- orig/bzrlib/transport/http/_urllib2_wrappers.py	2013-07-27 13:50:53.000000000 +0200
++++ bzr-2.6.0/bzrlib/transport/http/_urllib2_wrappers.py	2014-02-04 18:34:15.838622492 +0100
+@@ -86,6 +86,7 @@
+     u"/usr/local/share/certs/ca-root-nss.crt", # FreeBSD
+     # XXX: Needs checking, can't trust the interweb ;) -- vila 2012-01-25
+     u'/etc/openssl/certs/ca-certificates.crt', # Solaris
++    u'@certPath@',
+     ]
+ def default_ca_certs():
+     if sys.platform == 'win32':
diff --git a/pkgs/applications/version-management/bazaar/default.nix b/pkgs/applications/version-management/bazaar/default.nix
index 1eb114ecd8ce..648d59ac01c2 100644
--- a/pkgs/applications/version-management/bazaar/default.nix
+++ b/pkgs/applications/version-management/bazaar/default.nix
@@ -1,20 +1,28 @@
-{ stdenv, fetchurl, pythonPackages }:
+{ stdenv, fetchurl, pythonPackages, cacert }:
 
 stdenv.mkDerivation rec {
-  version = "2.5";
-  release = ".1";
+  version = "2.6";
+  release = ".0";
   name = "bazaar-${version}${release}";
 
   src = fetchurl {
     url = "http://launchpad.net/bzr/${version}/${version}${release}/+download/bzr-${version}${release}.tar.gz";
-    sha256 = "10krjbzia2avn09p0cdlbx2wya0r5v11w5ymvyl72af5dkx4cwwn";
+    sha256 = "1c6sj77h5f97qimjc14kr532kgc0jk3wq778xrkqi0pbh9qpk509";
   };
 
-  buildInputs = [ pythonPackages.python pythonPackages.wrapPython ];
+  buildInputs = [ pythonPackages.python pythonPackages.wrapPython cacert ];
 
   # Readline support is needed by bzrtools.
   pythonPath = [ pythonPackages.readline ];
 
+  # Bazaar can't find the certificates alone
+  patches = [ ./add_certificates.patch ];
+  postPatch = ''
+    substituteInPlace bzrlib/transport/http/_urllib2_wrappers.py \
+      --subst-var-by "certPath" "${cacert}/etc/ca-bundle.crt"
+  '';
+
+
   installPhase = ''
     python setup.py install --prefix=$out
     wrapPythonPrograms
@@ -23,6 +31,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://bazaar-vcs.org/;
     description = "A distributed version control system that Just Works";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/version-management/bazaar/tools.nix b/pkgs/applications/version-management/bazaar/tools.nix
index 19a00d2b8415..f10fb5e65ce2 100644
--- a/pkgs/applications/version-management/bazaar/tools.nix
+++ b/pkgs/applications/version-management/bazaar/tools.nix
@@ -1,10 +1,10 @@
 args : with args; 
 
 rec {
-  version = "2.2.0";
+  version = "2.5";
   src = fetchurl {
     url = "http://launchpad.net/bzrtools/stable/${version}/+download/bzrtools-${version}.tar.gz";
-    sha256 = "835e0dc2b3b798d3c88b960bf719fe3b4cec7ae241908aafeb6aafe4c83f591b";
+    sha256 = "0gzh63vl9006cpklszwmsymrq5ddxxrnxwbv5bwi740jlvxzdkxw";
   };
 
   buildInputs = [];
diff --git a/pkgs/applications/version-management/codeville/0.8.0.nix b/pkgs/applications/version-management/codeville/0.8.0.nix
index 5c1910d6c6f6..0c0f3c4c19c0 100644
--- a/pkgs/applications/version-management/codeville/0.8.0.nix
+++ b/pkgs/applications/version-management/codeville/0.8.0.nix
@@ -1,6 +1,6 @@
 args : with args; 
 
-if (! python ? db4Support) || (! python.db4Support) then 
+if (! python ? dbSupport) || (! python.dbSupport) then 
   throw ''Python DB4 support is required for codeville.'' 
 else
 
diff --git a/pkgs/applications/version-management/cvsps/default.nix b/pkgs/applications/version-management/cvsps/default.nix
index 1be797fea966..9bc4401e0681 100644
--- a/pkgs/applications/version-management/cvsps/default.nix
+++ b/pkgs/applications/version-management/cvsps/default.nix
@@ -24,6 +24,6 @@ stdenv.mkDerivation rec {
       same time (using a single "cvs commit" command).
     '';
     homepage = http://www.cobite.com/cvsps/;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/version-management/darcs/default.nix b/pkgs/applications/version-management/darcs/default.nix
index f33e479b3ada..d53b38c28c32 100644
--- a/pkgs/applications/version-management/darcs/default.nix
+++ b/pkgs/applications/version-management/darcs/default.nix
@@ -1,3 +1,5 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, curl, extensibleExceptions, filepath, hashedStorage
 , haskeline, html, HTTP, mmap, mtl, network, parsec, random
 , regexCompat, tar, terminfo, text, utf8String, vector, zlib
@@ -15,6 +17,7 @@ cabal.mkDerivation (self: {
     utf8String vector zlib
   ];
   extraLibraries = [ curl ];
+  jailbreak = true;
   doCheck = false;
   postInstall = ''
     mkdir -p $out/etc/bash_completion.d
diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix
index 2a669729a9c6..c2793190e892 100644
--- a/pkgs/applications/version-management/fossil/default.nix
+++ b/pkgs/applications/version-management/fossil/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, zlib, openssl, tcl, readline, sqlite, withJson ? true}:
 
 stdenv.mkDerivation {
-  name = "fossil-1.27";
+  name = "fossil-1.28";
 
   src = fetchurl {
-    url = http://www.fossil-scm.org/download/fossil-src-20130911114349.tar.gz;
-    sha256 = "0n40z8bx2311i11zjx2x15lw3q8vzjwvfqzikrjlqnpal4vzd72f";
+    url = http://www.fossil-scm.org/download/fossil-src-20140127173344.tar.gz;
+    sha256 = "105a3f3wiqshmkw8q7f7ask3nm0jkjf0h3h2283qiqlsqfkwb9xc";
   };
 
   buildInputs = [ zlib openssl readline sqlite ];
diff --git a/pkgs/applications/version-management/git-and-tools/cgit/default.nix b/pkgs/applications/version-management/git-and-tools/cgit/default.nix
index 63dd56d7e33c..fb7232794c51 100644
--- a/pkgs/applications/version-management/git-and-tools/cgit/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/cgit/default.nix
@@ -1,23 +1,37 @@
-{ stdenv, fetchurl, openssl, zlib, asciidoc, libxml2, libxslt, docbook_xml_xslt }:
+{ stdenv, fetchurl, openssl, zlib, asciidoc, libxml2, libxslt
+, docbook_xml_xslt, pkgconfig, luajit
+, gzip, bzip2, xz
+}:
 
 stdenv.mkDerivation rec {
-  name = "cgit-0.9.2";
+  name = "cgit-${version}";
+  version = "0.10.1";
 
   src = fetchurl {
     url = "http://git.zx2c4.com/cgit/snapshot/${name}.tar.xz";
-    sha256 = "0q177q1r7ssna32c760l4dx6p4aaz6kdv27zn2jb34bx98045h08";
+    sha256 = "0bci1p9spf79wirc4lk36cndcx2b9wj0fq1l58rlp6r563is77l3";
   };
 
-  # cgit is is tightly coupled with git and needs a git source tree to build.
-  # The cgit-0.9.2 Makefile has GIT_VER = 1.8.3, so use that version.
+  # cgit is tightly coupled with git and needs a git source tree to build.
   # IMPORTANT: Remember to check which git version cgit needs on every version
-  # bump.
+  # bump (look in the Makefile).
+  # NOTE: as of 0.10.1, the git version is compatible from 1.9.0 to
+  # 1.9.2 (see the repository history)
   gitSrc = fetchurl {
-    url = https://git-core.googlecode.com/files/git-1.8.3.tar.gz;
-    sha256 = "0fn5xdx30dl8dl1cdpqif5hgc3qnxlqfpwyhm0sm1wgqhgbcdlzi";
+    url    = "https://www.kernel.org/pub/software/scm/git/git-1.9.2.tar.xz";
+    sha256 = "1x4rb06vw4ckdflmn01r5l9spvn7cng4i5mm3sbd0n8cz0n6xz13";
   };
 
-  buildInputs = [ openssl zlib asciidoc libxml2 libxslt docbook_xml_xslt ];
+  buildInputs = [
+    openssl zlib asciidoc libxml2 libxslt docbook_xml_xslt pkgconfig luajit
+  ];
+
+  postPatch = ''
+    sed -e 's|"gzip"|"${gzip}/bin/gzip"|' \
+        -e 's|"bzip2"|"${bzip2}/bin/bzip2"|' \
+        -e 's|"xz"|"${xz}/bin/xz"|' \
+        -i ui-snapshot.c
+  '';
 
   # Give cgit a git source tree and pass configuration parameters (as make
   # variables).
@@ -41,6 +55,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://git.zx2c4.com/cgit/about/;
+    repositories.git = git://git.zx2c4.com/cgit;
     description = "Web frontend for git repositories";
     license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index af1ab52c04d7..fd548296220e 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -4,10 +4,8 @@
 args: with args; with pkgs;
 let
   inherit (pkgs) stdenv fetchgit fetchurl subversion;
-in
-rec {
 
-  git = lib.makeOverridable (import ./git) {
+  gitBase = lib.makeOverridable (import ./git) {
     inherit fetchurl stdenv curl openssl zlib expat perl python gettext gnugrep
       asciidoc xmlto docbook2x docbook_xsl docbook_xml_dtd_45 libxslt cpio tcl
       tk makeWrapper subversionClient gzip;
@@ -24,6 +22,9 @@ rec {
     ];
   };
 
+in
+rec {
+
   # support for bugzilla
   gitBz = import ./git-bz {
     inherit fetchgit stdenv makeWrapper python asciidoc xmlto # docbook2x docbook_xsl docbook_xml_dtd_45 libxslt
@@ -31,17 +32,19 @@ rec {
     inherit (pythonPackages) pysqlite;
   };
 
+  git = appendToName "minimal" gitBase;
+
   # Git with SVN support, but without GUI.
-  gitSVN = lowPrio (appendToName "with-svn" (git.override {
+  gitSVN = lowPrio (appendToName "with-svn" (gitBase.override {
     svnSupport = true;
   }));
 
   # The full-featured Git.
-  gitFull = appendToName "full" (git.override {
+  gitFull = gitBase.override {
     svnSupport = true;
     guiSupport = true;
     sendEmailSupport = !stdenv.isDarwin;
-  });
+  };
 
   gitAnnex = pkgs.haskellPackages.gitAnnex;
 
@@ -66,7 +69,7 @@ rec {
   };
 
   tig = import ./tig {
-    inherit stdenv fetchurl ncurses asciidoc xmlto docbook_xsl;
+    inherit stdenv fetchurl ncurses asciidoc xmlto docbook_xsl docbook_xml_dtd_45 readline;
   };
 
   hub = import ./hub {
@@ -83,7 +86,7 @@ rec {
   };
 
   svn2git = import ./svn2git {
-    inherit stdenv fetchgit ruby makeWrapper;
+    inherit stdenv fetchurl ruby makeWrapper;
     git = gitSVN;
   };
 
@@ -92,4 +95,7 @@ rec {
   darcsToGit = callPackage ./darcs-to-git { };
 
   gitflow = callPackage ./gitflow { };
+
+  git-remote-hg = callPackage ./git-remote-hg { };
+
 }
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 e32a7dc52b9b..62132271ec99 100644
--- a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
@@ -1,59 +1,55 @@
-{ cabal, aeson, async, blazeBuilder, bloomfilter, bup
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, aeson, async, blazeBuilder, bloomfilter, bup, byteable
 , caseInsensitive, clientsession, cryptoApi, cryptohash, curl
 , dataDefault, dataenc, DAV, dbus, dlist, dns, editDistance
-, extensibleExceptions, feed, filepath, git, gnupg1, gnutls, hamlet
-, hinotify, hS3, hslogger, HTTP, httpConduit, httpTypes, HUnit
-, IfElse, json, lsof, MissingH, MonadCatchIOTransformers
-, monadControl, mtl, network, networkInfo, networkMulticast
-, networkProtocolXmpp, openssh, perl, QuickCheck, random, regexTdfa
-, rsync, SafeSemaphore, SHA, stm, text, time, transformers
-, unixCompat, utf8String, uuid, wai, waiLogger, warp, which
-, xmlConduit, xmlTypes, yesod, yesodCore, yesodDefault, yesodForm
-, yesodStatic
+, exceptions, fdoNotify, feed, filepath, git, gnupg1, gnutls
+, hamlet, hinotify, hS3, hslogger, httpClient, httpConduit
+, httpTypes, IfElse, json, lsof, MissingH, monadControl, mtl
+, network, networkInfo, networkMulticast, networkProtocolXmpp
+, openssh, optparseApplicative, pathPieces, perl, QuickCheck
+, random, regexTdfa, rsync, SafeSemaphore, securemem, SHA
+, shakespeare, stm, tasty, tastyHunit, tastyQuickcheck, tastyRerun
+, text, time, transformers, unixCompat, utf8String, uuid, wai
+, waiExtra, warp, warpTls, which, xmlTypes, yesod, yesodCore
+, yesodDefault, yesodForm, yesodStatic
 }:
 
 cabal.mkDerivation (self: {
   pname = "git-annex";
-  version = "4.20131024";
-  sha256 = "1a4mrx8zr5znhcy2cszv5ri9avqj7lcn467nmaj172f00vn4fd5x";
+  version = "5.20140817";
+  sha256 = "0cly19rd250qiikzszgad2r5xz570kr00vcb8ij6icbm53pw3hxc";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    aeson async blazeBuilder bloomfilter caseInsensitive clientsession
-    cryptoApi cryptohash dataDefault dataenc DAV dbus dlist dns
-    editDistance extensibleExceptions feed filepath gnutls hamlet
-    hinotify hS3 hslogger HTTP httpConduit httpTypes HUnit IfElse json
-    MissingH MonadCatchIOTransformers monadControl mtl network
-    networkInfo networkMulticast networkProtocolXmpp QuickCheck random
-    regexTdfa SafeSemaphore SHA stm text time transformers unixCompat
-    utf8String uuid wai waiLogger warp xmlConduit xmlTypes yesod
-    yesodCore yesodDefault yesodForm yesodStatic
+    aeson async blazeBuilder bloomfilter byteable caseInsensitive
+    clientsession cryptoApi cryptohash dataDefault dataenc DAV dbus
+    dlist dns editDistance exceptions fdoNotify feed filepath gnutls
+    hamlet hinotify hS3 hslogger httpClient httpConduit httpTypes
+    IfElse json MissingH monadControl mtl network networkInfo
+    networkMulticast networkProtocolXmpp optparseApplicative pathPieces
+    QuickCheck random regexTdfa SafeSemaphore securemem SHA shakespeare
+    stm tasty tastyHunit tastyQuickcheck tastyRerun text time
+    transformers unixCompat utf8String uuid wai waiExtra warp warpTls
+    xmlTypes yesod yesodCore yesodDefault yesodForm yesodStatic
   ];
   buildTools = [ bup curl git gnupg1 lsof openssh perl rsync which ];
-  configureFlags = "-fS3
-                    -fWebDAV
-                    -fInotify
-                    -fDbus
-                    -fAssistant
-                    -fWebapp
-                    -fPairing
-                    -fXMPP
-                    -fDNS
-                    -fProduction
-                    -fTDFA";
-  preConfigure = "patchShebangs .";
-  installPhase = "./Setup install";
-  checkPhase = ''
+  configureFlags = "-fAssistant -fProduction";
+  preConfigure = ''
     export HOME="$NIX_BUILD_TOP/tmp"
     mkdir "$HOME"
+  '';
+  installPhase = "./Setup install";
+  checkPhase = ''
     cp dist/build/git-annex/git-annex git-annex
     ./git-annex test
   '';
+  propagatedUserEnvPkgs = [git lsof];
   meta = {
     homepage = "http://git-annex.branchable.com/";
     description = "manage files with git, without checking their contents into git";
     license = self.stdenv.lib.licenses.gpl3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.simons ];
+    maintainers = with self.stdenv.lib.maintainers; [ simons ];
   };
 })
diff --git a/pkgs/applications/version-management/git-and-tools/git-bz/default.nix b/pkgs/applications/version-management/git-and-tools/git-bz/default.nix
index 5e6b9fdc2438..4c4ff62901e5 100644
--- a/pkgs/applications/version-management/git-and-tools/git-bz/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-bz/default.nix
@@ -21,8 +21,8 @@ stdenv.mkDerivation {
   '';
 
   installPhase = ''
-    ensureDir $out
-    ensureDir $out/bin
+    mkdir -p $out
+    mkdir -p $out/bin
     cp git-bz $out/bin
     wrapProgram $out/bin/git-bz \
       --prefix PYTHONPATH : "$(toPythonPath $python):$(toPythonPath $pysqlite)"
@@ -49,5 +49,6 @@ stdenv.mkDerivation {
 
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.pierron ];
+    broken = true;
   };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/git-remote-hg/default.nix b/pkgs/applications/version-management/git-and-tools/git-remote-hg/default.nix
new file mode 100644
index 000000000000..ffeb299f49b5
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git-remote-hg/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchgit, mercurial, makeWrapper,
+  asciidoc, xmlto, dbus, docbook_xsl, docbook_xml_dtd_45, libxslt, libxml2
+}:
+
+stdenv.mkDerivation rec {
+  rev = "185852eac44c25ae2e8d3b3fb6c9630e754e6363";
+  version = "v0.2-185852eac44c25ae2e8d3b3fb6c9630e754e6363";
+  name = "git-remote-hg-${version}";
+
+  src = fetchgit {
+    inherit rev;
+    url = "git://github.com/felipec/git-remote-hg.git";
+    sha256 = "1hc65nvxq7if1imwffyxia0i6vnkbax09gfcl9vq9yffzi8xzzfy";
+  };
+
+  buildInputs = [ mercurial.python mercurial makeWrapper
+    asciidoc xmlto dbus docbook_xsl docbook_xml_dtd_45 libxslt libxml2
+  ];
+
+  doCheck = false;
+
+  installFlags = "HOME=\${out}";
+
+  postInstall = ''
+    wrapProgram $out/bin/git-remote-hg \
+      --prefix PYTHONPATH : "$(echo ${mercurial}/lib/python*/site-packages):$(echo ${mercurial.python}/lib/python*/site-packages)${stdenv.lib.concatMapStrings (x: ":$(echo ${x}/lib/python*/site-packages)") mercurial.pythonPackages}"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/felipec/git-remote-hg";
+    description = "semi-official Mercurial bridge from Git project, once installed, it allows you to clone, fetch and push to and from Mercurial repositories as if they were Git ones";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.garbas ];
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/git/cert-path.patch b/pkgs/applications/version-management/git-and-tools/git/cert-path.patch
new file mode 100644
index 000000000000..846752f5bfe3
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git/cert-path.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' git-1.9.2-orig/git-send-email.perl git-1.9.2/git-send-email.perl
+--- git-1.9.2-orig/git-send-email.perl	2014-04-09 21:09:34.000000000 +0200
++++ git-1.9.2/git-send-email.perl	2014-04-16 18:35:05.861132282 +0200
+@@ -1094,6 +1094,8 @@
+ 		return;
+ 	}
+ 
++	$smtp_ssl_cert_path //= $ENV{'OPENSSL_X509_CERT_FILE'};
++
+ 	if (!defined $smtp_ssl_cert_path) {
+ 		# use the OpenSSL defaults
+ 		return (SSL_verify_mode => SSL_VERIFY_PEER());
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 fb2e34c7aac9..a4d16e460607 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -10,7 +10,7 @@
 
 let
 
-  version = "1.8.4";
+  version = "2.1.0";
 
   svn = subversionClient.override { perlBindings = true; };
 
@@ -20,11 +20,11 @@ stdenv.mkDerivation {
   name = "git-${version}";
 
   src = fetchurl {
-    url = "http://git-core.googlecode.com/files/git-${version}.tar.gz";
-    sha256 = "156bwqqgaw65rsvbb4wih5jfg94bxyf6p16mdwf0ky3f4ln55s2i";
+    url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz";
+    sha256 = "19q1as2bjh4yifmgw6cciwfw0dswxppaf5iq8h8934i33bf15mwd";
   };
 
-  patches = [ ./docbook2texi.patch ./symlinks-in-bin.patch ];
+  patches = [ ./docbook2texi.patch ./symlinks-in-bin.patch ./cert-path.patch ];
 
   buildInputs = [curl openssl zlib expat gettext cpio makeWrapper]
     ++ stdenv.lib.optionals withManual [ asciidoc texinfo xmlto docbook2x
@@ -35,7 +35,10 @@ stdenv.mkDerivation {
   NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
 
   makeFlags = "prefix=\${out} sysconfdir=/etc/ PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell} "
-      + (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1");
+      + (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1")
+      + (if stdenv.isSunOS then " INSTALL=install NO_INET_NTOP= NO_INET_PTON=" else "")
+      + (if stdenv.isDarwin then " NO_APPLE_COMMON_CRYPTO=1" else "");
+
 
   # FIXME: "make check" requires Sparse; the Makefile must be tweaked
   # so that `SPARSE_FLAGS' corresponds to the current architecture...
@@ -46,8 +49,7 @@ stdenv.mkDerivation {
   postInstall =
     ''
       notSupported() {
-        echo -e "#\!/bin/sh\necho '`basename $1` not supported, $2'\nexit 1" > "$1"
-        chmod +x $1
+        unlink $1 || true
       }
 
       # Install git-subtree.
@@ -64,8 +66,9 @@ stdenv.mkDerivation {
       ln -s "$out/share/git/contrib/emacs/"*.el $out/share/emacs/site-lisp/
       mkdir -p $out/etc/bash_completion.d
       ln -s $out/share/git/contrib/completion/git-completion.bash $out/etc/bash_completion.d/
+      ln -s $out/share/git/contrib/completion/git-prompt.sh $out/etc/bash_completion.d/
 
-      # grep is a runtime dependence, need to patch so that it's found
+      # grep is a runtime dependency, need to patch so that it's found
       substituteInPlace $out/libexec/git-core/git-sh-setup \
           --replace ' grep' ' ${gnugrep}/bin/grep' \
           --replace ' egrep' ' ${gnugrep}/bin/egrep'
@@ -76,7 +79,7 @@ stdenv.mkDerivation {
              -e 's|	perl -e|	${perl}/bin/perl -e|g' \
              $out/libexec/git-core/{git-am,git-submodule}
 
-      # gzip (and optionally bzip2, xz, zip) are a runtime dependencies for
+      # gzip (and optionally bzip2, xz, zip) are runtime dependencies for
       # gitweb.cgi, need to patch so that it's found
       sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \
           $out/share/gitweb/gitweb.cgi
@@ -93,7 +96,7 @@ stdenv.mkDerivation {
                      --set GITPERLLIB "$gitperllib"   \
                      --prefix PATH : "${svn}/bin" ''
        else '' # replace git-svn by notification script
-        notSupported $out/libexec/git-core/git-svn "reinstall with config git = { svnSupport = true } set"
+        notSupported $out/libexec/git-core/git-svn
        '')
 
    + (if sendEmailSupport then
@@ -105,7 +108,7 @@ stdenv.mkDerivation {
         wrapProgram $out/libexec/git-core/git-send-email \
                      --set GITPERLLIB "$gitperllib" ''
        else '' # replace git-send-email by notification script
-        notSupported $out/libexec/git-core/git-send-email "reinstall with config git = { sendEmailSupport = true } set"
+        notSupported $out/libexec/git-core/git-send-email
        '')
 
    + stdenv.lib.optionalString withManual ''# Install man pages and Info manual
@@ -122,8 +125,7 @@ stdenv.mkDerivation {
      '' else ''
        # Don't wrap Tcl/Tk, replace them by notification scripts
        for prog in bin/gitk libexec/git-core/git-gui; do
-         notSupported "$out/$prog" \
-                      "reinstall with config git = { guiSupport = true; } set"
+         notSupported "$out/$prog"
        done
      '');
 
@@ -140,6 +142,6 @@ stdenv.mkDerivation {
     '';
 
     platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    maintainers = with stdenv.lib.maintainers; [ simons the-kenny ];
   };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/gitflow/default.nix b/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
index 26a7826d4f0c..0898345c30b6 100644
--- a/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "gitflow-${version}";
-  version = "1.6.1";
+  version = "1.7.0";
 
   src = fetchurl {
     url = "https://github.com/petervanderdoes/gitflow/archive/${version}.tar.gz";
-    sha256 = "1f4879ahi8diddn7qvhr0dkj96gh527xnfihbf1ha83fn9cvvcls";
+    sha256 = "0rppgyqgk0drip6852bdm2479zks16cb3mj1jdw6jq80givrqnjx";
   };
 
   preBuild = ''
diff --git a/pkgs/applications/version-management/git-and-tools/github-backup/default.nix b/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
index 557886a4deb1..ca329eddc66a 100644
--- a/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
@@ -1,16 +1,19 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, extensibleExceptions, filepath, git, github, hslogger
-, IfElse, MissingH, mtl, network, prettyShow, text, unixCompat
+, IfElse, MissingH, mtl, network, optparseApplicative, prettyShow
+, text, unixCompat
 }:
 
 cabal.mkDerivation (self: {
   pname = "github-backup";
-  version = "1.20131006";
-  sha256 = "0yc2hszi509mc0d6245dc8cq20mjjmr8mgrd8571dy9sgda532pf";
+  version = "1.20140721";
+  sha256 = "0bnkfmgpk1iaaqck4ppn461fzk3s2761w2nxfrvw10gc934lhrxc";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
     extensibleExceptions filepath github hslogger IfElse MissingH mtl
-    network prettyShow text unixCompat
+    network optparseApplicative prettyShow text unixCompat
   ];
   buildTools = [ git ];
   meta = {
@@ -18,5 +21,7 @@ cabal.mkDerivation (self: {
     description = "backs up everything github knows about a repository, to the repository";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
+    hydraPlatforms = self.stdenv.lib.platforms.none;
+    broken = true;
   };
 })
diff --git a/pkgs/applications/version-management/git-and-tools/hub/default.nix b/pkgs/applications/version-management/git-and-tools/hub/default.nix
index b9a053211fae..28484322d351 100644
--- a/pkgs/applications/version-management/git-and-tools/hub/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/hub/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "hub-${version}";
-  version = "1.10.6";
+  version = "1.12.0";
 
   src = fetchurl {
     url = "https://github.com/github/hub/archive/v${version}.tar.gz";
-    sha256 = "0vfl1iq1927in81vd7zvp7yqqzay7pciyj87s83qfxrqyjpxn609";
+    sha256 = "1lbl4dl7483q320qw4jm6mqq4dbbk3xncypxgg86zcdigxvw6igv";
   };
 
   buildInputs = [ rake makeWrapper ];
diff --git a/pkgs/applications/version-management/git-and-tools/qgit/default.nix b/pkgs/applications/version-management/git-and-tools/qgit/default.nix
index d92b49b9ef6c..a7e6a62ce5f5 100644
--- a/pkgs/applications/version-management/git-and-tools/qgit/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/qgit/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "qgit-2.5";
   meta =
   {
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     homepage = "http://libre.tibirna.org/projects/qgit/wiki/QGit";
     description = "Graphical front-end to Git";
     inherit (qt.meta) platforms;
diff --git a/pkgs/applications/version-management/git-and-tools/qgit/qgit-git.nix b/pkgs/applications/version-management/git-and-tools/qgit/qgit-git.nix
index c3b3469ca1ad..590e090de48c 100644
--- a/pkgs/applications/version-management/git-and-tools/qgit/qgit-git.nix
+++ b/pkgs/applications/version-management/git-and-tools/qgit/qgit-git.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "qgit-git";
   meta =
   {
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     homepage = "http://digilander.libero.it/mcostalba/";
     description = "Graphical front-end to Git";
   };
diff --git a/pkgs/applications/version-management/git-and-tools/stgit/default.nix b/pkgs/applications/version-management/git-and-tools/stgit/default.nix
index a933ae84e603..d4b74390c4cc 100644
--- a/pkgs/applications/version-management/git-and-tools/stgit/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/stgit/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, python, git }:
 
 let
-  name = "stgit-0.15";
+  name = "stgit-0.17.1";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "http://download.gna.org/stgit/${name}.tar.gz";
-    sha256 = "0kgq9x0i7riwcl1lmmm40z0jiz5agr1kqxm2byv1qsf0q1ny47v9";
+    sha256 = "1pka0ns9x0kabn036zsf0mwmwiynckhnva51kgxsch9fqah6acyl";
   };
 
   buildInputs = [ python git ];
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
     description = "StGit is a patch manager implemented on top of Git";
     license = "GPL";
 
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    maintainers = with stdenv.lib.maintainers; [ simons the-kenny ];
     platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/svn2git-kde/default.nix b/pkgs/applications/version-management/git-and-tools/svn2git-kde/default.nix
index c44f2dbcbb6b..94c819e711b5 100644
--- a/pkgs/applications/version-management/git-and-tools/svn2git-kde/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/svn2git-kde/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp svn-all-fast-export $out/bin
   '';
 
diff --git a/pkgs/applications/version-management/git-and-tools/svn2git/default.nix b/pkgs/applications/version-management/git-and-tools/svn2git/default.nix
index 6f5d36f6aa74..b0cfcaeb1108 100644
--- a/pkgs/applications/version-management/git-and-tools/svn2git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/svn2git/default.nix
@@ -1,12 +1,14 @@
-{ stdenv, fetchgit, ruby, makeWrapper, git }:
+{ stdenv, fetchurl, ruby, makeWrapper, git }:
 
-stdenv.mkDerivation rec {
-  name = "svn2git-2.1.0-20111206";
+let
+  version = "2.2.5";
+in
+stdenv.mkDerivation {
+  name = "svn2git-${version}";
 
-  src = fetchgit {
-    url = https://github.com/nirvdrum/svn2git;
-    rev = "5cd8d4b509affb66eb2dad50d7298c52b3b0d848";
-    sha256 = "26aa17f68f605e958b623d803b4bd405e12d6c5d51056635873a2c59e4c7b9ca";
+  src = fetchurl {
+    url = "https://github.com/nirvdrum/svn2git/archive/v${version}.tar.gz";
+    sha256 = "1afmrr80357pg3kawyghhc55z1pszaq8fyrrjmxa6nr9dcrqjwwh";
   };
 
   buildInputs = [ ruby makeWrapper ];
@@ -17,14 +19,22 @@ stdenv.mkDerivation rec {
     ''
       mkdir -p $out
       cp -r lib $out/
-      
+
       mkdir -p $out/bin
       substituteInPlace bin/svn2git --replace '/usr/bin/env ruby' ${ruby}/bin/ruby
       cp bin/svn2git $out/bin/
       chmod +x $out/bin/svn2git
-      
+
       wrapProgram $out/bin/svn2git \
         --set RUBYLIB $out/lib \
         --prefix PATH : ${git}/bin
     '';
+
+  meta = {
+    homepage = https://github.com/nirvdrum/svn2git;
+    description = "Ruby tool for importing existing svn projects into git";
+    license = stdenv.lib.licenses.mit;
+
+    maintainers = [ stdenv.lib.maintainers.the-kenny ];
+  };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/tig/default.nix b/pkgs/applications/version-management/git-and-tools/tig/default.nix
index bdd6e806fe3b..239fa87d32c5 100644
--- a/pkgs/applications/version-management/git-and-tools/tig/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/tig/default.nix
@@ -1,23 +1,33 @@
-{ stdenv, fetchurl, ncurses, asciidoc, xmlto, docbook_xsl }:
+{ stdenv, fetchurl, ncurses, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45
+, readline
+}:
 
 stdenv.mkDerivation rec {
-  name = "tig-1.1";
+  name = "tig-2.0.2";
+
   src = fetchurl {
     url = "http://jonas.nitro.dk/tig/releases/${name}.tar.gz";
-    md5 = "adeb797a8320962eeb345a615257cbac";
+    sha256 = "0gi7iqiij37b0d3izxymxaw5ns2mv1y7qfic0fhl7xj4s2rz075r";
   };
-  buildInputs = [ncurses asciidoc xmlto docbook_xsl];
+
+  buildInputs = [ ncurses asciidoc xmlto docbook_xsl readline ];
+
+  preConfigure = ''
+    export XML_CATALOG_FILES='${docbook_xsl}/xml/xsl/docbook/catalog.xml ${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml'
+  '';
+
   installPhase = ''
     make install
     make install-doc
     mkdir -p $out/etc/bash_completion.d/
     cp contrib/tig-completion.bash $out/etc/bash_completion.d/
   '';
+
   meta = with stdenv.lib; {
     homepage = "http://jonas.nitro.dk/tig/";
-    description = "Tig is a git repository browser that additionally can act as a pager for output from various git commands";
-    maintainers = [ maintainers.garbas maintainers.bjornfor maintainers.iElectric ];
+    description = "Text-mode interface for git";
+    maintainers = with maintainers; [ garbas bjornfor iElectric ];
     license = licenses.gpl2;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/topgit/default.nix b/pkgs/applications/version-management/git-and-tools/topgit/default.nix
index 5290a12a54ac..195f6f3a4635 100644
--- a/pkgs/applications/version-management/git-and-tools/topgit/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/topgit/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://github.com/greenrd/topgit";
     description = "TopGit manages large amount of interdependent topic branches";
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.unix;
     maintainers = with stdenv.lib.maintainers; [ marcweber ludo simons ];
   };
diff --git a/pkgs/applications/version-management/git-repo/default.nix b/pkgs/applications/version-management/git-repo/default.nix
new file mode 100644
index 000000000000..7f8091067cb9
--- /dev/null
+++ b/pkgs/applications/version-management/git-repo/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, python }:
+
+stdenv.mkDerivation {
+  name = "git-repo-1.20";
+  src = fetchurl {
+    # I could not find a versioned url for the 1.20 version. In case
+    # the sha mismatches, check the homepage for new version and sha.
+    url = "http://commondatastorage.googleapis.com/git-repo-downloads/repo";
+    sha1 = "e197cb48ff4ddda4d11f23940d316e323b29671c";
+  };
+
+  unpackPhase = "true";
+  installPhase = ''
+    mkdir -p $out/bin
+    sed -e 's,!/usr/bin/env python,!${python}/bin/python,' < $src > $out/bin/repo
+    chmod +x $out/bin/repo
+  '';
+
+  meta = {
+    homepage = "http://source.android.com/source/downloading.html";
+    description = "Android's repo management tool";
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/version-management/gitolite/default.nix b/pkgs/applications/version-management/gitolite/default.nix
new file mode 100644
index 000000000000..67e3cba70ca0
--- /dev/null
+++ b/pkgs/applications/version-management/gitolite/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, perl, git }:
+
+stdenv.mkDerivation rec {
+  name = "gitolite-${version}";
+  version = "3.6.1";
+
+  src = fetchurl {
+    url = "https://github.com/sitaramc/gitolite/archive/v${version}.tar.gz";
+    sha256 = "0sizzv705aypasi9vf9kmdbzcl3gmyfxg9dwdl5prn64biqkvq3y";
+  };
+
+  buildInputs = [ perl git ];
+  buildPhase = "true";
+
+  patchPhase = ''
+    substituteInPlace ./install --replace " 2>/dev/null" ""
+    substituteInPlace src/lib/Gitolite/Hooks/PostUpdate.pm \
+      --replace /usr/bin/perl "${perl}/bin/perl"
+    substituteInPlace src/lib/Gitolite/Hooks/Update.pm \
+      --replace /usr/bin/perl "${perl}/bin/perl"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    perl ./install -to $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Finely-grained git repository hosting";
+    homepage    = http://gitolite.com/gitolite/index.html;
+    license     = licenses.gpl2;
+    platforms   = platforms.unix;
+    maintainers = [ maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/applications/version-management/gource/default.nix b/pkgs/applications/version-management/gource/default.nix
index 886ed9a71999..13c554767743 100644
--- a/pkgs/applications/version-management/gource/default.nix
+++ b/pkgs/applications/version-management/gource/default.nix
@@ -1,23 +1,27 @@
-{ stdenv, fetchurl, SDL, ftgl, pkgconfig, libpng, libjpeg, pcre, SDL_image, glew, mesa }:
+{ stdenv, fetchurl, SDL, ftgl, pkgconfig, libpng, libjpeg, pcre
+, SDL_image, glew, mesa, boost, glm
+}:
 
-let
-  name = "gource-0.37";
-in
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation rec {
+  name = "gource-0.40";
 
   src = fetchurl {
     url = "http://gource.googlecode.com/files/${name}.tar.gz";
-    sha256 = "03kd9nn65cl1p2jgn6pvpxmvnfscz3c8jqds90fsc0z37ij2iiyn";
+    sha256 = "04nirh07xjslqsph557as4s50nlf91bi6v2l7vmbifmkdf90m2cw";
   };
 
-  buildInputs = [glew SDL ftgl pkgconfig libpng libjpeg pcre SDL_image mesa];
+  buildInputs = [
+    glew SDL ftgl pkgconfig libpng libjpeg pcre SDL_image mesa boost glm
+  ];
+
+  configureFlags = "--with-boost-libdir=${boost}/lib";
+
+  NIX_CFLAGS_COMPILE = "-fpermissive"; # fix build with newer gcc versions
 
   meta = {
     homepage = "http://code.google.com/p/gource/";
     description = "software version control visualization tool";
     license = stdenv.lib.licenses.gpl3Plus;
-
     longDescription = ''
       Software projects are displayed by Gource as an animated tree with
       the root directory of the project at its centre. Directories
@@ -28,8 +32,6 @@ stdenv.mkDerivation {
       Mercurial and Bazaar and SVN. Gource can also parse logs produced
       by several third party tools for CVS repositories.
     '';
-
-    platforms = stdenv.lib.platforms.gnu;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/version-management/kdesvn/default.nix b/pkgs/applications/version-management/kdesvn/default.nix
index 59fb1f5a867f..60f5d8bb9e08 100644
--- a/pkgs/applications/version-management/kdesvn/default.nix
+++ b/pkgs/applications/version-management/kdesvn/default.nix
@@ -1,21 +1,20 @@
-{ stdenv, fetchurl, gettext, apr, aprutil, subversion, db4, kdelibs, expat }:
+{ stdenv, fetchurl, gettext, apr, aprutil, subversion, db, kdelibs, expat }:
 
+# the homepage mentions this is the final release.
+# from now on, kdesvn will be part of the official kde software distribution
 stdenv.mkDerivation rec {
-  name = "kdesvn-1.5.5";
+  name = "kdesvn-1.6.0";
 
-  src = fetchurl {
-    url = "${meta.homepage}/downloads/${name}.tar.bz2";
-    sha256 = "02sb34p04dyd88ksxvpiffhxqwmhs3yv1wif9m8w0fly9hvy1zk7";
+  src = fetchurl rec {
+    url = "http://pkgs.fedoraproject.org/repo/pkgs/kdesvn/${name}.tar.bz2/${md5}/${name}.tar.bz2";
+    md5 = "7e6adc98ff4777a06d5752d3f2b58fa3";
   };
 
   prePatch = ''
     sed -i -e "s|/usr|${subversion}|g" src/svnqt/cmakemodules/FindSubversion.cmake
   '';
 
-  patches = [ ./docbook.patch ./virtual_inheritance.patch ];
-  
-
-  buildInputs = [ apr aprutil subversion db4 kdelibs expat ];
+  buildInputs = [ apr aprutil subversion db kdelibs expat ];
 
   nativeBuildInputs = [ gettext ];
 
diff --git a/pkgs/applications/version-management/kdesvn/docbook.patch b/pkgs/applications/version-management/kdesvn/docbook.patch
deleted file mode 100644
index 54f43c779580..000000000000
--- a/pkgs/applications/version-management/kdesvn/docbook.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-The name of the dtd changed in kdelibs 4.5, so we need to increase it.
-
-diff --git a/doc/nl/index.docbook b/doc/nl/index.docbook
-index 8747869..a9676aa 100644
---- a/doc/nl/index.docbook
-+++ b/doc/nl/index.docbook
-@@ -1,5 +1,5 @@
- <?xml version="1.0" ?>
--<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
-+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
-   <!ENTITY kdesvn "<application>kdesvn</application>">
-   <!ENTITY kappname "&kdesvn;"><!-- Do *not* replace kappname-->
-   <!ENTITY package "kde-module"><!-- kdebase, kdeadmin, etc -->
diff --git a/pkgs/applications/version-management/kdesvn/virtual_inheritance.patch b/pkgs/applications/version-management/kdesvn/virtual_inheritance.patch
deleted file mode 100644
index faaf6afcd6ba..000000000000
--- a/pkgs/applications/version-management/kdesvn/virtual_inheritance.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- kdesvn-1.5.5.orig/src/svnfrontend/graphtree/revgraphview.h
-+++ kdesvn-1.5.5/src/svnfrontend/graphtree/revgraphview.h
-@@ -49,7 +49,7 @@ typedef svn::SharedPointer<KTemporaryFil
- /**
- 	@author Rajko Albrecht <ral@alwins-world.de>
- */
--class RevGraphView : virtual public QGraphicsView
-+class RevGraphView : public QGraphicsView
- {
-     Q_OBJECT
- public:
diff --git a/pkgs/applications/version-management/meld/default.nix b/pkgs/applications/version-management/meld/default.nix
index 73b21728e165..951ea29a7fca 100644
--- a/pkgs/applications/version-management/meld/default.nix
+++ b/pkgs/applications/version-management/meld/default.nix
@@ -1,8 +1,8 @@
 {stdenv, fetchurl, pygtk, python, intltool, scrollkeeper, makeWrapper }:
 
 let
-  minor = "1.6";
-  version = "${minor}.1";
+  minor = "1.8";
+  version = "${minor}.6";
 in
 
 stdenv.mkDerivation {
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://gnome/sources/meld/${minor}/meld-${version}.tar.xz";
-    sha256 = "00rsff0yl5qwzh0igkdns6ry2xsbxad70avpqpkbd2bldi94v76y";
+    sha256 = "19g86rksrs77hd58zhs3zwbjmmhqc98v2ly8451avwsbiwmni5mg";
   };
 
   buildInputs = [ pygtk python intltool scrollkeeper makeWrapper ];
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
   meta = with stdenv.lib; {
     description = "Visual diff and merge tool";
     homepage = http://meld.sourceforge.net;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix
index 669aa5713a08..8237a5517c7e 100644
--- a/pkgs/applications/version-management/mercurial/default.nix
+++ b/pkgs/applications/version-management/mercurial/default.nix
@@ -2,7 +2,8 @@
 , guiSupport ? false, tk ? null, curses }:
 
 let
-  name = "mercurial-2.6.1";
+  version = "3.1";
+  name = "mercurial-${version}";
 in
 
 stdenv.mkDerivation {
@@ -10,7 +11,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://mercurial.selenic.com/release/${name}.tar.gz";
-    sha256 = "0r4fg269xnqgacc82ppm3wxl9wwvvgwz8z6zi1iai4gx76iklhdn";
+    sha256 = "1r6hdxka867lpsq2jq3vz662m3ywflg4yylayc9g0s9gmiww5pgi";
   };
 
   inherit python; # pass it so that the same version can be used in hg2git
@@ -53,9 +54,11 @@ stdenv.mkDerivation {
     '';
 
   meta = {
+    inherit version;
     description = "A fast, lightweight SCM system for very large distributed projects";
-    homepage = "http://www.selenic.com/mercurial/";
-    license = "GPLv2";
+    homepage = "http://mercurial.selenic.com/";
+    downloadPage = "http://mercurial.selenic.com/release/";
+    license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/applications/version-management/monotone/default.nix b/pkgs/applications/version-management/monotone/default.nix
index 0df1c652761e..6be36533ce6b 100644
--- a/pkgs/applications/version-management/monotone/default.nix
+++ b/pkgs/applications/version-management/monotone/default.nix
@@ -1,8 +1,10 @@
 { stdenv, fetchurl, boost, zlib, botan, libidn
-, lua, pcre, sqlite, perl, pkgconfig, expect }:
+, lua, pcre, sqlite, perl, pkgconfig, expect
+, bzip2, gmp, openssl
+}:
 
 let
-  version = "1.0";
+  version = "1.1";
   perlVersion = (builtins.parseDrvName perl.name).version;
 in
 
@@ -13,12 +15,13 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://monotone.ca/downloads/${version}/monotone-${version}.tar.bz2";
-    sha256 = "5c530bc4652b2c08b5291659f0c130618a14780f075f981e947952dcaefc31dc";
+    sha256 = "124cwgi2q86hagslbk5idxbs9j896rfjzryhr6z63r6l485gcp7r";
   };
 
-  patches = [ ./glibc-file-handle.patch ];
+  patches = [ ];
 
-  buildInputs = [ boost zlib botan libidn lua pcre sqlite pkgconfig expect ];
+  buildInputs = [ boost zlib botan libidn lua pcre sqlite pkgconfig expect 
+    openssl gmp bzip2 ];
 
   postInstall = ''
     mkdir -p $out/share/${name}
diff --git a/pkgs/applications/version-management/monotone/default.upstream b/pkgs/applications/version-management/monotone/default.upstream
new file mode 100644
index 000000000000..e0d01fb190c6
--- /dev/null
+++ b/pkgs/applications/version-management/monotone/default.upstream
@@ -0,0 +1,8 @@
+url http://www.monotone.ca/downloads.php
+
+do_overwrite(){
+  ensure_version
+  ensure_hash
+  set_var_value version $CURRENT_VERSION
+  set_var_value sha256 $CURRENT_HASH
+}
diff --git a/pkgs/applications/version-management/monotone/glibc-file-handle.patch b/pkgs/applications/version-management/monotone/glibc-file-handle.patch
deleted file mode 100644
index 601b6ede0fb9..000000000000
--- a/pkgs/applications/version-management/monotone/glibc-file-handle.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-Revision: da62cad10eda55aa233ac124273f3db4f541137a
-Parent:   65bcb8cf8b32f68a5b48629b328f6d65979e58df
-Author:   Thomas Moschny <thomas.moschny@gmx.de>
-Date:     07.05.2011 13:32:06
-Branch:   net.venge.monotone
-
-Changelog: 
-
-* src/rcs_file.cc: Rename struct "file_handle" to "rcs_file_handle"
-  to avoid a name clash with a struct of same name defined by newer
-  glibc's "fcntl.h". For aesthetic reasons, also rename struct
-  "file_source".
-
-References:
-https://code.monotone.ca/p/monotone/source/commit/da62cad10eda55aa233ac124273f3db4f541137a/
-https://bugs.gentoo.org/396651
-
-============================================================
---- a/src/rcs_file.cc	885b3fbe7b6cfed78816f0e57cd71d44616213c6
-+++ b/src/rcs_file.cc	03cf68912a4a708545ebce3d415c0e970ddead0b
-@@ -42,12 +42,12 @@ struct
- 
- #ifdef HAVE_MMAP
- struct
--file_handle
-+rcs_file_handle
- {
-   string const & filename;
-   off_t length;
-   int fd;
--  file_handle(string const & fn) :
-+  rcs_file_handle(string const & fn) :
-     filename(fn),
-     length(0),
-     fd(-1)
-@@ -60,13 +60,13 @@ file_handle
-       if (fd == -1)
-         throw oops("open of " + filename + " failed");
-     }
--  ~file_handle()
-+  ~rcs_file_handle()
-     {
-       if (close(fd) == -1)
-         throw oops("close of " + filename + " failed");
-     }
- };
--struct file_source
-+struct rcs_file_source
- {
-   string const & filename;
-   int fd;
-@@ -91,7 +91,7 @@ struct file_source
-       ++pos;
-     return good();
-   }
--  file_source(string const & fn,
-+  rcs_file_source(string const & fn,
-               int f,
-               off_t len) :
-     filename(fn),
-@@ -104,7 +104,7 @@ struct file_source
-     if (mapping == MAP_FAILED)
-       throw oops("mmap of " + filename + " failed");
-   }
--  ~file_source()
-+  ~rcs_file_source()
-   {
-     if (munmap(mapping, length) == -1)
-       throw oops("munmapping " + filename + " failed, after reading RCS file");
-@@ -112,12 +112,12 @@ struct
- };
- #elif defined(WIN32)
- struct
--file_handle
-+rcs_file_handle
- {
-   string const & filename;
-   off_t length;
-   HANDLE fd;
--  file_handle(string const & fn) :
-+  rcs_file_handle(string const & fn) :
-     filename(fn),
-     length(0),
-     fd(NULL)
-@@ -134,7 +134,7 @@ file_handle
-       if (fd == NULL)
-         throw oops("open of " + filename + " failed");
-     }
--  ~file_handle()
-+  ~rcs_file_handle()
-     {
-       if (CloseHandle(fd)==0)
-         throw oops("close of " + filename + " failed");
-@@ -142,7 +142,7 @@ struct
- };
- 
- struct
--file_source
-+rcs_file_source
- {
-   string const & filename;
-   HANDLE fd,map;
-@@ -167,7 +167,7 @@ file_source
-       ++pos;
-     return good();
-   }
--  file_source(string const & fn,
-+  rcs_file_source(string const & fn,
-               HANDLE f,
-               off_t len) :
-     filename(fn),
-@@ -183,7 +183,7 @@ file_source
-     if (mapping==NULL)
-       throw oops("MapViewOfFile of " + filename + " failed");
-   }
--  ~file_source()
-+  ~rcs_file_source()
-   {
-     if (UnmapViewOfFile(mapping)==0)
-       throw oops("UnmapViewOfFile of " + filename + " failed");
-@@ -193,7 +193,7 @@ file_source
- };
- #else
- // no mmap at all
--typedef istream file_source;
-+typedef istream rcs_file_source;
- #endif
- 
- typedef enum
-@@ -220,7 +220,7 @@ static token_type
- }
- 
- static token_type
--get_token(file_source & ist,
-+get_token(rcs_file_source & ist,
-           string & str,
-           size_t & line,
-           size_t & col)
-@@ -303,14 +303,14 @@ struct parser
- 
- struct parser
- {
--  file_source & ist;
-+  rcs_file_source & ist;
-   rcs_file & r;
-   string token;
-   token_type ttype;
- 
-   size_t line, col;
- 
--  parser(file_source & s,
-+  parser(rcs_file_source & s,
-          rcs_file & r)
-     : ist(s), r(r), line(1), col(1)
-   {}
-@@ -489,8 +489,8 @@ parse_rcs_file(string const & filename, 
- parse_rcs_file(string const & filename, rcs_file & r)
- {
- #if defined(HAVE_MMAP) || defined(WIN32)
--      file_handle handle(filename);
--      file_source ifs(filename, handle.fd, handle.length);
-+      rcs_file_handle handle(filename);
-+      rcs_file_source ifs(filename, handle.fd, handle.length);
- #else
-       ifstream ifs(filename.c_str());
-       ifs.unsetf(ios_base::skipws);
diff --git a/pkgs/applications/version-management/mr/default.nix b/pkgs/applications/version-management/mr/default.nix
index 9e8024d7b191..29fafc4db74c 100644
--- a/pkgs/applications/version-management/mr/default.nix
+++ b/pkgs/applications/version-management/mr/default.nix
@@ -17,13 +17,14 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    mkdir -pv $out/bin $out/share/man/man1
+    mkdir -pv $out/bin $out/share/man/man1 $out/share/mr
     cp -v mr $out/bin
     cp -v webcheckout $out/bin
     cp -v mr.1 $out/share/man/man1
     cp -v webcheckout.1 $out/share/man/man1
+    cp -v lib/* $out/share/mr
   '';
-      
+
   meta = {
     description = "Multiple Repository management tool";
     longDescription = ''The mr(1) command can checkout, update, or perform other actions on a
@@ -48,9 +49,8 @@ stdenv.mkDerivation rec {
           offline, so they can be retried when it comes back online.
     '';
     homepage = http://joeyh.name/code/mr/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.antono ];
   };
 }
- 
diff --git a/pkgs/applications/version-management/rapidsvn/default.nix b/pkgs/applications/version-management/rapidsvn/default.nix
index 264340b48262..843fe9ad3230 100644
--- a/pkgs/applications/version-management/rapidsvn/default.nix
+++ b/pkgs/applications/version-management/rapidsvn/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Multi-platform GUI front-end for the Subversion revision system";
     homepage = http://rapidsvn.tigris.org/;
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = [ stdenv.lib.maintainers.viric ];
   };
 }
diff --git a/pkgs/applications/version-management/rcs/default.nix b/pkgs/applications/version-management/rcs/default.nix
index 5f88bbc74cc6..e71d23132aca 100644
--- a/pkgs/applications/version-management/rcs/default.nix
+++ b/pkgs/applications/version-management/rcs/default.nix
@@ -1,13 +1,15 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, ed }:
 
 stdenv.mkDerivation rec {
-  name = "rcs-5.8.2";
+  name = "rcs-5.9.2";
 
   src = fetchurl {
-    url = "mirror://gnu/rcs/${name}.tar.gz";
-    sha256 = "1p4kqqrvc7plc3n6ls4xwp6d3mw1jcx9p36pilwd65q31mgbs07a";
+    url = "mirror://gnu/rcs/${name}.tar.xz";
+    sha256 = "0wdmmplga9k05d9k7wjqv4zb6xvvzsli8hmn206pvangki1g66k5";
   };
 
+  buildInputs = [ ed ];
+
   doCheck = true;
 
   meta = {
@@ -21,7 +23,7 @@ stdenv.mkDerivation rec {
          documentation, graphics, papers, and form letters.
       '';
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = with stdenv.lib.maintainers; [ eelco simons ];
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix
index b1469038d42d..6e3d2f3d4d53 100644
--- a/pkgs/applications/version-management/subversion/default.nix
+++ b/pkgs/applications/version-management/subversion/default.nix
@@ -1,37 +1,33 @@
 { bdbSupport ? false # build support for Berkeley DB repositories
 , httpServer ? false # build Apache DAV module
 , httpSupport ? false # client must support http
-, sslSupport ? false # client must support https
-, compressionSupport ? false # client must support http compression
 , pythonBindings ? false
 , perlBindings ? false
 , javahlBindings ? false
 , saslSupport ? false
-, stdenv, fetchurl, apr, aprutil, neon, zlib, sqlite
+, stdenv, fetchurl, apr, aprutil, zlib, sqlite
 , httpd ? null, expat, swig ? null, jdk ? null, python ? null, perl ? null
-, sasl ? null
+, sasl ? null, serf ? null
 }:
 
 assert bdbSupport -> aprutil.bdbSupport;
 assert httpServer -> httpd != null;
 assert pythonBindings -> swig != null && python != null;
 assert javahlBindings -> jdk != null && perl != null;
-assert sslSupport -> neon.sslSupport;
-assert compressionSupport -> neon.compressionSupport;
 
 stdenv.mkDerivation rec {
 
-  version = "1.7.13";
+  version = "1.8.10";
 
   name = "subversion-${version}";
 
   src = fetchurl {
-    url = "mirror://apache/subversion//${name}.tar.bz2";
-    sha1 = "844bb756ec505edaa12b9610832bcd21567139f1";
+    url = "mirror://apache/subversion/${name}.tar.bz2";
+    sha1 = "d6896d94bb53c1b4c6e9c5bb1a5c466477b19b2b";
   };
 
   buildInputs = [ zlib apr aprutil sqlite ]
-    ++ stdenv.lib.optional httpSupport neon
+    ++ stdenv.lib.optional httpSupport serf
     ++ stdenv.lib.optional pythonBindings python
     ++ stdenv.lib.optional perlBindings perl
     ++ stdenv.lib.optional saslSupport sasl;
@@ -43,6 +39,7 @@ stdenv.mkDerivation rec {
     ${if javahlBindings then "--enable-javahl --with-jdk=${jdk}" else ""}
     ${if stdenv.isDarwin then "--enable-keychain" else "--disable-keychain"}
     ${if saslSupport then "--enable-sasl --with-sasl=${sasl}" else "--disable-sasl"}
+    ${if httpSupport then "--enable-serf --with-serf=${serf}" else "--disable-serf"}
     --with-zlib=${zlib}
     --with-sqlite=${sqlite}
   '';
@@ -67,16 +64,23 @@ stdenv.mkDerivation rec {
         make install
         cd -
     fi
+
+    mkdir -p $out/share/bash-completion/completions
+    cp tools/client-side/bash_completion $out/share/bash-completion/completions/subversion
   '';
 
   inherit perlBindings pythonBindings;
 
   enableParallelBuilding = true;
 
+  # Hack to build on Mac OS X. The system header files use C99-style
+  # comments, but Subversion passes -std=c90.
+  NIX_CFLAGS_COMPILE = "-std=c99";
+
   meta = {
     description = "A version control system intended to be a compelling replacement for CVS in the open source community";
     homepage = http://subversion.apache.org/;
     maintainers = with stdenv.lib.maintainers; [ eelco lovek323 ];
-    platforms = stdenv.lib.platforms.all;
+    hydraPlatforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
   };
 }
diff --git a/pkgs/applications/version-management/tailor/default.nix b/pkgs/applications/version-management/tailor/default.nix
index 54529503d82a..f8937f39e769 100644
--- a/pkgs/applications/version-management/tailor/default.nix
+++ b/pkgs/applications/version-management/tailor/default.nix
@@ -2,7 +2,10 @@ args : with args;
 let version = if args ? version then args.version else "0.9.35"; in
 rec {
   src = fetchurl {
-    url = "http://darcs.arstecnica.it/tailor/tailor-${version}.tar.gz";
+    urls = [
+      "http://darcs.arstecnica.it/tailor/tailor-${version}.tar.gz"
+      "http://pkgs.fedoraproject.org/repo/pkgs/tailor/tailor-${version}.tar.gz/58a6bc1c1d922b0b1e4579c6440448d1/tailor-${version}.tar.gz"
+    ];
     sha256 = "061acapxxn5ab3ipb5nd3nm8pk2xj67bi83jrfd6lqq3273fmdjh";
   };
 
diff --git a/pkgs/applications/version-management/tkcvs/default.nix b/pkgs/applications/version-management/tkcvs/default.nix
index 569c442f9838..b3bfe8a22e68 100644
--- a/pkgs/applications/version-management/tkcvs/default.nix
+++ b/pkgs/applications/version-management/tkcvs/default.nix
@@ -22,6 +22,6 @@ stdenv.mkDerivation
   meta = {
     homepage = http://www.twobarleycorns.net/tkcvs.html;
     description = "TCL/TK GUI for cvs and subversion";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/version-management/vcprompt/default.nix b/pkgs/applications/version-management/vcprompt/default.nix
new file mode 100644
index 000000000000..476abd4e19bd
--- /dev/null
+++ b/pkgs/applications/version-management/vcprompt/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchhg, autoconf, sqlite }:
+
+stdenv.mkDerivation {
+  name = "vcprompt";
+
+  src = fetchhg {
+    url = "http://hg.gerg.ca/vcprompt/";
+    rev = "1.2.1";
+    sha256 = "03xqvp6bfl98bpacrw4n82qv9cw6a4fxci802s3vrygas989v1kj";
+  };
+
+  buildInputs = [ sqlite autoconf ];
+
+  preConfigure = ''
+    autoconf
+    makeFlags="$makeFlags PREFIX=$out"
+  '';
+
+  meta = with stdenv.lib; {
+    description = ''
+      A little C program that prints a short string with barebones information
+      about the current working directory for various version control systems
+    '';
+    homepage    = http://hg.gerg.ca/vcprompt;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms   = with platforms; linux ++ darwin;
+  };
+}
diff --git a/pkgs/applications/version-management/vcsh/default.nix b/pkgs/applications/version-management/vcsh/default.nix
new file mode 100644
index 000000000000..d438cb1bc6cd
--- /dev/null
+++ b/pkgs/applications/version-management/vcsh/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchgit}:
+
+stdenv.mkDerivation rec {
+  rev = "75c4c554eefbefb714fabd356933858edbce3b1e";
+  version = "1.20131229";
+  name = "vcsh-${version}_${rev}";
+
+  src = fetchgit {
+    inherit rev;
+    url = "https://github.com/RichiH/vcsh";
+    sha256 = "0rc82a8vnnk9q6q88z9s10873gqgdpppbpwy2yw8a7hydqrpn0hs";
+  };
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp vcsh $out/bin
+  '';
+
+  meta = {
+    description = "Version Control System for $HOME";
+    homepage = https://github.com/RichiH/vcsh;
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/applications/version-management/veracity/default.nix b/pkgs/applications/version-management/veracity/default.nix
index 6bf452c18210..4c69f41106b8 100644
--- a/pkgs/applications/version-management/veracity/default.nix
+++ b/pkgs/applications/version-management/veracity/default.nix
@@ -102,6 +102,7 @@ rec {
     ];
     platforms = with a.lib.platforms;
       linux ;
+    broken = true;
   };
 }) x
 
diff --git a/pkgs/applications/video/aegisub/default.nix b/pkgs/applications/video/aegisub/default.nix
new file mode 100644
index 000000000000..c06aa0a036cd
--- /dev/null
+++ b/pkgs/applications/video/aegisub/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, fetchurl
+, libX11, gettext, wxGTK
+, libiconv, fontconfig, freetype
+, mesa
+, libass, fftw, ffms
+, ffmpeg, pkgconfig, zlib # Undocumented (?) dependencies
+, icu, boost, intltool # New dependencies
+, spellChecking ? true, hunspell ? null
+, automationSupport ? true, lua ? null
+, openalSupport ? false, openal ? null
+, alsaSupport ? true, alsaLib ? null
+, pulseaudioSupport ? true, pulseaudio ? null
+, portaudioSupport ? false, portaudio ? null
+}:
+
+assert spellChecking -> (hunspell != null);
+assert automationSupport -> (lua != null);
+assert openalSupport -> (openal != null);
+assert alsaSupport -> (alsaLib != null);
+assert pulseaudioSupport -> (pulseaudio != null);
+assert portaudioSupport -> (portaudio != null);
+
+stdenv.mkDerivation rec {
+  name = "aegisub-${version}";
+  version = "3.2.0";
+
+  src = fetchurl {
+    url = "http://ftp.aegisub.org/pub/releases/${name}.tar.xz";
+    sha256 = "0nciw5p1aq94qwz5j4vbc06fywdjhazgh4qs6qr9iqj3n94gvrfr";
+  };
+
+  nativeBuildInputs = [ intltool ];
+
+  buildInputs = with stdenv.lib;
+  [ libX11 gettext wxGTK libiconv fontconfig freetype mesa libass fftw ffms ffmpeg pkgconfig zlib icu boost ]
+  ++ optional spellChecking hunspell
+  ++ optional automationSupport lua
+  ++ optional openalSupport openal
+  ++ optional alsaSupport alsaLib
+  ++ optional pulseaudioSupport pulseaudio
+  ++ optional portaudioSupport portaudio
+  ;
+
+  NIX_LDFLAGS = "-liconv -lavutil -lavformat -lavcodec -lswscale -lz -lm -lGL";
+
+  configureFlags = "--with-boost-libdir=${boost}/lib/";
+
+  postInstall = "ln -s $out/bin/aegisub-* $out/bin/aegisub";
+
+  meta = with stdenv.lib; {
+    description = "An advanced subtitle editor";
+    longDescription = ''
+      Aegisub is a free, cross-platform open source tool for creating and
+      modifying subtitles. Aegisub makes it quick and easy to time subtitles to
+      audio, and features many powerful tools for styling them, including a
+      built-in real-time video preview.
+    '';
+    homepage = http://www.aegisub.org/;
+    license = licenses.bsd3;
+              # The Aegisub sources are itself BSD/ISC,
+              # but they are linked against GPL'd softwares
+              # - so the resulting program will be GPL
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+
+  };
+}
diff --git a/pkgs/applications/video/avidemux/default.nix b/pkgs/applications/video/avidemux/default.nix
index d706d16241ce..485d8c54eb36 100644
--- a/pkgs/applications/video/avidemux/default.nix
+++ b/pkgs/applications/video/avidemux/default.nix
@@ -1,20 +1,23 @@
 {stdenv, fetchurl, cmake, pkgconfig, libxml2, qt4, gtk, gettext, SDL,
 libXv, pixman, libpthreadstubs, libXau, libXdmcp, libxslt, x264,
-alsaLib, lame, faac, faad2, libvorbis, yasm, libvpx, xvidcore, libva }:
+alsaLib, lame, faad2, libvorbis, yasm, libvpx, xvidcore, libva,
+faac ? null, faacSupport ? false }:
 
 assert stdenv ? glibc;
+assert faacSupport -> faac != null;
 
 stdenv.mkDerivation {
   name = "avidemux-2.5.6";
-  
+
   src = fetchurl {
     url = mirror://sourceforge/avidemux/avidemux_2.5.6.tar.gz;
     sha256 = "12wvxz0n2g85f079d8mdkkp2zm279d34m9v7qgcqndh48cn7znnn";
   };
-  
+
   buildInputs = [ cmake pkgconfig libxml2 qt4 gtk gettext SDL libXv
-    pixman libpthreadstubs libXau libXdmcp libxslt x264 alsaLib 
-    lame faac faad2 libvorbis yasm libvpx xvidcore libva ];
+    pixman libpthreadstubs libXau libXdmcp libxslt x264 alsaLib
+    lame faad2 libvorbis yasm libvpx xvidcore libva
+  ] ++ stdenv.lib.optional faacSupport faac;
 
   cmakeFlags = "-DPTHREAD_INCLUDE_DIR=${stdenv.glibc}/include" +
     " -DGETTEXT_INCLUDE_DIR=${gettext}/include" +
@@ -34,7 +37,7 @@ stdenv.mkDerivation {
     make install
   '';
 
-  meta = { 
+  meta = {
     homepage = http://fixounet.free.fr/avidemux/;
     description = "Free video editor designed for simple video editing tasks";
     maintainers = with stdenv.lib.maintainers; [viric];
diff --git a/pkgs/applications/video/avxsynth/default.nix b/pkgs/applications/video/avxsynth/default.nix
index 70dcad49c978..a9a2ec46397f 100644
--- a/pkgs/applications/video/avxsynth/default.nix
+++ b/pkgs/applications/video/avxsynth/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = https://github.com/avxsynth/avxsynth/wiki;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/video/bangarang/default.nix b/pkgs/applications/video/bangarang/default.nix
index 5dde88076a1e..f962b52dd627 100644
--- a/pkgs/applications/video/bangarang/default.nix
+++ b/pkgs/applications/video/bangarang/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
   buildInputs = [ kdelibs phonon soprano shared_desktop_ontologies kdemultimedia taglib gettext ];
   nativeBuildInputs = [ cmake ];
 
+  patches = [ ./gcc-4.7.patch ];
+
   meta = with stdenv.lib; {
     description = "A media player for KDE based on Nepomuk and Phonon";
     longDescription = ''
@@ -17,7 +19,7 @@ stdenv.mkDerivation rec {
       media collection management, playlists and statistics.
     '';
     homepage = http://bangarangkde.wordpress.com/;
-    license = "GPLv3";
+    license = stdenv.lib.licenses.gpl3;
     maintainers = [ maintainers.phreedom maintainers.urkud ];
     platforms = platforms.linux;
   };
diff --git a/pkgs/applications/video/bangarang/gcc-4.7.patch b/pkgs/applications/video/bangarang/gcc-4.7.patch
new file mode 100644
index 000000000000..d4f650b9caf5
--- /dev/null
+++ b/pkgs/applications/video/bangarang/gcc-4.7.patch
@@ -0,0 +1,45 @@
+commit b893fcdb7ddfc8c59fd29a29b7265a713c3dbab1
+Author: Alex Fiestas <afiestas@kde.org>
+Date:   Thu Mar 29 10:09:22 2012 +0200
+
+    Build fix: Add unistd.h include since sleep is defined there
+
+diff --git a/src/platform/infofetchers/lastfminfofetcher.cpp b/src/platform/infofetchers/lastfminfofetcher.cpp
+index 0c49d69..fcc4cd3 100644
+--- a/src/platform/infofetchers/lastfminfofetcher.cpp
++++ b/src/platform/infofetchers/lastfminfofetcher.cpp
+@@ -32,6 +32,8 @@
+ #include <QFile>
+ #include <QTextEdit>
+ 
++#include <unistd.h>
++
+ LastfmInfoFetcher::LastfmInfoFetcher(QObject *parent) :
+         InfoFetcher(parent)
+ {
+diff --git a/src/platform/infofetchers/tmdbinfofetcher.cpp b/src/platform/infofetchers/tmdbinfofetcher.cpp
+index 7801644..3c01960 100644
+--- a/src/platform/infofetchers/tmdbinfofetcher.cpp
++++ b/src/platform/infofetchers/tmdbinfofetcher.cpp
+@@ -30,6 +30,8 @@
+ #include <QDomDocument>
+ #include <QFile>
+ 
++#include <unistd.h>
++
+ TMDBInfoFetcher::TMDBInfoFetcher(QObject *parent) :
+         InfoFetcher(parent)
+ {
+diff --git a/src/platform/infofetchers/tvdbinfofetcher.cpp b/src/platform/infofetchers/tvdbinfofetcher.cpp
+index ff351b0..670ed18 100644
+--- a/src/platform/infofetchers/tvdbinfofetcher.cpp
++++ b/src/platform/infofetchers/tvdbinfofetcher.cpp
+@@ -30,6 +30,8 @@
+ #include <QDomDocument>
+ #include <QFile>
+ 
++#include <unistd.h>
++
+ TVDBInfoFetcher::TVDBInfoFetcher(QObject *parent) :
+         InfoFetcher(parent)
+ {
diff --git a/pkgs/applications/video/cc1394/default.nix b/pkgs/applications/video/cc1394/default.nix
index df131f0e4852..d555e1b7885a 100644
--- a/pkgs/applications/video/cc1394/default.nix
+++ b/pkgs/applications/video/cc1394/default.nix
@@ -33,5 +33,6 @@ stdenv.mkDerivation rec {
     license = "BSD";
     maintainers = [ stdenv.lib.maintainers.viric ];
     platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = []; # because libdc1394avt is broken
   };
 }
diff --git a/pkgs/applications/video/cinelerra/default.nix b/pkgs/applications/video/cinelerra/default.nix
index 98ba7a8e137e..8287cb9121ea 100644
--- a/pkgs/applications/video/cinelerra/default.nix
+++ b/pkgs/applications/video/cinelerra/default.nix
@@ -41,9 +41,9 @@ stdenv.mkDerivation {
     ];
 
   meta = { 
-    description = "Cinelerra - Video Editor";
+    description = "Video Editor";
     homepage = http://www.cinelerra.org;
     maintainers = [ stdenv.lib.maintainers.marcweber ];
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/video/coriander/default.nix b/pkgs/applications/video/coriander/default.nix
index f4be54ae23ec..e3c288534035 100644
--- a/pkgs/applications/video/coriander/default.nix
+++ b/pkgs/applications/video/coriander/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://damien.douxchamps.net/ieee1394/coriander/;
     description = "GUI for controlling a Digital Camera through the IEEE1394 bus";
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/applications/video/dvb-apps/default.nix b/pkgs/applications/video/dvb-apps/default.nix
index 74e3d58553a7..5e8e63564f4f 100644
--- a/pkgs/applications/video/dvb-apps/default.nix
+++ b/pkgs/applications/video/dvb-apps/default.nix
@@ -18,6 +18,6 @@ stdenv.mkDerivation {
     description = "Linux DVB API applications and utilities";
     homepage = http://linuxtv.org/;
     platforms = stdenv.lib.platforms.linux;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/video/dvswitch/default.nix b/pkgs/applications/video/dvswitch/default.nix
deleted file mode 100644
index 8803fe0a7868..000000000000
--- a/pkgs/applications/video/dvswitch/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchurl, alsaLib, boost, cmake, gtkmm, libXau, libXdmcp
-, libXv, libav, pixman, libpthreadstubs, pkgconfig 
-}:
-
-stdenv.mkDerivation rec {
-  name = "dvswitch-${version}";
-  version = "0.8.3.6";
-
-  src = fetchurl {
-    url = "https://alioth.debian.org/frs/download.php/3615/${name}.tar.gz";
-    sha256 = "7bd196389f9913ae08e12a29e168d79324c508bb545eab114df77b0375cd87f0";
-  };
-
-  buildInputs = [
-    alsaLib boost cmake gtkmm libXau libXdmcp libXv libav
-    libpthreadstubs pixman pkgconfig
-  ];
-
-  patchPhase = ''
-    sed -e "s@prefix /usr/local@prefix $out@" -i CMakeLists.txt
-  '';
-
-  meta =  with stdenv.lib; {
-    description = "interactive live video mixer for DV streams";
-    homepage = "http://dvswitch.alioth.debian.org";
-    license = licenses.gpl2Plus;
-    maintainers = [ maintainers.goibhniu ];
-  };
-}
diff --git a/pkgs/applications/video/gnash/default.nix b/pkgs/applications/video/gnash/default.nix
index 4f2addcc99b0..06122619066a 100644
--- a/pkgs/applications/video/gnash/default.nix
+++ b/pkgs/applications/video/gnash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ stdenv, fetchurl, fetchpatch
 , SDL, SDL_mixer, gstreamer, gst_plugins_base, gst_plugins_good
 , gst_ffmpeg, speex
 , libogg, libxml2, libjpeg, mesa, libpng, libungif, libtool
@@ -10,7 +10,13 @@
 
 assert stdenv ? glibc;
 
-let version = "0.8.10"; in
+let version = "0.8.10";
+    patch_CVE = fetchpatch {
+      url = "http://git.savannah.gnu.org/cgit/gnash.git/patch/?id=bb4dc77eecb6ed1b967e3ecbce3dac6c5e6f1527";
+      sha256 = "0ghnki5w7xf3qwfl1x6vhijpd6q608niyxrvh0g8dw5xavkvallk";
+      name = "CVE-2012-1175.patch";
+    };
+in
 
 stdenv.mkDerivation rec {
   name = "gnash-${version}";
@@ -21,6 +27,8 @@ stdenv.mkDerivation rec {
   };
 
   patchPhase = ''
+    patch -p1 < ${patch_CVE}
+
     # Add all libs to `macros/libslist', a list of library search paths.
     for lib in ${lib.concatStringsSep " "
                                       (map (lib: "\"${lib}\"/lib")
@@ -73,6 +81,8 @@ stdenv.mkDerivation rec {
        echo "\$GST_PLUGIN_PATH set to \`$GST_PLUGIN_PATH'"
     '';
 
+  postConfigure = "echo '#define nullptr NULL' >> gnashconfig.h";
+
   # Make sure `gtk-gnash' gets `libXext' in its `RPATH'.
   NIX_LDFLAGS="-lX11 -lXext";
 
@@ -87,9 +97,7 @@ stdenv.mkDerivation rec {
     # (e.g., gst-ffmpeg is needed to watch movies such as YouTube's).
     for prog in "$out/bin/"*
     do
-      wrapProgram "$prog" --prefix                                            \
-        GST_PLUGIN_PATH ":"                                                     \
-        "${gst_plugins_base}/lib/gstreamer-0.10:${gst_plugins_good}/lib/gstreamer-0.10:${gst_ffmpeg}/lib/gstreamer-0.10"
+      wrapProgram "$prog" --prefix GST_PLUGIN_SYSTEM_PATH ":" "$GST_PLUGIN_SYSTEM_PATH"
     done
   '';
 
@@ -106,7 +114,7 @@ stdenv.mkDerivation rec {
       supports most SWF v7 features and some SWF v8 and v9.
     '';
 
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
     platforms = stdenv.lib.platforms.gnu;
diff --git a/pkgs/applications/video/handbrake/default.nix b/pkgs/applications/video/handbrake/default.nix
new file mode 100644
index 000000000000..297da6738ee4
--- /dev/null
+++ b/pkgs/applications/video/handbrake/default.nix
@@ -0,0 +1,100 @@
+# Handbrake normally uses its own copies of the libraries it uses, for better
+# control over library patches.
+#
+# This derivation patches HB so it doesn't do that. The relevant patches
+# are added to the Nix packages and proposed upstream instead. In several cases
+# upstream already incorporated these patches.
+# This has the benefits of providing improvements to other packages,
+# making licenses more clear and reducing compile time/install size.
+#
+# For compliance, the unfree codec faac is optionally spliced out.
+#
+# Only tested on Linux
+#
+# TODO: package and use libappindicator
+
+{ stdenv, config, fetchurl,
+  python, pkgconfig, yasm,
+  autoconf, automake, libtool, m4,
+  libass, libsamplerate, fribidi, libxml2, bzip2,
+  libogg, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac,
+  lame, faac, ffmpeg, libdvdread, libdvdnav, libbluray,
+  mp4v2, mpeg2dec, x264, libmkv,
+  fontconfig, freetype,
+  glib, gtk, webkitgtk, intltool, libnotify,
+  gst_all_1, dbus_glib, udev,
+  useGtk ? true,
+  useWebKitGtk ? false # This prevents ghb from starting in my tests
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.9.9";
+  name = "handbrake-${version}";
+
+  # ToDo: doesn't work (yet)
+  allowUnfree = false; # config.allowUnfree or false;
+
+  buildInputsX = stdenv.lib.optionals useGtk [
+    glib gtk intltool libnotify
+    gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus_glib udev
+  ] ++ stdenv.lib.optionals useWebKitGtk [ webkitgtk ];
+
+  # Did not test compiling with it
+  unfreeInputs = stdenv.lib.optional allowUnfree faac;
+
+  nativeBuildInputs = [ python pkgconfig yasm autoconf automake libtool m4 ];
+  buildInputs = [
+    fribidi fontconfig freetype
+    libass libsamplerate libxml2 bzip2
+    libogg libtheora libvorbis libdvdcss a52dec libmkv fdk_aac
+    lame ffmpeg libdvdread libdvdnav libbluray mp4v2 mpeg2dec x264
+  ] ++ buildInputsX ++ unfreeInputs;
+
+
+  src = fetchurl {
+    name = "HandBrake-${version}.tar.bz2";
+    url = "http://handbrake.fr/rotation.php?file=HandBrake-${version}.tar.bz2";
+    sha256 = "1crmm1c32vx60jfl2bqzg59q4qqx6m83b08snp7h1njc21sdf7d7";
+  };
+
+  patches = stdenv.lib.optional (! allowUnfree) ./disable-unfree.patch;
+
+  preConfigure = ''
+    # Fake wget to prevent downloads
+    mkdir wget
+    echo "#!/bin/sh" > wget/wget
+    echo "echo ===== Not fetching \$*" >> wget/wget
+    echo "exit 1" >> wget/wget
+    chmod +x wget/wget
+    export PATH=$PATH:$PWD/wget
+
+    # Force using nixpkgs dependencies
+    sed -i '/MODULES += contrib/d' make/include/main.defs
+    sed -i '/PKG_CONFIG_PATH=/d' gtk/module.rules
+
+    # disable faac if non-free
+    if [ -z "$allowUnfree" ]; then
+      rm libhb/encfaac.c
+    fi
+  '';
+
+  configureFlags = "--enable-fdk-aac ${if useGtk then "--disable-gtk-update-checks" else "--disable-gtk"}";
+
+  preBuild = ''
+    cd build
+  '';
+
+  meta = {
+    homepage = http://handbrake.fr/;
+    description = "A tool for ripping DVDs into video files";
+    longDescription = ''
+      Handbrake is a versatile transcoding DVD ripper. This package
+      provides the cli HandbrakeCLI and the GTK+ version ghb.
+      The faac library is disabled if you're compiling free-only.
+    '';
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.wmertens ];
+    # Not tested on anything else
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/video/handbrake/disable-unfree.patch b/pkgs/applications/video/handbrake/disable-unfree.patch
new file mode 100644
index 000000000000..30edcb81c099
--- /dev/null
+++ b/pkgs/applications/video/handbrake/disable-unfree.patch
@@ -0,0 +1,101 @@
+diff -ru HandBrake-0.9.9-orig/gtk/configure.ac HandBrake-0.9.9/gtk/configure.ac
+--- HandBrake-0.9.9-orig/gtk/configure.ac	2014-05-02 22:50:00.047305795 +0200
++++ HandBrake-0.9.9/gtk/configure.ac	2014-05-02 22:48:57.119304020 +0200
+@@ -203,7 +203,7 @@
+     ;;
+ esac
+ 
+-HB_LIBS="-lhb -la52 -lmkv -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lfaac -lmp3lame -lmpeg2 -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lmp4v2 -lswscale -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2"
++HB_LIBS="-lhb -la52 -lmkv -lavresample -lavformat -lavcodec -lavutil -ldvdnav -ldvdread -lmp3lame -lmpeg2 -lvorbis -lvorbisenc -logg -lsamplerate -lx264 -lmp4v2 -lswscale -ltheoraenc -ltheoradec -lz -lbz2 -lpthread -lbluray -lass -lfontconfig -lfreetype -lxml2"
+ 
+ if test "x$use_fdk_aac" = "xyes" ; then
+     HB_LIBS+=" -lfdk-aac"
+diff -ru HandBrake-0.9.9-orig/gtk/src/preset_xlat.c HandBrake-0.9.9/gtk/src/preset_xlat.c
+--- HandBrake-0.9.9-orig/gtk/src/preset_xlat.c	2014-05-02 22:50:00.043305794 +0200
++++ HandBrake-0.9.9/gtk/src/preset_xlat.c	2014-05-02 22:42:20.987292846 +0200
+@@ -260,7 +260,6 @@
+ 
+ static value_map_t acodec_xlat[] =
+ {
+-    {"AAC (faac)", "faac"},
+     {"AC3 Passthru", "ac3"},
+     {"MP3 (lame)", "lame"},
+     {"Vorbis (vorbis)", "vorbis"},
+diff -ru HandBrake-0.9.9-orig/gtk/src/presets.c HandBrake-0.9.9/gtk/src/presets.c
+--- HandBrake-0.9.9-orig/gtk/src/presets.c	2014-05-02 22:50:00.043305794 +0200
++++ HandBrake-0.9.9/gtk/src/presets.c	2014-05-02 22:42:41.283293419 +0200
+@@ -2029,8 +2029,6 @@
+ 
+ static value_map_t acodec_xlat_compat[] =
+ {
+-    {"AAC (CoreAudio)", "faac"},
+-    {"HE-AAC (CoreAudio)", "faac"},
+     {"AC3 (ffmpeg)", "ac3"},
+     {"AC3", "ac3"},
+     {"MP3 Passthru", "mp3pass"},
+diff -ru HandBrake-0.9.9-orig/libhb/common.c HandBrake-0.9.9/libhb/common.c
+--- HandBrake-0.9.9-orig/libhb/common.c	2014-05-02 22:50:00.047305795 +0200
++++ HandBrake-0.9.9/libhb/common.c	2014-05-02 22:37:24.679284489 +0200
+@@ -126,7 +126,6 @@
+     { "AAC (CoreAudio)",    "ca_aac",     HB_ACODEC_CA_AAC,       HB_MUX_MP4|HB_MUX_MKV },
+     { "HE-AAC (CoreAudio)", "ca_haac",    HB_ACODEC_CA_HAAC,      HB_MUX_MP4|HB_MUX_MKV },
+ #endif
+-    { "AAC (faac)",         "faac",       HB_ACODEC_FAAC,         HB_MUX_MP4|HB_MUX_MKV },
+ #ifdef USE_FDK_AAC
+     { "AAC (FDK)",          "fdk_aac",    HB_ACODEC_FDK_AAC,      HB_MUX_MP4|HB_MUX_MKV },
+     { "HE-AAC (FDK)",       "fdk_haac",   HB_ACODEC_FDK_HAAC,     HB_MUX_MP4|HB_MUX_MKV },
+diff -ru HandBrake-0.9.9-orig/libhb/common.h HandBrake-0.9.9/libhb/common.h
+--- HandBrake-0.9.9-orig/libhb/common.h	2014-05-02 22:50:00.047305795 +0200
++++ HandBrake-0.9.9/libhb/common.h	2014-05-02 22:39:37.839288245 +0200
+@@ -945,7 +945,6 @@
+ extern hb_work_object_t hb_decavcodeca;
+ extern hb_work_object_t hb_decavcodecv;
+ extern hb_work_object_t hb_declpcm;
+-extern hb_work_object_t hb_encfaac;
+ extern hb_work_object_t hb_enclame;
+ extern hb_work_object_t hb_encvorbis;
+ extern hb_work_object_t hb_muxer;
+diff -ru HandBrake-0.9.9-orig/libhb/hb.c HandBrake-0.9.9/libhb/hb.c
+--- HandBrake-0.9.9-orig/libhb/hb.c	2014-05-02 22:50:00.047305795 +0200
++++ HandBrake-0.9.9/libhb/hb.c	2014-05-02 22:39:02.287287242 +0200
+@@ -487,7 +487,6 @@
+ 	hb_register( &hb_decavcodeca );
+ 	hb_register( &hb_decavcodecv );
+ 	hb_register( &hb_declpcm );
+-	hb_register( &hb_encfaac );
+ 	hb_register( &hb_enclame );
+ 	hb_register( &hb_encvorbis );
+ 	hb_register( &hb_muxer );
+@@ -588,7 +587,6 @@
+ 	hb_register( &hb_decavcodeca );
+ 	hb_register( &hb_decavcodecv );
+ 	hb_register( &hb_declpcm );
+-	hb_register( &hb_encfaac );
+ 	hb_register( &hb_enclame );
+ 	hb_register( &hb_encvorbis );
+ 	hb_register( &hb_muxer );
+diff -ru HandBrake-0.9.9-orig/libhb/module.defs HandBrake-0.9.9/libhb/module.defs
+--- HandBrake-0.9.9-orig/libhb/module.defs	2014-05-02 22:50:00.047305795 +0200
++++ HandBrake-0.9.9/libhb/module.defs	2014-05-02 22:39:25.727287903 +0200
+@@ -95,7 +95,7 @@
+ LIBHB.lib = $(LIBHB.build/)hb.lib
+ 
+ LIBHB.dll.libs = $(foreach n, \
+-        a52 ass avcodec avformat avutil avresample dvdnav dvdread faac \
++        a52 ass avcodec avformat avutil avresample dvdnav dvdread \
+         fontconfig freetype mkv mpeg2 mp3lame mp4v2 \
+         ogg samplerate swscale theora vorbis vorbisenc x264 xml2 bluray, \
+         $(CONTRIB.build/)lib/lib$(n).a )
+Only in HandBrake-0.9.9: libhb-orig
+diff -ru HandBrake-0.9.9orig/test/module.defs HandBrake-0.9.9/test/module.defs
+--- HandBrake-0.9.9-orig/test/module.defs	2014-05-02 23:15:10.575348401 +0200
++++ HandBrake-0.9.9/test/module.defs	2014-05-02 23:17:00.523351502 +0200
+@@ -14,7 +14,7 @@
+ TEST.libs = $(LIBHB.a)
+ 
+ TEST.GCC.l = \
+-        a52 ass avcodec avformat avutil avresample dvdnav dvdread faac \
++        a52 ass avcodec avformat avutil avresample dvdnav dvdread \
+         fontconfig freetype fribidi mkv mpeg2 mp3lame mp4v2 ogg \
+         samplerate swscale theoraenc theoradec vorbis vorbisenc x264 \
+         bluray xml2 bz2 z
diff --git a/pkgs/applications/video/kazam/bug_1190693.patch b/pkgs/applications/video/kazam/bug_1190693.patch
new file mode 100644
index 000000000000..9f00c6b60791
--- /dev/null
+++ b/pkgs/applications/video/kazam/bug_1190693.patch
@@ -0,0 +1,14 @@
+=== modified file 'kazam/frontend/indicator.py'
+--- a/kazam/frontend/indicator.py	2013-01-26 01:53:53 +0000
++++ b/kazam/frontend/indicator.py	2013-06-13 18:18:37 +0000
+@@ -291,3 +291,9 @@
+         def start_recording(self):
+             logger.debug("Recording started.")
+             self.indicator.set_from_icon_name("kazam-recording")
++
++        def hide_it(self):
++            self.indicator.set_visible(False)
++
++        def show_it(self):
++            self.indicator.set_visible(True)
+
diff --git a/pkgs/applications/video/kazam/datadir.patch b/pkgs/applications/video/kazam/datadir.patch
new file mode 100644
index 000000000000..114d4228be2d
--- /dev/null
+++ b/pkgs/applications/video/kazam/datadir.patch
@@ -0,0 +1,11 @@
+--- a/bin/kazam       2014-02-03 23:11:38.465614061 +0100
++++ b/bin/kazam-1     2014-02-03 23:12:28.447058700 +0100
+@@ -68,7 +68,7 @@
+         # when base install path is not /usr
+         curpath = os.path.abspath(__file__)
+         curpath = os.path.realpath(curpath)
+-        datadir = curpath.split('bin/')[0] + "share/kazam/"
++        datadir = os.path.realpath(os.path.join(curpath, "./../../", "share/kazam/"))
+ 
+     try:
+         import platform
diff --git a/pkgs/applications/video/kazam/default.nix b/pkgs/applications/video/kazam/default.nix
new file mode 100644
index 000000000000..17bf282a459a
--- /dev/null
+++ b/pkgs/applications/video/kazam/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, python3Packages, gst_all_1, makeWrapper, gobjectIntrospection
+, gtk3, libwnck3, keybinder, intltool, libcanberra }:
+
+
+python3Packages.buildPythonPackage rec {
+  name = "kazam-${version}";
+  version = "1.4.3";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "https://launchpad.net/kazam/stable/${version}/+download/kazam-${version}.tar.gz";
+    sha256 = "00bcn0yj9xrv87sf6xd3wpilsjgjpsj15zzpjh351ffpjnr0ica8";
+  };
+
+  # TODO: keybinder, appindicator3
+  buildInputs = with python3Packages;
+    [ pygobject3 pyxdg pycairo gst_all_1.gstreamer gst_all_1.gst-plugins-base
+      gst_all_1.gst-plugins-good gobjectIntrospection gtk3 libwnck3 distutils_extra
+      intltool dbus ];
+
+  # TODO: figure out why PYTHONPATH is not passed automatically for those programs
+  pythonPath = with python3Packages;
+    [ pygobject3 pyxdg pycairo dbus ];
+
+  patches = [ ./datadir.patch ./bug_1190693.patch ];
+  prePatch = ''
+    rm setup.cfg
+    substituteInPlace kazam/backend/grabber.py --replace "/usr/bin/canberra-gtk-play" "${libcanberra}/bin/canberra-gtk-play"
+  '';
+
+  # no tests
+  doCheck = false;
+
+  preFixup = ''
+    wrapProgram $out/bin/kazam \
+      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
+      --prefix LD_LIBRARY_PATH ":" "${gtk3}/lib:${gst_all_1.gstreamer}/lib:${keybinder}/lib" \
+      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" \
+      --prefix XDG_DATA_DIRS : "${gtk3}/share" \
+      --set GST_REGISTRY "/tmp/kazam.gstreamer.registry";
+  '';
+
+
+  meta = with stdenv.lib; {
+    description = "Cross-platform, Friend-2-Friend and secure decentralised communication platform";
+    homepage = https://code.launchpad.net/kazam;
+    #license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.iElectric ];
+  };
+}
diff --git a/pkgs/applications/video/kdenlive/default.nix b/pkgs/applications/video/kdenlive/default.nix
index d7fab74e6cac..8c51c4f35a3b 100644
--- a/pkgs/applications/video/kdenlive/default.nix
+++ b/pkgs/applications/video/kdenlive/default.nix
@@ -1,28 +1,36 @@
-{ stdenv, fetchurl, lib, cmake, qt4, perl, kdelibs, automoc4, phonon
-, mlt, gettext , qimageblitz, qjson, shared_mime_info, soprano
-, pkgconfig, shared_desktop_ontologies, libv4l }:
+{ stdenv, fetchurl, frei0r, lib, cmake, qt4, perl, kdelibs, automoc4
+, phonon , makeWrapper, mlt, gettext , qimageblitz, qjson
+, shared_mime_info, soprano, pkgconfig, shared_desktop_ontologies
+, libv4l
+}:
 
 stdenv.mkDerivation rec {
   name = "kdenlive-${version}";
-  version = "0.9.6";
+  version = "0.9.8";
 
   src = fetchurl {
     url = "mirror://kde/stable/kdenlive/${version}/src/${name}.tar.bz2";
-    sha256 = "1rw2cbzy5mabwijvryyzbhpgldn2zy5jy4j87hl4m1i8ah9lgi7x";
+    sha256 = "17x5srgywcwlbpbs598jwwc62l8313n4dbqx3sdk7p6lyvwk3jln";
   };
 
-  buildInputs =
-    [ cmake qt4 perl kdelibs automoc4 phonon mlt gettext qimageblitz
-      qjson shared_mime_info soprano pkgconfig shared_desktop_ontologies libv4l
-    ];
+  buildInputs = [
+    automoc4 cmake frei0r gettext kdelibs libv4l makeWrapper mlt perl
+    phonon pkgconfig qimageblitz qjson qt4 shared_desktop_ontologies
+    shared_mime_info soprano
+  ];
 
   enableParallelBuilding = true;
 
+  postInstall = ''
+    wrapProgram $out/bin/kdenlive --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
+    wrapProgram $out/bin/kdenlive_render  --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
+  '';
+
   meta = {
     description = "Free and open source video editor";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     homepage = http://www.kdenlive.org/;
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [ goibhniu viric ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/video/key-mon/default.nix b/pkgs/applications/video/key-mon/default.nix
index 7d0256ae455d..cb00ac813842 100644
--- a/pkgs/applications/video/key-mon/default.nix
+++ b/pkgs/applications/video/key-mon/default.nix
@@ -3,12 +3,12 @@
 
 buildPythonPackage rec {
   name = "key-mon-${version}";
-  version = "1.13";
+  version = "1.16";
   namePrefix = "";
 
   src = fetchurl {
     url = "http://key-mon.googlecode.com/files/${name}.tar.gz";
-    sha256 = "02h7lcnyqwyqsycd1vlvl11ms81v0zmr9p0pfyl5gmzry9dj7imj";
+    sha256 = "1pfki1fyh3q29sj6kq1chhi1h2v9ki6sp09qyww59rjraypvzsis";
   };
 
   propagatedBuildInputs =
diff --git a/pkgs/applications/video/kino/default.nix b/pkgs/applications/video/kino/default.nix
index 30e0bdfb197a..16bd57bef34a 100644
--- a/pkgs/applications/video/kino/default.nix
+++ b/pkgs/applications/video/kino/default.nix
@@ -87,6 +87,6 @@ stdenv.mkDerivation {
   meta = { 
       description = "Kino is a non-linear DV editor for GNU/Linux";
       homepage = http://www.kinodv.org/;
-      license = "GPL2";
+      license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/video/lxdvdrip/default.nix b/pkgs/applications/video/lxdvdrip/default.nix
index 9323a1cbd32a..6e7b874841fc 100644
--- a/pkgs/applications/video/lxdvdrip/default.nix
+++ b/pkgs/applications/video/lxdvdrip/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, libdvdread }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "lxdvdrip-1.76";
 
   src = fetchurl {
-    url = http://download.berlios.de/lxdvdrip/lxdvdrip-1.76.tgz;
+    url = "mirror://sourceforge/lxdvdrip/${name}.tgz";
     sha256 = "0vgslc7dapfrbgslnaicc8bggdccyrvcgjv1dwi19qswhh7jkzj6";
   };
 
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
 
   meta = { 
     description = "Command line tool to make a copy from a video DVD for private use";
-    homepage = http://lxdvdrip.berlios.de/;
-    license = "GPLv2";
+    homepage = http://sourceforge.net/projects/lxdvdrip;
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/video/makemkv/builder.sh b/pkgs/applications/video/makemkv/builder.sh
index 0e1898a45564..e4cfcf3d9068 100644
--- a/pkgs/applications/video/makemkv/builder.sh
+++ b/pkgs/applications/video/makemkv/builder.sh
@@ -30,9 +30,9 @@ for i in ${bin} ; do
     ${i}
 done 
 
-ensureDir $out/bin
-ensureDir $out/lib
-ensureDir $out/share/MakeMKV
+mkdir -p $out/bin
+mkdir -p $out/lib
+mkdir -p $out/share/MakeMKV
 cp ${lib} ${out}/lib
 cp ${bin} ${out}/bin
 cp makemkv-bin-${ver}/src/share/* $out/share/MakeMKV
diff --git a/pkgs/applications/video/makemkv/default.nix b/pkgs/applications/video/makemkv/default.nix
index 43482bd97624..bec9d85aefd8 100644
--- a/pkgs/applications/video/makemkv/default.nix
+++ b/pkgs/applications/video/makemkv/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
       can always download the latest version from makemkv.com that will reset the
       expiration date.
     '';
-    license = "unfree";
+    license = stdenv.lib.licenses.unfree;
     homepage = http://makemkv.com;
   };
 }
diff --git a/pkgs/applications/video/miro/default.nix b/pkgs/applications/video/miro/default.nix
index 5ca6c80dc7c1..7572bedc1e05 100644
--- a/pkgs/applications/video/miro/default.nix
+++ b/pkgs/applications/video/miro/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, python, buildPythonPackage, pythonPackages, pkgconfig
-, pyrex096, ffmpeg, boost, glib, pygobject, gtk2, webkit_gtk2, libsoup, pygtk
+, pyrex096, ffmpeg, boost, glib, pygobject, gtk2, webkitgtk2, libsoup, pygtk
 , taglib, pysqlite, pycurl, mutagen, pycairo, pythonDBus, pywebkitgtk
-, libtorrentRasterbar
+, libtorrentRasterbar, glib_networking, gsettings_desktop_schemas
 , gst_python, gst_plugins_base, gst_plugins_good, gst_ffmpeg
 }:
 
@@ -22,8 +22,7 @@ buildPythonPackage rec {
   patches = [ ./gconf.patch ];
 
   postPatch = ''
-    sed -i -e '2i import os; os.environ["GST_PLUGIN_PATH"] = \\\
-      '"'$GST_PLUGIN_PATH'" miro.real
+    patch -p1 -d .. < "${./youtube-feeds.patch}"
 
     sed -i -e 's/\$(shell which python)/python/' Makefile
     sed -i -e 's|/usr/bin/||' -e 's|/usr||' \
@@ -40,10 +39,6 @@ buildPythonPackage rec {
            plat/resources.py
   '';
 
-  installCommand = ''
-    python setup.py install --prefix= --root="$out"
-  '';
-
   # Disabled for now, because it requires networking and even if we skip those
   # tests, the whole test run takes around 10-20 minutes.
   doCheck = false;
@@ -51,13 +46,23 @@ buildPythonPackage rec {
     HOME="$TEMPDIR" LANG=en_US.UTF-8 python miro.real --unittest
   '';
 
+  preInstall = ''
+    # see https://bitbucket.org/pypa/setuptools/issue/130/install_data-doesnt-respect-prefix
+    ${python}/bin/${python.executable} setup.py install_data --root=$out
+    sed -i '/data_files=data_files/d' setup.py
+  '';
+
   postInstall = ''
     mv "$out/bin/miro.real" "$out/bin/miro"
+    wrapProgram "$out/bin/miro" \
+      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" \
+      --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
   '';
 
   buildInputs = [
-    pkgconfig pyrex096 ffmpeg boost glib pygobject gtk2 webkit_gtk2 libsoup
-    pygtk taglib
+    pkgconfig pyrex096 ffmpeg boost glib pygobject gtk2 webkitgtk2 libsoup
+    pygtk taglib gsettings_desktop_schemas
   ];
 
   propagatedBuildInputs = [
diff --git a/pkgs/applications/video/miro/youtube-feeds.patch b/pkgs/applications/video/miro/youtube-feeds.patch
new file mode 100644
index 000000000000..1527fa6a5b62
--- /dev/null
+++ b/pkgs/applications/video/miro/youtube-feeds.patch
@@ -0,0 +1,15 @@
+diff --git a/lib/flashscraper.py b/lib/flashscraper.py
+index 323dbe4..d203b78 100644
+--- a/lib/flashscraper.py
++++ b/lib/flashscraper.py
+@@ -134,9 +134,7 @@ def _youtube_callback_step2(info, video_id, callback):
+         # strip url= from url=xxxxxx, strip trailer.  Strip duplicate params.
+         for fmt, stream_map_data in zip(fmt_list, stream_map):
+             stream_map = cgi.parse_qs(stream_map_data)
+-            url_base = stream_map['url'][0]
+-            sig_part = '&signature=' + stream_map['sig'][0]
+-            fmt_url_map[fmt] = url_base + sig_part
++            fmt_url_map[fmt] = stream_map['url'][0]
+ 
+         title = params.get("title", ["No title"])[0]
+         try:
diff --git a/pkgs/applications/video/mkvtoolnix/default.nix b/pkgs/applications/video/mkvtoolnix/default.nix
index 7d2eb514c94b..ed64448c13a8 100644
--- a/pkgs/applications/video/mkvtoolnix/default.nix
+++ b/pkgs/applications/video/mkvtoolnix/default.nix
@@ -15,11 +15,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "mkvtoolnix-6.2.0";
+  name = "mkvtoolnix-6.5.0";
 
   src = fetchurl {
     url = "http://www.bunkus.org/videotools/mkvtoolnix/sources/${name}.tar.xz";
-    sha256 = "0864vmdcnfwk5cb2fv1y60yvp9kqcyaqxwbvy4nsj7bzwv1iqysn";
+    sha256 = "0a3h878bsjbpb2r7b528xzyqzl8r82yhrniry9bnhmw7rcl53bd8";
   };
 
   buildInputs = [ libmatroska flac libvorbis file boost 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 6d8780d6cf48..07bcb26569e9 100644
--- a/pkgs/applications/video/mplayer/default.nix
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, pkgconfig, freetype, yasm
 , fontconfigSupport ? true, fontconfig ? null, freefont_ttf ? null
+, fribidiSupport ? true, fribidi ? null
 , x11Support ? true, libX11 ? null, libXext ? null, mesa ? null
 , xineramaSupport ? true, libXinerama ? null
 , xvSupport ? true, libXv ? null
@@ -15,7 +16,7 @@
 , speexSupport ? true, speex ? null
 , theoraSupport ? true, libtheora ? null
 , x264Support ? false, x264 ? null
-, jackaudioSupport ? false, jackaudio ? null
+, jackaudioSupport ? false, jack2 ? null
 , pulseSupport ? false, pulseaudio ? null
 , bs2bSupport ? false, libbs2b ? null
 # For screenshots
@@ -25,6 +26,7 @@
 
 assert fontconfigSupport -> (fontconfig != null);
 assert (!fontconfigSupport) -> (freefont_ttf != null);
+assert fribidiSupport -> (fribidi != null);
 assert x11Support -> (libX11 != null && libXext != null && mesa != null);
 assert xineramaSupport -> (libXinerama != null && x11Support);
 assert xvSupport -> (libXv != null && x11Support);
@@ -40,7 +42,7 @@ assert lameSupport -> lame != null;
 assert speexSupport -> speex != null;
 assert theoraSupport -> libtheora != null;
 assert x264Support -> x264 != null;
-assert jackaudioSupport -> jackaudio != null;
+assert jackaudioSupport -> jack2 != null;
 assert pulseSupport -> pulseaudio != null;
 assert bs2bSupport -> libbs2b != null;
 assert libpngSupport -> libpng != null;
@@ -72,13 +74,13 @@ let
       cp -prv * $out
     '';
 
-    meta.license = "unfree";
+    meta.license = stdenv.lib.licenses.unfree;
   } else null;
 
 in
 
 stdenv.mkDerivation rec {
-  name = "mplayer-1.1";
+  name = "mplayer-1.1.1";
 
   src = fetchurl {
     # Old kind of URL:
@@ -89,8 +91,8 @@ stdenv.mkDerivation rec {
     #url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
     #sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
 
-    url = "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.xz";
-    sha256 = "173cmsfz7ckzy1hay9mpnc5as51127cfnxl20b521d2jvgm4gjvn";
+    url = "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.1.tar.xz";
+    sha256 = "ce8fc7c3179e6a57eb3a58cb7d1604388756b8a61764cc93e095e7aff3798c76";
   };
 
   prePatch = ''
@@ -100,6 +102,7 @@ stdenv.mkDerivation rec {
   buildInputs = with stdenv.lib;
     [ pkgconfig freetype ]
     ++ optional fontconfigSupport fontconfig
+    ++ optional fribidiSupport fribidi
     ++ optionals x11Support [ libX11 libXext mesa ]
     ++ optional alsaSupport alsaLib
     ++ optional xvSupport libXv
@@ -109,7 +112,7 @@ stdenv.mkDerivation rec {
     ++ optional dvdnavSupport libdvdnav
     ++ optional bluraySupport libbluray
     ++ optional cddaSupport cdparanoia
-    ++ optional jackaudioSupport jackaudio
+    ++ optional jackaudioSupport jack2
     ++ optionals amrSupport [ amrnb amrwb ]
     ++ optional x264Support x264
     ++ optional pulseSupport pulseaudio
@@ -150,6 +153,7 @@ stdenv.mkDerivation rec {
       ${if pulseSupport then "--enable-pulse" else "--disable-pulse"}
       ${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"}
       ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"}
+      ${optionalString fribidiSupport "--enable-fribidi"}
       --disable-xanim
       --disable-ivtv
       --disable-xvid --disable-xvid-lavc
@@ -160,6 +164,7 @@ stdenv.mkDerivation rec {
 
   NIX_LDFLAGS = with stdenv.lib;
        optional  fontconfigSupport "-lfontconfig"
+    ++ optional  fribidiSupport "-lfribidi"
     ++ optionals x11Support [ "-lX11" "-lXext" ]
     ;
 
diff --git a/pkgs/applications/video/mplayer2/default.nix b/pkgs/applications/video/mplayer2/default.nix
index 24f53884e39c..d8ada6372b10 100644
--- a/pkgs/applications/video/mplayer2/default.nix
+++ b/pkgs/applications/video/mplayer2/default.nix
@@ -10,7 +10,7 @@
 , bluraySupport ? true, libbluray ? null
 , speexSupport ? true, speex ? null
 , theoraSupport ? true, libtheora ? null
-, jackaudioSupport ? false, jackaudio ? null
+, jackaudioSupport ? false, jack2 ? null
 , pulseSupport ? true, pulseaudio ? null
 , bs2bSupport ? false, libbs2b ? null
 # For screenshots
@@ -28,7 +28,7 @@ assert dvdnavSupport -> libdvdnav != null;
 assert bluraySupport -> libbluray != null;
 assert speexSupport -> speex != null;
 assert theoraSupport -> libtheora != null;
-assert jackaudioSupport -> jackaudio != null;
+assert jackaudioSupport -> jack2 != null;
 assert pulseSupport -> pulseaudio != null;
 assert bs2bSupport -> libbs2b != null;
 assert libpngSupport -> libpng != null;
@@ -60,18 +60,18 @@ let
       cp -prv * $out
     '';
 
-    meta.license = "unfree";
+    meta.license = stdenv.lib.licenses.unfree;
   } else null;
 
 in
 
 stdenv.mkDerivation rec {
-  name = "mplayer2-20130130";
+  name = "mplayer2-20130428";
 
   src = fetchgit {
     url = "git://git.mplayer2.org/mplayer2.git";
-    rev = "d3c580156c0b8777ff082426ebd61bb7ffe0c225";
-    sha256 = "1akf2mb2zklz609ks555vjvcs1gw8nwg5kbb9jwra8c4v1dfyhys";
+    rev = "6c87a981baa4972fd71c25dfddea017b5a972e89";
+    sha256 = "b09c1331141dd0939dfa424ae14dc0bdf82c8a72bb32c78e3ad15e3ee1d2c851";
   };
 
   prePatch = ''
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
     ++ optional xineramaSupport libXinerama
     ++ optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
     ++ optional bluraySupport libbluray
-    ++ optional jackaudioSupport jackaudio
+    ++ optional jackaudioSupport jack2
     ++ optional pulseSupport pulseaudio
     ++ optional screenSaverSupport libXScrnSaver
     ++ optional vdpauSupport libvdpau
@@ -130,7 +130,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A movie player that supports many video formats (MPlayer fork)";
     homepage = "http://mplayer2.org";
-    license = "GPLv3+";
+    license = stdenv.lib.licenses.gpl3Plus;
     maintainers = [ stdenv.lib.maintainers.viric ];
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
new file mode 100644
index 000000000000..4eec9afdbf3d
--- /dev/null
+++ b/pkgs/applications/video/mpv/default.nix
@@ -0,0 +1,132 @@
+{ stdenv, fetchurl, fetchgit, freetype, pkgconfig, freefont_ttf, ffmpeg, libass
+, lua, perl, libpthreadstubs
+, lua5_sockets
+, python3, docutils, which
+, x11Support ? true, libX11 ? null, libXext ? null, mesa ? null, libXxf86vm ? null
+, xineramaSupport ? true, libXinerama ? null
+, xvSupport ? true, libXv ? null
+, sdl2Support? true, SDL2 ? null
+, alsaSupport ? true, alsaLib ? null
+, screenSaverSupport ? true, libXScrnSaver ? null
+, vdpauSupport ? true, libvdpau ? null
+, dvdreadSupport? true, libdvdread ? null
+, dvdnavSupport ? true, libdvdnav ? null
+, bluraySupport ? true, libbluray ? null
+, speexSupport ? true, speex ? null
+, theoraSupport ? true, libtheora ? null
+, jackaudioSupport ? true, jack2 ? null
+, pulseSupport ? true, pulseaudio ? null
+, bs2bSupport ? false, libbs2b ? null
+# For screenshots
+, libpngSupport ? true, libpng ? null
+# for Youtube support
+, quviSupport? false, libquvi ? null
+, cacaSupport? false, libcaca ? null
+}:
+
+assert x11Support -> (libX11 != null && libXext != null && mesa != null && libXxf86vm != null);
+assert xineramaSupport -> (libXinerama != null && x11Support);
+assert xvSupport -> (libXv != null && x11Support);
+assert sdl2Support -> SDL2 != null;
+assert alsaSupport -> alsaLib != null;
+assert screenSaverSupport -> libXScrnSaver != null;
+assert vdpauSupport -> libvdpau != null;
+assert dvdreadSupport -> libdvdread != null;
+assert dvdnavSupport -> libdvdnav != null;
+assert bluraySupport -> libbluray != null;
+assert speexSupport -> speex != null;
+assert theoraSupport -> libtheora != null;
+assert jackaudioSupport -> jack2 != null;
+assert pulseSupport -> pulseaudio != null;
+assert bs2bSupport -> libbs2b != null;
+assert libpngSupport -> libpng != null;
+assert quviSupport -> libquvi != null;
+assert cacaSupport -> libcaca != null;
+
+# Purity problem: Waf needed to be is downloaded by bootstrap.py
+# but by purity reasons it should be avoided; thanks the-kenny to point it out!
+# Now, it will just download and package Waf, mimetizing bootstrap.py behaviour
+
+let
+  waf = fetchurl {
+    url = https://waf.googlecode.com/files/waf-1.7.15;
+    sha256 = "e5ae7028f9b2d8ce1acb9fe1092e8010a90ba764d3ac065ea4e846743290b1d6";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  name = "mpv-${version}";
+  version = "0.4.1";
+
+  src = fetchurl {
+    url = "https://github.com/mpv-player/mpv/archive/v${version}.tar.gz";
+    sha256 = "0wqjyzw3kk854zj263k7jyykzfaz1g27z50aqrd26hylg8k135cn";
+  };
+
+  buildInputs = with stdenv.lib;
+    [ waf freetype pkgconfig ffmpeg libass docutils which libpthreadstubs lua5_sockets ]
+    ++ optionals x11Support [ libX11 libXext mesa libXxf86vm ]
+    ++ optional alsaSupport alsaLib
+    ++ optional xvSupport libXv
+    ++ optional theoraSupport libtheora
+    ++ optional xineramaSupport libXinerama
+    ++ optional dvdreadSupport libdvdread
+    ++ optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
+    ++ optional bluraySupport libbluray
+    ++ optional jackaudioSupport jack2
+    ++ optional pulseSupport pulseaudio
+    ++ optional screenSaverSupport libXScrnSaver
+    ++ optional vdpauSupport libvdpau
+    ++ optional speexSupport speex
+    ++ optional bs2bSupport libbs2b
+    ++ optional libpngSupport libpng
+    ++ optional quviSupport libquvi
+    ++ optional sdl2Support SDL2
+    ++ optional cacaSupport libcaca
+    ;
+
+  nativeBuildInputs = [ python3 lua perl ];
+
+
+# There are almost no need of "configure flags", but some libraries
+# weren't detected; see the TODO comments below
+
+  NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
+
+  enableParallelBuilding = true;
+
+  configurePhase = ''
+    python3 ${waf} configure --prefix=$out
+    patchShebangs TOOLS
+  '';
+
+  buildPhase = ''
+    python3 ${waf} build
+  '';
+
+  installPhase = ''
+    python3 ${waf} install
+    # Maybe not needed, but it doesn't hurt anyway: a standard font
+    mkdir -p $out/share/mpv
+    ln -s ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mpv/subfont.ttf
+    '';
+
+  meta = {
+    description = "A movie player that supports many video formats (MPlayer and mplayer2 fork)";
+    longDescription = ''
+    mpv is a free and open-source general-purpose video player, based on the MPlayer and mplayer2 projects, with great improvements above both.
+    '';
+    homepage = "http://mpv.io";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.AndersonTorres ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
+# Heavily based on mplayer2 expression
+
+# TODO: Wayland support
+# TODO: investigate libquvi support
+# TODO: investigate caca support
+# TODO: investigate lua5_sockets bug
diff --git a/pkgs/applications/video/ogmtools/default.nix b/pkgs/applications/video/ogmtools/default.nix
index 11a16e3a79d2..82077e4d3ddd 100644
--- a/pkgs/applications/video/ogmtools/default.nix
+++ b/pkgs/applications/video/ogmtools/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
       tool for extracting chapter information from DVD.
     '';
     homepage = http://www.bunkus.org/videotools/ogmtools/;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/video/omxplayer/default.nix b/pkgs/applications/video/omxplayer/default.nix
index b3880067cac4..3add2646ad9e 100644
--- a/pkgs/applications/video/omxplayer/default.nix
+++ b/pkgs/applications/video/omxplayer/default.nix
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
     export INCLUDES="-I${raspberrypifw}/include/interface/vcos/pthreads -I${raspberrypifw}/include/interface/vmcs_host/linux/"
   '';
   installPhase = ''
-    ensureDir $out/bin
+    mkdir -p $out/bin
     cp omxplayer.bin $out/bin
   '';
   buildInputs = [ raspberrypifw ffmpeg pcre boostHeaders freetype zlib ];
@@ -79,6 +79,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = https://github.com/huceke/omxplayer;
     description = "Commandline OMX player for the Raspberry Pi";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/video/pitivi/default.nix b/pkgs/applications/video/pitivi/default.nix
new file mode 100644
index 000000000000..7f53aa07db60
--- /dev/null
+++ b/pkgs/applications/video/pitivi/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, pkgconfig, intltool, itstool, makeWrapper
+, pythonPackages, gst, clutter-gst, clutter-gtk
+, gobjectIntrospection, clutter, gtk3, librsvg
+, gnome_icon_theme, gnome_icon_theme_symbolic, gnome3
+}:
+
+let
+  version = "0.93";
+in stdenv.mkDerivation rec {
+  name = "pitivi-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/pitivi/${version}/${name}.tar.xz";
+    sha256 = "0z89dwrd7akhkap270i372yszqib8yqcymv78lhdmn3a8bsa7jhp";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Non-Linear video editor utilizing the power of GStreamer";
+    homepage    = "http://pitivi.org/";
+    longDescription = ''
+      Pitivi is a video editor built upon the GStreamer Editing Services.
+      It aims to be an intuitive and flexible application
+      that can appeal to newbies and professionals alike.
+    '';
+    license     = licenses.lgpl21Plus;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ iyzsong ];
+  };
+
+  nativeBuildInputs = [ pkgconfig intltool itstool makeWrapper ];
+
+  buildInputs = [
+    gobjectIntrospection clutter-gst clutter-gtk librsvg
+  ] ++ (with gst; [
+    gst-python gst-editing-services
+    gst-plugins-base gst-plugins-good
+    gst-plugins-bad gst-plugins-ugly gst-libav
+  ]) ++ (with pythonPackages; [
+    python pygobject3 pyxdg numpy pycairo sqlite3
+  ]);
+
+  preFixup = with stdenv.lib; with gst; let
+    libraryPath = makeLibraryPath [
+      gstreamer gst-editing-services
+      clutter-gst clutter-gtk clutter gtk3
+      gnome3.gnome_desktop
+    ];
+  in ''
+    wrapProgram "$out/bin/pitivi" \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+      --prefix LD_LIBRARY_PATH : "${libraryPath}" \
+      --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" \
+      --prefix XDG_DATA_DIRS : "\$XDG_ICON_DIRS:$out/share:$GSETTINGS_SCHEMAS_PATH"
+    rm $out/share/icons/hicolor/icon-theme.cache
+  '';
+}
diff --git a/pkgs/applications/video/quvi/library.nix b/pkgs/applications/video/quvi/library.nix
index 49207ad06615..0fdd78fe1068 100644
--- a/pkgs/applications/video/quvi/library.nix
+++ b/pkgs/applications/video/quvi/library.nix
@@ -1,15 +1,15 @@
-{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts}:
+{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libproxy, libgcrypt}:
 
 stdenv.mkDerivation rec {
   name = "libquvi-${version}";
-  version="0.4.0";
+  version="0.9.4";
 
   src = fetchurl {
-    url = "mirror://sourceforge/quvi/libquvi-${version}.tar.gz";
-    sha256 = "15cm9j8dssn2zhplqvlw49piwfw511lia6b635byiwfniqf6dnwp";
+    url = "mirror://sourceforge/quvi/libquvi-${version}.tar.xz";
+    sha256 = "1cl1kbgxl1jnx2nwx4z90l0lap09lnnj1fg7hxsxk3m6aj4y4grd";
   };
 
-  buildInputs = [ pkgconfig lua5 curl quvi_scripts ];
+  buildInputs = [ pkgconfig lua5 curl quvi_scripts libproxy libgcrypt ];
 
   meta = { 
     description = "Web video downloader";
diff --git a/pkgs/applications/video/quvi/scripts.nix b/pkgs/applications/video/quvi/scripts.nix
index cc82158ae829..68b61fc453de 100644
--- a/pkgs/applications/video/quvi/scripts.nix
+++ b/pkgs/applications/video/quvi/scripts.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "quvi-scripts-${version}";
-  version="0.4.0";
+  version="0.9.20131130";
 
   src = fetchurl {
-    url = "mirror://sourceforge/quvi/libquvi-scripts-${version}.tar.gz";
-    sha256 = "14p1sn7id4n35isaw3i3h8vsgfqlym09fih9k5xfqwsg6n7xdvq5";
+    url = "mirror://sourceforge/quvi/libquvi-scripts-${version}.tar.xz";
+    sha256 = "1qvp6z5k1qgcys7vf7jd6fm0g07xixmciwj14ypn1kqhmjgizwhp";
   };
 
   buildInputs = [ pkgconfig ];
diff --git a/pkgs/applications/video/quvi/tool.nix b/pkgs/applications/video/quvi/tool.nix
index f8b6aad43106..29bb439dcf66 100644
--- a/pkgs/applications/video/quvi/tool.nix
+++ b/pkgs/applications/video/quvi/tool.nix
@@ -1,22 +1,24 @@
-{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libquvi}:
+{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libquvi, lua5_sockets, glib, makeWrapper}:
 
 stdenv.mkDerivation rec {
   name = "quvi-${version}";
-  version="0.4.0";
+  version="0.9.5";
 
   src = fetchurl {
-    url = "mirror://sourceforge/quvi/quvi-${version}.tar.gz";
-    sha256 = "0qzyj55py4z7pg97794jjycq8nvrlr02072rgjzg8jgknw49hgfv";
+    url = "mirror://sourceforge/quvi/quvi-${version}.tar.xz";
+    sha256 = "1h52s265rp3af16dvq1xlscp2926jqap2l4ah94vrfchv6m1hffb";
   };
 
-  buildInputs = [ pkgconfig lua5 curl quvi_scripts libquvi ];
+  buildInputs = [ pkgconfig lua5 curl quvi_scripts libquvi glib makeWrapper ];
+  postInstall = ''
+      wrapProgram $out/bin/quvi --set LUA_PATH "${lua5_sockets}/share/lua/${lua5.luaversion}/?.lua"
+  '';
 
-  meta = { 
+  meta = {
     description = "Web video downloader";
     homepage = http://quvi.sf.net;
-    license = "LGPLv2.1+";
+    license = stdenv.lib.licenses.lgpl21Plus;
     platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.mornfall ]; 
+    maintainers = [ stdenv.lib.maintainers.mornfall ];
   };
 }
-
diff --git a/pkgs/applications/video/shotcut/default.nix b/pkgs/applications/video/shotcut/default.nix
new file mode 100644
index 000000000000..51baa32f61e8
--- /dev/null
+++ b/pkgs/applications/video/shotcut/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, SDL, frei0r, gettext, makeWrapper, mlt, pkgconfig, qt5 }:
+
+stdenv.mkDerivation rec {
+  name = "shotcut-${version}";
+  version = "14.08";
+
+  src = fetchurl {
+    url = "https://github.com/mltframework/shotcut/archive/v${version}.tar.gz";
+    sha256 = "0klcvpgp2l6xcdjy1gg7a5s8mx0mm347zdf26q6kk685pldlvkyj";
+  };
+
+  buildInputs = [ SDL frei0r gettext makeWrapper mlt pkgconfig qt5 ];
+
+  configurePhase = "qmake PREFIX=$out";
+
+  postInstall = ''
+    mkdir -p $out/share/shotcut
+    cp -r src/qml $out/share/shotcut/
+    wrapProgram $out/bin/shotcut --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A free, open source, cross-platform video editor";
+    longDescription = ''
+      An offical binary for Shotcut, which includes all the
+      dependencies pinned to specific versions, is provided on
+      http://shotcut.org.
+
+      If you encounter problems with this version, please contact the
+      nixpkgs maintainer(s). If you wish to report any bugs upstream,
+      please use the official build from shotcut.org instead.
+    '';
+    homepage = http://shotcut.org;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/video/simplescreenrecorder/default.nix b/pkgs/applications/video/simplescreenrecorder/default.nix
new file mode 100644
index 000000000000..4c58262a5f10
--- /dev/null
+++ b/pkgs/applications/video/simplescreenrecorder/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, alsaLib, ffmpeg, jack2, libX11, libXext
+, libXfixes, mesa, pkgconfig, pulseaudio, qt4
+}:
+
+stdenv.mkDerivation rec {
+  name = "simplescreenrecorder-${version}";
+  version = "0.3.0";
+
+  src = fetchurl {
+    url = "https://github.com/MaartenBaert/ssr/archive/${version}.tar.gz";
+    sha256 = "0caal8jq47d56ld57cdf2lr1ji350v09j5chgvgxv2pbqmqga4p5";
+  };
+
+  buildInputs = [
+    alsaLib ffmpeg jack2 libX11 libXext libXfixes mesa pkgconfig
+    pulseaudio qt4
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A screen recorder for Linux";
+    homepage = http://www.maartenbaert.be/simplescreenrecorder;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/video/smplayer/default.nix b/pkgs/applications/video/smplayer/default.nix
index ab48d74c00da..8bd5b7c6160a 100644
--- a/pkgs/applications/video/smplayer/default.nix
+++ b/pkgs/applications/video/smplayer/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, qt4 }:
 
 stdenv.mkDerivation rec {
-  name = "smplayer-0.8.5";
+  name = "smplayer-0.8.6";
 
   src = fetchurl {
     url = "mirror://sourceforge/smplayer/${name}.tar.bz2";
-    sha256 = "0vbfvaqg5c25vabq1mf9xg6kzgvxnpd0i172y1gjznnlpcw2fxrw";
+    sha256 = "1p70929j8prc4mgqxvsbcjxy8zwp4r9jk0mp0iddxl7vfyck74g0";
   };
 
   buildInputs = [ qt4 ];
diff --git a/pkgs/applications/video/subtitleeditor/default.nix b/pkgs/applications/video/subtitleeditor/default.nix
new file mode 100644
index 000000000000..c1c11357ca03
--- /dev/null
+++ b/pkgs/applications/video/subtitleeditor/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, desktop_file_utils, enchant, gnome, gstreamer, gstreamermm,
+  gst_plugins_base, gst_plugins_good, intltool, hicolor_icon_theme,
+  libsigcxx, libxmlxx, makeWrapper, xdg_utils, pkgconfig } :
+
+let
+  ver_maj = "0.41";
+  ver_min = "0";
+in
+
+stdenv.mkDerivation rec {
+  name = "subtitle-editor-${ver_maj}.${ver_min}";
+
+  buildInputs =  [
+    desktop_file_utils enchant gnome.gtk gnome.gtkmm gstreamer gstreamermm
+    gst_plugins_base gst_plugins_good intltool hicolor_icon_theme libsigcxx libxmlxx
+    makeWrapper xdg_utils pkgconfig
+  ];
+
+  src = fetchurl {
+    url = "http://download.gna.org/subtitleeditor/${ver_maj}/subtitleeditor-${ver_maj}.${ver_min}.tar.gz";
+    md5 = "3c21ccd8296001dcb1a02c62396db1b6";
+  };
+
+  doCheck = true;
+
+  postInstall = ''
+    wrapProgram "$out/bin/subtitleeditor" --prefix \
+      GST_PLUGIN_SYSTEM_PATH ":" "$GST_PLUGIN_SYSTEM_PATH"                                                     \
+  '';
+
+
+  meta = {
+    description = "GTK+2 application to edit video subtitles";
+    longDescription = ''
+      Subtitle Editor is a GTK+2 tool to edit subtitles for GNU/Linux/*BSD. It can be
+      used for new subtitles or as a tool to transform, edit, correct and refine
+      existing subtitle. This program also shows sound waves, which makes it easier
+      to synchronise subtitles to voices.
+      '';
+    homepage = http://home.gna.org/subtitleeditor;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = stdenv.lib.maintainers.plcplc;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/video/tvtime/default.nix b/pkgs/applications/video/tvtime/default.nix
index eef6e9caf165..2ec5e813c412 100644
--- a/pkgs/applications/video/tvtime/default.nix
+++ b/pkgs/applications/video/tvtime/default.nix
@@ -60,5 +60,6 @@ stdenv.mkDerivation rec {
     license = stdenv.lib.licenses.gpl2;
     maintainers = with stdenv.lib.maintainers; [qknight];
     platforms = with stdenv.lib.platforms; linux;
+    broken = true;
   };
 }
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 3d48b296ad9d..71db3d40a46f 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -1,30 +1,31 @@
 { stdenv, fetchurl, xz, bzip2, perl, xlibs, libdvdnav, libbluray
 , zlib, a52dec, libmad, faad2, ffmpeg, alsaLib
-, pkgconfig, dbus, fribidi, qt4, freefont_ttf
+, pkgconfig, dbus, fribidi, qt4, freefont_ttf, libebml, libmatroska
 , libvorbis, libtheora, speex, lua5, libgcrypt, libupnp
 , libcaca, pulseaudio, flac, schroedinger, libxml2, librsvg
-, mpeg2dec, udev, gnutls, avahi, libcddb, jackaudio, SDL, SDL_image
+, mpeg2dec, udev, gnutls, avahi, libcddb, jack2, SDL, SDL_image
 , libmtp, unzip, taglib, libkate, libtiger, libv4l, samba, liboggz
 , libass, libva, libdvbpsi, libdc1394, libraw1394, libopus
+, libvdpau
 }:
 
 stdenv.mkDerivation rec {
   name = "vlc-${version}";
-  version = "2.1.0";
+  version = "2.1.5";
 
   src = fetchurl {
     url = "http://download.videolan.org/pub/videolan/vlc/${version}/${name}.tar.xz";
-    sha256 = "1xs1zsjip6ljqyy5jlqf14ncda4pjx166bqvjqgcyskq66m7s5yj";
+    sha256 = "0whzbn7ahn5maarcwl1yhk9lq10b0q0y9w5pjl9kh3frdjmncrbg";
   };
 
   buildInputs =
     [ xz bzip2 perl zlib a52dec libmad faad2 ffmpeg alsaLib libdvdnav libdvdnav.libdvdread
       libbluray dbus fribidi qt4 libvorbis libtheora speex lua5 libgcrypt
       libupnp libcaca pulseaudio flac schroedinger libxml2 librsvg mpeg2dec
-      udev gnutls avahi libcddb jackaudio SDL SDL_image libmtp unzip taglib
+      udev gnutls avahi libcddb jack2 SDL SDL_image libmtp unzip taglib
       libkate libtiger libv4l samba liboggz libass libdvbpsi libva
       xlibs.xlibs xlibs.libXv xlibs.libXvMC xlibs.libXpm xlibs.xcbutilkeysyms
-      libdc1394 libraw1394 libopus
+      libdc1394 libraw1394 libopus libebml libmatroska libvdpau
     ];
 
   nativeBuildInputs = [ pkgconfig ];
@@ -33,6 +34,8 @@ stdenv.mkDerivation rec {
     [ "--enable-alsa"
       "--with-kde-solid=$out/share/apps/solid/actions"
       "--enable-dc1394"
+      "--enable-ncurses"
+      "--enable-vdpau"
     ];
 
   preConfigure = ''sed -e "s@/bin/echo@echo@g" -i configure'';
@@ -45,8 +48,10 @@ stdenv.mkDerivation rec {
       ${freefont_ttf}/share/fonts/truetype/FreeSerifBold.ttf
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Cross-platform media player and streaming server";
     homepage = http://www.videolan.org/vlc/;
+    platforms = platforms.linux;
+    license = licenses.lgpl21Plus;
   };
 }
diff --git a/pkgs/applications/video/xawtv/default.nix b/pkgs/applications/video/xawtv/default.nix
index 5f2e905efa09..63c1adb15e42 100644
--- a/pkgs/applications/video/xawtv/default.nix
+++ b/pkgs/applications/video/xawtv/default.nix
@@ -1,15 +1,31 @@
-{stdenv, fetchurl, ncurses, libjpeg, libX11, libXt, libXft, xproto, libFS, fontsproto, libXaw, libXpm, libXext, libSM, libICE, perl, xextproto, linux}:
+{stdenv, fetchurl, ncurses, libjpeg, libX11, libXt, alsaLib, aalib, libXft, xproto, libv4l
+, libFS, fontsproto, libXaw, libXpm, libXext, libSM, libICE, perl, xextproto, linux}:
 
-stdenv.mkDerivation {
-  name = "xawtv-3.95";
+stdenv.mkDerivation rec {
+  name = "xawtv-3.103";
   src = fetchurl {
-    url = http://dl.bytesex.org/releases/xawtv/xawtv-3.95.tar.gz;
-    md5 = "ad25e03f7e128b318e392cb09f52207d";
+    url = "http://linuxtv.org/downloads/xawtv/${name}.tar.bz2";
+    sha256 = "0lnxr3xip80g0rz7h6n14n9d1qy0cm56h0g1hsyr982rbldskwrc";
   };
+
   preConfigure = ''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${linux}/lib/modules/*/build/include)"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${linux}/lib/modules/${linux.modDirVersion}/build"
   '';
-  buildInputs = [ncurses libjpeg libX11 libXt libXft xproto libFS fontsproto libXaw libXpm libXext libSM libICE perl xextproto];
-  patches = [./xawtv-3.95-libfs.patch ./xawtv-3.95-makefile.patch ./xawtv-3.95-page-mask.patch ];
+
+  configureFlags="--prefix=";
+  NIX_LDFLAGS="-lgcc_s";
+
+  makeFlags = "SUID_ROOT= DESTDIR=\$(out) PREFIX=";
+
+  buildInputs = [ncurses libjpeg libX11 libXt libXft xproto libFS perl alsaLib aalib
+                 fontsproto libXaw libXpm libXext libSM libICE xextproto libv4l];
+
+  meta = {
+    description = "TV application for Linux with apps and tools such as a teletext browser";
+    license = stdenv.lib.licenses.gpl2;
+    homePage = https://www.kraxel.org/blog/linux/xawtv/;
+    maintainers = with stdenv.lib.maintainers; [ iElectric ];
+    platforms = stdenv.lib.platforms.linux;
+  };
   
 }
diff --git a/pkgs/applications/video/xawtv/xawtv-3.95-libfs.patch b/pkgs/applications/video/xawtv/xawtv-3.95-libfs.patch
deleted file mode 100644
index 4555f1058672..000000000000
--- a/pkgs/applications/video/xawtv/xawtv-3.95-libfs.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -ruN xawtv-3.95/console/fs.h xawtv-3.95.new/console/fs.h
---- xawtv-3.95/console/fs.h	2003-02-14 15:14:04.000000000 +0100
-+++ xawtv-3.95.new/console/fs.h	2006-01-03 22:16:06.000000000 +0100
-@@ -1,5 +1,5 @@
- #ifndef X_DISPLAY_MISSING
--# include <FSlib.h>
-+# include <X11/fonts/FSlib.h>
- 
- struct fs_font {
-     Font               font;
-diff -ruN xawtv-3.95/console/Subdir.mk xawtv-3.95.new/console/Subdir.mk
---- xawtv-3.95/console/Subdir.mk	2003-02-14 15:14:04.000000000 +0100
-+++ xawtv-3.95.new/console/Subdir.mk	2006-01-03 22:32:38.000000000 +0100
-@@ -74,7 +74,7 @@
- # libraries to link
- console/fbtv     : LDLIBS  += \
- 	$(THREAD_LIBS) $(CURSES_LIBS) $(LIRC_LIBS) $(ALSA_LIBS) \
--	$(FS_LIBS) -ljpeg -lm
-+	$(FS_LIBS) -ljpeg -lm -lFS
- console/ttv      : LDLIBS  += $(THREAD_LIBS) $(AA_LIBS) -ljpeg -lm
- console/scantv   : LDLIBS  += $(THREAD_LIBS) $(VBI_LIBS) -ljpeg
- console/streamer : LDLIBS  += $(THREAD_LIBS) -ljpeg -lm
diff --git a/pkgs/applications/video/xawtv/xawtv-3.95-makefile.patch b/pkgs/applications/video/xawtv/xawtv-3.95-makefile.patch
deleted file mode 100644
index 271bb4c7e5c0..000000000000
--- a/pkgs/applications/video/xawtv/xawtv-3.95-makefile.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ruN xawtv-3.95/Makefile.in xawtv-3.95.new/Makefile.in
---- xawtv-3.95/Makefile.in	2004-04-22 16:52:29.000000000 +0200
-+++ xawtv-3.95.new/Makefile.in	2006-01-20 13:07:00.000000000 +0100
-@@ -3,7 +3,7 @@
- 
- # for package builds (buildroot install + no root privs needed)
- DESTDIR=
--SUID_ROOT=-m4755 -o root
-+SUID_ROOT=
- 
- # install paths
- prefix		:= @prefix@
-@@ -12,7 +12,7 @@
- mandir		:= $(DESTDIR)@mandir@
- libdir		:= $(DESTDIR)@libdir@/xawtv
- datadir		:= $(DESTDIR)@datadir@/xawtv
--resdir		:= $(DESTDIR)@resdir@
-+resdir		:= $(out)@resdir@
- config		:= @x11conf@/xawtvrc
- 
- # programs
diff --git a/pkgs/applications/video/xawtv/xawtv-3.95-page-mask.patch b/pkgs/applications/video/xawtv/xawtv-3.95-page-mask.patch
deleted file mode 100644
index 5714e8238e67..000000000000
--- a/pkgs/applications/video/xawtv/xawtv-3.95-page-mask.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Fix problems with fbtv and kernel headers
-
-diff -urN ../tmp-orig/xawtv-3.95/console/fbtools.c ./console/fbtools.c
---- xawtv-3.95/console/fbtools.c	2003-02-14 14:14:04.000000000 +0000
-+++ xawtv-3.95/console/fbtools.c	2006-08-23 10:57:40.000000000 +0000
-@@ -21,8 +21,6 @@
- #include <linux/vt.h>
- #include <linux/fb.h>
- 
--#include <asm/page.h>
--
- #include "fbtools.h"
- 
- /* -------------------------------------------------------------------- */
-@@ -424,7 +422,7 @@
- 	goto err;
-     }
- #endif
--    fb_mem_offset = (unsigned long)(fb_fix.smem_start) & (~PAGE_MASK);
-+    fb_mem_offset = (unsigned long)(fb_fix.smem_start) & ~(sysconf(_SC_PAGE_SIZE)-1);
-     fb_mem = mmap(NULL,fb_fix.smem_len+fb_mem_offset,
- 		  PROT_READ|PROT_WRITE,MAP_SHARED,fb,0);
-     if (-1L == (long)fb_mem) {
-diff -urN ../tmp-orig/xawtv-3.95/console/matrox.c ./console/matrox.c
---- xawtv-3.95/console/matrox.c	2005-02-03 10:40:41.000000000 +0000
-+++ xawtv-3.95/console/matrox.c	2006-08-23 11:09:51.000000000 +0000
-@@ -9,7 +9,6 @@
- #include <sys/ioctl.h>
- #include <sys/mman.h>
- 
--#include <asm/page.h> /* PAGE_SIZE */
- #include <linux/fb.h>
- 
- #include "byteswap.h"
-@@ -226,7 +225,7 @@
- 	return -1;
-     }
-     off = (unsigned long)fb_fix.mmio_start -
--	((unsigned long)fb_fix.mmio_start & ~(PAGE_SIZE-1));
-+	((unsigned long)fb_fix.mmio_start & ~(sysconf(_SC_PAGE_SIZE)-1));
-     bmmio += off;
-     mmio = (uint32_t*)bmmio;
-     return 0;
-
diff --git a/pkgs/applications/video/xbmc/default.nix b/pkgs/applications/video/xbmc/default.nix
index 59537c7dce02..3232267fa94b 100644
--- a/pkgs/applications/video/xbmc/default.nix
+++ b/pkgs/applications/video/xbmc/default.nix
@@ -1,19 +1,19 @@
 { stdenv, lib, fetchurl, makeWrapper
-, pkgconfig, cmake, gnumake, yasm, python
-, boost, avahi, libdvdcss, lame
-, gettext, pcre, yajl, fribidi
+, pkgconfig, cmake, gnumake, yasm, pythonFull
+, boost, avahi, libdvdcss, lame, autoreconfHook
+, gettext, pcre, yajl, fribidi, which
 , openssl, gperf, tinyxml2, taglib, libssh, swig, jre
-, libX11, xproto, inputproto
+, libX11, xproto, inputproto, libxml2
 , libXt, libXmu, libXext, xextproto
 , libXinerama, libXrandr, randrproto
-, libXtst, libXfixes, fixesproto
+, libXtst, libXfixes, fixesproto, systemd
 , SDL, SDL_image, SDL_mixer, alsaLib
 , mesa, glew, fontconfig, freetype, ftgl
 , libjpeg, jasper, libpng, libtiff
 , ffmpeg, libmpeg2, libsamplerate, libmad
-, libogg, libvorbis, flac
-, lzo, libcdio, libmodplug, libass
-, sqlite, mysql, nasm
+, libogg, libvorbis, flac, libxslt
+, lzo, libcdio, libmodplug, libass, libbluray
+, sqlite, mysql, nasm, gnutls, libva
 , curl, bzip2, zip, unzip, glxinfo, xdpyinfo
 , dbus_libs ? null, dbusSupport ? true
 , udev, udevSupport ? true
@@ -23,7 +23,7 @@
 # TODO: would be nice to have nfsSupport (needs libnfs library)
 # TODO: librtmp
 , libvdpau ? null, vdpauSupport ? true
-, pulseaudio ? null, pulseSupport ? false
+, pulseaudio ? null, pulseSupport ? true
 }:
 
 assert dbusSupport  -> dbus_libs != null;
@@ -34,20 +34,20 @@ assert vdpauSupport -> libvdpau != null && ffmpeg.vdpauSupport;
 assert pulseSupport -> pulseaudio != null;
 
 stdenv.mkDerivation rec {
-    name = "xbmc-12.2";
+    name = "xbmc-13.1";
 
     src = fetchurl {
-      url = "http://mirrors.xbmc.org/releases/source/${name}.tar.gz";
-      sha256 = "077apkq9sx6wlwkwmiz63w5dcqbbrbjbn6qk9fj2fgaizhs0ccxj";
+      url = "https://github.com/xbmc/xbmc/archive/13.1-Gotham.tar.gz";
+      sha256 = "0y56c5csfp8xhk088g47m3bzrri73z868yfx6b04gnrdmr760jrl";
     };
 
     buildInputs = [
-      makeWrapper
-      pkgconfig cmake gnumake yasm python
-      boost libmicrohttpd
-      gettext pcre yajl fribidi
+      makeWrapper libxml2 gnutls
+      pkgconfig cmake gnumake yasm pythonFull
+      boost libmicrohttpd autoreconfHook
+      gettext pcre yajl fribidi libva
       openssl gperf tinyxml2 taglib libssh swig jre
-      libX11 xproto inputproto
+      libX11 xproto inputproto which
       libXt libXmu libXext xextproto
       libXinerama libXrandr randrproto
       libXtst libXfixes fixesproto
@@ -55,8 +55,8 @@ stdenv.mkDerivation rec {
       mesa glew fontconfig freetype ftgl
       libjpeg jasper libpng libtiff
       ffmpeg libmpeg2 libsamplerate libmad
-      libogg libvorbis flac
-      lzo libcdio libmodplug libass
+      libogg libvorbis flac libxslt systemd
+      lzo libcdio libmodplug libass libbluray
       sqlite mysql nasm avahi libdvdcss lame
       curl bzip2 zip unzip glxinfo xdpyinfo
     ]
@@ -72,6 +72,7 @@ stdenv.mkDerivation rec {
     preConfigure = ''
       substituteInPlace xbmc/linux/LinuxTimezone.cpp \
         --replace 'usr/share/zoneinfo' 'etc/zoneinfo'
+      ./bootstrap
     '';
 
     configureFlags = [
@@ -84,10 +85,11 @@ stdenv.mkDerivation rec {
     postInstall = ''
       for p in $(ls $out/bin/) ; do
         wrapProgram $out/bin/$p \
-          --prefix PATH ":" "${python}/bin" \
+          --prefix PATH ":" "${pythonFull}/bin" \
           --prefix PATH ":" "${glxinfo}/bin" \
           --prefix PATH ":" "${xdpyinfo}/bin" \
           --prefix LD_LIBRARY_PATH ":" "${curl}/lib" \
+          --prefix LD_LIBRARY_PATH ":" "${systemd}/lib" \
           --prefix LD_LIBRARY_PATH ":" "${libvdpau}/lib"
       done
     '';
diff --git a/pkgs/applications/video/xvidcap/default.nix b/pkgs/applications/video/xvidcap/default.nix
index 9d7f8a6ac992..83b5c778f866 100644
--- a/pkgs/applications/video/xvidcap/default.nix
+++ b/pkgs/applications/video/xvidcap/default.nix
@@ -18,6 +18,6 @@ stdenv.mkDerivation {
   meta = { 
     description = "screencast video catpuring tool";
     homepage = http://xvidcap.sourceforge.net/;
-    license = "GPLv2";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/virtualization/8086tiny/builder.sh b/pkgs/applications/virtualization/8086tiny/builder.sh
new file mode 100644
index 000000000000..7cff2589abe0
--- /dev/null
+++ b/pkgs/applications/virtualization/8086tiny/builder.sh
@@ -0,0 +1,28 @@
+
+source $stdenv/setup
+
+mkdir -p ./$name $out/bin $out/share/$name $out/share/doc/$name/images
+
+cd $name
+tar xf $src
+make 8086tiny
+if [ $bios ]; then
+    cd bios_source
+    nasm -f bin bios.asm -o bios
+    cd ..
+fi
+
+install -m 755 8086tiny $out/bin
+install -m 644 fd.img $out/share/$name/8086tiny-floppy.img
+install -m 644 bios_source/bios.asm  $out/share/$name/8086tiny-bios-src.asm
+install -m 644 docs/8086tiny.css  $out/share/doc/$name
+install -m 644 docs/doc.html  $out/share/doc/$name
+for i in docs/images/*.gif
+do
+    install -m 644 $i $out/share/doc/$name/images
+done
+if [ $bios ]; then
+    install -m 644 bios_source/bios $out/share/$name/8086tiny-bios
+else
+    install -m 644 bios $out/share/$name/8086tiny-bios
+fi
diff --git a/pkgs/applications/virtualization/8086tiny/default.nix b/pkgs/applications/virtualization/8086tiny/default.nix
new file mode 100644
index 000000000000..a16f052f622f
--- /dev/null
+++ b/pkgs/applications/virtualization/8086tiny/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl
+, localBios ? true, nasm ? null
+, sdlSupport ? true, SDL ? null
+}:
+
+assert sdlSupport -> (SDL != null);
+
+stdenv.mkDerivation rec {
+
+  name = "8086tiny-${version}";
+  version = "1.25";
+
+  src = fetchurl {
+    url ="http://www.megalith.co.uk/8086tiny/downloads/8086tiny_125.tar.bz2";
+    sha256 = "0kmq4iiwhi2grjwq43ljjk1b1f1v1x9gzrgrgq2fzfsj7m7s6ris";
+  };
+
+  buildInputs = with stdenv.lib;
+  optionals localBios [ nasm ]
+  ++  optionals sdlSupport [ SDL ];
+  
+  bios = localBios;
+  
+  builder = ./builder.sh;
+
+  meta = {
+    description = "An open-source 8086 emulator";
+    longDescription = ''
+    8086tiny is a tiny, open-source (MIT), portable (little-endian hosts) Intel PC emulator, powerful enough to run DOS, Windows 3.0, Excel, MS Flight Simulator, AutoCAD, Lotus 1-2-3, and similar applications. 8086tiny emulates a "late 80's era" PC XT-type machine.
+
+    8086tiny is based on an IOCCC 2013 winning entry. In fact that is the "unobfuscated" version :)
+    '';
+    homepage = http://www.megalith.co.uk/8086tiny/index.html;
+    license = stdenv.lib.licenses.mit;
+    maintainers = [ stdenv.lib.maintainers.AndersonTorres ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
+# TODO: add support for a locally made BIOS
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix
index e6d0b7cb40dd..54d697d42751 100644
--- a/pkgs/applications/virtualization/OVMF/default.nix
+++ b/pkgs/applications/virtualization/OVMF/default.nix
@@ -12,7 +12,7 @@ let
 in
 
 stdenv.mkDerivation (edk2.setup "OvmfPkg/OvmfPkg${targetArch}.dsc" {
-  name = "OVMF-2012-10-09";
+  name = "OVMF-2014-02-01";
 
   unpackPhase = ''
     for file in \
diff --git a/pkgs/applications/virtualization/bochs/default.nix b/pkgs/applications/virtualization/bochs/default.nix
new file mode 100644
index 000000000000..75afcb41f808
--- /dev/null
+++ b/pkgs/applications/virtualization/bochs/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl
+, libX11 , mesa
+, sdlSupport ? true, SDL ? null
+, termSupport ? true , ncurses ? null, readline ? null
+, wxSupport ? true , gtk ? null , wxGTK ? null , pkgconfig ? null
+, wgetSupport ? false, wget ? null
+, curlSupport ? false, curl ? null
+}:
+
+
+assert sdlSupport -> (SDL != null);
+assert termSupport -> (ncurses != null&& readline != null);
+assert wxSupport -> (gtk != null && wxGTK != null && pkgconfig != null);
+assert wgetSupport -> (wget != null);
+assert curlSupport -> (curl != null);
+
+stdenv.mkDerivation rec {
+
+  name = "bochs-${version}";
+  version = "2.6.2";
+
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/project/bochs/bochs/${version}/${name}.tar.gz";
+    sha256 = "042blm1xb9ig4fh2bv8nrrfpgkcxy4hq8yrkx7mrdpm5g4mvfwyr";
+  };
+
+  buildInputs = with stdenv.lib;
+  [ libX11 mesa ]
+  ++ optionals sdlSupport [ SDL ]
+  ++ optionals termSupport [ readline ncurses ]
+  ++ optionals wxSupport [ gtk wxGTK pkgconfig ]
+  ++ optionals wgetSupport [ wget ]
+  ++ optionals curlSupport [ curl ];
+
+  configureFlags = ''
+    --with-x11
+    --with-term=${if termSupport then "yes" else "no"}
+    --with-sdl=${if sdlSupport then "yes" else "no"}
+    --with-svga=no
+    --with-wx=${if wxSupport then "yes" else "no"}
+    --enable-readline
+    --enable-plugins=no
+    --enable-disasm
+    --enable-debugger
+    --enable-ne2000
+    --enable-e1000
+    --enable-sb16
+    --enable-voodoo
+    --enable-usb
+    --enable-pnic
+'';
+
+  meta = {
+    description = "An open-source IA-32 (x86) PC emulator";
+    longDescription = ''
+    Bochs is an open-source (LGPL), highly portable IA-32 PC emulator, written in C++, that runs on most popular platforms. It includes emulation of the Intel x86 CPU, common I/O devices, and a custom BIOS.
+    '';
+    homepage = http://bochs.sourceforge.net/;
+    license = stdenv.lib.licenses.lgpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.AndersonTorres ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix
new file mode 100644
index 000000000000..4a488a381abf
--- /dev/null
+++ b/pkgs/applications/virtualization/docker/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, makeWrapper, go, lxc, sqlite, iproute, bridge_utils, devicemapper,
+btrfsProgs, iptables, bash}:
+
+stdenv.mkDerivation rec {
+  name = "docker-${version}";
+  version = "1.1.2";
+
+  src = fetchurl {
+    url = "https://github.com/dotcloud/docker/archive/v${version}.tar.gz";
+    sha256 = "1pa6k3gx940ap3r96xdry6apzkm0ymqra92b2mrp25b25264cqcy";
+  };
+
+  buildInputs = [ makeWrapper go sqlite lxc iproute bridge_utils devicemapper btrfsProgs iptables ];
+
+  dontStrip = true;
+
+  buildPhase = ''
+    patchShebangs ./hack
+    export AUTO_GOPATH=1
+    export DOCKER_GITCOMMIT="d84a070"
+    ./hack/make.sh dynbinary
+  '';
+
+  installPhase = ''
+    install -Dm755 ./bundles/${version}/dynbinary/docker-${version} $out/bin/docker
+    install -Dm755 ./bundles/${version}/dynbinary/dockerinit-${version} $out/bin/dockerinit
+    wrapProgram $out/bin/docker --prefix PATH : "${iproute}/sbin:sbin:${lxc}/bin:${iptables}/sbin"
+
+    # systemd
+    install -Dm644 ./contrib/init/systemd/docker.service $out/etc/systemd/system/docker.service
+
+    # completion
+    install -Dm644 ./contrib/completion/bash/docker $out/share/bash-completion/completions/docker
+    install -Dm644 ./contrib/completion/zsh/_docker $out/share/zsh/site-functions/_docker
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.docker.io/;
+    description = "An open source project to pack, ship and run any application as a lightweight container";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ offline tailhook ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/virtualization/nova/client.nix b/pkgs/applications/virtualization/nova/client.nix
index bb65f80d2066..bcc72d19bb39 100644
--- a/pkgs/applications/virtualization/nova/client.nix
+++ b/pkgs/applications/virtualization/nova/client.nix
@@ -16,5 +16,6 @@ pythonPackages.buildPythonPackage rec {
   meta = {
     homepage = https://github.com/rackspace/python-novaclient;
     description = "Client library and command line tool for the OpenStack Nova API";
+    broken = true;
   };
 }
diff --git a/pkgs/applications/virtualization/nova/default.nix b/pkgs/applications/virtualization/nova/default.nix
index a9a36ffca4fe..c1ef20b7aa08 100644
--- a/pkgs/applications/virtualization/nova/default.nix
+++ b/pkgs/applications/virtualization/nova/default.nix
@@ -20,13 +20,13 @@ stdenv.mkDerivation rec {
       paste_deploy m2crypto ipy boto_1_9 twisted sqlalchemy_migrate
       distutils_extra simplejson readline glance cheetah lockfile httplib2
       # !!! should libvirt be a build-time dependency?  Note that
-      # libxml2Python is a dependency of libvirt.py. 
+      # libxml2Python is a dependency of libvirt.py.
       libvirt libxml2Python
       novaclient
     ];
 
   buildInputs =
-    [ pythonPackages.python 
+    [ pythonPackages.python
       pythonPackages.wrapPython
       pythonPackages.mox
       intltool
@@ -45,11 +45,11 @@ stdenv.mkDerivation rec {
       substituteInPlace nova/api/ec2/cloud.py \
         --replace 'sh genrootca.sh' $out/libexec/nova/genrootca.sh
     '';
-  
+
   buildPhase = "python setup.py build";
 
   installPhase =
-    ''    
+    ''
       p=$(toPythonPath $out)
       export PYTHONPATH=$p:$PYTHONPATH
       mkdir -p $p
@@ -59,14 +59,14 @@ stdenv.mkDerivation rec {
       # computes some stuff from its own argv[0].  So put the wrapped
       # programs in $out/libexec under their original names.
       mkdir -p $out/libexec/nova
-      
+
       wrapProgram() {
           local prog="$1"
           local hidden=$out/libexec/nova/$(basename "$prog")
           mv $prog $hidden
           makeWrapper $hidden $prog "$@"
       }
-      
+
       wrapPythonPrograms
 
       cp -prvd etc $out/etc
@@ -86,9 +86,10 @@ stdenv.mkDerivation rec {
   doCheck = false; # !!! fix
 
   checkPhase = "python setup.py test";
-    
+
   meta = {
     homepage = http://nova.openstack.org/;
     description = "OpenStack Compute (a.k.a. Nova), a cloud computing fabric controller";
+    broken = true;
   };
 }
diff --git a/pkgs/applications/virtualization/qemu/cve-2014-0150.patch b/pkgs/applications/virtualization/qemu/cve-2014-0150.patch
new file mode 100644
index 000000000000..a086b3693215
--- /dev/null
+++ b/pkgs/applications/virtualization/qemu/cve-2014-0150.patch
@@ -0,0 +1,14 @@
+
+diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
+index 439477b..33bd233 100644
+--- a/hw/net/virtio-net.c
++++ b/hw/net/virtio-net.c
+ <at>  <at>  -677,7 +677,7  <at>  <at>  static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
+         goto error;
+     }
+
+-    if (in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
++    if (mac_data.entries <= MAC_TABLE_ENTRIES - in_use) {
+         s = iov_to_buf(iov, iov_cnt, 0, &macs[in_use * ETH_ALEN],
+                        mac_data.entries * ETH_ALEN);
+         if (s != mac_data.entries * ETH_ALEN) {
diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix
index dcf5b4e50097..1d668c4a28cf 100644
--- a/pkgs/applications/virtualization/qemu/default.nix
+++ b/pkgs/applications/virtualization/qemu/default.nix
@@ -1,29 +1,31 @@
 { stdenv, fetchurl, python, zlib, pkgconfig, glib, ncurses, perl, pixman
-, attr, libcap, vde2, alsaLib, texinfo, libuuid
+, attr, libcap, vde2, alsaLib, texinfo, libuuid, flex, bison
 , makeWrapper
 , sdlSupport ? true, SDL
 , vncSupport ? true, libjpeg, libpng
-, spiceSupport ? true, spice, spice_protocol
+, spiceSupport ? true, spice, spice_protocol, usbredir
 , x86Only ? false
 }:
 
-let n = "qemu-1.5.2"; in
+let n = "qemu-2.0.0"; in
 
 stdenv.mkDerivation rec {
   name = n + (if x86Only then "-x86-only" else "");
 
   src = fetchurl {
     url = "http://wiki.qemu.org/download/${n}.tar.bz2";
-    sha256 = "0l52jwlxmwp9g3jpq0g7ix9dq4qgh46nd2h58lh47f0a35yi8qgn";
+    sha256 = "0frsahiw56jr4cqr9m6s383lyj4ar9hfs2wp3y4yr76krah1mk30";
   };
 
+  patches = [ ./cve-2014-0150.patch ];
+
   buildInputs =
     [ python zlib pkgconfig glib ncurses perl pixman attr libcap
-      vde2 alsaLib texinfo libuuid makeWrapper
+      vde2 alsaLib texinfo libuuid flex bison makeWrapper
     ]
     ++ stdenv.lib.optionals sdlSupport [ SDL ]
     ++ stdenv.lib.optionals vncSupport [ libjpeg libpng ]
-    ++ stdenv.lib.optionals spiceSupport [ spice_protocol spice ];
+    ++ stdenv.lib.optionals spiceSupport [ spice_protocol spice usbredir ];
 
   enableParallelBuilding = true;
 
@@ -39,15 +41,15 @@ stdenv.mkDerivation rec {
       # Add a ‘qemu-kvm’ wrapper for compatibility/convenience.
       p="$out/bin/qemu-system-${if stdenv.system == "x86_64-linux" then "x86_64" else "i386"}"
       if [ -e "$p" ]; then
-        makeWrapper "$p" $out/bin/qemu-kvm --add-flags "-enable-kvm"
+        makeWrapper "$p" $out/bin/qemu-kvm --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)"
       fi
     '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.qemu.org/;
     description = "A generic and open source machine emulator and virtualizer";
-    license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [ viric shlevy eelco ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ viric shlevy eelco ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/virtualization/qemu/linux-img/default.nix b/pkgs/applications/virtualization/qemu/linux-img/default.nix
deleted file mode 100644
index 58a2b29c2597..000000000000
--- a/pkgs/applications/virtualization/qemu/linux-img/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation rec {
-  name = "qemu-linux-image-0.2";
-
-  src = fetchurl {
-    url = http://wiki.qemu.org/download/linux-0.2.img.bz2;
-    sha256 = "08xlwy1908chpc4fsqy2v13zi25dapk0ybrd43fj95v67kdj5hj1";
-  };
-
-  unpackPhase = "true";
-
-  installPhase =
-    ''
-      mkdir -p $out/share/qemu-images
-      bunzip2 < $src > $out/share/qemu-images/linux-0.2.img
-    '';
-
-  meta = {
-    description = "QEMU sample Linux disk image";
-  };
-}
diff --git a/pkgs/applications/virtualization/virt-manager/custom_runner.py b/pkgs/applications/virtualization/virt-manager/custom_runner.py
deleted file mode 100644
index 5322c20dd329..000000000000
--- a/pkgs/applications/virtualization/virt-manager/custom_runner.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/python -t
-# this script was written to use /etc/nixos/nixpkgs/pkgs/development/python-modules/generic/wrap.sh
-# which already automates python executable wrapping by extending the PATH/pythonPath
-
-# from http://docs.python.org/library/subprocess.html
-# Warning Invoking the system shell with shell=True can be a security hazard if combined with untrusted input. See the warning under Frequently Used Arguments for details.
-
-from subprocess import Popen, PIPE, STDOUT
-
-cmd = 'PYTHON_EXECUTABLE_PATH -t THE_CUSTOM_PATH/share/virt-manager/THE_CUSTOM_PROGRAM.py'
-p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
-output = p.stdout.read()
-print output
diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix
index de3e5c98d36b..08d53d83eedb 100644
--- a/pkgs/applications/virtualization/virt-manager/default.nix
+++ b/pkgs/applications/virtualization/virt-manager/default.nix
@@ -1,84 +1,66 @@
-{ stdenv, fetchurl, pythonPackages, intltool, libvirt, libxml2Python, curl,
-  python, makeWrapper, virtinst, pyGtkGlade, pythonDBus, gnome_python, gtkvnc, vte}:
+{ stdenv, fetchurl, pythonPackages, intltool, libxml2Python, curl, python
+, makeWrapper, virtinst, pyGtkGlade, pythonDBus, gnome_python, gtkvnc, vte
+, gtk3, gobjectIntrospection, libvirt-glib, gsettings_desktop_schemas, glib
+, avahi, dconf, spiceSupport ? true, spice_gtk
+}:
 
 with stdenv.lib;
+with pythonPackages;
 
-let version = "0.9.1"; in
-
-stdenv.mkDerivation rec {
+buildPythonPackage rec {
   name = "virt-manager-${version}";
+  version = "1.0.1";
+  namePrefix = "";
 
   src = fetchurl {
-    url = "http://virt-manager.et.redhat.com/download/sources/virt-manager/virt-manager-${version}.tar.gz";
-    sha256 = "15e064167ba5ff84ce6fc8790081d61890430f2967f89886a84095a23e40094a";
+    url = "http://virt-manager.org/download/sources/virt-manager/${name}.tar.gz";
+    sha256 = "1n248kack1fni8y17ysgq5xhvffcgy4l62hnd0zvr4kjw0579qq8";
   };
 
-  pythonPath = with pythonPackages;
-    [ setuptools eventlet greenlet gflags netaddr sqlalchemy carrot routes
+  propagatedBuildInputs =
+    [ eventlet greenlet gflags netaddr sqlalchemy carrot routes
       paste_deploy m2crypto ipy boto_1_9 twisted sqlalchemy_migrate
       distutils_extra simplejson readline glance cheetah lockfile httplib2
-      # !!! should libvirt be a build-time dependency?  Note that
-      # libxml2Python is a dependency of libvirt.py. 
-      libvirt libxml2Python urlgrabber virtinst pyGtkGlade pythonDBus gnome_python
-      gtkvnc vte
-    ];
+      urlgrabber virtinst pyGtkGlade pythonDBus gnome_python pygobject3
+      libvirt libxml2Python ipaddr vte
+    ] ++ optional spiceSupport spice_gtk;
 
   buildInputs =
-    [ pythonPackages.python 
-      pythonPackages.wrapPython
-      pythonPackages.mox
-      pythonPackages.urlgrabber
+    [ mox
       intltool
-      pyGtkGlade
-      pythonDBus
-      gnome_python
       gtkvnc
-    ] ++ pythonPath;
-
-  buildPhase = "make";
-  
-  nativeBuildInputs = [ makeWrapper pythonPackages.wrapPython ];
-
-  # patch the runner script in order to make wrapPythonPrograms work and run the program using a syscall
-  # example code: /etc/nixos/nixpkgs/pkgs/development/interpreters/spidermonkey/1.8.0-rc1.nix
-  customRunner = ./custom_runner.py;
+      gtk3
+      libvirt-glib
+      avahi
+      glib
+      gobjectIntrospection
+    ];
 
-  # TODO
-  # virt-manager     -> import gtk.glade -> No module named glade --> fixed by removing 'pygtk' and by only using pyGtkGlade
-  #                  -> import gconf     -> ImportError: No module named gconf
-  #                        -> pfad um gtk-2.0 erweitern in virt-manger runner -> /nix/store/hnyxc9i4yz2mc42n44ms13mn8n486s5h-gnome-python-2.28.1/lib/python2.7/site-packages/gtk-2.0
-  #                  -> Error starting Virtual Machine Manager: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details -  1: GetIOR failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.GConf was not provided by any .service files)
+  configurePhase = ''
+    sed -i 's/from distutils.core/from setuptools/g' setup.py
+    sed -i 's/from distutils.command.install/from setuptools.command.install/g' setup.py
+    python setup.py configure --prefix=$out
+  '';
 
-#Traceback (most recent call last):
-#  File "/nix/store/y9rcdiv6686sqcv4r39p575s37jzc2cz-virt-manager-0.9.1/share/virt-manager/virt-manager.py", line 383, in <module>
-#    main()
-#  File "/nix/store/y9rcdiv6686sqcv4r39p575s37jzc2cz-virt-manager-0.9.1/share/virt-manager/virt-manager.py", line 315, in main
-#    config = virtManager.config.vmmConfig(appname, appversion, glade_dir)
-#  File "/nix/store/y9rcdiv6686sqcv4r39p575s37jzc2cz-virt-manager-0.9.1/share/virt-manager/virtManager/config.py", line 98, in __init__
-#    self.conf.add_dir(self.conf_dir, gconf.CLIENT_PRELOAD_NONE)
-#GError: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details -  1: GetIOR failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.GConf was not provided by any .service files)
-# -> fixed by http://nixos.org/wiki/Solve_GConf_errors_when_running_GNOME_applications & a restart
-  # virt-manager-tui -> ImportError: No module named newt_syrup.dialogscreen
+  buildPhase = "true";
 
-  patchPhase = ''
-    cat ${customRunner} > src/virt-manager.in
-    substituteInPlace "src/virt-manager.in" --replace "THE_CUSTOM_PATH" "$out"
-    substituteInPlace "src/virt-manager.in" --replace "THE_CUSTOM_PROGRAM" "virt-manager"
-    substituteInPlace "src/virt-manager.in" --replace "PYTHON_EXECUTABLE_PATH" "${python}/bin/python"
+  postInstall = ''
+    # GI_TYPELIB_PATH is needed at runtime for GObject stuff to work
+    for file in "$out"/bin/*; do
+        wrapProgram "$file" \
+            --prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH \
+            --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules" \
+            --prefix GSETTINGS_SCHEMA_DIR : $out/share/glib-2.0/schemas \
+            --prefix XDG_DATA_DIRS : "$out/share:${gsettings_desktop_schemas}/share:${gtk3}/share:$GSETTINGS_SCHEMAS_PATH:\$XDG_DATA_DIRS"
+    done
 
-    cat ${customRunner} > src/virt-manager-tui.in
-    substituteInPlace "src/virt-manager-tui.in" --replace "THE_CUSTOM_PATH" "$out"
-    substituteInPlace "src/virt-manager-tui.in" --replace "THE_CUSTOM_PROGRAM" "virt-manager-tui"
-    substituteInPlace "src/virt-manager-tui.in" --replace "PYTHON_EXECUTABLE_PATH" "${python}/bin/python"
+    ${glib}/bin/glib-compile-schemas "$out"/share/glib-2.0/schemas
   '';
 
-  # /etc/nixos/nixpkgs/pkgs/development/python-modules/generic/wrap.sh
-  installPhase = ''
-    make install
-    wrapPythonPrograms
-  '';
+  # Failed tests
+  doCheck = false;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://virt-manager.org;
     description = "Desktop user interface for managing virtual machines";
     longDescription = ''
@@ -86,7 +68,7 @@ stdenv.mkDerivation rec {
       virtual machines through libvirt. It primarily targets KVM VMs, but also
       manages Xen and LXC (linux containers).
     '';
-    license = "GPLv2";
-    maintainers = with stdenv.lib.maintainers; [qknight];
+    license = licenses.gpl2;
+    maintainers = with maintainers; [qknight offline];
   };
 }
diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix
index d2e608ba3fa8..a5d7c7754125 100644
--- a/pkgs/applications/virtualization/virt-viewer/default.nix
+++ b/pkgs/applications/virtualization/virt-viewer/default.nix
@@ -1,50 +1,40 @@
-x@{builderDefsPackage
-  , gnome, gtk, glib, libxml2, pkgconfig, libvirt, gtkvnc, cyrus_sasl, libtasn1
-  , gnupg, libgcrypt, perl, nettle, yajl, libcap_ng
-  , ...}:
-builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    ["gnome"];
+{ stdenv, fetchurl, pkgconfig, intltool, glib, libxml2, gtk3, gtkvnc, gmp
+, libgcrypt, gnupg, cyrus_sasl, spiceSupport ? true, spice_gtk, shared_mime_info
+, libvirt, libcap_ng, yajl
+}:
 
-  buildInputs = (map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames)))
-    ++ [gnome.libglade];
-  sourceInfo = rec {
+with stdenv.lib;
+
+let sourceInfo = rec {
     baseName="virt-viewer";
-    version="0.2.0";
+    version="0.6.0";
     name="${baseName}-${version}";
     url="http://virt-manager.org/download/sources/${baseName}/${name}.tar.gz";
-    hash="0lhkmp4kn0s2z8241lqf2fdi55jg9iclr5hjw3m4wzaznpiajwlp";
-  };
-in
-rec {
-  src = a.fetchurl {
+    hash="0svalnr6k8rjadysnxixygk3bdx04asmwx75bhrbljyicba216v6";
+}; in
+
+stdenv.mkDerivation  {
+  inherit (sourceInfo) name version;
+
+  src = fetchurl {
     url = sourceInfo.url;
     sha256 = sourceInfo.hash;
   };
 
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
+  buildInputs = [ 
+    pkgconfig intltool glib libxml2 gtk3 gtkvnc gmp libgcrypt gnupg cyrus_sasl
+    shared_mime_info libvirt libcap_ng yajl
+  ] ++ optional spiceSupport spice_gtk;
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
   meta = {
     description = "A viewer for remote virtual machines";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = a.lib.licenses.gpl2;
+    maintainers = maintainers.raskin;
+    platforms = platforms.linux;
+    license = licenses.gpl2;
   };
   passthru = {
     updateInfo = {
       downloadPage = "http://virt-manager.org/download.html";
     };
   };
-}) x
-
+}
diff --git a/pkgs/applications/virtualization/virtinst/default.nix b/pkgs/applications/virtualization/virtinst/default.nix
index bb8b7a1d0d99..8e2da5c3b764 100644
--- a/pkgs/applications/virtualization/virtinst/default.nix
+++ b/pkgs/applications/virtualization/virtinst/default.nix
@@ -2,14 +2,14 @@
 
 with stdenv.lib;
 
-let version = "0.600.1"; in
+let version = "0.600.4"; in
 
 stdenv.mkDerivation rec {
   name = "virtinst-${version}";
 
   src = fetchurl {
     url = "http://virt-manager.org/download/sources/virtinst/virtinst-${version}.tar.gz";
-    sha256 = "db342cf93aae1f23df02001bdb0b0cc2c5bf675dca37b4417f5a79bf5a374716";
+    sha256 = "175laiy49dni8hzi0cn14bbsdsigvgr9h6d9z2bcvbpa29spldvf";
   };
 
   pythonPath = with pythonPackages;
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://virt-manager.org;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [qknight];
     description = "Command line tool which provides an easy way to provision operating systems into virtual machines";
   };
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 652b2ed92c10..682e7159ac8f 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2, libX11, xproto, libXext
-, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernelDev, lvm2
-, which, alsaLib, curl, gawk
+, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernel, lvm2
+, which, alsaLib, curl, libvpx, gawk
 , xorriso, makeself, perl, pkgconfig
 , javaBindings ? false, jdk ? null
 , pythonBindings ? false, python ? null
@@ -11,7 +11,7 @@ with stdenv.lib;
 
 let
 
-  version = "4.2.18"; # changes ./guest-additions as well
+  version = "4.3.12"; # changes ./guest-additions as well
 
   forEachModule = action: ''
     for mod in \
@@ -31,13 +31,13 @@ let
   '';
 
   # See https://github.com/NixOS/nixpkgs/issues/672 for details
-  extpackRevision = "88780";
+  extpackRevision = "93733";
   extensionPack = requireFile rec {
     name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRevision}.vbox-extpack";
     # IMPORTANT: Hash must be base16 encoded because it's used as an input to
     # VBoxExtPackHelperApp!
-    # Tip: see http://dlc.sun.com.edgesuite.net/virtualbox/4.2.18/SHA256SUMS
-    sha256 = "1d1737b59d0f30f5d42beeabaff168bdc0a75b8b28df685979be6173e5adbbba";
+    # Tip: see http://dlc.sun.com.edgesuite.net/virtualbox/4.3.10/SHA256SUMS
+    sha256 = "f931ce41b2cc9500dc43aba004630cf7bb7050ba737eae38827e91062f072d1f";
     message = ''
       In order to use the extension pack, you need to comply with the VirtualBox Personal Use
       and Evaluation License (PUEL) by downloading the related binaries from:
@@ -52,23 +52,23 @@ let
   };
 
 in stdenv.mkDerivation {
-  name = "virtualbox-${version}-${kernelDev.version}";
+  name = "virtualbox-${version}-${kernel.version}";
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
-    sha256 = "9dbddf393b029c549249f627d12040c1d257972bc09292969b8819a31ab78d74";
+    sha256 = "db84ddf47d1ecd316ec46417595f0252e3ec2f67e35e1e17320aba87b7c2934f";
   };
 
   buildInputs =
     [ iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor qt4 libIDL SDL
-      libcap glib kernelDev lvm2 python alsaLib curl pam xorriso makeself perl
+      libcap glib lvm2 python alsaLib curl libvpx pam xorriso makeself perl
       pkgconfig which libXmu ]
     ++ optional javaBindings jdk
     ++ optional pythonBindings python;
 
   prePatch = ''
     set -x
-    MODULES_BUILD_DIR=`echo ${kernelDev}/lib/modules/*/build`
+    MODULES_BUILD_DIR=`echo ${kernel.dev}/lib/modules/*/build`
     sed -e 's@/lib/modules/`uname -r`/build@'$MODULES_BUILD_DIR@ \
         -e 's@MKISOFS --version@MKISOFS -version@' \
         -e 's@PYTHONDIR=.*@PYTHONDIR=${if pythonBindings then python else ""}@' \
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
index de38843c7f1b..f168c0d57259 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lib, patchelf, cdrkit, kernelDev, which, makeWrapper
+{ stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper
 , xorg, dbus, virtualbox }:
 
 let
@@ -8,14 +8,14 @@ let
 in
 
 stdenv.mkDerivation {
-  name = "VirtualBox-GuestAdditions-${version}-${kernelDev.version}";
+  name = "VirtualBox-GuestAdditions-${version}-${kernel.version}";
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
-    sha256 = "f11a7f13dfe7bf9f246fb877144bb467fe6deadcd876568ec79b6ccd3b59d767";
+    sha256 = "c76dd5ec86f61ad72263ab6d2405723b06badfc2fae57f83ffa5de96f553400d";
   };
 
-  KERN_DIR = "${kernelDev}/lib/modules/*/build";
+  KERN_DIR = "${kernel.dev}/lib/modules/*/build";
 
   buildInputs = [ patchelf cdrkit makeWrapper dbus ];
 
@@ -115,7 +115,7 @@ stdenv.mkDerivation {
     for i in *
     do
         cd $i
-        kernelVersion=$(cd ${kernelDev}/lib/modules; ls)
+        kernelVersion=$(cd ${kernel.dev}/lib/modules; ls)
         export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
         find . -type f | xargs sed -i -e "s|-o root||g" \
                                       -e "s|-g root||g"
diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix
index 3cb16a6b4425..55ef83901484 100644
--- a/pkgs/applications/virtualization/xen/default.nix
+++ b/pkgs/applications/virtualization/xen/default.nix
@@ -30,7 +30,7 @@ let
       }
     ];
 
-in 
+in
 
 stdenv.mkDerivation {
   name = "xen-${version}";
@@ -136,5 +136,6 @@ stdenv.mkDerivation {
     description = "Xen hypervisor and management tools for Dom0";
     platforms = [ "i686-linux" "x86_64-linux" ];
     maintainers = [ stdenv.lib.maintainers.eelco ];
+    broken = true;
   };
 }
diff --git a/pkgs/applications/window-managers/awesome/3.4.nix b/pkgs/applications/window-managers/awesome/3.4.nix
new file mode 100644
index 000000000000..3db2bde6540d
--- /dev/null
+++ b/pkgs/applications/window-managers/awesome/3.4.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, cmake, gperf, imagemagick, pkgconfig, lua
+, glib, cairo, pango, imlib2, libxcb, libxdg_basedir, xcbutil
+, xcbutilimage, xcbutilkeysyms, xcbutilwm, libpthreadstubs, libXau
+, libXdmcp, pixman, doxygen
+, libstartup_notification, libev, asciidoc, xmlto, dbus, docbook_xsl
+, docbook_xml_dtd_45, libxslt, coreutils, which }:
+
+let
+  version = "3.4.13";
+in
+
+stdenv.mkDerivation rec {
+  name = "awesome-${version}";
+ 
+  src = fetchurl {
+    url = "http://awesome.naquadah.org/download/awesome-${version}.tar.xz";
+    sha256 = "0jhsgb8wdzpfmdyl9fxp2w6app7l6zl8b513z3ff513nvdlxj5hr";
+  };
+ 
+  buildInputs = [ cmake gperf imagemagick pkgconfig lua glib cairo pango
+    imlib2 libxcb libxdg_basedir xcbutil xcbutilimage xcbutilkeysyms xcbutilwm
+    libstartup_notification libev libpthreadstubs libXau libXdmcp pixman doxygen
+    asciidoc xmlto dbus docbook_xsl docbook_xml_dtd_45 libxslt which ];
+
+  # We use coreutils for 'env', that will allow then finding 'bash' or 'zsh' in
+  # the awesome lua code. I prefered that instead of adding 'bash' or 'zsh' as
+  # dependencies.
+  prePatch = ''
+    # Fix the tab completion (supporting bash or zsh)
+    sed s,/usr/bin/env,${coreutils}/bin/env, -i lib/awful/completion.lua.in
+    # Remove the 'root' PATH override (I don't know why they have that)
+    sed /WHOAMI/d -i utils/awsetbg
+    # Russian manpages fail to be generated:
+    #  [ 56%] Generating manpages/ru/man1/awesome.1.xml
+    #  asciidoc: ERROR: <stdin>: line 3: name section expected
+    #  asciidoc: FAILED: <stdin>: line 3: section title expected
+    #  make[2]: *** [manpages/ru/man1/awesome.1.xml] Error 1
+    substituteInPlace CMakeLists.txt \
+      --replace "set(AWE_MAN_LANGS it es fr de ru)" \
+                "set(AWE_MAN_LANGS it es fr de)"
+  '';
+ 
+  meta = {
+    homepage = http://awesome.naquadah.org/;
+    description = "Highly configurable, dynamic window manager for X";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix
index 61f2145ff33c..269875656369 100644
--- a/pkgs/applications/window-managers/awesome/default.nix
+++ b/pkgs/applications/window-managers/awesome/default.nix
@@ -1,51 +1,73 @@
-{stdenv, fetchurl, cmake, gperf, imagemagick, pkgconfig, lua
-, glib, cairo, pango, imlib2, libxcb, libxdg_basedir, xcbutil
-, xcbutilimage, xcbutilkeysyms, xcbutilwm, libpthreadstubs, libXau
-, libXdmcp, pixman, doxygen
-, libstartup_notification, libev, asciidoc, xmlto, dbus, docbook_xsl
-, docbook_xml_dtd_45, libxslt, coreutils}:
+{ stdenv, fetchurl, lua, cairo, cmake, imagemagick, pkgconfig, gdk_pixbuf
+, xlibs, libstartup_notification, libxdg_basedir, libpthreadstubs
+, xcb-util-cursor, lgi, makeWrapper, pango, gobjectIntrospection, unclutter
+, compton, procps, iproute, coreutils, curl, alsaUtils, findutils, rxvt_unicode
+, which, dbus, nettools, git, asciidoc, doxygen }:
 
 let
-  version = "3.4.13";
+  version = "3.5.5";
 in
 
 stdenv.mkDerivation rec {
   name = "awesome-${version}";
  
   src = fetchurl {
-    url = "http://awesome.naquadah.org/download/awesome-${version}.tar.xz";
-    sha256 = "0jhsgb8wdzpfmdyl9fxp2w6app7l6zl8b513z3ff513nvdlxj5hr";
+    url    = "http://awesome.naquadah.org/download/awesome-${version}.tar.xz";
+    sha256 = "0iwd4pjvq0akm9dbipbl4m4fm24m017l06arasr445v2qkbxnc5z";
   };
- 
-  buildInputs = [ cmake gperf imagemagick pkgconfig lua glib cairo pango
-    imlib2 libxcb libxdg_basedir xcbutil xcbutilimage xcbutilkeysyms xcbutilwm
-    libstartup_notification libev libpthreadstubs libXau libXdmcp pixman doxygen
-    asciidoc xmlto dbus docbook_xsl docbook_xml_dtd_45 libxslt ];
 
-  # We use coreutils for 'env', that will allow then finding 'bash' or 'zsh' in
-  # the awesome lua code. I prefered that instead of adding 'bash' or 'zsh' as
-  # dependencies.
-  prePatch = ''
-    # Fix the tab completion (supporting bash or zsh)
-    sed s,/usr/bin/env,${coreutils}/bin/env, -i lib/awful/completion.lua.in
-    # Remove the 'root' PATH override (I don't know why they have that)
-    sed /WHOAMI/d -i utils/awsetbg
-    # Russian manpages fail to be generated:
-    #  [ 56%] Generating manpages/ru/man1/awesome.1.xml
-    #  asciidoc: ERROR: <stdin>: line 3: name section expected
-    #  asciidoc: FAILED: <stdin>: line 3: section title expected
-    #  make[2]: *** [manpages/ru/man1/awesome.1.xml] Error 1
-    substituteInPlace CMakeLists.txt \
-      --replace "set(AWE_MAN_LANGS it es fr de ru)" \
-                "set(AWE_MAN_LANGS it es fr de)"
-  '';
- 
-  meta = {
-    homepage = http://awesome.naquadah.org/;
+  meta = with stdenv.lib; {
     description = "Highly configurable, dynamic window manager for X";
-    license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    homepage    = http://awesome.naquadah.org/;
+    license     = "GPLv2+";
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.linux;
   };
-}
+ 
+  buildInputs = [
+    asciidoc
+    cairo
+    cmake
+    dbus
+    doxygen
+    gdk_pixbuf
+    git
+    imagemagick
+    lgi
+    libpthreadstubs
+    libstartup_notification
+    libxdg_basedir
+    lua
+    makeWrapper
+    nettools
+    pango
+    pkgconfig
+    xcb-util-cursor
+    xlibs.libXau
+    xlibs.libXdmcp
+    xlibs.libxcb
+    xlibs.libxshmfence
+    xlibs.xcbutil
+    xlibs.xcbutilimage
+    xlibs.xcbutilkeysyms
+    xlibs.xcbutilrenderutil
+    xlibs.xcbutilwm
+  ];
 
+  LD_LIBRARY_PATH = "${cairo}/lib:${pango}/lib:${gobjectIntrospection}/lib";
+  GI_TYPELIB_PATH = "${pango}/lib/girepository-1.0";
+  LUA_CPATH = "${lgi}/lib/lua/5.1/?.so";
+  LUA_PATH  = "${lgi}/share/lua/5.1/?.lua;${lgi}/share/lua/5.1/lgi/?.lua";
+
+  postInstall = ''
+    wrapProgram $out/bin/awesome \
+      --set LUA_CPATH '"${lgi}/lib/lua/5.1/?.so"' \
+      --set LUA_PATH '"${lgi}/share/lua/5.1/?.lua;${lgi}/share/lua/5.1/lgi/?.lua"' \
+      --set GI_TYPELIB_PATH "${pango}/lib/girepository-1.0" \
+      --prefix LD_LIBRARY_PATH : "${cairo}/lib:${pango}/lib:${gobjectIntrospection}/lib" \
+      --prefix PATH : "${compton}/bin:${unclutter}/bin:${procps}/bin:${iproute}/sbin:${coreutils}/bin:${curl}/bin:${alsaUtils}/bin:${findutils}/bin:${rxvt_unicode}/bin"
+
+    wrapProgram $out/bin/awesome-client \
+      --prefix PATH : "${which}/bin"
+  '';
+}
diff --git a/pkgs/applications/window-managers/bar/default.nix b/pkgs/applications/window-managers/bar/default.nix
new file mode 100644
index 000000000000..bee774d10da2
--- /dev/null
+++ b/pkgs/applications/window-managers/bar/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, perl, libxcb }:
+
+let
+  version = "1.0";
+in
+  stdenv.mkDerivation rec {
+    name = "bar-${version}";
+  
+    src = fetchurl {
+      url = "https://github.com/LemonBoy/bar/archive/v${version}.tar.gz";
+      sha256 = "1n2vak2acs37sslxl250cnz9c3irif5z4s54wi9qjyxbfzr2h2nc";
+    };
+  
+    buildInputs = [ libxcb perl ];
+  
+    prePatch = ''sed -i "s@/usr@$out@" Makefile'';
+  
+    meta = {
+      description = "A lightweight xcb based bar";
+      homepage = "https://github.com/LemonBoy/bar";
+      maintainers = stdenv.lib.maintainers.meisternu;
+      license = "Custom";   
+      platforms = stdenv.lib.platforms.linux;
+    };
+}
diff --git a/pkgs/applications/window-managers/bspwm/default.nix b/pkgs/applications/window-managers/bspwm/default.nix
new file mode 100644
index 000000000000..24789f37ba7e
--- /dev/null
+++ b/pkgs/applications/window-managers/bspwm/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, libxcb, libXinerama, sxhkd, xcbutil, xcbutilkeysyms, xcbutilwm }:
+
+stdenv.mkDerivation rec {
+  name = "bspwm-0.8.9";
+  
+
+  src = fetchurl {
+    url = "https://github.com/baskerville/bspwm/archive/0.8.9.tar.gz";
+    sha256 = "750c76132914661d8d5edf7809e9b601977215d31e747dd780c60fd562913d55";
+  };
+
+  buildInputs = [ libxcb libXinerama xcbutil xcbutilkeysyms xcbutilwm ];
+
+  buildPhase = ''
+    make PREFIX=$out
+  '';
+ 
+  installPhase = ''
+    make PREFIX=$out install
+  '';
+
+  meta = {
+    description = "A tiling window manager based on binary space partitioning";
+    homepage = "http://github.com/baskerville/bspwm";
+    maintainers = stdenv.lib.maintainers.meisternu;
+    license = "BSD";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/window-managers/compiz/default.nix b/pkgs/applications/window-managers/compiz/default.nix
index 02b7b9987bdb..b73d636aaa58 100644
--- a/pkgs/applications/window-managers/compiz/default.nix
+++ b/pkgs/applications/window-managers/compiz/default.nix
@@ -15,11 +15,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="compiz";
-    version="0.9.10.0";
+    version="0.9.11.2";
     name="${baseName}-${version}";
-    hash="0kvjib0ns02cikpsjq5hlf746yjx2gkfh373pvrb25lzv3rs1qax";
-    url="https://launchpad.net/compiz/0.9.10/0.9.10.0/+download/compiz-0.9.10.0.tar.bz2";
-    sha256="0kvjib0ns02cikpsjq5hlf746yjx2gkfh373pvrb25lzv3rs1qax";
+    hash="1czk4snv9j9l7b587nwf2y305lkn112zspm7f9l7yfk7jmkx1hqy";
+    url="https://launchpad.net/compiz/0.9.11/0.9.11.2/+download/compiz-0.9.11.2.tar.bz2";
+    sha256="1czk4snv9j9l7b587nwf2y305lkn112zspm7f9l7yfk7jmkx1hqy";
   };
   buildInputs = [cmake pkgconfig
     libXrender renderproto gtk libwnck pango cairo
diff --git a/pkgs/applications/window-managers/compton/default.nix b/pkgs/applications/window-managers/compton/default.nix
index dc1622972ad1..efa820b0b6a2 100644
--- a/pkgs/applications/window-managers/compton/default.nix
+++ b/pkgs/applications/window-managers/compton/default.nix
@@ -1,17 +1,24 @@
-{ stdenv, fetchgit, pkgconfig, libXcomposite, libXfixes, libXdamage
-, libXrender, libXext }:
+{ stdenv, fetchurl, pkgconfig
+, dbus, libconfig, libdrm, libxml2, mesa, pcre
+, libXcomposite, libXfixes, libXdamage, libXinerama
+, libXrandr, libXrender, libXext }:
+
 stdenv.mkDerivation rec {
-  name = "compton-20120507";
-  src = fetchgit {
-    url = git://github.com/chjj/compton.git;
-    rev = "d52f7a06dbc55d92e061f976730952177edac739";
-    sha256 = "0f7600a841c4c77d181b54bc14cf7d90d0bad25aa5edbade320ca8b9946f14eb";
+
+  name = "compton-0.1_beta2";
+
+  src = fetchurl {
+    url = https://github.com/chjj/compton/releases/download/v0.1_beta2/compton-git-v0.1_beta2-2013-10-21.tar.xz;
+    sha256 = "1mpgn1d98dv66xs2j8gaxjiw26nzwl9a641lrday7h40g3k45g9v";
   };
-  buildInputs = [ pkgconfig libXcomposite libXfixes libXdamage libXrender libXext ];
+
+  buildInputs = [ pkgconfig dbus libconfig libdrm libxml2 mesa pcre
+    libXcomposite libXfixes libXdamage libXinerama libXrandr libXrender libXext ];
   buildFlagsArray = ["CFLAGS=-O3 -fomit-frame-pointer"];
   installFlags = "PREFIX=$(out)";
-  meta = {
-    homepage = http://www.x.org/;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/chjj/compton/;
     description = "A fork of XCompMgr, a sample compositing manager for X servers";
     longDescription = ''
       A fork of XCompMgr, which is a  sample compositing manager for X servers
@@ -19,7 +26,7 @@ stdenv.mkDerivation rec {
       basic eye-candy effects. This fork adds additional features, such as additional
       effects, and a fork at a well-defined and proper place.
     '';
-    license = "bsd";
-    platforms = with stdenv.lib.platforms; linux;
+    license = licenses.mit;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/window-managers/dwm/confnotify-6.0.patch b/pkgs/applications/window-managers/dwm/confnotify-6.0.patch
deleted file mode 100644
index 5b5e2ebb68a7..000000000000
--- a/pkgs/applications/window-managers/dwm/confnotify-6.0.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix SDL fullscreen problems when the resolution changes:
-https://groups.google.com/d/msg/wmii/nJBrSjrnnq8/ZEYWOWE5pj4J
-
-diff -r ec4baab78314 dwm.c
---- a/dwm.c	Mon Dec 19 15:38:30 2011 +0100
-+++ b/dwm.c	Sat Jan 14 12:35:50 2012 +0100
-@@ -397,9 +397,10 @@
- 		showhide(m->stack);
- 	else for(m = mons; m; m = m->next)
- 		showhide(m->stack);
--	if(m)
-+	if(m) {
- 		arrangemon(m);
--	else for(m = mons; m; m = m->next)
-+		restack(m);
-+	} else for(m = mons; m; m = m->next)
- 		arrangemon(m);
- }
- 
-@@ -408,7 +409,6 @@
- 	strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol);
- 	if(m->lt[m->sellt]->arrange)
- 		m->lt[m->sellt]->arrange(m);
--	restack(m);
- }
- 
- void
-@@ -1827,6 +1827,8 @@
- 		.event_mask = ButtonPressMask|ExposureMask
- 	};
- 	for(m = mons; m; m = m->next) {
-+		if (m->barwin)
-+			continue;
- 		m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
- 		                          CopyFromParent, DefaultVisual(dpy, screen),
- 		                          CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
diff --git a/pkgs/applications/window-managers/dwm/default.nix b/pkgs/applications/window-managers/dwm/default.nix
index 82eb9e56935f..626a0926a676 100644
--- a/pkgs/applications/window-managers/dwm/default.nix
+++ b/pkgs/applications/window-managers/dwm/default.nix
@@ -16,14 +16,14 @@ stdenv.mkDerivation {
   prePatch = ''sed -i "s@/usr/local@$out@" config.mk'';
 
   # Allow users set their own list of patches
-  patches = [ ./confnotify-6.0.patch ] ++ patches;
+  inherit patches;
 
   buildPhase = " make ";
  
   meta = {
     homepage = "www.suckless.org";
     description = "Dynamic window manager for X";
-    license = "MIT";
+    license = stdenv.lib.licenses.mit;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; all;
   };
diff --git a/pkgs/applications/window-managers/dzen2/default.nix b/pkgs/applications/window-managers/dzen2/default.nix
new file mode 100644
index 000000000000..b3e970e90be0
--- /dev/null
+++ b/pkgs/applications/window-managers/dzen2/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, pkgconfig, libX11, libXft, libXinerama, libXpm }:
+
+stdenv.mkDerivation rec {
+  name = "dzen2-0.9.5";
+
+  buildInputs = [ pkgconfig libX11 libXft libXinerama libXpm ];
+
+  src = fetchurl {
+    url = "https://github.com/robm/dzen/tarball/master/dzen2-0.9.5git.tar.gz";
+    sha256 = "d4f7943cd39dc23fd825eb684b49dc3484860fa8443d30b06ee38af72a53b556";
+  };
+
+  patchPhase = ''
+    CFLAGS=" -Wall -Os ''${INCS} -DVERSION=\"''${VERSION}\" -DDZEN_XINERAMA -DDZEN_XPM -DDZEN_XFT `pkg-config --cflags xft`"
+    LIBS=" -L/usr/lib -lc -lXft -lXpm -lXinerama -lX11"
+    echo "CFLAGS=$CFLAGS" >>config.mk
+    echo "LIBS=$LIBS" >>config.mk
+    echo "LDFLAGS=$LIBS" >>config.mk
+    substituteInPlace config.mk --replace /usr/local "$out"
+    substituteInPlace gadgets/config.mk --replace /usr/local "$out"
+  '';
+
+  buildPhase = ''
+    mkdir -p $out/bin $out/man/man1
+    make clean install
+    cd gadgets
+    make clean install
+  '';
+
+  meta = {
+    homepage = https://github.com/robm/dzen;
+    license = stdenv.lib.licenses.mit;
+    description = "X notification utility";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/window-managers/fvwm/default.nix b/pkgs/applications/window-managers/fvwm/default.nix
index 33acd0002705..6830e3a1c010 100644
--- a/pkgs/applications/window-managers/fvwm/default.nix
+++ b/pkgs/applications/window-managers/fvwm/default.nix
@@ -20,7 +20,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://fvwm.org";
     description = "A multiple large virtual desktop window manager";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
-
diff --git a/pkgs/applications/window-managers/herbstluftwm/default.nix b/pkgs/applications/window-managers/herbstluftwm/default.nix
index 3ce50a82915a..7c4cb4934c9f 100644
--- a/pkgs/applications/window-managers/herbstluftwm/default.nix
+++ b/pkgs/applications/window-managers/herbstluftwm/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, glib, libX11, libXinerama }:
+{ stdenv, fetchurl, pkgconfig, glib, libX11, libXext, libXinerama }:
 
 stdenv.mkDerivation rec {
-  name = "herbstluftwm-0.5.2";
+  name = "herbstluftwm-0.6.2";
 
   src = fetchurl {
     url = "http://herbstluftwm.org/tarballs/${name}.tar.gz";
-    sha256 = "15crb77gw8p1h721r3dcgn0m1n03qk0g81rrnaqw8p7hz44k6gf5";
+    sha256 = "1b7h2zi0i9j17k1z62qw5zq7j9i8gv33pmcxnfiilzzfg8wmr7x8";
   };
 
   patchPhase = ''
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
           config.mk
   '';
 
-  buildInputs = [ pkgconfig glib libX11 libXinerama ];
+  buildInputs = [ pkgconfig glib libX11 libXext libXinerama ];
 
   meta = {
     description = "A manual tiling window manager for X";
diff --git a/pkgs/applications/window-managers/i3/default.nix b/pkgs/applications/window-managers/i3/default.nix
index f6d2dc4cfe5e..b5869ccaf8d9 100644
--- a/pkgs/applications/window-managers/i3/default.nix
+++ b/pkgs/applications/window-managers/i3/default.nix
@@ -1,23 +1,35 @@
 { fetchurl, stdenv, which, pkgconfig, libxcb, xcbutilkeysyms, xcbutil,
   xcbutilwm, libstartup_notification, libX11, pcre, libev, yajl,
-  libXcursor, coreutils, perl, pango }:
+  xcb-util-cursor, coreutils, perl, pango, perlPackages, xdummy }:
 
 stdenv.mkDerivation rec {
   name = "i3-${version}";
-  version = "4.6";
+  version = "4.8";
 
   src = fetchurl {
     url = "http://i3wm.org/downloads/${name}.tar.bz2";
-    sha256 = "1qand44hjqz84f2xzd0mmyk9vpsm7iwz6446s4ivdj6f86213lpm";
+    sha256 = "0sqvd8yqf9vwqrrvbpbf8k93b3qfa3q9289m82xq15r31wlk8b2h";
   };
 
-  buildInputs = [ which pkgconfig libxcb xcbutilkeysyms xcbutil xcbutilwm
-    libstartup_notification libX11 pcre libev yajl libXcursor perl pango ];
+  buildInputs = [
+    which pkgconfig libxcb xcbutilkeysyms xcbutil xcbutilwm
+    libstartup_notification libX11 pcre libev yajl xcb-util-cursor perl pango
+    perlPackages.AnyEventI3 perlPackages.X11XCB perlPackages.IPCRun
+    perlPackages.ExtUtilsPkgConfig perlPackages.TestMore perlPackages.InlineC
+  ];
 
-  patchPhase = ''
+  postPatch = ''
     patchShebangs .
   '';
 
+  doCheck = stdenv.system == "x86_64-linux";
+
+  checkPhase = ''
+    ln -sf "${xdummy}/bin/xdummy" testcases/Xdummy
+    (cd testcases && perl complete-run.pl -p 1)
+    ! grep -q '^not ok' testcases/latest/complete-run.log
+  '';
+
   configurePhase = "makeFlags=PREFIX=$out";
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/window-managers/i3/lock.nix b/pkgs/applications/window-managers/i3/lock.nix
index c37ed0d85f27..5af4519af03a 100644
--- a/pkgs/applications/window-managers/i3/lock.nix
+++ b/pkgs/applications/window-managers/i3/lock.nix
@@ -2,11 +2,11 @@
   pam, libX11, libev, cairo, libxkbcommon, libxkbfile }:
 
 stdenv.mkDerivation rec {
-  name = "i3lock-2.5";
+  name = "i3lock-2.6";
 
   src = fetchurl {
     url = "http://i3wm.org/i3lock/${name}.tar.bz2";
-    sha256 = "0xqdklvfcn2accwdbzsly7add0f3rh9sxjnahawas4zwwk4p49xc";
+    sha256 = "0aj0an8fwv66jhda499r3xa00546cc9ja1dk8xpc6sy6xygqjbf0";
   };
 
   buildInputs = [ which pkgconfig libxcb xcbutilkeysyms xcbutilimage pam libX11
diff --git a/pkgs/applications/window-managers/i3/status.nix b/pkgs/applications/window-managers/i3/status.nix
index 7317f17bb8b2..bf3367d78435 100644
--- a/pkgs/applications/window-managers/i3/status.nix
+++ b/pkgs/applications/window-managers/i3/status.nix
@@ -2,11 +2,11 @@
   }:
 
 stdenv.mkDerivation rec {
-  name = "i3status-2.7";
+  name = "i3status-2.8";
 
   src = fetchurl {
     url = "http://i3wm.org/i3status/${name}.tar.bz2";
-    sha256 = "0cm6fhsc7hzsqni8pwhjl2l0rfd458paabn54cgzqnmwwdflwgq7";
+    sha256 = "1zh7z2qbw0jsrqdkc1irviq2n20mc5hq4h1mckyfcm238pfwa1mb";
   };
 
   buildInputs = [ confuse yajl alsaLib wirelesstools ];
diff --git a/pkgs/applications/window-managers/jwm/default.nix b/pkgs/applications/window-managers/jwm/default.nix
index 57e6ecf17492..73c5e5df81af 100644
--- a/pkgs/applications/window-managers/jwm/default.nix
+++ b/pkgs/applications/window-managers/jwm/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, libX11, libXext, libXinerama, libXpm, libXft, freetype,
   fontconfig }:
 
-stdenv.mkDerivation {
-  name = "jwm-2.0.1";
+stdenv.mkDerivation rec {
+  name = "jwm-2.2.2";
   
   src = fetchurl {
-     url = http://www.joewing.net/programs/jwm/releases/jwm-2.0.1.tar.bz2;
-     sha256 = "1ix5y00cmg3cyazl0adzgv49140zxaf2dpngyg1dyy4ma6ysdmnw";
+     url = "http://www.joewing.net/programs/jwm/releases/${name}.tar.xz";
+     sha256 = "0nhyy78c6imk85d47bakk460x0cfhkyghqq82zghmb00dhwiryln";
   };
 
   buildInputs = [ libX11 libXext libXinerama libXpm libXft freetype 
diff --git a/pkgs/applications/window-managers/matchbox/default.nix b/pkgs/applications/window-managers/matchbox/default.nix
index ed2637eff6e5..08c1be9f963d 100644
--- a/pkgs/applications/window-managers/matchbox/default.nix
+++ b/pkgs/applications/window-managers/matchbox/default.nix
@@ -13,6 +13,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "X window manager for non-desktop embedded systems";
     homepage = http://matchbox-project.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/window-managers/openbox/default.nix b/pkgs/applications/window-managers/openbox/default.nix
index e8314ef1b433..fad5b8010ea4 100644
--- a/pkgs/applications/window-managers/openbox/default.nix
+++ b/pkgs/applications/window-managers/openbox/default.nix
@@ -1,24 +1,33 @@
 { stdenv, fetchurl, pkgconfig
 , libxml2, libXinerama, libXcursor, libXau, libXrandr
-, imlib2, pango, libstartup_notification }:
+, imlib2, pango, libstartup_notification, makeWrapper}:
 
 stdenv.mkDerivation rec {
-  name = "openbox-3.5.0";
+  name = "openbox-3.5.2";
 
   buildInputs = [
     pkgconfig libxml2
     libXinerama libXcursor libXau libXrandr
     imlib2 pango libstartup_notification
+    makeWrapper
   ];
 
   src = fetchurl {
     url = "http://openbox.org/dist/openbox/${name}.tar.gz";
-    sha256 = "02pa1wa2rzvnq1z3xchzafc96hvp3537jh155q8acfhbacb01abg";
+    sha256 = "0cxgb334zj6aszwiki9g10i56sm18i7w1kw52vdnwgzq27pv93qj";
   };
 
+  # Openbox needs XDG_DATA_DIRS set or it can't find its default theme
+  postInstall = ''
+    wrapProgram "$out/bin/openbox" --prefix XDG_DATA_DIRS : "$out/share"
+    wrapProgram "$out/bin/openbox-session" --prefix XDG_DATA_DIRS : "$out/share"
+    wrapProgram "$out/bin/openbox-gnome-session" --prefix XDG_DATA_DIRS : "$out/share"
+    wrapProgram "$out/bin/openbox-kde-session" --prefix XDG_DATA_DIRS : "$out/share"
+    '';
+
   meta = {
     description = "X window manager for non-desktop embedded systems";
     homepage = http://openbox.org/;
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/window-managers/ratpoison/default.nix b/pkgs/applications/window-managers/ratpoison/default.nix
index 272666533024..65264c20db35 100644
--- a/pkgs/applications/window-managers/ratpoison/default.nix
+++ b/pkgs/applications/window-managers/ratpoison/default.nix
@@ -2,11 +2,11 @@
 , libXtst, xextproto, readline, libXi, pkgconfig, perl, autoconf, automake }:
 
 stdenv.mkDerivation rec {
-  name = "ratpoison-1.4.5";
+  name = "ratpoison-1.4.6";
 
   src = fetchurl {
     url = "mirror://savannah/ratpoison/${name}.tar.gz";
-    sha256 = "7391079db20b8613eecfd81d64d243edc9d3c586750c8f2da2bb9db14d260f03";
+    sha256 = "1y1b38bng0naxfy50asshzg5xr1b2rn88mcgbds42y72d7y9d0za";
   };
 
   buildInputs =
@@ -18,8 +18,6 @@ stdenv.mkDerivation rec {
 
   preConfigure = "autoreconf -vf";      # needed because of the patch above
 
-  patches = [ ./glibc-fix.patch ];
-
   postInstall = ''
     mkdir -p $out/share/emacs/site-lisp
     mv "$out/share/ratpoison/"*.el $out/share/emacs/site-lisp/
@@ -28,7 +26,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.nongnu.org/ratpoison/";
     description = "Ratpoison, a simple mouse-free tiling window manager";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     longDescription = ''
        Ratpoison is a simple window manager with no fat library
@@ -45,7 +43,7 @@ stdenv.mkDerivation rec {
        cripples Emacs and other quality pieces of software.
     '';
 
-    maintainers = [ stdenv.lib.maintainers.simons ];
-    platforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = stdenv.lib.platforms.linux;
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/window-managers/ratpoison/glibc-fix.patch b/pkgs/applications/window-managers/ratpoison/glibc-fix.patch
deleted file mode 100644
index c779d5af795e..000000000000
--- a/pkgs/applications/window-managers/ratpoison/glibc-fix.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 4ad0b38fb53506d613c4b4f7268dadfcedae9b8e Mon Sep 17 00:00:00 2001
-From: Shawn Betts <sabetts@gmail.com>
-Date: Mon, 13 Jul 2009 01:23:25 +0000
-Subject: check for getline in configure.in
-
-This fixes a build error encountered on glibc 2.10 systems
----
-diff --git a/configure.in b/configure.in
-index 0c1b42c..08f4ee8 100644
---- a/configure.in
-+++ b/configure.in
-@@ -146,7 +146,7 @@ AC_CHECK_HEADERS(unistd.h stdarg.h)
- dnl Checks for typedefs, structures, and compiler characteristics.
- 
- dnl Checks for library functions.
--AC_CHECK_FUNCS(getopt getopt_long setsid setpgid setpgrp putenv vsnprintf usleep)
-+AC_CHECK_FUNCS(getopt getopt_long setsid setpgid setpgrp putenv vsnprintf usleep getline)
- 
- AC_TYPE_SIGNAL
- 
---
-cgit v0.9.0.2
diff --git a/pkgs/applications/window-managers/stalonetray/default.nix b/pkgs/applications/window-managers/stalonetray/default.nix
index 143e45b5484b..fdb81a88b151 100644
--- a/pkgs/applications/window-managers/stalonetray/default.nix
+++ b/pkgs/applications/window-managers/stalonetray/default.nix
@@ -11,10 +11,10 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="stalonetray";
-    version="0.8.0";
+    version="0.8.1";
     name="${baseName}-${version}";
     url="mirror://sourceforge/${baseName}/${name}.tar.bz2";
-    hash="0ccllmpsmilns6xxl174vgcjf8kfakcrhg3psc4cg0yynqbi2mka";
+    hash="1wp8pnlv34w7xizj1vivnc3fkwqq4qgb9dbrsg15598iw85gi8ll";
   };
 in
 rec {
diff --git a/pkgs/applications/window-managers/sxhkd/default.nix b/pkgs/applications/window-managers/sxhkd/default.nix
new file mode 100644
index 000000000000..03563a4f8121
--- /dev/null
+++ b/pkgs/applications/window-managers/sxhkd/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, asciidoc, libxcb, xcbutil, xcbutilkeysyms, xcbutilwm }:
+
+stdenv.mkDerivation rec {
+  name = "sxhkd-0.5.4";
+ 
+  src = fetchurl {
+    url = "https://github.com/baskerville/sxhkd/archive/0.5.4.tar.gz";
+    sha256 = "de95f97155319ded41ece9403ac9e9f18bfdd914a09f553ab09b331bbfe5d332";
+  };
+  
+  buildInputs = [ asciidoc libxcb xcbutil xcbutilkeysyms xcbutilwm ];
+
+  buildPhase = ''
+     make PREFIX=$out
+  '';
+
+  installPhase = ''
+     make PREFIX=$out install
+  '';
+
+  meta = {
+    description = "Simple X hotkey daemon";
+    homepage = "http://github.com/baskerville/sxhkd";
+    license = "BSD";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/window-managers/tabbed/default.nix b/pkgs/applications/window-managers/tabbed/default.nix
index 3ab950bf4d05..2dec3b2241f2 100644
--- a/pkgs/applications/window-managers/tabbed/default.nix
+++ b/pkgs/applications/window-managers/tabbed/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
  
   src = fetchhg {
     url = http://hg.suckless.org/tabbed;
-    tag = "d7542a6f6dc5";
+    rev = "d7542a6f6dc5";
     sha256 = "1963jsazfmh5k7923c1mfwppz1xbh48z16j0sa64fiscq22as2gj";
   };
 
diff --git a/pkgs/applications/window-managers/trayer/default.nix b/pkgs/applications/window-managers/trayer/default.nix
index b8ecf81f7fc7..43a1d2b8e79a 100644
--- a/pkgs/applications/window-managers/trayer/default.nix
+++ b/pkgs/applications/window-managers/trayer/default.nix
@@ -1,28 +1,25 @@
-{ stdenv, fetchurl, pkgconfig, gdk_pixbuf, gtk, libXmu }:
+{ stdenv, fetchFromGitHub, pkgconfig, gdk_pixbuf, gtk, libXmu }:
 
 stdenv.mkDerivation rec {
-  name = "trayer-1.1.5";
+  name = "trayer-1.1.6";
 
   buildInputs = [ pkgconfig gdk_pixbuf gtk libXmu ];
 
-  src = fetchurl {
-          url = "https://github.com/sargon/trayer-srg/tarball/${name}";
-          name = "${name}.tar.gz";
-          sha256 = "98804500188c0bb99c7389ebea4b2e4dfffa2f3d06dc97e633b4934cf7c29757";
-        };
+  src = fetchFromGitHub {
+    owner = "sargon";
+    repo = "trayer-srg";
+    rev = name;
+    sha256 = "0mmya7a1qh3zyqgvcx5fz2lvr9n0ilr490l1j3z4myahi4snk2mg";
+  };
 
   makeFlags = [ "PREFIX=$(out)" ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://github.com/sargon/trayer-srg;
-
-    license = "bsd";
-
+    license = licenses.mit;
     description = "A lightweight GTK2-based systray for UNIX desktop";
-
-    maintainers = [ stdenv.lib.maintainers.shlevy ];
-
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    maintainer = with maintainers; [ pSub ];
   };
 }
 
diff --git a/pkgs/applications/window-managers/weston/default.nix b/pkgs/applications/window-managers/weston/default.nix
index 2c1044d69372..73a6412afabc 100644
--- a/pkgs/applications/window-managers/weston/default.nix
+++ b/pkgs/applications/window-managers/weston/default.nix
@@ -1,31 +1,33 @@
 { stdenv, fetchurl, pkgconfig, wayland, mesa, libxkbcommon
 , cairo, libxcb, libXcursor, x11, udev, libdrm, mtdev
-, libjpeg, pam, autoconf, automake, libtool }:
+, libjpeg, pam, autoconf, automake, libtool, dbus }:
 
-let version = "1.0.5"; in
+let version = "1.5.0"; in
 
 stdenv.mkDerivation rec {
   name = "weston-${version}";
 
   src = fetchurl {
     url = "http://wayland.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "0g2k82pnlxl8b70ykazj7kn8xffjfsmgcgx427qdrm4083z2hgm0";
+    sha256 = "113nig2dmbgrjhi79k0zw77vicnx8vkaihawd0nsg6n79ah8nf06";
   };
 
-  buildInputs = [ pkgconfig wayland mesa libxkbcommon
-    cairo libxcb libXcursor x11 udev libdrm mtdev
-    libjpeg pam autoconf automake libtool ];
+  #ToDo: libinput can be split away
+  buildInputs = [
+    pkgconfig wayland mesa libxkbcommon
+    cairo libxcb libXcursor x11 udev libdrm mtdev libjpeg pam dbus.libs
+  ];
 
-  preConfigure = "autoreconf -vfi";
+  NIX_CFLAGS_COMPILE = "-I${libdrm}/include/libdrm";
 
-  # prevent install target to chown root weston-launch, which fails
-  configureFlags = ''
-    --disable-setuid-install
-  '';
+  configureFlags = [
+    "--disable-setuid-install" # prevent install target to chown root weston-launch, which fails
+  ];
 
   meta = {
     description = "Reference implementation of a Wayland compositor";
     homepage = http://wayland.freedesktop.org/;
     license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/window-managers/windowmaker/default.nix b/pkgs/applications/window-managers/windowmaker/default.nix
index 2b146a78cb39..bbb6c0388251 100644
--- a/pkgs/applications/window-managers/windowmaker/default.nix
+++ b/pkgs/applications/window-managers/windowmaker/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "windowmaker-${version}";
-  version = "0.95.4";
+  version = "0.95.5";
 
   src = fetchurl {
     url = "http://windowmaker.org/pub/source/release/"
         + "WindowMaker-${version}.tar.gz";
-    sha256 = "0icffqnmkkjjf412m27wljbf9vxb2ry4aiyi2pqmzw3h0pq9gsib";
+    sha256 = "1l3hmx4jzf6vp0zclqx9gsqrlwh4rvqm1g1zr5ha0cp0zmsg89ab";
   };
 
   buildInputs = [ pkgconfig libX11 libXft libXmu ];
diff --git a/pkgs/applications/window-managers/xmonad/default.nix b/pkgs/applications/window-managers/xmonad/default.nix
index 0b8b71db7e92..08b85a5530fd 100644
--- a/pkgs/applications/window-managers/xmonad/default.nix
+++ b/pkgs/applications/window-managers/xmonad/default.nix
@@ -1,3 +1,5 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, extensibleExceptions, filepath, mtl, utf8String, X11 }:
 
 cabal.mkDerivation (self: {
@@ -10,9 +12,14 @@ cabal.mkDerivation (self: {
     extensibleExceptions filepath mtl utf8String X11
   ];
   postInstall = ''
+    shopt -s globstar
     mkdir -p $out/share/man/man1
-    mv $out/share/xmonad-*/man/*.1 $out/share/man/man1/
+    mv "$out/"**"/man/"*.1 $out/share/man/man1/
   '';
+  patches = [
+    # Patch to make xmonad use XMONAD_{GHC,XMESSAGE} (if available).
+    ./xmonad_ghc_var_0.11.patch
+  ];
   meta = {
     homepage = "http://xmonad.org";
     description = "A tiling window manager";
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
index 5c00ddf0fd13..086d80963d84 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
@@ -1,11 +1,13 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, extensibleExceptions, mtl, random, utf8String, X11, X11Xft
 , xmonad
 }:
 
 cabal.mkDerivation (self: {
   pname = "xmonad-contrib";
-  version = "0.11.2";
-  sha256 = "0qlc732m6mhvx7g10r69hk5x460kjv2r04s91cnn5yfiia1qfpai";
+  version = "0.11.3";
+  sha256 = "14h9vr33yljymswj50wbimav263y9abdcgi07mvfis0zd08rxqxa";
   buildDepends = [
     extensibleExceptions mtl random utf8String X11 X11Xft xmonad
   ];
@@ -14,9 +16,6 @@ cabal.mkDerivation (self: {
     description = "Third party extensions for xmonad";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = with self.stdenv.lib.maintainers; [ simons ];
   };
 })
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
index 1976e393baad..87ee4994e45d 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
@@ -1,3 +1,5 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, hint, libmpd, mtl, network, parsec, random, regexPosix
 , split, X11, xmonad, xmonadContrib
 }:
@@ -17,9 +19,6 @@ cabal.mkDerivation (self: {
     description = "Third party extensions for xmonad with wacky dependencies";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = with self.stdenv.lib.maintainers; [ simons ];
   };
 })
diff --git a/pkgs/applications/window-managers/xmonad/xmonad_ghc_var_0.11.patch b/pkgs/applications/window-managers/xmonad/xmonad_ghc_var_0.11.patch
new file mode 100644
index 000000000000..f0785773cc14
--- /dev/null
+++ b/pkgs/applications/window-managers/xmonad/xmonad_ghc_var_0.11.patch
@@ -0,0 +1,44 @@
+--- xmonad-0.11/XMonad/Core.hs	2013-01-01 01:31:47.000000000 +0000
++++ new-xmonad/XMonad/Core.hs	2013-12-23 17:36:40.862146910 +0000
+@@ -47,6 +47,7 @@
+ import System.Process
+ import System.Directory
+ import System.Exit
++import System.Environment (lookupEnv)
+ import Graphics.X11.Xlib
+ import Graphics.X11.Xlib.Extras (Event)
+ import Data.Typeable
+@@ -452,6 +453,7 @@
+         err  = base ++ ".errors"
+         src  = base ++ ".hs"
+         lib  = dir </> "lib"
++    ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "XMONAD_GHC")
+     libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
+     srcT <- getModTime src
+     binT <- getModTime bin
+@@ -460,7 +462,7 @@
+         -- temporarily disable SIGCHLD ignoring:
+         uninstallSignalHandlers
+         status <- bracket (openFile err WriteMode) hClose $ \h ->
+-            waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir)
++            waitForProcess =<< runProcess ghc ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir)
+                                     Nothing Nothing Nothing (Just h)
+ 
+         -- re-enable SIGCHLD:
+@@ -469,6 +471,7 @@
+         -- now, if it fails, run xmessage to let the user know:
+         when (status /= ExitSuccess) $ do
+             ghcErr <- readFile err
++            xmessage <- fromMaybe "xmessage" <$> liftIO (lookupEnv "XMONAD_XMESSAGE")
+             let msg = unlines $
+                     ["Error detected while loading xmonad configuration file: " ++ src]
+                     ++ lines (if null ghcErr then show status else ghcErr)
+@@ -476,7 +479,7 @@
+             -- nb, the ordering of printing, then forking, is crucial due to
+             -- lazy evaluation
+             hPutStrLn stderr msg
+-            forkProcess $ executeFile "xmessage" True ["-default", "okay", msg] Nothing
++            forkProcess $ executeFile xmessage True ["-default", "okay", msg] Nothing
+             return ()
+         return (status == ExitSuccess)
+       else return True