about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-28 11:30:31 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-07-28 11:30:49 +0200
commitf64d84698eb3f4d833e846336ff99a73331c31f7 (patch)
tree1120886b680851bc8b8f8d337af3503ecd4a3d71
parent3e4a382d6753a057256c7ef1e9f52ae9e07bd677 (diff)
parent30431e71608576baf880567b2894ad2a542f8d5e (diff)
downloadnixlib-f64d84698eb3f4d833e846336ff99a73331c31f7.tar
nixlib-f64d84698eb3f4d833e846336ff99a73331c31f7.tar.gz
nixlib-f64d84698eb3f4d833e846336ff99a73331c31f7.tar.bz2
nixlib-f64d84698eb3f4d833e846336ff99a73331c31f7.tar.lz
nixlib-f64d84698eb3f4d833e846336ff99a73331c31f7.tar.xz
nixlib-f64d84698eb3f4d833e846336ff99a73331c31f7.tar.zst
nixlib-f64d84698eb3f4d833e846336ff99a73331c31f7.zip
Merge remote-tracking branch 'origin/master' into staging
Conflicts:
	pkgs/applications/audio/espeak/edit.nix
	pkgs/applications/audio/lmms/default.nix
	pkgs/desktops/e18/enlightenment.nix
	pkgs/games/exult/default.nix
	pkgs/os-specific/linux/alsa-plugins/default.nix
-rw-r--r--doc/contributing.xml21
-rw-r--r--doc/manual.xml1
-rw-r--r--doc/meta.xml155
-rw-r--r--doc/quick-start.xml14
-rw-r--r--nixos/doc/manual/README12
-rw-r--r--nixos/modules/services/amqp/rabbitmq.nix41
-rw-r--r--nixos/modules/services/misc/nix-ssh-serve.nix40
-rw-r--r--nixos/modules/services/monitoring/munin.nix15
-rw-r--r--nixos/modules/services/networking/znc.nix30
-rw-r--r--nixos/modules/services/search/elasticsearch.nix18
-rw-r--r--nixos/modules/services/web-servers/lighttpd/cgit.nix2
-rw-r--r--nixos/modules/services/web-servers/lighttpd/default.nix6
-rw-r--r--nixos/modules/services/web-servers/lighttpd/gitweb.nix4
-rw-r--r--nixos/modules/services/x11/desktop-managers/e18.nix7
-rw-r--r--nixos/modules/system/etc/etc.nix2
-rw-r--r--nixos/modules/system/etc/setup-etc.pl41
-rw-r--r--pkgs/applications/audio/a2jmidid/default.nix4
-rw-r--r--pkgs/applications/audio/ardour/default.nix4
-rw-r--r--pkgs/applications/audio/bristol/default.nix4
-rw-r--r--pkgs/applications/audio/calf/default.nix4
-rw-r--r--pkgs/applications/audio/distrho/default.nix4
-rw-r--r--pkgs/applications/audio/drumkv1/default.nix4
-rw-r--r--pkgs/applications/audio/espeak/default.nix14
-rw-r--r--pkgs/applications/audio/espeak/edit.nix52
-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/fluidsynth/default.nix4
-rw-r--r--pkgs/applications/audio/guitarix/default.nix4
-rw-r--r--pkgs/applications/audio/hydrogen/default.nix4
-rw-r--r--pkgs/applications/audio/ingen/default.nix4
-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.nix4
-rw-r--r--pkgs/applications/audio/jalv/default.nix4
-rw-r--r--pkgs/applications/audio/lash/default.nix4
-rw-r--r--pkgs/applications/audio/linuxsampler/default.nix4
-rw-r--r--pkgs/applications/audio/lmms/default.nix4
-rw-r--r--pkgs/applications/audio/mhwaveedit/default.nix4
-rw-r--r--pkgs/applications/audio/milkytracker/default.nix4
-rw-r--r--pkgs/applications/audio/moc/default.nix10
-rwxr-xr-xpkgs/applications/audio/ncmpc/default.nix4
-rw-r--r--pkgs/applications/audio/petrifoo/default.nix4
-rw-r--r--pkgs/applications/audio/projectm/default.nix4
-rw-r--r--pkgs/applications/audio/puredata/default.nix4
-rw-r--r--pkgs/applications/audio/qjackctl/default.nix8
-rw-r--r--pkgs/applications/audio/qsynth/default.nix4
-rw-r--r--pkgs/applications/audio/qtractor/default.nix4
-rw-r--r--pkgs/applications/audio/rakarrack/default.nix4
-rw-r--r--pkgs/applications/audio/samplv1/default.nix4
-rw-r--r--pkgs/applications/audio/seq24/default.nix4
-rw-r--r--pkgs/applications/audio/setbfree/default.nix4
-rw-r--r--pkgs/applications/audio/sonic-visualiser/default.nix4
-rw-r--r--pkgs/applications/audio/synthv1/default.nix4
-rwxr-xr-xpkgs/applications/audio/vimpc/default.nix34
-rw-r--r--pkgs/applications/audio/vmpk/default.nix4
-rw-r--r--pkgs/applications/audio/xsynth-dssi/default.nix4
-rw-r--r--pkgs/applications/audio/yoshimi/default.nix4
-rw-r--r--pkgs/applications/audio/zynaddsubfx/default.nix4
-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-modes/bbdb/3.nix25
-rw-r--r--pkgs/applications/editors/zed/default.nix75
-rw-r--r--pkgs/applications/inferno/default.nix2
-rw-r--r--pkgs/applications/misc/blender/default.nix4
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-rw-r--r--pkgs/applications/misc/hello/ex-2/default.nix3
-rw-r--r--pkgs/applications/misc/makeself/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/firefox/3.6.nix155
-rw-r--r--pkgs/applications/networking/browsers/firefox/default.nix212
-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/xpidl.patch11
-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/mozilla-plugins/gecko-mediaplayer/default.nix5
-rw-r--r--pkgs/applications/networking/mumble/default.nix6
-rw-r--r--pkgs/applications/networking/spideroak/default.nix62
-rw-r--r--pkgs/applications/science/biology/arb/default.nix1
-rw-r--r--pkgs/applications/version-management/git-and-tools/github-backup/default.nix4
-rw-r--r--pkgs/applications/video/kdenlive/default.nix30
-rw-r--r--pkgs/applications/video/mplayer/default.nix6
-rw-r--r--pkgs/applications/video/mplayer2/default.nix6
-rw-r--r--pkgs/applications/video/mpv/default.nix6
-rw-r--r--pkgs/applications/video/shotcut/CuteLogger.patch13
-rw-r--r--pkgs/applications/video/shotcut/default.nix41
-rw-r--r--pkgs/applications/video/simplescreenrecorder/default.nix4
-rw-r--r--pkgs/applications/video/vlc/default.nix4
-rw-r--r--pkgs/data/fonts/opensans-ttf/default.nix34
-rw-r--r--pkgs/desktops/e18/enlightenment.nix17
-rw-r--r--pkgs/development/compilers/gcc/4.2/builder.sh96
-rw-r--r--pkgs/development/compilers/gcc/4.2/default.nix66
-rw-r--r--pkgs/development/compilers/gcc/4.2/no-sys-dirs.patch139
-rw-r--r--pkgs/development/compilers/gcc/4.2/pass-cxxcpp.patch21
-rw-r--r--pkgs/development/compilers/gcc/4.2/siginfo_t.patch15
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix4
-rw-r--r--pkgs/development/compilers/idris/default.nix1
-rw-r--r--pkgs/development/compilers/idris/trifecta-fix.patch15
-rw-r--r--pkgs/development/compilers/llvm/3.1/clang-include-paths.patch21
-rw-r--r--pkgs/development/compilers/llvm/3.1/clang-ld-flags.patch57
-rw-r--r--pkgs/development/compilers/llvm/3.1/clang.nix42
-rw-r--r--pkgs/development/compilers/llvm/3.1/default.nix30
-rw-r--r--pkgs/development/compilers/llvm/3.2/clang-purity.patch137
-rw-r--r--pkgs/development/compilers/llvm/3.2/clang.nix40
-rw-r--r--pkgs/development/compilers/llvm/3.2/default.nix40
-rw-r--r--pkgs/development/compilers/llvm/3.2/set_soname.patch12
-rw-r--r--pkgs/development/compilers/opencxx/default.nix14
-rw-r--r--pkgs/development/interpreters/supercollider/default.nix4
-rw-r--r--pkgs/development/interpreters/xulrunner/default.nix82
-rw-r--r--pkgs/development/libraries/aubio/default.nix4
-rw-r--r--pkgs/development/libraries/dssi/default.nix2
-rw-r--r--pkgs/development/libraries/epoxy/default.nix30
-rw-r--r--pkgs/development/libraries/frei0r/default.nix22
-rw-r--r--pkgs/development/libraries/gtest/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/ChasingBottoms/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/HUnit-approx/default.nix17
-rw-r--r--pkgs/development/libraries/haskell/MFlow/default.nix28
-rw-r--r--pkgs/development/libraries/haskell/bloomfilter/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cgrep/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cmdargs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ekg-carbon/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/engine-io/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/focus/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/gdiff/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/generic-aeson/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/ghc-mod/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/haskell-token-utils/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/haste-perch/default.nix17
-rw-r--r--pkgs/development/libraries/haskell/hcltest/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/highlighting-kate/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hspec-expectations/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hspec-meta/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hspec/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hspec2/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/http-client/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/http-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/jack/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/json-schema/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/mongoDB/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/network-carbon/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/pandoc-types/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/parsers/0.11.0.3.nix21
-rw-r--r--pkgs/development/libraries/haskell/quickcheck-property-monad/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/scotty/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/socket-io/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/stm-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/streaming-commons/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/stylish-haskell/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/taggy/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/th-desugar/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/thyme/default.nix3
-rw-r--r--pkgs/development/libraries/haskell/trifecta/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/units/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/vinyl/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/wai/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/xml-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/icu/default.nix3
-rw-r--r--pkgs/development/libraries/libevdev/default.nix20
-rw-r--r--pkgs/development/libraries/libnm-qt/default.nix2
-rw-r--r--pkgs/development/libraries/mlt/default.nix36
-rw-r--r--pkgs/development/libraries/movit/default.nix25
-rw-r--r--pkgs/development/libraries/portaudio/default.nix3
-rw-r--r--pkgs/development/libraries/qt-5/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/qt-5.2-dlopen-absolute-paths.patch (renamed from pkgs/development/libraries/qt-5/dlopen-absolute-paths.patch)0
-rw-r--r--pkgs/development/libraries/qt-5/qt-5.3-dlopen-absolute-paths.patch24
-rw-r--r--pkgs/development/libraries/qt-5/qt-5.3.nix162
-rw-r--r--pkgs/development/libraries/rabbitmq-java-client/default.nix30
-rw-r--r--pkgs/development/python-modules/generic/wrap.sh3
-rw-r--r--pkgs/development/tools/analysis/sparse/default.nix33
-rw-r--r--pkgs/development/tools/haskell/HaRe/default.nix4
-rw-r--r--pkgs/development/tools/haskell/codex/default.nix4
-rw-r--r--pkgs/development/tools/haskell/hlint/default.nix5
-rw-r--r--pkgs/development/web/nodejs/build-node-package.nix12
-rw-r--r--pkgs/games/exult/64bits.patch21
-rw-r--r--pkgs/games/exult/arch.patch123
-rw-r--r--pkgs/games/exult/default.nix57
-rw-r--r--pkgs/games/minecraft/default.nix4
-rw-r--r--pkgs/games/openra/default.nix21
-rw-r--r--pkgs/misc/emulators/mednafen/default.nix4
-rw-r--r--pkgs/misc/emulators/snes9x-gtk/default.nix30
-rw-r--r--pkgs/misc/jackaudio/default.nix2
-rw-r--r--pkgs/misc/jackaudio/jack1.nix10
-rw-r--r--pkgs/misc/vim-plugins/default.nix14
-rw-r--r--pkgs/os-specific/linux/alsa-plugins/default.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.12.nix4
-rw-r--r--pkgs/servers/amqp/rabbitmq-server/default.nix4
-rw-r--r--pkgs/servers/http/apache-httpd/2.4.nix4
-rw-r--r--pkgs/servers/pulseaudio/default.nix6
-rw-r--r--pkgs/servers/search/elasticsearch/default.nix1
-rw-r--r--pkgs/servers/search/elasticsearch/plugins.nix53
-rw-r--r--pkgs/servers/serfdom/default.nix2
-rw-r--r--pkgs/servers/serfdom/deps.nix4
-rw-r--r--pkgs/servers/sql/mysql/5.5.x.nix5
-rw-r--r--pkgs/servers/xmpp/openfire/default.nix47
-rw-r--r--pkgs/tools/X11/nitrogen/default.nix2
-rw-r--r--pkgs/tools/admin/gtk-vnc/default.nix2
-rw-r--r--pkgs/tools/graphics/gnuplot/default.nix10
-rw-r--r--pkgs/tools/misc/emv/default.nix25
-rw-r--r--pkgs/tools/misc/kalibrate-rtl/default.nix30
-rw-r--r--pkgs/tools/misc/lrzsz/default.nix19
-rw-r--r--pkgs/tools/misc/picocom/default.nix7
-rw-r--r--pkgs/tools/misc/timidity/default.nix6
-rw-r--r--pkgs/tools/misc/tmux/default.nix4
-rw-r--r--pkgs/tools/networking/bud/default.nix34
-rw-r--r--pkgs/tools/networking/socat/2.x.nix4
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix6
-rw-r--r--pkgs/tools/system/at/default.nix6
-rw-r--r--pkgs/tools/system/at/install.patch17
-rw-r--r--pkgs/tools/system/evemu/default.nix37
-rw-r--r--pkgs/tools/system/monit/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix185
-rw-r--r--pkgs/top-level/haskell-packages.nix7
-rw-r--r--pkgs/top-level/python-packages.nix84
-rw-r--r--pkgs/top-level/release-small.nix1
-rw-r--r--pkgs/top-level/release.nix13
217 files changed, 2109 insertions, 2943 deletions
diff --git a/doc/contributing.xml b/doc/contributing.xml
new file mode 100644
index 000000000000..bcea404baee0
--- /dev/null
+++ b/doc/contributing.xml
@@ -0,0 +1,21 @@
+<chapter xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xml:id="chap-contributing">
+
+<title>Contributing</title>
+
+<para>If you make modifications to the manual, it's important to build the manual before contributing:</para>
+
+<orderedlist>
+
+  <listitem><para><command>$ git clone git://github.com/NixOS/nixpkgs.git</command></para></listitem>
+
+  <listitem><para><command>$ cd nixpkgs/pkgs/top-level</command></para></listitem>
+
+  <listitem><para><command>$ nix-build -A tarball release.nix</command></para></listitem>
+  
+  <listitem><para>Inside the built derivation you shall see <literal>manual/index.html</literal> file.</para></listitem>
+
+</orderedlist>
+
+</chapter>
diff --git a/doc/manual.xml b/doc/manual.xml
index d2c07859b281..145e3e12dd92 100644
--- a/doc/manual.xml
+++ b/doc/manual.xml
@@ -32,6 +32,7 @@
   <xi:include href="language-support.xml" />
   <xi:include href="package-notes.xml" />
   <xi:include href="coding-conventions.xml" />
+  <xi:include href="contributing.xml" />
   
         
 </book>
diff --git a/doc/meta.xml b/doc/meta.xml
index 6c8e458509a7..272e812a03bb 100644
--- a/doc/meta.xml
+++ b/doc/meta.xml
@@ -17,7 +17,9 @@ meta = {
     It is fully customizable.
   '';
   homepage = http://www.gnu.org/software/hello/manual/;
-  license = "GPLv3+";
+  license = stdenv.lib.licenses.gpl3Plus;
+  maintainers = [ stdenv.lib.maintainers.eelco ];
+  platforms = stdenv.lib.platforms.all;
 };
 </programlisting>
 
@@ -31,16 +33,42 @@ the package.  The value of a meta-attribute must a string.</para>
 command-line using <command>nix-env</command>:
 
 <screen>
-$ nix-env -qa hello --meta --xml
-&lt;?xml version='1.0' encoding='utf-8'?>
-&lt;items>
-  &lt;item attrPath="hello" name="hello-2.3" system="i686-linux">
-    &lt;meta name="description" value="A program that produces a familiar, friendly greeting" />
-    &lt;meta name="homepage" value="http://www.gnu.org/software/hello/manual/" />
-    &lt;meta name="license" value="GPLv3+" />
-    &lt;meta name="longDescription" value="GNU Hello is a program that prints &amp;quot;Hello, world!&amp;quot; when you run it.&amp;#xA;It is fully customizable.&amp;#xA;" />
-  &lt;/item>
-&lt;/items>
+$ nix-env -qa hello --meta --json
+{
+    "hello": {
+        "meta": {
+            "description": "A program that produces a familiar, friendly greeting",
+            "homepage": "http://www.gnu.org/software/hello/manual/",
+            "license": {
+                "fullName": "GNU General Public License version 3 or later",
+                "shortName": "GPLv3+",
+                "url": "http://www.fsf.org/licensing/licenses/gpl.html"
+            },
+            "longDescription": "GNU Hello is a program that prints \"Hello, world!\" when you run it.\nIt is fully customizable.\n",
+            "maintainers": [
+                "Ludovic Court\u00e8s &lt;ludo@gnu.org>"
+            ],
+            "platforms": [
+                "i686-linux",
+                "x86_64-linux",
+                "armv5tel-linux",
+                "armv7l-linux",
+                "mips64el-linux",
+                "x86_64-darwin",
+                "i686-cygwin",
+                "i686-freebsd",
+                "x86_64-freebsd",
+                "i686-openbsd",
+                "x86_64-openbsd"
+            ],
+            "position": "/home/user/dev/nixpkgs/pkgs/applications/misc/hello/ex-2/default.nix:14"
+        },
+        "name": "hello-2.9",
+        "system": "x86_64-linux"
+    }
+}
+
+
 </screen>
 
 <command>nix-env</command> knows about the
@@ -92,20 +120,22 @@ interpretation:</para>
 
   <varlistentry>
     <term><varname>license</varname></term>
-    <listitem><para>The license for the package.  See below for the
-    allowed values.</para></listitem>
+    <listitem><para>The license for the package. One from attribute set defined in
+      <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/licenses.nix">
+      <filename>nixpkgs/lib/licenses.nix</filename></link>.
+      Example:
+      <literal>stdenv.lib.licenses.gpl3</literal>.</para></listitem>
   </varlistentry>
 
   <varlistentry>
     <term><varname>maintainers</varname></term>
     <listitem><para>A list of names and e-mail addresses of the
-    maintainers of this Nix expression, e.g. <literal>["Alice
-    &lt;alice@example.org>" "Bob &lt;bob@example.com>"]</literal>.  If
-    you are the maintainer of multiple packages, you may want to add
+    maintainers of this Nix expression. If
+    you would like to be a maintainer of a package, you may want to add
     yourself to <link
-    xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/maintainers.nix"><filename>pkgs/lib/maintainers.nix</filename></link>
-    and write something like <literal>[stdenv.lib.maintainers.alice
-    stdenv.lib.maintainers.bob]</literal>.</para></listitem>
+    xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/maintainers.nix"><filename>nixpkgs/lib/maintainers.nix</filename></link>
+    and write something like <literal>[ stdenv.lib.maintainers.alice
+    stdenv.lib.maintainers.bob ]</literal>.</para></listitem>
   </varlistentry>
 
   <varlistentry>
@@ -121,29 +151,25 @@ interpretation:</para>
   <varlistentry>
     <term><varname>platforms</varname></term>
     <listitem><para>The list of Nix platform types on which the
-    package is supported.  If this attribute is set, the package will
-    refuse to build, and won’t show up in <literal>nix-env
-    -qa</literal> output, on any platform not listed
-    here.  An example is:
+    package is supported. Hydra builds packages according to the
+    platform specified. If no platform is specified, the package does
+    not have prebuilt binaries. An example is:
 
 <programlisting>
-meta.platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
-</programlisting>
-
-    The set <varname>lib.platforms</varname> defines various common
-    lists of platforms types, so it’s more typical to write:
-
-<programlisting>
-meta.platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+meta.platforms = stdenv.lib.platforms.linux;
 </programlisting>
 
+    Attribute Set <varname>stdenv.lib.platforms</varname> in 
+    <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/lib/platforms.nix">
+    <filename>nixpkgs/lib/platforms.nix</filename></link> defines various common
+    lists of platforms types.
     </para></listitem>
   </varlistentry>
 
   <varlistentry>
     <term><varname>hydraPlatforms</varname></term>
     <listitem><para>The list of Nix platform types for which the Hydra
-    instance at <literal>hydra.nixos.org</literal> should build the
+    instance at <literal>hydra.nixos.org</literal> will build the
     package.  (Hydra is the Nix-based continuous build system.)  It
     defaults to the value of <varname>meta.platforms</varname>.  Thus,
     the only reason to set <varname>meta.hydraPlatforms</varname> is
@@ -176,81 +202,18 @@ meta.hydraPlatforms = [];
 
 <section xml:id="sec-meta-license"><title>Licenses</title>
 
-<note><para>This is just a first attempt at standardising the license
-attribute.</para></note>
-
-<para>The <varname>meta.license</varname> attribute must be one of the
+<para>The <varname>meta.license</varname> attribute could be one of the
 following:
 
 <variablelist>
 
   <varlistentry>
-    <term><varname>GPL</varname></term>
-    <listitem><para>GNU General Public License; version not
-    specified.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>GPLv2</varname></term>
-    <listitem><para>GNU General Public License, version
-    2.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>GPLv2+</varname></term>
-    <listitem><para>GNU General Public License, version
-    2 or higher.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>GPLv3</varname></term>
-    <listitem><para>GNU General Public License, version
-    3.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>GPLv3+</varname></term>
-    <listitem><para>GNU General Public License, version
-    3 or higher.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>bsd</varname></term>
-    <listitem><para>Catch-all for licenses that are essentially
-    similar to <link
-    xlink:href="http://www.gnu.org/licenses/license-list.html#ModifiedBSD">the
-    original BSD license with the advertising clause removed</link>,
-    i.e. permissive non-copyleft free software licenses.  This
-    includes the <link
-    xlink:href="http://www.gnu.org/licenses/license-list.html#X11License">X11
-    (“MIT”) License</link>.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>perl5</varname></term>
-    <listitem><para>The Perl 5 license (Artistic License, version 1
-    and GPL, version 1 or later).</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
     <term><varname>free</varname></term>
     <listitem><para>Catch-all for free software licenses not listed
     above.</para></listitem>
   </varlistentry>
 
   <varlistentry>
-    <term><varname>free-copyleft</varname></term>
-    <listitem><para>Catch-all for free, copyleft software licenses not
-    listed above.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><varname>free-non-copyleft</varname></term>
-    <listitem><para>Catch-all for free, non-copyleft software licenses
-    not listed above.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
     <term><varname>unfree-redistributable</varname></term>
     <listitem><para>Unfree package that can be redistributed in binary
     form.  That is, it’s legal to redistribute the
diff --git a/doc/quick-start.xml b/doc/quick-start.xml
index 49c674052b95..0f11a906d771 100644
--- a/doc/quick-start.xml
+++ b/doc/quick-start.xml
@@ -155,9 +155,10 @@ $ git add pkgs/development/libraries/libfoo/default.nix</screen>
         </listitem>
 
         <listitem>
-          <para>You can use <command>nix-prefetch-url</command>
+          <para>You can use <command>nix-prefetch-url</command> (or similar nix-prefetch-git, etc)
           <replaceable>url</replaceable> to get the SHA-256 hash of
-          source distributions.</para>
+          source distributions. There are similar commands as <command>nix-prefetch-git</command> and
+          <command>nix-prefetch-hg</command> available in <literal>nix-prefetch-scripts</literal> package.</para>
         </listitem>
 
         <listitem>
@@ -221,17 +222,10 @@ $ nix-env -f . -iA libfoo</screen>
   </listitem>
 
   <listitem>
-    <para>Optionally commit the new package, or send a patch to
+    <para>Optionally commit the new package and open a pull request, or send a patch to
     <literal>nix-dev@cs.uu.nl</literal>.</para>
   </listitem>
 
-  <listitem>
-    <para>If you want the TU Delft build farm to build binaries of the
-    package and make them available in the <link
-    xlink:href="http://nixos.org/releases/nixpkgs/channels/nixpkgs-unstable/"><literal>nixpkgs</literal>
-    channel</link>, add it to <link
-    xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/release.nix"><filename>pkgs/top-level/release.nix</filename></link>.</para>
-  </listitem>
 
 </orderedlist>
 
diff --git a/nixos/doc/manual/README b/nixos/doc/manual/README
new file mode 100644
index 000000000000..587f6275197a
--- /dev/null
+++ b/nixos/doc/manual/README
@@ -0,0 +1,12 @@
+To build the manual, you need Nix installed on your system (no need
+for NixOS). To install Nix, follow the instructions at
+
+    https://nixos.org/nix/download.html
+
+When you have Nix on your system, in the root directory of the project
+(i.e., `nixpkgs`), run:
+
+    nix-build nixos/release.nix -A manual.x86_64-linux
+
+When this command successfully finishes, it will tell you where the
+manual got generated.
diff --git a/nixos/modules/services/amqp/rabbitmq.nix b/nixos/modules/services/amqp/rabbitmq.nix
index bef15fb64b7f..a930098bfeec 100644
--- a/nixos/modules/services/amqp/rabbitmq.nix
+++ b/nixos/modules/services/amqp/rabbitmq.nix
@@ -4,6 +4,8 @@ with lib;
 
 let
   cfg = config.services.rabbitmq;
+  config_file = pkgs.writeText "rabbitmq.config" cfg.config;
+  config_file_wo_suffix = builtins.substring 0 ((builtins.stringLength config_file) - 7) config_file;
 
 in {
   ###### interface
@@ -31,7 +33,6 @@ in {
         '';
       };
 
-
       dataDir = mkOption {
         type = types.path;
         default = "/var/lib/rabbitmq";
@@ -40,6 +41,30 @@ in {
         '';
       };
 
+      cookie = mkOption {
+        default = "";
+        type = types.str;
+        description = ''
+          Erlang cookie is a string of arbitrary length which must
+          be the same for several nodes to be allowed to communicate.
+          Leave empty to generate automatically.
+        '';
+      };
+
+      config = mkOption {
+        default = "";
+        type = types.str;
+        description = ''
+          Verbatim configuration file contents.
+          See http://www.rabbitmq.com/configure.htm
+        '';
+      };
+
+      plugins = mkOption {
+        default = [];
+        type = types.listOf types.str;
+        description = "The names of plugins to enable";
+      };
     };
   };
 
@@ -69,7 +94,10 @@ in {
         RABBITMQ_NODE_IP_ADDRESS = cfg.listenAddress;
         RABBITMQ_SERVER_START_ARGS = "-rabbit error_logger tty -rabbit sasl_error_logger false";
         SYS_PREFIX = "";
-      };
+        RABBITMQ_ENABLED_PLUGINS_FILE = pkgs.writeText "enabled_plugins" ''
+          [ ${concatStringsSep "," cfg.plugins} ].
+        '';
+      } //  optionalAttrs (cfg.config != "") { RABBITMQ_CONFIG_FILE = config_file_wo_suffix; };
 
       serviceConfig = {
         ExecStart = "${pkgs.rabbitmq_server}/sbin/rabbitmq-server";
@@ -81,6 +109,15 @@ in {
       preStart = ''
         mkdir -p ${cfg.dataDir} && chmod 0700 ${cfg.dataDir}
         if [ "$(id -u)" = 0 ]; then chown rabbitmq:rabbitmq ${cfg.dataDir}; fi
+        
+        ${optionalString (cfg.cookie != "") ''
+            echo -n ${cfg.cookie} > ${cfg.dataDir}/.erlang.cookie
+            chmod 400 ${cfg.dataDir}/.erlang.cookie
+            chown rabbitmq:rabbitmq ${cfg.dataDir}/.erlang.cookie
+        ''}
+
+        mkdir -p /var/log/rabbitmq && chmod 0700 /var/log/rabbitmq
+        chown rabbitmq:rabbitmq /var/log/rabbitmq
       '';
     };
 
diff --git a/nixos/modules/services/misc/nix-ssh-serve.nix b/nixos/modules/services/misc/nix-ssh-serve.nix
index 80e7961b1f82..d70bd855c7ff 100644
--- a/nixos/modules/services/misc/nix-ssh-serve.nix
+++ b/nixos/modules/services/misc/nix-ssh-serve.nix
@@ -1,32 +1,35 @@
 { config, lib, pkgs, ... }:
 
-let
-  serveOnly = pkgs.writeScript "nix-store-serve" ''
-    #!${pkgs.stdenv.shell}
-    if [ "$SSH_ORIGINAL_COMMAND" != "nix-store --serve" ]; then
-      echo 'Error: You are only allowed to run `nix-store --serve'\'''!' >&2
-      exit 1
-    fi
-    exec /run/current-system/sw/bin/nix-store --serve
-  '';
-
-  inherit (lib) mkIf mkOption types;
-in {
+with lib;
+
+{
   options = {
+
     nix.sshServe = {
+
       enable = mkOption {
-        description = "Whether to enable serving the nix store over ssh.";
-        default = false;
         type = types.bool;
+        default = false;
+        description = "Whether to enable serving the Nix store as a binary cache via SSH.";
+      };
+
+      keys = mkOption {
+        type = types.listOf types.str;
+        default = [];
+        example = [ "ssh-dss AAAAB3NzaC1k... alice@example.org" ];
+        description = "A list of SSH public keys allowed to access the binary cache via SSH.";
       };
+
     };
+
   };
 
   config = mkIf config.nix.sshServe.enable {
+
     users.extraUsers.nix-ssh = {
-      description = "User for running nix-store --serve.";
+      description = "Nix SSH substituter user";
       uid = config.ids.uids.nix-ssh;
-      shell = pkgs.stdenv.shell;
+      useDefaultShell = true;
     };
 
     services.openssh.enable = true;
@@ -38,8 +41,11 @@ in {
         PermitTTY no
         PermitTunnel no
         X11Forwarding no
-        ForceCommand ${serveOnly}
+        ForceCommand ${config.nix.package}/bin/nix-store --serve
       Match All
     '';
+
+    users.extraUsers.nix-ssh.openssh.authorizedKeys.keys = config.nix.sshServe.keys;
+
   };
 }
diff --git a/nixos/modules/services/monitoring/munin.nix b/nixos/modules/services/monitoring/munin.nix
index 966c2eca282a..21840bc67e8f 100644
--- a/nixos/modules/services/monitoring/munin.nix
+++ b/nixos/modules/services/monitoring/munin.nix
@@ -189,19 +189,18 @@ in
       wantedBy = [ "multi-user.target" ];
       path = [ pkgs.munin ];
       environment.MUNIN_PLUGSTATE = "/var/run/munin";
+      preStart = ''
+        echo "updating munin plugins..."
+
+        mkdir -p /etc/munin/plugins
+        rm -rf /etc/munin/plugins/*
+        PATH="/run/current-system/sw/bin:/run/current-system/sw/sbin" ${pkgs.munin}/sbin/munin-node-configure --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${muninPlugins} --servicedir=/etc/munin/plugins 2>/dev/null | ${pkgs.bash}/bin/bash
+      '';
       serviceConfig = {
         ExecStart = "${pkgs.munin}/sbin/munin-node --config ${nodeConf} --servicedir /etc/munin/plugins/";
       };
     };
 
-    system.activationScripts.munin-node = ''
-      echo "updating munin plugins..."
-
-      mkdir -p /etc/munin/plugins
-      rm -rf /etc/munin/plugins/*
-      PATH="/run/current-system/sw/bin:/run/current-system/sw/sbin" ${pkgs.munin}/sbin/munin-node-configure --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${muninPlugins} --servicedir=/etc/munin/plugins 2>/dev/null | ${pkgs.bash}/bin/bash
-    '';
-
   }) (mkIf cronCfg.enable {
 
     services.cron.systemCronJobs = [
diff --git a/nixos/modules/services/networking/znc.nix b/nixos/modules/services/networking/znc.nix
index a40fd924741b..56946f37aaf9 100644
--- a/nixos/modules/services/networking/znc.nix
+++ b/nixos/modules/services/networking/znc.nix
@@ -23,7 +23,7 @@ let
   confOptions = { ... }: {
     options = {
       modules = mkOption {
-        type = types.listOf types.string;
+        type = types.listOf types.str;
         default = [ "partyline" "webadmin" "adminlog" "log" ];
         example = [ "partyline" "webadmin" "adminlog" "log" ];
         description = ''
@@ -34,7 +34,7 @@ let
       userName = mkOption {
         default = defaultUserName;
         example = "johntron";
-        type = types.string;
+        type = types.str;
         description = ''
           The user name to use when generating the `znc.conf` file.
           This is the user name used by the user logging into the ZNC web admin. 
@@ -44,7 +44,7 @@ let
       nick = mkOption {
         default = "znc-user";
         example = "john";
-        type = types.string;
+        type = types.str;
         description = ''
           The IRC nick to use when generating the `znc.conf` file.
         '';
@@ -53,7 +53,7 @@ let
       passBlock = mkOption {
         default = defaultPassBlock;
         example = "Must be the block generated by the `znc --makepass` command.";
-        type = types.string;
+        type = types.str;
         description = ''
           The pass block to use when generating the `znc.conf` file.
           This is the password used by the user logging into the ZNC web admin.
@@ -63,9 +63,9 @@ let
       };
 
       port = mkOption {
-        default = "5000";
-        example = "5000";
-        type = types.string;
+        default = 5000;
+        example = 5000;
+        type = types.int;
         description = ''
           Specifies the port on which to listen.
         '';
@@ -104,7 +104,7 @@ let
             AllowWeb = true
             IPv4 = true
             IPv6 = false
-            Port = ${if confOpts.useSSL then "+" else ""}${confOpts.port}
+            Port = ${if confOpts.useSSL then "+" else ""}${toString confOpts.port}
             SSL = ${if confOpts.useSSL then "true" else "false"}
     </Listener>
     
@@ -160,7 +160,7 @@ in
       user = mkOption {
         default = "znc";
         example = "john";
-        type = types.string;
+        type = types.str;
         description = ''
           The name of an existing user account to use to own the ZNC server process.
           If not specified, a default user will be created to own the process.
@@ -170,7 +170,7 @@ in
       dataDir = mkOption {
         default = "/home/${cfg.user}/.znc";
         example = "/home/john/.znc";
-        type = types.string; 
+        type = types.path;
         description = ''
           The data directory. Used for configuration files and modules.
         '';
@@ -179,7 +179,7 @@ in
       zncConf = mkOption {
         default = "";
         example = "See: http://wiki.znc.in/Configuration";
-        type = types.string;
+        type = types.lines;
         description = ''
           The contents of the `znc.conf` file to use when creating it.
           If specified, `confOptions` will be ignored, and this value, as-is, will be used.
@@ -218,9 +218,9 @@ in
       };
  
       extraFlags = mkOption {
-        default = "";
-        example = "--debug";
-        type = types.string;
+        default = [ ];
+        example = [ "--debug" ];
+        type = types.listOf types.str;
         description = ''
           Extra flags to use when executing znc command.
         '';
@@ -272,7 +272,7 @@ in
           ${pkgs.znc}/bin/znc --makepem
         fi
       '';
-      script = "${pkgs.znc}/bin/znc --foreground --datadir ${cfg.dataDir} ${cfg.extraFlags}";
+      script = "${pkgs.znc}/bin/znc --foreground --datadir ${cfg.dataDir} ${toString cfg.extraFlags}";
     };
 
     users.extraUsers = optional (cfg.user == defaultUser)
diff --git a/nixos/modules/services/search/elasticsearch.nix b/nixos/modules/services/search/elasticsearch.nix
index eeae11dc4ff3..c99d1e229677 100644
--- a/nixos/modules/services/search/elasticsearch.nix
+++ b/nixos/modules/services/search/elasticsearch.nix
@@ -21,6 +21,11 @@ let
     ];
   };
 
+  esPlugins = pkgs.buildEnv {
+    name = "elasticsearch-plugins";
+    paths = cfg.plugins;
+  };
+
 in {
 
   ###### interface
@@ -101,6 +106,12 @@ in {
       example = [ "-Djava.net.preferIPv4Stack=true" ];
     };
 
+    plugins = mkOption {
+      description = "Extra elasticsearch plugins";
+      default = [];
+      type = types.listOf types.package;
+    };
+
   };
 
   ###### implementation
@@ -111,14 +122,19 @@ in {
       wantedBy = [ "multi-user.target" ];
       after = [ "network-interfaces.target" ];
       environment = { ES_HOME = cfg.dataDir; };
+      path = [ pkgs.elasticsearch ];
       serviceConfig = {
-        ExecStart = "${pkgs.elasticsearch}/bin/elasticsearch -Des.path.conf=${configDir} ${toString cfg.extraCmdLineOptions}";
+        ExecStart = "elasticsearch -Des.path.conf=${configDir} ${toString cfg.extraCmdLineOptions}";
         User = "elasticsearch";
         PermissionsStartOnly = true;
       };
       preStart = ''
         mkdir -m 0700 -p ${cfg.dataDir}
         if [ "$(id -u)" = 0 ]; then chown -R elasticsearch ${cfg.dataDir}; fi
+
+        # Install plugins
+        rm ${cfg.dataDir}/plugins || true
+        ln -s ${esPlugins}/plugins ${cfg.dataDir}/plugins
       '';
     };
 
diff --git a/nixos/modules/services/web-servers/lighttpd/cgit.nix b/nixos/modules/services/web-servers/lighttpd/cgit.nix
index dbff565bd8a3..d4663781fd84 100644
--- a/nixos/modules/services/web-servers/lighttpd/cgit.nix
+++ b/nixos/modules/services/web-servers/lighttpd/cgit.nix
@@ -29,7 +29,7 @@ in
         cache-size=1000
         scan-path=/srv/git
       '';
-      type = types.string;
+      type = types.lines;
       description = ''
         Verbatim contents of the cgit runtime configuration file. Documentation
         (with cgitrc example file) is available in "man cgitrc". Or online:
diff --git a/nixos/modules/services/web-servers/lighttpd/default.nix b/nixos/modules/services/web-servers/lighttpd/default.nix
index 3ba934c72bf8..f0f59a664026 100644
--- a/nixos/modules/services/web-servers/lighttpd/default.nix
+++ b/nixos/modules/services/web-servers/lighttpd/default.nix
@@ -102,7 +102,7 @@ in
 
       document-root = mkOption {
         default = "/srv/www";
-        type = types.str;
+        type = types.path;
         description = ''
           Document-root of the web server. Must be readable by the "lighttpd" user.
         '';
@@ -128,7 +128,7 @@ in
 
       configText = mkOption {
         default = "";
-        type = types.string;
+        type = types.lines;
 	example = ''...verbatim config file contents...'';
         description = ''
           Overridable config file contents to use for lighttpd. By default, use
@@ -138,7 +138,7 @@ in
 
       extraConfig = mkOption {
         default = "";
-        type = types.string;
+        type = types.lines;
         description = ''
           These configuration lines will be appended to the generated lighttpd
           config file. Note that this mechanism does not work when the manual
diff --git a/nixos/modules/services/web-servers/lighttpd/gitweb.nix b/nixos/modules/services/web-servers/lighttpd/gitweb.nix
index d49278be09a8..c407a1d89778 100644
--- a/nixos/modules/services/web-servers/lighttpd/gitweb.nix
+++ b/nixos/modules/services/web-servers/lighttpd/gitweb.nix
@@ -25,7 +25,7 @@ in
 
     projectroot = mkOption {
       default = "/srv/git";
-      type = types.str;
+      type = types.path;
       description = ''
         Path to git projects (bare repositories) that should be served by
         gitweb. Must not end with a slash.
@@ -34,7 +34,7 @@ in
 
     extraConfig = mkOption {
       default = "";
-      type = types.str;
+      type = types.lines;
       description = ''
         Verbatim configuration text appended to the generated gitweb.conf file.
       '';
diff --git a/nixos/modules/services/x11/desktop-managers/e18.nix b/nixos/modules/services/x11/desktop-managers/e18.nix
index e59b7f426837..cb717eea909c 100644
--- a/nixos/modules/services/x11/desktop-managers/e18.nix
+++ b/nixos/modules/services/x11/desktop-managers/e18.nix
@@ -6,6 +6,7 @@ let
 
   xcfg = config.services.xserver;
   cfg = xcfg.desktopManager.e18;
+  e18_enlightenment = pkgs.e18.enlightenment.override { set_freqset_setuid = true; };
 
 in
 
@@ -23,18 +24,20 @@ in
   config = mkIf (xcfg.enable && cfg.enable) {
 
     environment.systemPackages = [
-      pkgs.e18.efl pkgs.e18.evas pkgs.e18.emotion pkgs.e18.elementary pkgs.e18.enlightenment
+      pkgs.e18.efl pkgs.e18.evas pkgs.e18.emotion pkgs.e18.elementary e18_enlightenment
       pkgs.e18.terminology pkgs.e18.econnman
     ];
 
     services.xserver.desktopManager.session = [
     { name = "E18";
       start = ''
-        ${pkgs.e18.enlightenment}/bin/enlightenment_start
+        ${e18_enlightenment}/bin/enlightenment_start
         waitPID=$!
       '';
     }];
 
+    security.setuidPrograms = [ "e18_freqset" ];
+
   };
 
 }
diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix
index 22d55a9e246c..b57b03bcf962 100644
--- a/nixos/modules/system/etc/etc.nix
+++ b/nixos/modules/system/etc/etc.nix
@@ -132,7 +132,7 @@ in
       ''
         # Set up the statically computed bits of /etc.
         echo "setting up /etc..."
-        ${pkgs.perl}/bin/perl ${./setup-etc.pl} ${etc}/etc
+        ${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl ${./setup-etc.pl} ${etc}/etc
       '';
 
   };
diff --git a/nixos/modules/system/etc/setup-etc.pl b/nixos/modules/system/etc/setup-etc.pl
index 8ba9a370b27a..d7e15eccefcd 100644
--- a/nixos/modules/system/etc/setup-etc.pl
+++ b/nixos/modules/system/etc/setup-etc.pl
@@ -3,6 +3,7 @@ use File::Find;
 use File::Copy;
 use File::Path;
 use File::Basename;
+use File::Slurp;
 
 my $etc = $ARGV[0] or die;
 my $static = "/etc/static";
@@ -46,35 +47,55 @@ sub cleanup {
 find(\&cleanup, "/etc");
 
 
+# Use /etc/.clean to keep track of copied files.
+my @oldCopied = read_file("/etc/.clean", chomp => 1, err_mode => 'quiet');
+open CLEAN, ">>/etc/.clean";
+
+
 # For every file in the etc tree, create a corresponding symlink in
 # /etc to /etc/static.  The indirection through /etc/static is to make
 # switching to a new configuration somewhat more atomic.
+my %created;
+my @copied;
+
 sub link {
     my $fn = substr $File::Find::name, length($etc) + 1 or next;
     my $target = "/etc/$fn";
     File::Path::make_path(dirname $target);
+    $created{$fn} = 1;
     if (-e "$_.mode") {
-        open MODE, "<$_.mode";
-        my $mode = <MODE>; chomp $mode;
-        close MODE;
+        my $mode = read_file("$_.mode"); chomp $mode;
         if ($mode eq "direct-symlink") {
             atomicSymlink readlink("$static/$fn"), $target or warn;
         } else {
-            open UID, "<$_.uid";
-            my $uid = <UID>; chomp $uid;
-            close UID;
-            open GID, "<$_.gid";
-            my $gid = <GID>; chomp $gid;
-            close GID;
-
+            my $uid = read_file("$_.uid"); chomp $uid;
+            my $gid = read_file("$_.gid"); chomp $gid;
             copy "$static/$fn", "$target.tmp" or warn;
             chown int($uid), int($gid), "$target.tmp" or warn;
             chmod oct($mode), "$target.tmp" or warn;
             rename "$target.tmp", $target or warn;
         }
+        push @copied, $fn;
+        print CLEAN "$fn\n";
     } elsif (-l "$_") {
         atomicSymlink "$static/$fn", $target or warn;
     }
 }
 
 find(\&link, $etc);
+
+
+# Delete files that were copied in a previous version but not in the
+# current.
+foreach my $fn (@oldCopied) {
+    if (!defined $created{$fn}) {
+        $fn = "/etc/$fn";
+        print STDERR "removing obsolete file ‘$fn’...\n";
+        unlink "$fn";
+    }
+}
+
+
+# Rewrite /etc/.clean.
+close CLEAN;
+write_file("/etc/.clean", map { "$_\n" } @copied);
diff --git a/pkgs/applications/audio/a2jmidid/default.nix b/pkgs/applications/audio/a2jmidid/default.nix
index c5e35d8867c8..38192311ccfa 100644
--- a/pkgs/applications/audio/a2jmidid/default.nix
+++ b/pkgs/applications/audio/a2jmidid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, dbus, jackaudio, pkgconfig, python }:
+{ stdenv, fetchurl, alsaLib, dbus, jack2, pkgconfig, python }:
 
 stdenv.mkDerivation rec {
   name = "a2jmidid-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0pzm0qk5ilqhwz74pydg1jwrds27vm47185dakdrxidb5bv3b5ia";
   };
 
-  buildInputs = [ alsaLib dbus jackaudio pkgconfig python ];
+  buildInputs = [ alsaLib dbus jack2 pkgconfig python ];
 
   configurePhase = "python waf configure --prefix=$out";
 
diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix
index 88bc7399c65e..afc2e49fc8af 100644
--- a/pkgs/applications/audio/ardour/default.nix
+++ b/pkgs/applications/audio/ardour/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchgit, alsaLib, aubio, boost, cairomm, curl, fftw
-, fftwSinglePrec, flac, glibc, glibmm, gtk, gtkmm, jackaudio
+, 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
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = 
     [ alsaLib aubio boost cairomm curl fftw fftwSinglePrec flac glibc
-      glibmm gtk gtkmm jackaudio libgnomecanvas libgnomecanvasmm liblo
+      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
diff --git a/pkgs/applications/audio/bristol/default.nix b/pkgs/applications/audio/bristol/default.nix
index 5eb4f0c4e9f1..b27ac0586025 100644
--- a/pkgs/applications/audio/bristol/default.nix
+++ b/pkgs/applications/audio/bristol/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, jackaudio, pkgconfig, pulseaudio, xlibs }:
+{ stdenv, fetchurl, alsaLib, jack2, pkgconfig, pulseaudio, xlibs }:
 
 stdenv.mkDerivation  rec {
   name = "bristol-${version}";
@@ -10,7 +10,7 @@ stdenv.mkDerivation  rec {
   };
 
   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/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 ab8027e23711..34950d1a343d 100644
--- a/pkgs/applications/audio/drumkv1/default.nix
+++ b/pkgs/applications/audio/drumkv1/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jackaudio, libsndfile, lv2, qt4 }:
+{ stdenv, fetchurl, jack2, libsndfile, lv2, qt4 }:
 
 stdenv.mkDerivation rec {
   name = "drumkv1-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "18rvfgblynlmklk25azmppibn1bdjid97hipa323gnzmxgq0rfjq";
   };
 
-  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/espeak/default.nix b/pkgs/applications/audio/espeak/default.nix
index e1cf5fee1cc7..d47d82497ab6 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+";
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/espeak/edit.nix b/pkgs/applications/audio/espeak/edit.nix
index 6627c6eb0e52..0e59a42614fd 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 = ''
-    mkdir -p $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+";
+    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/fluidsynth/default.nix b/pkgs/applications/audio/fluidsynth/default.nix
index 89e95f62cd5f..8cba482194e5 100644
--- a/pkgs/applications/audio/fluidsynth/default.nix
+++ b/pkgs/applications/audio/fluidsynth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, glib, jackaudio, libsndfile, pkgconfig
+{ stdenv, fetchurl, alsaLib, glib, jack2, libsndfile, pkgconfig
 , pulseaudio }:
 
 stdenv.mkDerivation  rec {
@@ -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/guitarix/default.nix b/pkgs/applications/audio/guitarix/default.nix
index 44b0e9ef0d79..777c0ddb2e35 100644
--- a/pkgs/applications/audio/guitarix/default.nix
+++ b/pkgs/applications/audio/guitarix/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, avahi, boost, fftw, gettext, glib, glibmm, gtk
-, gtkmm, intltool, jackaudio, ladspaH, librdf, libsndfile, lv2 
+, gtkmm, intltool, jack2, ladspaH, librdf, libsndfile, lv2
 , pkgconfig, python }:
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    avahi boost fftw gettext glib glibmm gtk gtkmm intltool jackaudio
+    avahi boost fftw gettext glib glibmm gtk gtkmm intltool jack2
     ladspaH librdf libsndfile lv2 pkgconfig python
   ];
 
diff --git a/pkgs/applications/audio/hydrogen/default.nix b/pkgs/applications/audio/hydrogen/default.nix
index 74ff2a3407c4..10f15f5882cb 100644
--- a/pkgs/applications/audio/hydrogen/default.nix
+++ b/pkgs/applications/audio/hydrogen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, boost, glib, jackaudio, ladspaPlugins
+{ stdenv, fetchurl, alsaLib, boost, glib, jack2, ladspaPlugins
 , libarchive, liblrdf , libsndfile, pkgconfig, qt4, scons, subversion }:
 
 stdenv.mkDerivation rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   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/ingen/default.nix b/pkgs/applications/audio/ingen/default.nix
index 73138cc269d0..ac46ff6140c1 100644
--- a/pkgs/applications/audio/ingen/default.nix
+++ b/pkgs/applications/audio/ingen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn, boost, ganv, glibmm, gtk, gtkmm, jackaudio, lilv
+{ stdenv, fetchsvn, boost, ganv, glibmm, gtk, gtkmm, jack2, lilv
 , lv2, pkgconfig, python, raul, serd, sord, sratom, suil
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs = [
-    boost ganv glibmm gtk gtkmm jackaudio lilv lv2 pkgconfig python
+    boost ganv glibmm gtk gtkmm jack2 lilv lv2 pkgconfig python
     raul serd sord sratom suil
   ];
 
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 98fcb8943af6..8557bc31c445 100644
--- a/pkgs/applications/audio/jackmeter/default.nix
+++ b/pkgs/applications/audio/jackmeter/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jackaudio, pkgconfig }:
+{ stdenv, fetchurl, jack2, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "jackmeter-0.4";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1cnvgx3jv0yvxlqy0l9k285zgvazmh5k8m4l7lxckjfm5bn6hm1r";
   };
 
-  buildInputs = [ jackaudio pkgconfig ];
+  buildInputs = [ jack2 pkgconfig ];
 
   meta = { 
     description = "Console jack loudness meter";
diff --git a/pkgs/applications/audio/jalv/default.nix b/pkgs/applications/audio/jalv/default.nix
index 2baf69cef4fd..70ef5bdec5cb 100644
--- a/pkgs/applications/audio/jalv/default.nix
+++ b/pkgs/applications/audio/jalv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gtk, jackaudio, lilv, lv2, pkgconfig, python
+{ stdenv, fetchurl, gtk, jack2, lilv, lv2, pkgconfig, python
 , serd, sord , sratom, suil }:
 
 stdenv.mkDerivation  rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation  rec {
   };
 
   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";
diff --git a/pkgs/applications/audio/lash/default.nix b/pkgs/applications/audio/lash/default.nix
index ad52e7b2d85c..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 = ''
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 46d5017c4fe1..dd0649811bbb 100644
--- a/pkgs/applications/audio/lmms/default.nix
+++ b/pkgs/applications/audio/lmms/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, alsaLib, cmake, fftwSinglePrec, jackaudio, libogg
+{ stdenv, fetchurl, SDL, alsaLib, cmake, fftwSinglePrec, jack2, libogg
 , libsamplerate, libsndfile, pkgconfig, pulseaudio, qt4, freetype
 }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs = [
-    SDL alsaLib cmake fftwSinglePrec jackaudio libogg libsamplerate
+    SDL alsaLib cmake fftwSinglePrec jack2 libogg libsamplerate
     libsndfile pkgconfig pulseaudio qt4
   ];
 
diff --git a/pkgs/applications/audio/mhwaveedit/default.nix b/pkgs/applications/audio/mhwaveedit/default.nix
index a8287b10a298..a1e81be3cb37 100644
--- a/pkgs/applications/audio/mhwaveedit/default.nix
+++ b/pkgs/applications/audio/mhwaveedit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL , alsaLib, gtk, jackaudio, ladspaH
+{ stdenv, fetchurl, SDL , alsaLib, gtk, jack2, ladspaH
 , ladspaPlugins, libsamplerate, libsndfile, pkgconfig, pulseaudio }:
 
 stdenv.mkDerivation  rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs =
-   [ SDL alsaLib gtk jackaudio ladspaH libsamplerate libsndfile
+   [ SDL alsaLib gtk jack2 ladspaH libsamplerate libsndfile
      pkgconfig pulseaudio
    ];
 
diff --git a/pkgs/applications/audio/milkytracker/default.nix b/pkgs/applications/audio/milkytracker/default.nix
index 965c941113c3..eadbaabcf560 100644
--- a/pkgs/applications/audio/milkytracker/default.nix
+++ b/pkgs/applications/audio/milkytracker/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, alsaLib, autoconf, automake, jackaudio, perl
+{ stdenv, fetchurl, SDL, alsaLib, autoconf, automake, jack2, perl
 , zlib, zziplib
 }:
 
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     export CPATH=${zlib}/lib
   '';
 
-  buildInputs = [ SDL alsaLib autoconf automake jackaudio perl zlib zziplib ];
+  buildInputs = [ SDL alsaLib autoconf automake jack2 perl zlib zziplib ];
 
   meta = {
     description = "Music tracker application, similar to Fasttracker II.";
diff --git a/pkgs/applications/audio/moc/default.nix b/pkgs/applications/audio/moc/default.nix
index c5a33796ca52..e5264f5c3d2f 100644
--- a/pkgs/applications/audio/moc/default.nix
+++ b/pkgs/applications/audio/moc/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, ncurses, pkgconfig, alsaLib, flac, libmad, speex, ffmpeg, libvorbis, mpc, libsndfile, jackaudio, db, libmodplug, timidity, libid3tag, libtool }:
+{ stdenv, fetchurl, ncurses, pkgconfig, alsaLib, flac, libmad, speex, ffmpeg
+, libvorbis, mpc, libsndfile, jack2, db, libmodplug, timidity, libid3tag
+, libtool
+}:
 
 stdenv.mkDerivation rec {
   name = "moc-${version}";
@@ -11,7 +14,10 @@ stdenv.mkDerivation rec {
 
   configurePhase = "./configure prefix=$out";
 
-  buildInputs = [ ncurses pkgconfig alsaLib flac libmad speex ffmpeg libvorbis mpc libsndfile jackaudio db libmodplug timidity libid3tag libtool ];
+  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.";
diff --git a/pkgs/applications/audio/ncmpc/default.nix b/pkgs/applications/audio/ncmpc/default.nix
index 937a030f3e53..94fa50a88836 100755
--- a/pkgs/applications/audio/ncmpc/default.nix
+++ b/pkgs/applications/audio/ncmpc/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, pkgconfig, glib, ncurses, mpd_clientlib, libintlOrEmpty }:
 
 stdenv.mkDerivation rec {
-  version = "0.22";
+  version = "0.23";
   name = "ncmpc-${version}";
 
   src = fetchurl {
     url = "http://www.musicpd.org/download/ncmpc/0/ncmpc-${version}.tar.xz";
-    sha256 = "a8d65f12653d9ce8bc4493aa1c5de09359c25bf3a22498d2ae797e7d41422211";
+    sha256 = "d7b30cefaf5c74a5d8ab18ab8275e0102ae12e8ee6d6f8144f8e4cc9a97b5de4";
   };
 
   buildInputs = [ pkgconfig glib ncurses mpd_clientlib ]
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/projectm/default.nix b/pkgs/applications/audio/projectm/default.nix
index 2dd251ddd5bd..508b6743cc39 100644
--- a/pkgs/applications/audio/projectm/default.nix
+++ b/pkgs/applications/audio/projectm/default.nix
@@ -2,7 +2,7 @@
 , glew, ftgl, ttf_bitstream_vera
 , withQt ? true, qt4
 , withLibvisual ? false, libvisual, SDL
-, withJack ? false, jackaudio
+, withJack ? false, jack2
 , withPulseAudio ? true, pulseaudio
 }:
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation {
     [ glew ftgl ]
     ++ optional withQt qt4
     ++ optionals withLibvisual [ libvisual SDL ]
-    ++ optional withJack jackaudio
+    ++ optional withJack jack2
     ++ optional withPulseAudio pulseaudio
     ;
 }
diff --git a/pkgs/applications/audio/puredata/default.nix b/pkgs/applications/audio/puredata/default.nix
index d0394b72eddc..9abca0cb0141 100644
--- a/pkgs/applications/audio/puredata/default.nix
+++ b/pkgs/applications/audio/puredata/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, autoreconfHook, gettext, makeWrapper
-, alsaLib, jackaudio, tk
+, alsaLib, jack2, tk
 }:
 
 stdenv.mkDerivation  rec {
@@ -17,7 +17,7 @@ stdenv.mkDerivation  rec {
 
   nativeBuildInputs = [ autoreconfHook gettext makeWrapper ];
 
-  buildInputs = [ alsaLib jackaudio ];
+  buildInputs = [ alsaLib jack2 ];
 
   configureFlags = ''
     --enable-alsa
diff --git a/pkgs/applications/audio/qjackctl/default.nix b/pkgs/applications/audio/qjackctl/default.nix
index dcb2a1b48e60..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.10";
+  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 = "0ch14y3p0x5ss28cpnqcxp42zb2w07d3l1n2sbrkgiz58iy97paw";
+    sha256 = "1wjzrgx3n2asyxk6cnfcm34msaw84qvsqy08bd4qnghrgpl96hwl";
   };
 
-  buildInputs = [ qt4 alsaLib jackaudio dbus ];
+  buildInputs = [ qt4 alsaLib jack2 dbus ];
 
   configureFlags = "--enable-jack-version";
 
diff --git a/pkgs/applications/audio/qsynth/default.nix b/pkgs/applications/audio/qsynth/default.nix
index 05e6da223dad..a5d0e7e621e2 100644
--- a/pkgs/applications/audio/qsynth/default.nix
+++ b/pkgs/applications/audio/qsynth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, fluidsynth, jackaudio, qt4 }:
+{ stdenv, fetchurl, alsaLib, fluidsynth, jack2, qt4 }:
 
 stdenv.mkDerivation  rec {
   name = "qsynth-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation  rec {
     sha256 = "0wmq61cq93x2l00xwr871373mj3dwamz1dg6v62x7s8m1612ndrw";
   };
 
-  buildInputs = [ alsaLib fluidsynth jackaudio qt4 ];
+  buildInputs = [ alsaLib fluidsynth jack2 qt4 ];
 
   meta = with stdenv.lib; {
     description = "Fluidsynth GUI";
diff --git a/pkgs/applications/audio/qtractor/default.nix b/pkgs/applications/audio/qtractor/default.nix
index a15cf2550407..e589adc0e417 100644
--- a/pkgs/applications/audio/qtractor/default.nix
+++ b/pkgs/applications/audio/qtractor/default.nix
@@ -1,4 +1,4 @@
-{ 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 }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   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/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 c201536ed347..7d8d5fc04abc 100644
--- a/pkgs/applications/audio/samplv1/default.nix
+++ b/pkgs/applications/audio/samplv1/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jackaudio, libsndfile, lv2, qt4 }:
+{ stdenv, fetchurl, jack2, libsndfile, lv2, qt4 }:
 
 stdenv.mkDerivation rec {
   name = "samplv1-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1vr6jbqnsgdq3v2h1ndp4pirnil3119dqwlq0k0kdscmcskvb9j4";
   };
 
-  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
index 0d5b69297538..5119c384cf6a 100644
--- a/pkgs/applications/audio/setbfree/default.nix
+++ b/pkgs/applications/audio/setbfree/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, freetype, ftgl, jackaudio, libX11, lv2
+{ stdenv, fetchurl, alsaLib, freetype, ftgl, jack2, libX11, lv2
 , mesa, pkgconfig, ttf_bitstream_vera
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation  rec {
   '';
 
   buildInputs = [
-    alsaLib freetype ftgl jackaudio libX11 lv2 mesa pkgconfig
+    alsaLib freetype ftgl jack2 libX11 lv2 mesa pkgconfig
     ttf_bitstream_vera
   ];
 
diff --git a/pkgs/applications/audio/sonic-visualiser/default.nix b/pkgs/applications/audio/sonic-visualiser/default.nix
index 7704397e6d0a..42c390620427 100644
--- a/pkgs/applications/audio/sonic-visualiser/default.nix
+++ b/pkgs/applications/audio/sonic-visualiser/default.nix
@@ -1,6 +1,6 @@
 # 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, pkgconfig, pulseaudio, qt5, redland
 , rubberband, serd, sord, vampSDK
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
       sord
       pkgconfig
       # optional
-      jackaudio
+      jack2
       # portaudio
       pulseaudio
       libmad
diff --git a/pkgs/applications/audio/synthv1/default.nix b/pkgs/applications/audio/synthv1/default.nix
index d1c2230cf16d..08c13243804b 100644
--- a/pkgs/applications/audio/synthv1/default.nix
+++ b/pkgs/applications/audio/synthv1/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4, jackaudio, lv2 }:
+{ stdenv, fetchurl, qt4, jack2, lv2 }:
 
 stdenv.mkDerivation rec {
   name = "synthv1-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1r4fszbzwd0yfcch0mcsmh7781zw1317hiljn85w79721fs2m8hc";
   };
 
-  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/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
index 7fffa77b5a39..9a75fa5f3831 100644
--- a/pkgs/applications/audio/vmpk/default.nix
+++ b/pkgs/applications/audio/vmpk/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, cmake, pkgconfig
-, qt4, jackaudio
+, qt4, jack2
 }:
 
 let
@@ -22,5 +22,5 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  buildInputs = [ qt4 jackaudio ];
+  buildInputs = [ qt4 jack2 ];
 }
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 df0b98cdd9e4..497ab3ac78d6 100644
--- a/pkgs/applications/audio/yoshimi/default.nix
+++ b/pkgs/applications/audio/yoshimi/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, alsaLib, boost, cairo, cmake, fftwSinglePrec, fltk
-, jackaudio, libsndfile, mesa, minixml, pkgconfig, zlib
+, jack2, libsndfile, mesa, minixml, pkgconfig, zlib
 }:
 
 assert stdenv ? glibc;
@@ -14,7 +14,7 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs = [
-    alsaLib boost cairo fftwSinglePrec fltk jackaudio libsndfile mesa
+    alsaLib boost cairo fftwSinglePrec fltk jack2 libsndfile mesa
     minixml zlib
   ];
 
diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix
index cd30b5b30847..a5aa7d5c8d95 100644
--- a/pkgs/applications/audio/zynaddsubfx/default.nix
+++ b/pkgs/applications/audio/zynaddsubfx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, cmake, jackaudio, fftw, fltk13, minixml
+{ stdenv, fetchurl, alsaLib, cmake, jack2, fftw, fltk13, minixml
 , pkgconfig, zlib
 }:
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation  rec {
     sha256 = "0kgmwyh4rhyqdfrdzhbzjjk2hzggkp9c4aac6sy3xv6cc1b5jjxq";
   };
 
-  buildInputs = [ alsaLib jackaudio fftw fltk13 minixml zlib ];
+  buildInputs = [ alsaLib jack2 fftw fltk13 minixml zlib ];
   nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = with stdenv.lib; {
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-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/zed/default.nix b/pkgs/applications/editors/zed/default.nix
new file mode 100644
index 000000000000..61abec29b47d
--- /dev/null
+++ b/pkgs/applications/editors/zed/default.nix
@@ -0,0 +1,75 @@
+{ stdenv, buildEnv, fetchurl, xlibs, glib, gtk2, atk, pango, gdk_pixbuf,
+  cairo, freetype, fontconfig, nss, nspr, gnome, alsaLib, expat, dbus, udev,
+  makeWrapper, writeScript, gnused }:
+
+let
+
+  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" ];
+  };
+
+  name = "zed-${version}";
+  version = "0.12.0";
+
+  zed = stdenv.mkDerivation rec {
+    inherit name version;
+
+    src = if stdenv.system == "i686-linux" then fetchurl {
+      url = "http://download.zedapp.org/zed-linux32-v${version}.tar.gz";
+      sha256 = "04cygfhaynlpl8jrf2r55qk5zz1ipad8l9m8q81lfly2q0h9fbxi";
+    } else fetchurl {
+      url = "http://download.zedapp.org/zed-linux64-v${version}.tar.gz";
+      sha256 = "0ng2v07fyglpbyl4pwm2bn5rbldw51kliw8rakbpcdia891hi6z1";
+    };
+
+    buildInputs = [ makeWrapper ];
+
+    installPhase = ''
+      mkdir -p $out/zed
+      cp ./* $out/zed
+    '';
+
+    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
+    '';
+  };
+  zed_installer = writeScript "zed-installer.sh" ''
+    mkdir -p ~/.zed
+    cp -rv ${zed}/zed/* ~/.zed
+
+    ${gnused}/bin/sed -ri 's/DIR\=\$\(dirname\ \$0\)/DIR\=\~\/\.zed/' ~/.zed/zed
+
+    mkdir -p ~/bin
+    ln -sv ~/.zed/zed ~/bin/zed
+  '';
+
+in stdenv.mkDerivation rec {
+  inherit name version;
+
+  src = zed;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    ln -s ${zed_installer} $out/bin/zed-installer
+  '';
+
+  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/inferno/default.nix b/pkgs/applications/inferno/default.nix
index 6a1a3be27dd5..c5a40fcbf5b3 100644
--- a/pkgs/applications/inferno/default.nix
+++ b/pkgs/applications/inferno/default.nix
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
     description = "A compact distributed operating system for building cross-platform distributed systems";
     homepage = "http://inferno-os.org/";
     license = stdenv.lib.licenses.gpl2;
-    maintainer = [ "Chris Double <chris.double@double.co.nz>" ];
+    maintainers = [ "Chris Double <chris.double@double.co.nz>" ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index 7e4fffa98bfc..a31fcfeab0f4 100644
--- a/pkgs/applications/misc/blender/default.nix
+++ b/pkgs/applications/misc/blender/default.nix
@@ -2,7 +2,7 @@
 , ilmbase, libXi, libjpeg, libpng, libsamplerate, libsndfile
 , libtiff, mesa, openal, opencolorio, openexr, openimageio, openjpeg, python
 , zlib, fftw
-, jackaudioSupport ? false, jackaudio
+, jackaudioSupport ? false, jack2
 }:
 
 with lib;
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     [ SDL boost cmake ffmpeg gettext glew ilmbase libXi
       libjpeg libpng libsamplerate libsndfile libtiff mesa openal
       opencolorio openexr openimageio /* openjpeg */ python zlib fftw
-    ] ++ optional jackaudioSupport jackaudio;
+    ] ++ optional jackaudioSupport jack2;
 
   postUnpack =
     ''
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index 95f28d9058a0..764145e39d65 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.45.0";
+  name = "calibre-1.46.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/calibre/${name}.tar.xz";
-    sha256 = "0g9fzpkjvi0h7h5azk3v425l8gxd8zidcz3nrzlg26hgvbkzpm20";
+    sha256 = "1mzw6cmnw1wk8jd2pkl6z7bgjhwn4j7lg0a33f07gk4xw94sbry2";
   };
 
   inherit python;
diff --git a/pkgs/applications/misc/hello/ex-2/default.nix b/pkgs/applications/misc/hello/ex-2/default.nix
index d3ade1ab8505..71c9777ff9b7 100644
--- a/pkgs/applications/misc/hello/ex-2/default.nix
+++ b/pkgs/applications/misc/hello/ex-2/default.nix
@@ -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/makeself/default.nix b/pkgs/applications/misc/makeself/default.nix
index e433b83cdeb5..3ba0faef9682 100644
--- a/pkgs/applications/misc/makeself/default.nix
+++ b/pkgs/applications/misc/makeself/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     homepage = http://megastep.org/makeself;
     description = "Utility to create self-extracting packages";
     license = licenses.gpl2;
-    maintainer = maintainers.wmertens;
+    maintainers = [ maintainers.wmertens ];
     platforms = platforms.all;
   };
 }
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/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix
index 1e2c3e2cfb19..ad2ea75bd704 100644
--- a/pkgs/applications/networking/browsers/firefox/default.nix
+++ b/pkgs/applications/networking/browsers/firefox/default.nix
@@ -1,5 +1,5 @@
-{ 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
@@ -15,27 +15,38 @@
 
 assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
 
-rec {
-
-  firefoxVersion = "30.0";
-
-  xulVersion = "30.0"; # this attribute is used by other packages
+let version = "31.0"; in
 
+stdenv.mkDerivation rec {
+  name = "firefox-${version}";
 
   src = fetchurl {
-    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
-    sha1 = "bll9hxf31gvg9db6gxgmq25qsjif3p11";
+    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${version}/source/firefox-${version}.source.tar.bz2";
+    sha1 = "a6c3e25ee3aeb7da42db2aaeb50a385d63532beb";
   };
 
-  commonConfigureFlags =
-    [ "--with-system-jpeg"
+  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"
       "--with-system-nspr"
       "--with-system-nss"
       "--with-system-libevent"
       "--with-system-libvpx"
-      "--with-system-png"
+      # "--with-system-png" # needs APNG support
       # "--with-system-icu" # causes ‘ar: invalid option -- 'L'’ in Firefox 28.0
       "--enable-system-ffi"
       "--enable-system-hunspell"
@@ -52,160 +63,45 @@ rec {
       "--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";
+    ]
+    ++ (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
+  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
-
+  postInstall =
+    ''
       # 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
-    ''; # */
+      paxmark m $out/lib/*/{plugin-container,xulrunner}
 
-    meta = {
-      description = "Mozilla Firefox XUL runner";
-      homepage = http://www.mozilla.com/en-US/firefox/;
-    };
+      # Remove SDK cruft. FIXME: move to a separate output?
+      rm -rf $out/share/idl $out/include $out/lib/firefox-devel-*
+    '';
 
-    passthru = { inherit gtk; version = xulVersion; };
+  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 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;
-    };
+  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/xpidl.patch b/pkgs/applications/networking/browsers/firefox/xpidl.patch
deleted file mode 100644
index e6a6b4d82646..000000000000
--- a/pkgs/applications/networking/browsers/firefox/xpidl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- mozilla-release/python/mozbuild/mozbuild/backend/recursivemake.py	2013-12-05 08:07:53.000000000 -0800
-+++ mozilla-release_1/python/mozbuild/mozbuild/backend/recursivemake.py	2013-12-12 23:38:39.697318563 -0800
-@@ -421,7 +421,7 @@
-     def _handle_idl_manager(self, manager):
-         build_files = self._purge_manifests['xpidl']
- 
--        for p in ('Makefile', 'backend.mk', '.deps/.mkdir.done',
-+        for p in ('Makefile.in', 'Makefile', 'backend.mk', '.deps/.mkdir.done',
-             'xpt/.mkdir.done'):
-             build_files.add(p)
- 
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/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/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix
index b2b2e37fd663..0f2a3d93cdbc 100644
--- a/pkgs/applications/networking/mumble/default.nix
+++ b/pkgs/applications/networking/mumble/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, qt4, boost, protobuf, libsndfile
 , speex, libopus, avahi, pkgconfig
 , jackSupport ? false
-, jackaudio ? null
+, jack2 ? null
 , speechdSupport ? false
 , speechd ? null
 }:
 
-assert jackSupport -> jackaudio != null;
+assert jackSupport -> jack2 != null;
 assert speechdSupport -> speechd != null;
 
 let
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 boost protobuf libsndfile speex
     libopus avahi pkgconfig ]
-    ++ (optional jackSupport jackaudio)
+    ++ (optional jackSupport jack2)
     ++ (optional speechdSupport speechd);
 
   installPhase = ''
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/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/version-management/git-and-tools/github-backup/default.nix b/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
index f9d43037f6a1..93ad94514018 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
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "github-backup";
-  version = "1.20140707";
-  sha256 = "0c15gq91c36xza7yiimqvgk609p9xf9jlzy9683d9p9bx1khpadd";
+  version = "1.20140721";
+  sha256 = "0bnkfmgpk1iaaqck4ppn461fzk3s2761w2nxfrvw10gc934lhrxc";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
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/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix
index 6d8780d6cf48..6a385786eff3 100644
--- a/pkgs/applications/video/mplayer/default.nix
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -15,7 +15,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
@@ -40,7 +40,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;
@@ -109,7 +109,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
diff --git a/pkgs/applications/video/mplayer2/default.nix b/pkgs/applications/video/mplayer2/default.nix
index 74b74037e50e..f0830f007d91 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;
@@ -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
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
index 53136010c826..4eec9afdbf3d 100644
--- a/pkgs/applications/video/mpv/default.nix
+++ b/pkgs/applications/video/mpv/default.nix
@@ -14,7 +14,7 @@
 , bluraySupport ? true, libbluray ? null
 , speexSupport ? true, speex ? null
 , theoraSupport ? true, libtheora ? null
-, jackaudioSupport ? true, jackaudio ? null
+, jackaudioSupport ? true, jack2 ? null
 , pulseSupport ? true, pulseaudio ? null
 , bs2bSupport ? false, libbs2b ? null
 # For screenshots
@@ -36,7 +36,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;
@@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
     ++ optional dvdreadSupport libdvdread
     ++ optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
     ++ optional bluraySupport libbluray
-    ++ optional jackaudioSupport jackaudio
+    ++ optional jackaudioSupport jack2
     ++ optional pulseSupport pulseaudio
     ++ optional screenSaverSupport libXScrnSaver
     ++ optional vdpauSupport libvdpau
diff --git a/pkgs/applications/video/shotcut/CuteLogger.patch b/pkgs/applications/video/shotcut/CuteLogger.patch
new file mode 100644
index 000000000000..77b451cb437d
--- /dev/null
+++ b/pkgs/applications/video/shotcut/CuteLogger.patch
@@ -0,0 +1,13 @@
+diff --git shotcut-14.07/CuteLogger/CuteLogger.pro shotcut-14.07/CuteLogger/CuteLogger.pro
+index 501eddc..a5290b0 100644
+--- shotcut-14.07/CuteLogger/CuteLogger.pro
++++ shotcut-14.07/CuteLogger/CuteLogger.pro
+@@ -42,7 +42,7 @@ unix:!symbian {
+     maemo5 {
+         target.path = /opt/usr/lib
+     } else {
+-        target.path = /usr/lib
++        target.path = $(INSTALL_ROOT)/usr/lib
+     }
+     INSTALLS += target
+ }
diff --git a/pkgs/applications/video/shotcut/default.nix b/pkgs/applications/video/shotcut/default.nix
new file mode 100644
index 000000000000..97c3720f7f93
--- /dev/null
+++ b/pkgs/applications/video/shotcut/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, SDL, frei0r, gettext, makeWrapper, mlt, pkgconfig, qt5 }:
+
+stdenv.mkDerivation rec {
+  name = "shotcut-${version}";
+  version = "14.07";
+
+  src = fetchurl {
+    url = "https://github.com/mltframework/shotcut/archive/v${version}.tar.gz";
+    sha256 = "05g0b3jhmmdv8qnlgmi8wsfi7l3c5zvjcrrb3q7ajfc3q7yf6k6a";
+  };
+
+  buildInputs = [ SDL frei0r gettext makeWrapper mlt pkgconfig qt5 ];
+
+  # Fixed in git and can be removed for the next release
+  patches = [ ./CuteLogger.patch ];
+
+  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
index 3251127c7a19..14ce5e9684bd 100644
--- a/pkgs/applications/video/simplescreenrecorder/default.nix
+++ b/pkgs/applications/video/simplescreenrecorder/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, ffmpeg, jackaudio, libX11, libXext
+{ stdenv, fetchurl, alsaLib, ffmpeg, jack2, libX11, libXext
 , libXfixes, mesa, pkgconfig, pulseaudio, qt4
 }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    alsaLib ffmpeg jackaudio libX11 libXext libXfixes mesa pkgconfig
+    alsaLib ffmpeg jack2 libX11 libXext libXfixes mesa pkgconfig
     pulseaudio qt4
   ];
 
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 2c5b53c596a6..4b42bcd2859d 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -3,7 +3,7 @@
 , 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
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     [ 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 libebml libmatroska libvdpau
diff --git a/pkgs/data/fonts/opensans-ttf/default.nix b/pkgs/data/fonts/opensans-ttf/default.nix
new file mode 100644
index 000000000000..2e0f3d5df2a7
--- /dev/null
+++ b/pkgs/data/fonts/opensans-ttf/default.nix
@@ -0,0 +1,34 @@
+{stdenv, fetchurl}:
+
+# adapted from https://aur.archlinux.org/packages/tt/ttf-opensans/PKGBUILD
+
+stdenv.mkDerivation rec {
+  name = "opensans-ttf-20140617";
+
+  src = fetchurl {
+    url = "https://hexchain.org/pub/archlinux/ttf-opensans/opensans.tar.gz";
+    sha256 = "1ycn39dijhd3lffmafminrnfmymdig2jvc6i47bb42fx777q97q4";
+  };
+
+  sourceRoot = ".";
+
+  installPhase = ''
+    mkdir -p $out/share/fonts/truetype
+    cp *.ttf $out/share/fonts/truetype
+  '';
+
+  meta = {
+    description = "Open Sans fonts";
+
+    longDescription = ''
+      Open Sans is a humanist sans serif typeface designed by Steve Matteson,
+      Type Director of Ascender Corp.
+    '';
+
+    homepage = "http://en.wikipedia.org/wiki/Open_Sans";
+    license = "Apache";
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ ];
+  };
+}
diff --git a/pkgs/desktops/e18/enlightenment.nix b/pkgs/desktops/e18/enlightenment.nix
index e51a61209e21..c3cd585e5257 100644
--- a/pkgs/desktops/e18/enlightenment.nix
+++ b/pkgs/desktops/e18/enlightenment.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, pkgconfig, e18, xlibs, libffi, pam, alsaLib, luajit, bzip2 }:
+{ stdenv, fetchurl, pkgconfig, e18, xlibs, libffi, pam, alsaLib, luajit, bzip2, set_freqset_setuid ? false }:
+
 stdenv.mkDerivation rec {
   name = "enlightenment-${version}";
   version = "0.18.8";
@@ -10,6 +11,20 @@ stdenv.mkDerivation rec {
   preConfigure = ''
     export NIX_CFLAGS_COMPILE="-I${e18.efl}/include/eo-1 -I${e18.efl}/include/ecore-imf-1 -I${e18.efl}/include/ethumb-client-1 -I${e18.efl}/include/ethumb-1 $NIX_CFLAGS_COMPILE"
   '';
+
+  # this is a hack and without this cpufreq module is not working:
+  #   when set_freqset_setuid is true and "e18_freqset" is set in setuidPrograms (this is taken care of in e18 NixOS module),
+  #   then this postInstall does the folowing:
+  #   1. moves the "freqset" binary to "e18_freqset",
+  #   2. linkes "e18_freqset" to enlightenment/bin so that,
+  #   3. setuidPrograms detects it and makes appropriate stuff to /var/setuid-wrappers/e18_freqset,
+  #   4. and finaly, linkes /var/setuid-wrappers/e18_freqset to original destination where enlightenment wants it
+  postInstall = if set_freqset_setuid then ''
+    export CPUFREQ_DIRPATH=`readlink -f $out/lib/enlightenment/modules/cpufreq/linux-gnu-*`;
+    mv $CPUFREQ_DIRPATH/freqset $CPUFREQ_DIRPATH/e18_freqset
+    ln -sv $CPUFREQ_DIRPATH/e18_freqset $out/bin/e18_freqset
+    ln -sv /var/setuid-wrappers/e18_freqset $CPUFREQ_DIRPATH/freqset
+  '' else "";
   meta = {
     description = "The Compositing Window Manager and Desktop Shell";
     homepage = http://enlightenment.org/;
diff --git a/pkgs/development/compilers/gcc/4.2/builder.sh b/pkgs/development/compilers/gcc/4.2/builder.sh
deleted file mode 100644
index d749fc08d2a0..000000000000
--- a/pkgs/development/compilers/gcc/4.2/builder.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
-# Thing.
-export CPP="gcc -E"
-
-
-if test "$noSysDirs" = "1"; then
-
-    if test -e $NIX_GCC/nix-support/orig-libc; then
-
-        # Figure out what extra flags to pass to the gcc compilers
-        # being generated to make sure that they use our glibc.
-        extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
-        extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
-
-        # Use *real* header files, otherwise a limits.h is generated
-        # that does not include Glibc's limits.h (notably missing
-        # SSIZE_MAX, which breaks the build).
-        export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
-        
-    else
-        # Hack: support impure environments.
-        extraCFlags="-isystem /usr/include"
-        extraLDFlags="-L/usr/lib64 -L/usr/lib"
-        export NIX_FIXINC_DUMMY=/usr/include
-    fi
-
-    extraCFlags="-g0 $extraCFlags"
-    extraLDFlags="--strip-debug $extraLDFlags"
-
-    export NIX_EXTRA_CFLAGS=$extraCFlags
-    for i in $extraLDFlags; do
-        export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
-    done
-
-    makeFlagsArray=( \
-        "${makeFlagsArray[@]}" \
-        NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        LIMITS_H_TEST=true \
-        X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        )
-fi
-
-
-preConfigure() {
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-    configureScript=../$sourceRoot/configure
-}
-
-
-postInstall() {
-    # Remove precompiled headers for now.  They are very big and
-    # probably not very useful yet.
-    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
-
-    # Remove `fixincl' to prevent a retained dependency on the
-    # previous gcc.
-    rm -rf $out/libexec/gcc/*/*/install-tools
-    rm -rf $out/lib/gcc/*/*/install-tools
-
-    # Get rid of some "fixed" header files
-    rm -rf $out/lib/gcc/*/*/include/root
-
-    # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks.
-    for i in $out/bin/*-gcc*; do
-        if cmp -s $out/bin/gcc $i; then
-            ln -sfn gcc $i
-        fi
-    done
-
-    for i in $out/bin/*-c++* $out/bin/*-g++*; do
-        if cmp -s $out/bin/g++ $i; then
-            ln -sfn g++ $i
-        fi
-    done
-}
-
-
-if test -z "$profiledCompiler"; then
-    buildFlags="bootstrap $buildFlags"
-else    
-    buildFlags="profiledbootstrap $buildFlags"
-fi
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc/4.2/default.nix b/pkgs/development/compilers/gcc/4.2/default.nix
deleted file mode 100644
index 69cac159d4a5..000000000000
--- a/pkgs/development/compilers/gcc/4.2/default.nix
+++ /dev/null
@@ -1,66 +0,0 @@
-{ stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false
-, profiledCompiler ? false
-, staticCompiler ? false
-, gmp ? null
-, mpfr ? null
-, texinfo ? null
-, name ? "gcc"
-}:
-
-with stdenv.lib;
-
-let version = "4.2.4"; in
-
-stdenv.mkDerivation {
-  name = "${name}-${version}";
-  
-  builder = ./builder.sh;
-  
-  src =
-    optional /*langC*/ true (fetchurl {
-      url = "mirror://gnu/gcc/gcc-${version}/gcc-core-${version}.tar.bz2";
-      sha256 = "0cm5yzhqhgdfk03aayakmdj793sya42xkkqhslj7s2b697hygjfg";
-    }) ++
-    optional langCC (fetchurl {
-      url = "mirror://gnu/gcc/gcc-${version}/gcc-g++-${version}.tar.bz2";
-      sha256 = "0gq8ikci0qqgck71qqlhfld6zkwn9179x6z15vdd9blkdig55nxg";
-    }) ++
-    optional langFortran (fetchurl {
-      url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
-      sha256 = "013yqiqhdavgxzjryvylgf3lcnknmw89fx41jf2v4899srn0bhkg";
-    });
-
-  patches =
-    [./pass-cxxcpp.patch ./siginfo_t.patch]
-    ++ optional noSysDirs [./no-sys-dirs.patch];
-
-  inherit noSysDirs profiledCompiler staticCompiler;
-
-  buildInputs = [gmp mpfr texinfo];
-
-  configureFlags = "
-    --disable-multilib
-    --disable-libstdcxx-pch
-    --with-system-zlib
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC       "c"
-        ++ optional langCC      "c++"
-        ++ optional langFortran "fortran"
-        )
-      )
-    }
-    ${if stdenv.isi686 then "--with-arch=i686" else ""}
-  ";
-
-  NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
-
-  passthru = { inherit langC langCC langFortran; };
-
-  meta = {
-    homepage = "http://gcc.gnu.org/";
-    license = "GPL/LGPL";
-    description = "GNU Compiler Collection, 4.2.x";
-  };
-}
diff --git a/pkgs/development/compilers/gcc/4.2/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.2/no-sys-dirs.patch
deleted file mode 100644
index f1d429e274a0..000000000000
--- a/pkgs/development/compilers/gcc/4.2/no-sys-dirs.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-diff -rc gcc-4.2.0-orig/Makefile.in gcc-4.2.0/Makefile.in
-*** gcc-4.2.0-orig/Makefile.in	2006-12-29 18:47:06.000000000 +0100
---- gcc-4.2.0/Makefile.in	2007-05-20 21:06:42.000000000 +0200
-***************
-*** 364,369 ****
---- 364,377 ----
-  @host_makefile_frag@
-  ###
-  
-+ CFLAGS += $(NIX_EXTRA_CFLAGS)
-+ CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS)
-+ CXXFLAGS += $(NIX_EXTRA_CFLAGS)
-+ LDFLAGS += $(NIX_EXTRA_LDFLAGS)
-+ LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS)
-+ BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS)
-+ BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS)
-+ 
-  # This is the list of directories that may be needed in RPATH_ENVVAR
-  # so that prorgams built for the target machine work.
-  TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc)
-diff -rc gcc-4.2.0-orig/gcc/Makefile.in gcc-4.2.0/gcc/Makefile.in
-*** gcc-4.2.0-orig/gcc/Makefile.in	2007-03-12 05:40:09.000000000 +0100
---- gcc-4.2.0/gcc/Makefile.in	2007-05-20 19:35:13.000000000 +0200
-***************
-*** 396,402 ****
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! NATIVE_SYSTEM_HEADER_DIR = /usr/include
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
---- 396,406 ----
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! # Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-! # `fixinc' from fixing header files in /usr/include.  However,
-! # NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-! # it to some dummy directory.
-! NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
-***************
-*** 3066,3072 ****
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
---- 3070,3076 ----
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
-diff -rc gcc-4.2.0-orig/gcc/cppdefault.c gcc-4.2.0/gcc/cppdefault.c
-*** gcc-4.2.0-orig/gcc/cppdefault.c	2006-01-20 22:00:03.000000000 +0100
---- gcc-4.2.0/gcc/cppdefault.c	2007-05-20 17:16:44.000000000 +0200
-***************
-*** 41,46 ****
---- 41,50 ----
-  # undef CROSS_INCLUDE_DIR
-  #endif
-  
-+ #undef LOCAL_INCLUDE_DIR
-+ #undef SYSTEM_INCLUDE_DIR
-+ #undef STANDARD_INCLUDE_DIR
-+ 
-  const struct default_include cpp_include_defaults[]
-  #ifdef INCLUDE_DEFAULTS
-  = INCLUDE_DEFAULTS;
-diff -rc gcc-4.2.0-orig/gcc/gcc.c gcc-4.2.0/gcc/gcc.c
-*** gcc-4.2.0-orig/gcc/gcc.c	2007-03-05 21:37:05.000000000 +0100
---- gcc-4.2.0/gcc/gcc.c	2007-05-20 17:49:48.000000000 +0200
-***************
-*** 1449,1458 ****
-  /* Default prefixes to attach to command names.  */
-  
-  #ifndef STANDARD_STARTFILE_PREFIX_1
-! #define STANDARD_STARTFILE_PREFIX_1 "/lib/"
-  #endif
-  #ifndef STANDARD_STARTFILE_PREFIX_2
-! #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
-  #endif
-  
-  #ifdef CROSS_COMPILE  /* Don't use these prefixes for a cross compiler.  */
---- 1449,1458 ----
-  /* Default prefixes to attach to command names.  */
-  
-  #ifndef STANDARD_STARTFILE_PREFIX_1
-! #define STANDARD_STARTFILE_PREFIX_1 ""
-  #endif
-  #ifndef STANDARD_STARTFILE_PREFIX_2
-! #define STANDARD_STARTFILE_PREFIX_2 ""
-  #endif
-  
-  #ifdef CROSS_COMPILE  /* Don't use these prefixes for a cross compiler.  */
-***************
-*** 1473,1480 ****
-  #endif
-  
-  static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
-! static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
-! static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
-  static const char *md_exec_prefix = MD_EXEC_PREFIX;
-  
-  static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
---- 1473,1480 ----
-  #endif
-  
-  static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
-! static const char *const standard_exec_prefix_1 = "/no-such-path/";
-! static const char *const standard_exec_prefix_2 = "/no-such-path/";
-  static const char *md_exec_prefix = MD_EXEC_PREFIX;
-  
-  static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
-diff -rc gcc-4.2.0-orig/ltconfig gcc-4.2.0/ltconfig
-*** gcc-4.2.0-orig/ltconfig	2007-02-14 18:08:35.000000000 +0100
---- gcc-4.2.0/ltconfig	2007-05-20 22:16:24.000000000 +0200
-***************
-*** 2322,2327 ****
---- 2322,2332 ----
-  # A language-specific compiler.
-  CC=$CC
-  
-+ # Ugly hack to get libmudflap (and possibly other libraries) to build.
-+ # Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+ # to Glibc gets lost.  Here we forcibly add it to any invocation.
-+ CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
-+ 
-  # Is the compiler the GNU C compiler?
-  with_gcc=$with_gcc
-  
diff --git a/pkgs/development/compilers/gcc/4.2/pass-cxxcpp.patch b/pkgs/development/compilers/gcc/4.2/pass-cxxcpp.patch
deleted file mode 100644
index 9b0676d4fdc9..000000000000
--- a/pkgs/development/compilers/gcc/4.2/pass-cxxcpp.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -rc gcc-orig/Makefile.in gcc-4.1.1/Makefile.in
-*** gcc-orig/Makefile.in	Wed Jun 21 13:40:23 2006
---- gcc-4.1.1/Makefile.in	Wed Jun 21 14:19:44 2006
-***************
-*** 213,219 ****
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
---- 213,220 ----
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
-! 	CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
diff --git a/pkgs/development/compilers/gcc/4.2/siginfo_t.patch b/pkgs/development/compilers/gcc/4.2/siginfo_t.patch
deleted file mode 100644
index bfb9f9753728..000000000000
--- a/pkgs/development/compilers/gcc/4.2/siginfo_t.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-https://bbs.archlinux.org/viewtopic.php?id=144949
---- a/gcc/config/i386/linux-unwind.h	2011-01-03 20:52:22.000000000 +0000
-+++ b/gcc/config/i386/linux-unwind.h	2012-07-06 12:23:51.562859470 +0100
-@@ -133,9 +133,9 @@
-     {
-       struct rt_sigframe {
- 	int sig;
--	struct siginfo *pinfo;
-+	siginfo_t *pinfo;
- 	void *puc;
--	struct siginfo info;
-+	siginfo_t info;
- 	struct ucontext uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index f00c42e421ad..ab7732a68eb2 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -52,7 +52,7 @@ assert langGo -> langCC;
 with stdenv.lib;
 with builtins;
 
-let version = "4.9.0";
+let version = "4.9.1";
 
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
@@ -209,7 +209,7 @@ stdenv.mkDerivation ({
 
   src = fetchurl {
     url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
-    sha256 = "0mqjxpw2klskls00lwx1k24pnyzm3whqxg3hk74c3sddgfllgc5r";
+    sha256 = "0zki3ngi0gsidnmsp88mjl2868cc7cm5wm1vwqw6znja28d7hd6k";
   };
 
   inherit patches;
diff --git a/pkgs/development/compilers/idris/default.nix b/pkgs/development/compilers/idris/default.nix
index c2b6b0ac5acc..df57364fa085 100644
--- a/pkgs/development/compilers/idris/default.nix
+++ b/pkgs/development/compilers/idris/default.nix
@@ -26,6 +26,7 @@ cabal.mkDerivation (self: {
   buildTools = [ happy ];
   extraLibraries = [ boehmgc gmp ];
   configureFlags = "-fllvm -fgmp -fffi";
+  patches = [ ./trifecta-fix.patch ];
   meta = {
     homepage = "http://www.idris-lang.org/";
     description = "Functional Programming Language with Dependent Types";
diff --git a/pkgs/development/compilers/idris/trifecta-fix.patch b/pkgs/development/compilers/idris/trifecta-fix.patch
new file mode 100644
index 000000000000..a20e482d2c41
--- /dev/null
+++ b/pkgs/development/compilers/idris/trifecta-fix.patch
@@ -0,0 +1,15 @@
+diff --git a/src/Idris/AbsSyntaxTree.hs b/src/Idris/AbsSyntaxTree.hs
+index 76df969..076f1ff 100644
+--- a/src/Idris/AbsSyntaxTree.hs
++++ b/src/Idris/AbsSyntaxTree.hs
+@@ -194,6 +194,10 @@ data IState = IState {
+     idris_callswho :: Maybe (M.Map Name [Name])
+    }
+
++-- Required for parsers library, and therefore trifecta
++instance Show IState where
++  show = const "{internal state}"
++
+ data SizeChange = Smaller | Same | Bigger | Unknown
+     deriving (Show, Eq)
+ {-!
diff --git a/pkgs/development/compilers/llvm/3.1/clang-include-paths.patch b/pkgs/development/compilers/llvm/3.1/clang-include-paths.patch
deleted file mode 100644
index 5e7370718ab4..000000000000
--- a/pkgs/development/compilers/llvm/3.1/clang-include-paths.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -Naur clang-3.1.src-orig/lib/Driver/ToolChains.cpp clang-3.1.src/lib/Driver/ToolChains.cpp
---- clang-3.1.src-orig/lib/Driver/ToolChains.cpp	2012-05-11 20:16:02.000000000 -0400
-+++ clang-3.1.src/lib/Driver/ToolChains.cpp	2012-10-08 01:13:01.044083509 -0400
-@@ -2146,9 +2146,6 @@
-   if (DriverArgs.hasArg(options::OPT_nostdinc))
-     return;
- 
--  if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
--    addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
--
-   if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
-     llvm::sys::Path P(D.ResourceDir);
-     P.appendComponent("include");
-@@ -2264,6 +2261,7 @@
-     return;
- 
-   // Check if libc++ has been enabled and provide its include paths if so.
-+  // !!! Will need to modify this if/when nixpkgs uses libc++
-   if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
-     // libc++ is always installed at a fixed path on Linux currently.
-     addSystemInclude(DriverArgs, CC1Args,
diff --git a/pkgs/development/compilers/llvm/3.1/clang-ld-flags.patch b/pkgs/development/compilers/llvm/3.1/clang-ld-flags.patch
deleted file mode 100644
index ffa67b464eca..000000000000
--- a/pkgs/development/compilers/llvm/3.1/clang-ld-flags.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -Naur clang-3.1.src-orig/lib/Driver/ToolChains.cpp clang-3.1.src/lib/Driver/ToolChains.cpp
---- clang-3.1.src-orig/lib/Driver/ToolChains.cpp	2012-05-11 20:16:02.000000000 -0400
-+++ clang-3.1.src/lib/Driver/ToolChains.cpp	2012-10-08 01:22:53.458850737 -0400
-@@ -2077,16 +2077,6 @@
-       addPathIfExists(LibPath + "/../" + Multilib, Paths);
-     }
-   }
--  addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths);
--  addPathIfExists(SysRoot + "/lib/../" + Multilib, Paths);
--  addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
--  addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths);
--
--  // Try walking via the GCC triple path in case of multiarch GCC
--  // installations with strange symlinks.
--  if (GCCInstallation.isValid())
--    addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
--                    "/../../" + Multilib, Paths);
- 
-   // Add the non-multilib suffixed paths (if potentially different).
-   if (GCCInstallation.isValid()) {
-@@ -2100,8 +2090,6 @@
-       addPathIfExists(LibPath, Paths);
-     }
-   }
--  addPathIfExists(SysRoot + "/lib", Paths);
--  addPathIfExists(SysRoot + "/usr/lib", Paths);
- }
- 
- bool Linux::HasNativeLLVMSupport() const {
-diff -Naur clang-3.1.src-orig/lib/Driver/Tools.cpp clang-3.1.src/lib/Driver/Tools.cpp
---- clang-3.1.src-orig/lib/Driver/Tools.cpp	2012-04-18 17:32:25.000000000 -0400
-+++ clang-3.1.src/lib/Driver/Tools.cpp	2012-10-08 01:25:23.913501995 -0400
-@@ -5210,24 +5210,6 @@
-       ToolChain.getArch() == llvm::Triple::thumb ||
-       (!Args.hasArg(options::OPT_static) &&
-        !Args.hasArg(options::OPT_shared))) {
--    CmdArgs.push_back("-dynamic-linker");
--    if (ToolChain.getArch() == llvm::Triple::x86)
--      CmdArgs.push_back("/lib/ld-linux.so.2");
--    else if (ToolChain.getArch() == llvm::Triple::arm ||
--             ToolChain.getArch() == llvm::Triple::thumb)
--      CmdArgs.push_back("/lib/ld-linux.so.3");
--    else if (ToolChain.getArch() == llvm::Triple::mips ||
--             ToolChain.getArch() == llvm::Triple::mipsel)
--      CmdArgs.push_back("/lib/ld.so.1");
--    else if (ToolChain.getArch() == llvm::Triple::mips64 ||
--             ToolChain.getArch() == llvm::Triple::mips64el)
--      CmdArgs.push_back("/lib64/ld.so.1");
--    else if (ToolChain.getArch() == llvm::Triple::ppc)
--      CmdArgs.push_back("/lib/ld.so.1");
--    else if (ToolChain.getArch() == llvm::Triple::ppc64)
--      CmdArgs.push_back("/lib64/ld64.so.1");
--    else
--      CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
-   }
- 
-   CmdArgs.push_back("-o");
diff --git a/pkgs/development/compilers/llvm/3.1/clang.nix b/pkgs/development/compilers/llvm/3.1/clang.nix
deleted file mode 100644
index c152d2215d80..000000000000
--- a/pkgs/development/compilers/llvm/3.1/clang.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ stdenv, fetchurl, perl, groff, llvm, cmake }:
-
-let
-  version = "3.1";
-  gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
-in
-
-stdenv.mkDerivation {
-  name = "clang-${version}";
-
-  buildInputs = [ perl llvm groff cmake ];
-
-  patches = stdenv.lib.optionals (stdenv.gcc.libc != null) 
-    [ ./clang-include-paths.patch ./clang-ld-flags.patch ];
-
-  cmakeFlags = [
-    "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
-    "-DCMAKE_BUILD_TYPE=Release"
-    "-DLLVM_TARGETS_TO_BUILD=all"
-    "-DGCC_INSTALL_PREFIX=${gccReal}"
-  ] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
-    "-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
-  ];
-
-  enableParallelBuilding = true;
-
-  src = fetchurl {
-      url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
-      sha256 = "11m7sm9f8qcrayckfg3z91zb3fimilpm0f7azn7q7qnkvhay4qzz";
-  };
-
-  passthru = { gcc = stdenv.gcc.gcc; };
-
-  meta = {
-    homepage = http://clang.llvm.org/;
-    description = "A C language family frontend for LLVM";
-    license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric vlstill];
-    platforms = with stdenv.lib.platforms; all;
-  };
-}
-
diff --git a/pkgs/development/compilers/llvm/3.1/default.nix b/pkgs/development/compilers/llvm/3.1/default.nix
deleted file mode 100644
index 60837d58b295..000000000000
--- a/pkgs/development/compilers/llvm/3.1/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ stdenv, fetchurl, perl, groff, cmake, python, binutils }:
-
-let version = "3.1"; in
-
-stdenv.mkDerivation {
-  name = "llvm-${version}";
-
-  src = fetchurl {
-    url    = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
-    sha256 = "1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab";
-  };
-
-  buildInputs = [ perl groff cmake python ];
-
-  cmakeFlags = [
-    "-DCMAKE_BUILD_TYPE=Release"
-    "-DLLVM_BINUTILS_INCDIR=${binutils}/include"
-  ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://llvm.org/;
-    description = "Collection of modular and reusable compiler and toolchain technologies";
-    license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric raskin vlstill];
-    platforms = with stdenv.lib.platforms; all;
-  };
-}
-
diff --git a/pkgs/development/compilers/llvm/3.2/clang-purity.patch b/pkgs/development/compilers/llvm/3.2/clang-purity.patch
deleted file mode 100644
index 18c70b56c540..000000000000
--- a/pkgs/development/compilers/llvm/3.2/clang-purity.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-diff -Naur clang-3.2.src-orig/lib/Driver/ToolChains.cpp clang-3.2.src/lib/Driver/ToolChains.cpp
---- clang-3.2.src-orig/lib/Driver/ToolChains.cpp	2012-12-16 10:59:27.000000000 -0500
-+++ clang-3.2.src/lib/Driver/ToolChains.cpp	2013-01-22 14:16:55.787547681 -0500
-@@ -2153,16 +2153,6 @@
-       addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/lib", Paths);
-     }
-   }
--  addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths);
--  addPathIfExists(SysRoot + "/lib/../" + Multilib, Paths);
--  addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
--  addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths);
--
--  // Try walking via the GCC triple path in case of multiarch GCC
--  // installations with strange symlinks.
--  if (GCCInstallation.isValid())
--    addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
--                    "/../../" + Multilib, Paths);
- 
-   // Add the non-multilib suffixed paths (if potentially different).
-   if (GCCInstallation.isValid()) {
-@@ -2176,8 +2166,6 @@
-       addPathIfExists(LibPath, Paths);
-     }
-   }
--  addPathIfExists(SysRoot + "/lib", Paths);
--  addPathIfExists(SysRoot + "/usr/lib", Paths);
- }
- 
- bool Linux::HasNativeLLVMSupport() const {
-@@ -2228,9 +2216,6 @@
-   if (DriverArgs.hasArg(options::OPT_nostdinc))
-     return;
- 
--  if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
--    addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
--
-   if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
-     llvm::sys::Path P(D.ResourceDir);
-     P.appendComponent("include");
-@@ -2295,24 +2280,6 @@
-     "/usr/include/powerpc64-linux-gnu"
-   };
-   ArrayRef<StringRef> MultiarchIncludeDirs;
--  if (getTriple().getArch() == llvm::Triple::x86_64) {
--    MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
--  } else if (getTriple().getArch() == llvm::Triple::x86) {
--    MultiarchIncludeDirs = X86MultiarchIncludeDirs;
--  } else if (getTriple().getArch() == llvm::Triple::arm) {
--    if (getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
--      MultiarchIncludeDirs = ARMHFMultiarchIncludeDirs;
--    else
--      MultiarchIncludeDirs = ARMMultiarchIncludeDirs;
--  } else if (getTriple().getArch() == llvm::Triple::mips) {
--    MultiarchIncludeDirs = MIPSMultiarchIncludeDirs;
--  } else if (getTriple().getArch() == llvm::Triple::mipsel) {
--    MultiarchIncludeDirs = MIPSELMultiarchIncludeDirs;
--  } else if (getTriple().getArch() == llvm::Triple::ppc) {
--    MultiarchIncludeDirs = PPCMultiarchIncludeDirs;
--  } else if (getTriple().getArch() == llvm::Triple::ppc64) {
--    MultiarchIncludeDirs = PPC64MultiarchIncludeDirs;
--  }
-   for (ArrayRef<StringRef>::iterator I = MultiarchIncludeDirs.begin(),
-                                      E = MultiarchIncludeDirs.end();
-        I != E; ++I) {
-@@ -2324,13 +2291,6 @@
- 
-   if (getTriple().getOS() == llvm::Triple::RTEMS)
-     return;
--
--  // Add an include of '/include' directly. This isn't provided by default by
--  // system GCCs, but is often used with cross-compiling GCCs, and harmless to
--  // add even when Clang is acting as-if it were a system compiler.
--  addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include");
--
--  addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
- }
- 
- /// \brief Helper to add the thre variant paths for a libstdc++ installation.
-diff -Naur clang-3.2.src-orig/lib/Driver/Tools.cpp clang-3.2.src/lib/Driver/Tools.cpp
---- clang-3.2.src-orig/lib/Driver/Tools.cpp	2012-11-21 02:56:23.000000000 -0500
-+++ clang-3.2.src/lib/Driver/Tools.cpp	2013-01-22 14:24:37.167212186 -0500
-@@ -5972,34 +5972,6 @@
-       ToolChain.getArch() == llvm::Triple::thumb ||
-       (!Args.hasArg(options::OPT_static) &&
-        !Args.hasArg(options::OPT_shared))) {
--    CmdArgs.push_back("-dynamic-linker");
--    if (isAndroid)
--      CmdArgs.push_back("/system/bin/linker");
--    else if (ToolChain.getArch() == llvm::Triple::x86)
--      CmdArgs.push_back("/lib/ld-linux.so.2");
--    else if (ToolChain.getArch() == llvm::Triple::arm ||
--             ToolChain.getArch() == llvm::Triple::thumb) {
--      if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
--        CmdArgs.push_back("/lib/ld-linux-armhf.so.3");
--      else
--        CmdArgs.push_back("/lib/ld-linux.so.3");
--    }
--    else if (ToolChain.getArch() == llvm::Triple::mips ||
--             ToolChain.getArch() == llvm::Triple::mipsel)
--      CmdArgs.push_back("/lib/ld.so.1");
--    else if (ToolChain.getArch() == llvm::Triple::mips64 ||
--             ToolChain.getArch() == llvm::Triple::mips64el) {
--      if (hasMipsN32ABIArg(Args))
--        CmdArgs.push_back("/lib32/ld.so.1");
--      else
--        CmdArgs.push_back("/lib64/ld.so.1");
--    }
--    else if (ToolChain.getArch() == llvm::Triple::ppc)
--      CmdArgs.push_back("/lib/ld.so.1");
--    else if (ToolChain.getArch() == llvm::Triple::ppc64)
--      CmdArgs.push_back("/lib64/ld64.so.1");
--    else
--      CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
-   }
- 
-   CmdArgs.push_back("-o");
-diff -Naur clang-3.2.src-orig/lib/Frontend/InitHeaderSearch.cpp clang-3.2.src/lib/Frontend/InitHeaderSearch.cpp
---- clang-3.2.src-orig/lib/Frontend/InitHeaderSearch.cpp	2012-10-24 12:19:39.000000000 -0400
-+++ clang-3.2.src/lib/Frontend/InitHeaderSearch.cpp	2013-01-22 14:20:32.803925775 -0500
-@@ -221,8 +221,6 @@
-     case llvm::Triple::Bitrig:
-       break;
-     default:
--      // FIXME: temporary hack: hard-coded paths.
--      AddPath("/usr/local/include", System, true, false, false);
-       break;
-     }
-   }
-@@ -330,8 +328,6 @@
-     break;
-   }
- 
--  if ( os != llvm::Triple::RTEMS )
--    AddPath("/usr/include", System, false, false, false);
- }
- 
- void InitHeaderSearch::
diff --git a/pkgs/development/compilers/llvm/3.2/clang.nix b/pkgs/development/compilers/llvm/3.2/clang.nix
deleted file mode 100644
index b8e9f946773d..000000000000
--- a/pkgs/development/compilers/llvm/3.2/clang.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, fetchurl, perl, groff, llvm, cmake, libxml2 }:
-
-let
-  version = "3.2";
-  gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
-in
-
-stdenv.mkDerivation {
-  name = "clang-${version}";
-
-  buildInputs = [ perl llvm groff cmake libxml2 ];
-
-  patches = stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
-
-  cmakeFlags = [
-    "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
-    "-DCMAKE_BUILD_TYPE=Release"
-    "-DLLVM_TARGETS_TO_BUILD=all"
-    "-DGCC_INSTALL_PREFIX=${gccReal}"
-  ] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
-    "-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
-  ];
-
-  enableParallelBuilding = true;
-
-  src = fetchurl {
-      url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
-      sha256 = "0n2nzw3pw2v7fk67f2k2qyzd9wibvi3i5j7cjzz1csqgghzz1aia";
-  };
-
-  passthru = { gcc = stdenv.gcc.gcc; };
-
-  meta = {
-    homepage = http://clang.llvm.org/;
-    description = "A C language family frontend for LLVM";
-    license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; all;
-  };
-}
diff --git a/pkgs/development/compilers/llvm/3.2/default.nix b/pkgs/development/compilers/llvm/3.2/default.nix
deleted file mode 100644
index c373f1c1a4a2..000000000000
--- a/pkgs/development/compilers/llvm/3.2/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils }:
-
-let version = "3.2"; in
-
-stdenv.mkDerivation {
-  name = "llvm-${version}";
-
-  src = fetchurl {
-    url    = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
-    sha256 = "0hv30v5l4fkgyijs56sr1pbrlzgd674pg143x7az2h37sb290l0j";
-  };
-
-  patches = [ ./set_soname.patch ]; # http://llvm.org/bugs/show_bug.cgi?id=12334
-  patchFlags = "-p0";
-
-  preConfigure = "patchShebangs .";
-
-  propagatedBuildInputs = [ libffi ];
-  buildInputs = [ perl groff cmake python ]; # ToDo: polly, libc++; enable cxx11?
-
-  # created binaries need to be run before installation... I coudn't find a better way
-  preBuild = ''export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/lib'';
-
-  cmakeFlags = [
-    "-DCMAKE_BUILD_TYPE=Release"
-    "-DBUILD_SHARED_LIBS=ON"
-    "-DLLVM_BINUTILS_INCDIR=${binutils}/include"
-  ];
-
-  enableParallelBuilding = true;
-  #doCheck = true; # tests are broken, don't know why
-
-  meta = {
-    homepage = http://llvm.org/;
-    description = "Collection of modular and reusable compiler and toolchain technologies";
-    license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric raskin vlstill];
-    platforms = with stdenv.lib.platforms; all;
-  };
-}
diff --git a/pkgs/development/compilers/llvm/3.2/set_soname.patch b/pkgs/development/compilers/llvm/3.2/set_soname.patch
deleted file mode 100644
index 69ba74dddad8..000000000000
--- a/pkgs/development/compilers/llvm/3.2/set_soname.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=409267
-http://llvm.org/bugs/show_bug.cgi?id=12334
---- tools/llvm-shlib/Makefile.orig	2012-03-26 18:14:13.071797115 +0200
-+++ tools/llvm-shlib/Makefile	2012-03-26 17:31:12.491196254 +0200
-@@ -67,6 +67,7 @@
-     # Include everything from the .a's into the shared library.
-     LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
-                        -Wl,--no-whole-archive
-+    LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
- endif
- 
- ifeq ($(HOST_OS),Linux)
diff --git a/pkgs/development/compilers/opencxx/default.nix b/pkgs/development/compilers/opencxx/default.nix
deleted file mode 100644
index 54eda51353f9..000000000000
--- a/pkgs/development/compilers/opencxx/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ stdenv, fetchurl, libtool, gcc, patches ? []}:
-
-stdenv.mkDerivation {
-  name = "opencxx-2.8";
-  src = fetchurl {
-    url = mirror://sourceforge/opencxx/opencxx-2.8.tar.gz;
-    md5 = "0f71df82751fe8aba5122d6e0541c98a";
-  };
-
-  buildInputs = [libtool];
-  NIX_GCC = gcc;
-
-  inherit patches;
-}
diff --git a/pkgs/development/interpreters/supercollider/default.nix b/pkgs/development/interpreters/supercollider/default.nix
index 97808f6faf13..a8c967b59678 100644
--- a/pkgs/development/interpreters/supercollider/default.nix
+++ b/pkgs/development/interpreters/supercollider/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, cmake, pkgconfig
-, jackaudio, libsndfile, fftw, curl
+, jack2, libsndfile, fftw, curl
 , libXt, qt, readline
 , useSCEL ? false, emacs
 }:
@@ -35,6 +35,6 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkgconfig ];
 
   buildInputs = [ 
-    jackaudio libsndfile fftw curl libXt qt readline ] 
+    jack2 libsndfile fftw curl libXt qt readline ]
     ++ optional useSCEL emacs;
 }
diff --git a/pkgs/development/interpreters/xulrunner/default.nix b/pkgs/development/interpreters/xulrunner/default.nix
new file mode 100644
index 000000000000..47dea40eba22
--- /dev/null
+++ b/pkgs/development/interpreters/xulrunner/default.nix
@@ -0,0 +1,82 @@
+{ 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, icu
+, debugBuild ? false
+}:
+
+assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
+
+let version = "31.0"; in
+
+stdenv.mkDerivation rec {
+  name = "xulrunner-${version}";
+
+  src = fetchurl {
+    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${version}/source/firefox-${version}.source.tar.bz2";
+    sha1 = "a6c3e25ee3aeb7da42db2aaeb50a385d63532beb";
+  };
+
+  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=xulrunner"
+      "--disable-javaxpcom"
+      "--with-system-jpeg"
+      "--with-system-zlib"
+      "--with-system-bz2"
+      "--with-system-nspr"
+      "--with-system-nss"
+      "--with-system-libevent"
+      "--with-system-libvpx"
+      # "--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"
+      "--disable-pulseaudio"
+    ]
+    ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
+                      else [ "--disable-debug" "--enable-release"
+                             "--enable-optimize" "--enable-strip" ]);
+
+  enableParallelBuilding = true;
+
+  preConfigure =
+    ''
+      mkdir ../objdir
+      cd ../objdir
+      configureScript=../mozilla-release/configure
+    '';
+
+  meta = {
+    description = "Mozilla Firefox XUL runner";
+    homepage = http://www.mozilla.com/en-US/firefox/;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.linux;
+  };
+
+  passthru = { inherit gtk version; };
+}
diff --git a/pkgs/development/libraries/aubio/default.nix b/pkgs/development/libraries/aubio/default.nix
index 53ff65720529..7a5351da10e0 100644
--- a/pkgs/development/libraries/aubio/default.nix
+++ b/pkgs/development/libraries/aubio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, fftw, jackaudio, libsamplerate
+{ stdenv, fetchurl, alsaLib, fftw, jack2, libsamplerate
 , libsndfile, pkgconfig, python
 }:
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    alsaLib fftw jackaudio libsamplerate libsndfile pkgconfig python
+    alsaLib fftw jack2 libsamplerate libsndfile pkgconfig python
   ];
 
   configurePhase = "python waf configure --prefix=$out";
diff --git a/pkgs/development/libraries/dssi/default.nix b/pkgs/development/libraries/dssi/default.nix
index 951278b4433f..ae276c6aa0aa 100644
--- a/pkgs/development/libraries/dssi/default.nix
+++ b/pkgs/development/libraries/dssi/default.nix
@@ -1,5 +1,5 @@
 x@{builderDefsPackage
-  , ladspaH, jackaudio, liblo, alsaLib, qt4, libX11, libsndfile, libSM
+  , ladspaH, jack2, liblo, alsaLib, qt4, libX11, libsndfile, libSM
   , libsamplerate, libtool, autoconf, automake, xproto, libICE, pkgconfig
   , ...}:
 builderDefsPackage
diff --git a/pkgs/development/libraries/epoxy/default.nix b/pkgs/development/libraries/epoxy/default.nix
new file mode 100644
index 000000000000..a1b0d87cdfdc
--- /dev/null
+++ b/pkgs/development/libraries/epoxy/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, autoconf, autogen, automake, gettext, libX11
+, mesa, pkgconfig, python, utilmacros
+}:
+
+stdenv.mkDerivation rec {
+  name = "epoxy-${version}";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "https://github.com/anholt/libepoxy/archive/v${version}.tar.gz";
+    sha256 = "1xp8g6b7xlbym2rj4vkbl6xpb7ijq7glpv656mc7k9b01x22ihs2";
+  };
+
+  buildInputs = [
+    autoconf autogen automake gettext libX11 mesa pkgconfig python
+    utilmacros
+  ];
+
+  configureScript = ''
+    ./autogen.sh --prefix="$out"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A library for handling OpenGL function pointer management";
+    homepage = https://github.com/anholt/libepoxy;
+    license = licenses.mit;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/frei0r/default.nix b/pkgs/development/libraries/frei0r/default.nix
new file mode 100644
index 000000000000..2e3db4c2d73a
--- /dev/null
+++ b/pkgs/development/libraries/frei0r/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, autoconf, cairo, opencv, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "frei0r-plugins-${version}";
+  version = "1.4";
+
+  src = fetchurl {
+    url = "https://files.dyne.org/.xsend.php?file=frei0r/releases/${name}.tar.gz";
+    sha256 = "0mxyhdp1p1a3ga8170ijygb870zwbww1dgp3kdr1nd4zvsmzqw44";
+  };
+
+  buildInputs = [ autoconf cairo opencv pkgconfig ];
+
+  meta = with stdenv.lib; {
+    homepage = http://frei0r.dyne.org;
+    description = "Minimalist, cross-platform, shared video plugins";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+
+  };
+}
diff --git a/pkgs/development/libraries/gtest/default.nix b/pkgs/development/libraries/gtest/default.nix
index 1e030d4d7ce0..a59e3d07cb44 100644
--- a/pkgs/development/libraries/gtest/default.nix
+++ b/pkgs/development/libraries/gtest/default.nix
@@ -21,6 +21,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out/lib
     cp -v libgtest.a libgtest_main.a $out/lib
     cp -v -r ../include $out
+    cp -v -r ../src $out
   '';
 
   meta = {
diff --git a/pkgs/development/libraries/haskell/ChasingBottoms/default.nix b/pkgs/development/libraries/haskell/ChasingBottoms/default.nix
index 34087a5836bb..715793c7e9a7 100644
--- a/pkgs/development/libraries/haskell/ChasingBottoms/default.nix
+++ b/pkgs/development/libraries/haskell/ChasingBottoms/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ChasingBottoms";
-  version = "1.3.0.7";
-  sha256 = "0g1bx6d2mi27qsb4bxvby50g39fm56gyi2658fyjiq1gamy50ypa";
+  version = "1.3.0.8";
+  sha256 = "1f6jg4j17s3y7hcz9gp7cffa77p57xgzv15ng5ypcxpq603721dv";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ mtl QuickCheck random syb ];
diff --git a/pkgs/development/libraries/haskell/HUnit-approx/default.nix b/pkgs/development/libraries/haskell/HUnit-approx/default.nix
new file mode 100644
index 000000000000..b507aa21cbb5
--- /dev/null
+++ b/pkgs/development/libraries/haskell/HUnit-approx/default.nix
@@ -0,0 +1,17 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
+{ cabal, HUnit }:
+
+cabal.mkDerivation (self: {
+  pname = "HUnit-approx";
+  version = "1.0";
+  sha256 = "0svkjvcanjsi5bhn9b91jhig36np5imr3qyj6b1s5msm7wmlk3v1";
+  buildDepends = [ HUnit ];
+  testDepends = [ HUnit ];
+  meta = {
+    homepage = "https://github.com/goldfirere/HUnit-approx";
+    description = "Approximate equality for floating point numbers with HUnit";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/MFlow/default.nix b/pkgs/development/libraries/haskell/MFlow/default.nix
index 4a8f7a91bbab..8e5969bbf271 100644
--- a/pkgs/development/libraries/haskell/MFlow/default.nix
+++ b/pkgs/development/libraries/haskell/MFlow/default.nix
@@ -1,21 +1,29 @@
 # This file was auto-generated by cabal2nix. Please do NOT edit manually!
 
-{ cabal, blazeHtml, blazeMarkup, caseInsensitive, clientsession
-, conduit, conduitExtra, cpphs, extensibleExceptions, httpTypes
-, monadloc, mtl, parsec, random, RefSerialize, stm, TCache, text
-, time, transformers, utf8String, vector, wai, warp, warpTls
+{ cabal, acidState, aws, blazeHtml, blazeMarkup, caseInsensitive
+, clientsession, conduit, conduitExtra, cpphs, extensibleExceptions
+, hamlet, hscolour, httpConduit, httpTypes, monadloc, monadLogger
+, mtl, network, parsec, persistent, persistentSqlite
+, persistentTemplate, pwstoreFast, random, RefSerialize, resourcet
+, safecopy, shakespeare, stm, TCache, tcacheAWS, text, time
+, transformers, utf8String, vector, wai, waiExtra, warp, warpTls
 , Workflow
 }:
 
 cabal.mkDerivation (self: {
   pname = "MFlow";
-  version = "0.4.5.4";
-  sha256 = "1ih9ni14xmqvcfvayjkggmpmw3s9yzp17gf4xzygldmjcs35j4n3";
+  version = "0.4.5.5";
+  sha256 = "0ggwzjxhw2xmp2m6a560pn5m0qfn80x5q23vrd2k9aqxh8n2k6i5";
+  isLibrary = true;
+  isExecutable = true;
   buildDepends = [
-    blazeHtml blazeMarkup caseInsensitive clientsession conduit
-    conduitExtra extensibleExceptions httpTypes monadloc mtl parsec
-    random RefSerialize stm TCache text time transformers utf8String
-    vector wai warp warpTls Workflow
+    acidState aws blazeHtml blazeMarkup caseInsensitive clientsession
+    conduit conduitExtra extensibleExceptions hamlet hscolour
+    httpConduit httpTypes monadloc monadLogger mtl network parsec
+    persistent persistentSqlite persistentTemplate pwstoreFast random
+    RefSerialize resourcet safecopy shakespeare stm TCache tcacheAWS
+    text time transformers utf8String vector wai waiExtra warp warpTls
+    Workflow
   ];
   buildTools = [ cpphs ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/bloomfilter/default.nix b/pkgs/development/libraries/haskell/bloomfilter/default.nix
index 6eae9a30da68..2494f08eaac3 100644
--- a/pkgs/development/libraries/haskell/bloomfilter/default.nix
+++ b/pkgs/development/libraries/haskell/bloomfilter/default.nix
@@ -9,6 +9,10 @@ cabal.mkDerivation (self: {
   version = "2.0.0.0";
   sha256 = "07fif8i5rinysli1mpi92k405kvw8va7w9v9w4wd5bylb87zy77f";
   buildDepends = [ deepseq ];
+  # https://github.com/bos/bloomfilter/pull/8
+  preConfigure = ''
+    sed -i -e "s/0xffffffff/0x7fffffff/" Data/BloomFilter/Easy.hs
+  '';
   testDepends = [
     QuickCheck random testFramework testFrameworkQuickcheck2
   ];
diff --git a/pkgs/development/libraries/haskell/cgrep/default.nix b/pkgs/development/libraries/haskell/cgrep/default.nix
index 5fae8ab3dfdd..fa4035b41ab9 100644
--- a/pkgs/development/libraries/haskell/cgrep/default.nix
+++ b/pkgs/development/libraries/haskell/cgrep/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cgrep";
-  version = "6.4.3.1";
-  sha256 = "0pqifapjgazz7wiydc775i4f6iixq8v87rzjgvvymdbdsn0sfa0r";
+  version = "6.4.4";
+  sha256 = "1czy9skv3jcfljwxml4nprmsxq70pav7mqhk92jg5wj1klgrz21k";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/cmdargs/default.nix b/pkgs/development/libraries/haskell/cmdargs/default.nix
index d58885f8226d..6482751a7978 100644
--- a/pkgs/development/libraries/haskell/cmdargs/default.nix
+++ b/pkgs/development/libraries/haskell/cmdargs/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cmdargs";
-  version = "0.10.7";
-  sha256 = "0mhsj27vynilpmwxgdpb3r383rksrqs9ix15zl2xbhc95a815pfl";
+  version = "0.10.8";
+  sha256 = "1gh6g655s5yjf55qlbpn7daw5f67j79znibs4dwrvhj985hb9a7p";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ filepath transformers ];
diff --git a/pkgs/development/libraries/haskell/ekg-carbon/default.nix b/pkgs/development/libraries/haskell/ekg-carbon/default.nix
index 12c29f0d56e5..e69e6a5ae4a6 100644
--- a/pkgs/development/libraries/haskell/ekg-carbon/default.nix
+++ b/pkgs/development/libraries/haskell/ekg-carbon/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ekg-carbon";
-  version = "1.0.0";
-  sha256 = "0zcnh74z0n0xxxr6r0j3kgpbfwli58y714k0mwwc2wxjgcv6xiyc";
+  version = "1.0.1";
+  sha256 = "1slaykn1a6f09dzn78v2aqw8snmidycvaw5cfyr4f0ndd88vi77d";
   buildDepends = [
     ekgCore network networkCarbon text time unorderedContainers vector
   ];
diff --git a/pkgs/development/libraries/haskell/engine-io/default.nix b/pkgs/development/libraries/haskell/engine-io/default.nix
index 9684c7660fba..fd21d94cdf72 100644
--- a/pkgs/development/libraries/haskell/engine-io/default.nix
+++ b/pkgs/development/libraries/haskell/engine-io/default.nix
@@ -1,3 +1,5 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, aeson, async, attoparsec, base64Bytestring, either
 , monadLoops, mwcRandom, stm, text, transformers
 , unorderedContainers, vector, websockets
diff --git a/pkgs/development/libraries/haskell/focus/default.nix b/pkgs/development/libraries/haskell/focus/default.nix
index a2575734b4da..480d974e2b88 100644
--- a/pkgs/development/libraries/haskell/focus/default.nix
+++ b/pkgs/development/libraries/haskell/focus/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "focus";
-  version = "0.1.1";
-  sha256 = "0x158zqxgm8ys4mxs94zl811qfdcb06jqy5h99qc63r7snwnixmd";
+  version = "0.1.2";
+  sha256 = "0j157nv668621i94iqg923bfg7594bpfn0q9scb62cik2yikc1p0";
   buildDepends = [ lochTh placeholders ];
   meta = {
     homepage = "https://github.com/nikita-volkov/focus";
diff --git a/pkgs/development/libraries/haskell/gdiff/default.nix b/pkgs/development/libraries/haskell/gdiff/default.nix
index 3d34f388fb31..1b94961e4eed 100644
--- a/pkgs/development/libraries/haskell/gdiff/default.nix
+++ b/pkgs/development/libraries/haskell/gdiff/default.nix
@@ -4,9 +4,10 @@
 
 cabal.mkDerivation (self: {
   pname = "gdiff";
-  version = "1.0";
-  sha256 = "35257b1090cf78f95d24c7a89920863c1d824652311fa5793693d7d06d96517b";
+  version = "1.1";
+  sha256 = "1d0d8f8bfw7ld6a1d5y6syzdha5qsm909mqzd5gfqcbi2wnh8aqc";
   meta = {
+    homepage = "https://github.com/eelco/gdiff";
     description = "Generic diff and patch";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/generic-aeson/default.nix b/pkgs/development/libraries/haskell/generic-aeson/default.nix
index 209cbb7a52e3..9c18b511efc0 100644
--- a/pkgs/development/libraries/haskell/generic-aeson/default.nix
+++ b/pkgs/development/libraries/haskell/generic-aeson/default.nix
@@ -1,17 +1,16 @@
 # This file was auto-generated by cabal2nix. Please do NOT edit manually!
 
-{ cabal, aeson, attoparsec, genericDeriving, HUnit, mtl, tagged
-, text, vector
+{ cabal, aeson, attoparsec, genericDeriving, mtl, tagged, text
+, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "generic-aeson";
-  version = "0.1.0.3";
-  sha256 = "1svbjgd8g1ljximqb4pph9lvsswgvkj46jkqq8lzmh9ql385g2vp";
+  version = "0.1.1.1";
+  sha256 = "14jpma2p4dxmzpwd557igbg7xhgdzp9w9fm6dxa06sgfqxvb7ln1";
   buildDepends = [
     aeson attoparsec genericDeriving mtl tagged text vector
   ];
-  testDepends = [ aeson attoparsec HUnit ];
   meta = {
     description = "Derivation of Aeson instances using GHC generics";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/ghc-mod/default.nix b/pkgs/development/libraries/haskell/ghc-mod/default.nix
index d56470899603..d82c5bbc1317 100644
--- a/pkgs/development/libraries/haskell/ghc-mod/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-mod/default.nix
@@ -23,6 +23,7 @@ cabal.mkDerivation (self: {
   configureFlags = "--datasubdir=${self.pname}-${self.version}";
   postInstall = ''
     cd $out/share/$pname-$version
+    sed -i -e 's/"-b" "\\n" "-l"/"-l" "-b" "\\"\\\\n\\""/' ghc-process.el
     make
     rm Makefile
     cd ..
diff --git a/pkgs/development/libraries/haskell/haskell-token-utils/default.nix b/pkgs/development/libraries/haskell/haskell-token-utils/default.nix
index 27e9eae783f3..378dfe898eae 100644
--- a/pkgs/development/libraries/haskell/haskell-token-utils/default.nix
+++ b/pkgs/development/libraries/haskell/haskell-token-utils/default.nix
@@ -2,20 +2,21 @@
 
 { cabal, Diff, dualTree, ghcMod, ghcPaths, ghcSybUtils
 , haskellSrcExts, hspec, HUnit, monoidExtras, mtl, QuickCheck
-, rosezipper, semigroups, syb
+, rosezipper, semigroups, syb, uniplate
 }:
 
 cabal.mkDerivation (self: {
   pname = "haskell-token-utils";
-  version = "0.0.0.3";
-  sha256 = "1qfb0gzi8mvraflk7l8wckkaa2gfdq5wqk7ax3v4i4f1mrd7zr4f";
+  version = "0.0.0.4";
+  sha256 = "0bb47g58m76293dw4h349j3fmajmw62rqna2kcgx681a1rsbpb4i";
   buildDepends = [
-    dualTree ghcSybUtils haskellSrcExts monoidExtras mtl rosezipper
-    semigroups syb
+    dualTree ghcPaths ghcSybUtils haskellSrcExts monoidExtras mtl
+    rosezipper semigroups syb
   ];
   testDepends = [
     Diff dualTree ghcMod ghcPaths ghcSybUtils haskellSrcExts hspec
     HUnit monoidExtras mtl QuickCheck rosezipper semigroups syb
+    uniplate
   ];
   meta = {
     homepage = "https://github.com/alanz/haskell-token-utils";
diff --git a/pkgs/development/libraries/haskell/haste-perch/default.nix b/pkgs/development/libraries/haskell/haste-perch/default.nix
deleted file mode 100644
index e9135d943208..000000000000
--- a/pkgs/development/libraries/haskell/haste-perch/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file was auto-generated by cabal2nix. Please do NOT edit manually!
-
-{ cabal, hasteCompiler, mtl }:
-
-cabal.mkDerivation (self: {
-  pname = "haste-perch";
-  version = "0.1.0.0";
-  sha256 = "0g2ijb0mzqs2iq4i47biaxbsg4v15w9ky6yyz6wmngwf06rg4iwj";
-  buildDepends = [ hasteCompiler mtl ];
-  jailbreak = true;
-  meta = {
-    homepage = "https://github.com/agocorona/haste-perch";
-    description = "Create dynamic HTML in the browser using blaze-html-style notation with Haste";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-  };
-})
diff --git a/pkgs/development/libraries/haskell/hcltest/default.nix b/pkgs/development/libraries/haskell/hcltest/default.nix
index 62db765ac163..bc2c01268bbe 100644
--- a/pkgs/development/libraries/haskell/hcltest/default.nix
+++ b/pkgs/development/libraries/haskell/hcltest/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hcltest";
-  version = "0.3.2";
-  sha256 = "0q5b0v2gh0b3a15hg25bqj7scbckrkka2ckk49g2mrdz2gpr28bq";
+  version = "0.3.3";
+  sha256 = "191fpvcr5hg902akcvq9wcsy801drqwrl7xqk0bqy003ffrv4228";
   buildDepends = [
     dlist either filepath free lens mmorph monadControl mtl
     optparseApplicative randomShuffle split stm tagged tasty temporary
diff --git a/pkgs/development/libraries/haskell/highlighting-kate/default.nix b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
index 531273e5a135..5eeedef33cc2 100644
--- a/pkgs/development/libraries/haskell/highlighting-kate/default.nix
+++ b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "highlighting-kate";
-  version = "0.5.8.4";
-  sha256 = "018j5z4cl9iv5m9wzjykh2gcn5d4fi7vahj76jv0ah101g6fqvrh";
+  version = "0.5.8.5";
+  sha256 = "0xynbxffjp44189zzqx30wabbrj83mvjl3mj1i5lag1h945yp1nk";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/hspec-expectations/default.nix b/pkgs/development/libraries/haskell/hspec-expectations/default.nix
index 313d1a01f022..7706fbca50ff 100644
--- a/pkgs/development/libraries/haskell/hspec-expectations/default.nix
+++ b/pkgs/development/libraries/haskell/hspec-expectations/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hspec-expectations";
-  version = "0.6.0";
-  sha256 = "01l9mnny5pgaqqswv1hyq1v77yd4vx9bfyz6662iypc0fz78519i";
+  version = "0.6.0.1";
+  sha256 = "16013x7v6zly4h1spzarrlzskbjb19bljsj98fn8k21mzb82f7wl";
   buildDepends = [ HUnit ];
   testDepends = [ hspec HUnit markdownUnlit silently ];
   doCheck = false;
diff --git a/pkgs/development/libraries/haskell/hspec-meta/default.nix b/pkgs/development/libraries/haskell/hspec-meta/default.nix
index e8f65395fa3c..f361d2cf8659 100644
--- a/pkgs/development/libraries/haskell/hspec-meta/default.nix
+++ b/pkgs/development/libraries/haskell/hspec-meta/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hspec-meta";
-  version = "1.10.0";
-  sha256 = "1x32wgrd1i6rs6790dbr51j9g6abjpcf951cx3nmm4zdcwblyi6a";
+  version = "1.11.0";
+  sha256 = "1gsczyzxavd3abrq5p0qdxb92z6v3jhicqa40ihgfy89x3pp6bw8";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/hspec/default.nix b/pkgs/development/libraries/haskell/hspec/default.nix
index c665bf2f2728..e332e5279ef5 100644
--- a/pkgs/development/libraries/haskell/hspec/default.nix
+++ b/pkgs/development/libraries/haskell/hspec/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hspec";
-  version = "1.10.0.1";
-  sha256 = "1i0pl67jplvqh370x6mzdb86a653k1a1l8bjac60izr8d22n35rl";
+  version = "1.11.0";
+  sha256 = "1hkflasm7w9z0b1c1mq3rl5pq05np27sz3p2s61bick371qi9zsf";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/hspec2/default.nix b/pkgs/development/libraries/haskell/hspec2/default.nix
index cc59a0b35752..9fa76dc9b4f0 100644
--- a/pkgs/development/libraries/haskell/hspec2/default.nix
+++ b/pkgs/development/libraries/haskell/hspec2/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hspec2";
-  version = "0.3.4";
-  sha256 = "0vs5y1cqprixmmjdk3sdrig9gr1k63nvn4c91b3z66jj39rdxl21";
+  version = "0.4.0";
+  sha256 = "0x5y77qa33gx1shqhzdkdp0732lpkihvp5wh4826scg229haj5v5";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/http-client/default.nix b/pkgs/development/libraries/haskell/http-client/default.nix
index d52017615836..acd93b29e18c 100644
--- a/pkgs/development/libraries/haskell/http-client/default.nix
+++ b/pkgs/development/libraries/haskell/http-client/default.nix
@@ -8,8 +8,8 @@
 
 cabal.mkDerivation (self: {
   pname = "http-client";
-  version = "0.3.5";
-  sha256 = "0ffr4xccm2yp5ikiz5dzzjm82vz7gab56l80ra9criry9qirmwqh";
+  version = "0.3.6";
+  sha256 = "0zav8arj6swhrzfyxf6py2yfpphjd0bllz7rm1540vb5lrhg4znm";
   buildDepends = [
     base64Bytestring blazeBuilder caseInsensitive cookie
     dataDefaultClass deepseq exceptions filepath httpTypes mimeTypes
diff --git a/pkgs/development/libraries/haskell/http-conduit/default.nix b/pkgs/development/libraries/haskell/http-conduit/default.nix
index 8d8c3af80932..bd8be746b04a 100644
--- a/pkgs/development/libraries/haskell/http-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/http-conduit/default.nix
@@ -9,8 +9,8 @@
 
 cabal.mkDerivation (self: {
   pname = "http-conduit";
-  version = "2.1.3";
-  sha256 = "1z9i0b9kl1kqh3nvbhh5vmqyg19pkdpj4cbkfhj0r47rbcynhwlb";
+  version = "2.1.4";
+  sha256 = "14xfd25y7r2lhg7dx9hfniihgyzhkz4c6642k5pr27fqjjlr6ijb";
   buildDepends = [
     conduit httpClient httpClientTls httpTypes liftedBase monadControl
     mtl resourcet transformers
diff --git a/pkgs/development/libraries/haskell/jack/default.nix b/pkgs/development/libraries/haskell/jack/default.nix
index acb4b0b7e570..2e6b6ee1aa3a 100644
--- a/pkgs/development/libraries/haskell/jack/default.nix
+++ b/pkgs/development/libraries/haskell/jack/default.nix
@@ -1,6 +1,6 @@
 # This file was auto-generated by cabal2nix. Please do NOT edit manually!
 
-{ cabal, enumset, eventList, explicitException, jackaudio, midi
+{ cabal, enumset, eventList, explicitException, jack2, midi
 , nonNegative, transformers
 }:
 
@@ -13,7 +13,7 @@ cabal.mkDerivation (self: {
   buildDepends = [
     enumset eventList explicitException midi nonNegative transformers
   ];
-  pkgconfigDepends = [ jackaudio ];
+  pkgconfigDepends = [ jack2 ];
   meta = {
     homepage = "http://www.haskell.org/haskellwiki/JACK";
     description = "Bindings for the JACK Audio Connection Kit";
diff --git a/pkgs/development/libraries/haskell/json-schema/default.nix b/pkgs/development/libraries/haskell/json-schema/default.nix
index 52789acf41ca..4eb407646730 100644
--- a/pkgs/development/libraries/haskell/json-schema/default.nix
+++ b/pkgs/development/libraries/haskell/json-schema/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "json-schema";
-  version = "0.6";
-  sha256 = "1rlx6r4ybbgz8q159mxh0hp3l0cc8q4nc1g7yd1ii1z4p9wjmnny";
+  version = "0.6.1.1";
+  sha256 = "0hn1v2idra9sx1x5mr511h4qcvnhy7b80fgn58w9856w9cl7d34b";
   buildDepends = [
     aeson genericAeson genericDeriving tagged text time
     unorderedContainers vector
diff --git a/pkgs/development/libraries/haskell/mongoDB/default.nix b/pkgs/development/libraries/haskell/mongoDB/default.nix
index 73d8f5ccf94c..d156c9c101ea 100644
--- a/pkgs/development/libraries/haskell/mongoDB/default.nix
+++ b/pkgs/development/libraries/haskell/mongoDB/default.nix
@@ -7,14 +7,14 @@
 
 cabal.mkDerivation (self: {
   pname = "mongoDB";
-  version = "2.0";
-  sha256 = "1dspx1x20903i44i825ziwmvaax75m8g08kz97cv34077bdir80h";
+  version = "2.0.2";
+  sha256 = "02xq80jcrrp41gzzg7008spw3npj6iz3gcf1bkj4cf8vjs44nplf";
   buildDepends = [
     binary bson cryptohash hashtables liftedBase monadControl mtl
     network parsec random randomShuffle text transformersBase
   ];
   meta = {
-    homepage = "http://github.com/selectel/mongodb-haskell";
+    homepage = "https://github.com/mongodb-haskell/mongodb";
     description = "Driver (client) for MongoDB, a free, scalable, fast, document DBMS";
     license = "unknown";
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/network-carbon/default.nix b/pkgs/development/libraries/haskell/network-carbon/default.nix
index d5a4c64cff8a..c9bbe2b0daf8 100644
--- a/pkgs/development/libraries/haskell/network-carbon/default.nix
+++ b/pkgs/development/libraries/haskell/network-carbon/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "network-carbon";
-  version = "1.0.0";
-  sha256 = "13mbwbcas7g8dyvlcbbl20ryzjvz0grmlbhb5kf1gs957kmn1z52";
+  version = "1.0.1";
+  sha256 = "1q3b7vw80yw6fkmpwgazy8ikhbwjmmqmm4fry8c9f8ckkpzahj2b";
   buildDepends = [ network text time vector ];
   meta = {
     homepage = "http://github.com/ocharles/network-carbon";
diff --git a/pkgs/development/libraries/haskell/pandoc-types/default.nix b/pkgs/development/libraries/haskell/pandoc-types/default.nix
index 7ca48e390bac..ee44d908c498 100644
--- a/pkgs/development/libraries/haskell/pandoc-types/default.nix
+++ b/pkgs/development/libraries/haskell/pandoc-types/default.nix
@@ -1,12 +1,12 @@
 # This file was auto-generated by cabal2nix. Please do NOT edit manually!
 
-{ cabal, aeson, syb }:
+{ cabal, aeson, deepseqGenerics, syb }:
 
 cabal.mkDerivation (self: {
   pname = "pandoc-types";
-  version = "1.12.3.3";
-  sha256 = "1rw641w8xdisnbni5glxqxgfjps6p8vpnvprd4zgsjqn71397pdk";
-  buildDepends = [ aeson syb ];
+  version = "1.12.4";
+  sha256 = "10vlw8iabaay0xqlshagl45ksawlanlg6fyqwv9d448qm32ngvdn";
+  buildDepends = [ aeson deepseqGenerics syb ];
   meta = {
     homepage = "http://johnmacfarlane.net/pandoc";
     description = "Types for representing a structured document";
diff --git a/pkgs/development/libraries/haskell/parsers/0.11.0.3.nix b/pkgs/development/libraries/haskell/parsers/0.11.0.3.nix
deleted file mode 100644
index 42f51f00659c..000000000000
--- a/pkgs/development/libraries/haskell/parsers/0.11.0.3.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-# This file was auto-generated by cabal2nix. Please do NOT edit manually!
-
-{ cabal, attoparsec, charset, doctest, filepath, parsec, text
-, transformers, unorderedContainers
-}:
-
-cabal.mkDerivation (self: {
-  pname = "parsers";
-  version = "0.11.0.3";
-  sha256 = "0cwjzk76i7isg7h1xl9iv6x87vfw3x2x5jaacx85g8v45lv7g88s";
-  buildDepends = [
-    attoparsec charset parsec text transformers unorderedContainers
-  ];
-  testDepends = [ doctest filepath ];
-  meta = {
-    homepage = "http://github.com/ekmett/parsers/";
-    description = "Parsing combinators";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-  };
-})
diff --git a/pkgs/development/libraries/haskell/quickcheck-property-monad/default.nix b/pkgs/development/libraries/haskell/quickcheck-property-monad/default.nix
index d8b8d4719797..3ef3b02851e9 100644
--- a/pkgs/development/libraries/haskell/quickcheck-property-monad/default.nix
+++ b/pkgs/development/libraries/haskell/quickcheck-property-monad/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "quickcheck-property-monad";
-  version = "0.2.2";
-  sha256 = "1liixl4xxpx9f3877sss16m67y5bkwhxdmr8h40rpqdi7dz9s0mj";
+  version = "0.2.3";
+  sha256 = "12vg14xwhhsqwygrs5lylsg514am5sslqc15nbl8mwzzxix1w8xb";
   buildDepends = [ either QuickCheck transformers ];
   testDepends = [ doctest filepath QuickCheck ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/scotty/default.nix b/pkgs/development/libraries/haskell/scotty/default.nix
index 4555f5af9d5b..91876f7e3187 100644
--- a/pkgs/development/libraries/haskell/scotty/default.nix
+++ b/pkgs/development/libraries/haskell/scotty/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "scotty";
-  version = "0.8.1";
-  sha256 = "182iwsz5h7p08sqwfzb332gwj1wjx7fhhazm6gfdc0incab769m0";
+  version = "0.8.2";
+  sha256 = "07vjdj26380inlyi350mdifm7v1dpbc56041vi2czf5zzhx97qb0";
   buildDepends = [
     aeson blazeBuilder caseInsensitive conduit dataDefault httpTypes
     monadControl mtl regexCompat text transformers transformersBase wai
diff --git a/pkgs/development/libraries/haskell/socket-io/default.nix b/pkgs/development/libraries/haskell/socket-io/default.nix
index ff0b90c03e0f..a91832a0ad0c 100644
--- a/pkgs/development/libraries/haskell/socket-io/default.nix
+++ b/pkgs/development/libraries/haskell/socket-io/default.nix
@@ -1,3 +1,5 @@
+# This file was auto-generated by cabal2nix. Please do NOT edit manually!
+
 { cabal, aeson, attoparsec, engineIo, mtl, stm, text, transformers
 , unorderedContainers, vector
 }:
diff --git a/pkgs/development/libraries/haskell/stm-conduit/default.nix b/pkgs/development/libraries/haskell/stm-conduit/default.nix
index 77d2771ed88d..cebb79c3344f 100644
--- a/pkgs/development/libraries/haskell/stm-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/stm-conduit/default.nix
@@ -8,8 +8,8 @@
 
 cabal.mkDerivation (self: {
   pname = "stm-conduit";
-  version = "2.5.0";
-  sha256 = "1pxs1ggyyjm4x06cirdcjaqzvz3964spv34fcf0q9ddhxm5kb30q";
+  version = "2.5.1";
+  sha256 = "08cnr92c442b1in46xcklni35597hbsggw97arq2f9w5sfir341q";
   buildDepends = [
     async cereal cerealConduit conduit conduitExtra liftedAsync
     liftedBase monadControl monadLoops resourcet stm stmChans
diff --git a/pkgs/development/libraries/haskell/streaming-commons/default.nix b/pkgs/development/libraries/haskell/streaming-commons/default.nix
index 6e8aeb10ff7e..4e6811593916 100644
--- a/pkgs/development/libraries/haskell/streaming-commons/default.nix
+++ b/pkgs/development/libraries/haskell/streaming-commons/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "streaming-commons";
-  version = "0.1.4";
-  sha256 = "0p18sha2xa583rn9jyhylcykgrvydrwnl47c2wxf1c1yswn45iz6";
+  version = "0.1.4.1";
+  sha256 = "0n5xm2j5hz0hbify0yanhcrkc3pni9s2c53h22alc7pcaimdmalc";
   buildDepends = [
     blazeBuilder network random stm text transformers zlib
   ];
diff --git a/pkgs/development/libraries/haskell/stylish-haskell/default.nix b/pkgs/development/libraries/haskell/stylish-haskell/default.nix
index 8fc02625bb86..afa664a68f90 100644
--- a/pkgs/development/libraries/haskell/stylish-haskell/default.nix
+++ b/pkgs/development/libraries/haskell/stylish-haskell/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "stylish-haskell";
-  version = "0.5.10.0";
-  sha256 = "12sba4bbc1qzicvavlbf4wqj7xs2pk0z3ha70xsvldszhyav9zj9";
+  version = "0.5.10.1";
+  sha256 = "1jd2dbi844cjs012gwr5idk1jmn860ff8hy1r1s6jndsm69awbba";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/taggy/default.nix b/pkgs/development/libraries/haskell/taggy/default.nix
index 81bc5a2981aa..9ddde26cbcf8 100644
--- a/pkgs/development/libraries/haskell/taggy/default.nix
+++ b/pkgs/development/libraries/haskell/taggy/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "taggy";
-  version = "0.1";
-  sha256 = "0qqz5h706k96i7gl8vvn4c044cd5wj1zjlr6cnlxxpii0pyiiwh1";
+  version = "0.1.1";
+  sha256 = "14m02hn5ikw6qv36xxw7j39fm07q2pbs0m504ij7lvaf5c3rngz5";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/th-desugar/default.nix b/pkgs/development/libraries/haskell/th-desugar/default.nix
index c6493736001d..50bea860af36 100644
--- a/pkgs/development/libraries/haskell/th-desugar/default.nix
+++ b/pkgs/development/libraries/haskell/th-desugar/default.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   sha256 = "16l0khjx2wppnm9spp6mg659m95hxjkzfv3pjw5ays3z6clhx8b9";
   buildDepends = [ mtl syb ];
   testDepends = [ hspec HUnit mtl syb ];
+  doCheck = false;
   meta = {
     homepage = "http://www.cis.upenn.edu/~eir/packages/th-desugar";
     description = "Functions to desugar Template Haskell";
diff --git a/pkgs/development/libraries/haskell/thyme/default.nix b/pkgs/development/libraries/haskell/thyme/default.nix
index b646fe4d1559..dbf78bac9030 100644
--- a/pkgs/development/libraries/haskell/thyme/default.nix
+++ b/pkgs/development/libraries/haskell/thyme/default.nix
@@ -2,13 +2,14 @@
 
 { cabal, aeson, attoparsec, Cabal, deepseq, filepath, mtl
 , profunctors, QuickCheck, random, systemPosixRedirect, text, time
-, vector, vectorSpace, vectorThUnbox
+, vector, vectorSpace, vectorThUnbox, cpphs
 }:
 
 cabal.mkDerivation (self: {
   pname = "thyme";
   version = "0.3.5.2";
   sha256 = "1vb5qn9m88y9738d9znim5lprb8z10am5yjaksdjl151li8apd6x";
+  buildTools = [ cpphs ];
   buildDepends = [
     aeson attoparsec deepseq mtl profunctors QuickCheck random text
     time vector vectorSpace vectorThUnbox
diff --git a/pkgs/development/libraries/haskell/trifecta/default.nix b/pkgs/development/libraries/haskell/trifecta/default.nix
index 192164c3189e..4710189f9137 100644
--- a/pkgs/development/libraries/haskell/trifecta/default.nix
+++ b/pkgs/development/libraries/haskell/trifecta/default.nix
@@ -2,20 +2,20 @@
 
 { cabal, ansiTerminal, ansiWlPprint, blazeBuilder, blazeHtml
 , blazeMarkup, charset, comonad, deepseq, doctest, filepath
-, fingertree, hashable, lens, mtl, parsers, reducers, semigroups
-, transformers, unorderedContainers, utf8String
+, fingertree, hashable, lens, mtl, parsers, QuickCheck, reducers
+, semigroups, transformers, unorderedContainers, utf8String
 }:
 
 cabal.mkDerivation (self: {
   pname = "trifecta";
-  version = "1.4.2";
-  sha256 = "13kj1xz2bxixsqsrywdx3snl1hjkyv437ifwfrys1m4hnkv4aqai";
+  version = "1.4.3";
+  sha256 = "0kc8ykvh8m9yhyrkd9kx5xkv5ag99384k06xdi6ynjqv9wj6gfzg";
   buildDepends = [
     ansiTerminal ansiWlPprint blazeBuilder blazeHtml blazeMarkup
     charset comonad deepseq fingertree hashable lens mtl parsers
     reducers semigroups transformers unorderedContainers utf8String
   ];
-  testDepends = [ doctest filepath ];
+  testDepends = [ doctest filepath parsers QuickCheck ];
   meta = {
     homepage = "http://github.com/ekmett/trifecta/";
     description = "A modern parser combinator library with convenient diagnostics";
diff --git a/pkgs/development/libraries/haskell/units/default.nix b/pkgs/development/libraries/haskell/units/default.nix
index 6508cc7edb74..c5d5262750db 100644
--- a/pkgs/development/libraries/haskell/units/default.nix
+++ b/pkgs/development/libraries/haskell/units/default.nix
@@ -1,12 +1,20 @@
 # This file was auto-generated by cabal2nix. Please do NOT edit manually!
 
-{ cabal, singletons }:
+{ cabal, HUnitApprox, mtl, multimap, parsec, singletons, syb, tasty
+, tastyHunit, thDesugar, vectorSpace
+}:
 
 cabal.mkDerivation (self: {
   pname = "units";
-  version = "2.0";
-  sha256 = "1iv0pirhyp7crbkb008k14z57jl8c91r1sl8kqmb778xawb1hx52";
-  buildDepends = [ singletons ];
+  version = "2.1";
+  sha256 = "1qrjc57j15ras0v43cpd7qhh9nzh9dbnkaik6s4c8aj8nkhgd8vs";
+  buildDepends = [
+    mtl multimap parsec singletons syb thDesugar vectorSpace
+  ];
+  testDepends = [
+    HUnitApprox mtl multimap parsec singletons syb tasty tastyHunit
+    thDesugar vectorSpace
+  ];
   meta = {
     homepage = "http://www.cis.upenn.edu/~eir/packages/units";
     description = "A domain-specific type system for dimensional analysis";
diff --git a/pkgs/development/libraries/haskell/vinyl/default.nix b/pkgs/development/libraries/haskell/vinyl/default.nix
index b0c57672e0d6..46ea723641ca 100644
--- a/pkgs/development/libraries/haskell/vinyl/default.nix
+++ b/pkgs/development/libraries/haskell/vinyl/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "vinyl";
-  version = "0.4.2";
-  sha256 = "17vh5yv9dzw6zq1xw22k7mljpha0rcngbk5k0kynh7hyh6xy4zxz";
+  version = "0.4.3";
+  sha256 = "1npcpvr94l2gpk9z4y527raf2p3d6099m231vw0myci37ljnjgdf";
   testDepends = [ doctest lens singletons ];
   meta = {
     description = "Extensible Records";
diff --git a/pkgs/development/libraries/haskell/wai/default.nix b/pkgs/development/libraries/haskell/wai/default.nix
index 4a67a8001096..6c70fede1eca 100644
--- a/pkgs/development/libraries/haskell/wai/default.nix
+++ b/pkgs/development/libraries/haskell/wai/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "wai";
-  version = "3.0.0.2";
-  sha256 = "1zmpalgck8jns45wnlarw26kfw45ml0cp82kdqqpbckscxnr04r1";
+  version = "3.0.1";
+  sha256 = "1889l6fbgvxn13yaskcvjrq07vs62ayvq8q5rn9cpq0yqyc6llcw";
   buildDepends = [ blazeBuilder httpTypes network text vault ];
   testDepends = [ blazeBuilder hspec ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/xml-conduit/default.nix b/pkgs/development/libraries/haskell/xml-conduit/default.nix
index f46361a14514..7468bc96bd04 100644
--- a/pkgs/development/libraries/haskell/xml-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/xml-conduit/default.nix
@@ -8,8 +8,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xml-conduit";
-  version = "1.2.0.3";
-  sha256 = "0bb4nc9nwq4z6vdsiqs0zk8k8yvmyxdrya5fz2h8z8ng66xaq4k1";
+  version = "1.2.1";
+  sha256 = "1bh0d2fqcdbx2dq5ybipf7ws59blrb8yd98z1rnbvv1fj9r0xw10";
   buildDepends = [
     attoparsec attoparsecConduit blazeBuilder blazeBuilderConduit
     blazeHtml blazeMarkup conduit conduitExtra dataDefault deepseq
diff --git a/pkgs/development/libraries/icu/default.nix b/pkgs/development/libraries/icu/default.nix
index 12628e4c53db..a029eab6f121 100644
--- a/pkgs/development/libraries/icu/default.nix
+++ b/pkgs/development/libraries/icu/default.nix
@@ -30,7 +30,8 @@ stdenv.mkDerivation {
     sed -i -e "s|/bin/sh|${stdenv.shell}|" configure
   '';
 
-  configureFlags = "--disable-debug";
+  configureFlags = "--disable-debug" +
+    stdenv.lib.optionalString stdenv.isDarwin " --enable-rpath";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/libevdev/default.nix b/pkgs/development/libraries/libevdev/default.nix
new file mode 100644
index 000000000000..2776a3c0614c
--- /dev/null
+++ b/pkgs/development/libraries/libevdev/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, python }:
+
+stdenv.mkDerivation rec {
+  name = "libevdev-1.2";
+
+  src = fetchurl {
+    url = "http://www.freedesktop.org/software/libevdev/${name}.tar.xz";
+    sha256 = "0h54ym5rsmicl4gx7gcdaifpyndakbl38c5dcxgr27f0cy0635a1";
+  };
+
+  buildInputs = [ python ];
+
+  meta = with stdenv.lib; {
+    description = "Wrapper library for evdev devices";
+    homepage = http://www.freedesktop.org/software/libevdev/doc/latest/index.html; 
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.amorsillo ];
+  };
+}
diff --git a/pkgs/development/libraries/libnm-qt/default.nix b/pkgs/development/libraries/libnm-qt/default.nix
index 31afcae8e01a..44c8b406e459 100644
--- a/pkgs/development/libraries/libnm-qt/default.nix
+++ b/pkgs/development/libraries/libnm-qt/default.nix
@@ -27,6 +27,6 @@ stdenv.mkDerivation {
     description = "Qt wrapper for NetworkManager DBus API";
     license = licenses.lgpl21;
     platforms = platforms.linux;
-    maintainer = [ maintainers.jgeerds ];
+    maintainers = [ maintainers.jgeerds ];
   };
 }
diff --git a/pkgs/development/libraries/mlt/default.nix b/pkgs/development/libraries/mlt/default.nix
index 1d21e03efa6c..00d586a9f04c 100644
--- a/pkgs/development/libraries/mlt/default.nix
+++ b/pkgs/development/libraries/mlt/default.nix
@@ -1,29 +1,39 @@
-{ stdenv, fetchurl, SDL, ffmpeg, libdv, libsamplerate, libvorbis
-, libxml2 , pkgconfig, qt4, sox, gtk2 }:
+{ stdenv, fetchurl, SDL, frei0r, jack2, libav, libdv, libsamplerate
+, libvorbis, libxml2, makeWrapper, movit, pkgconfig, qt, sox
+}:
 
 stdenv.mkDerivation rec {
   name = "mlt-${version}";
-  version = "0.9.0";
+  version = "0.9.2";
 
   src = fetchurl {
-    url = "mirror://sourceforge/mlt/${name}.tar.gz";
-    sha256 = "1j8wbkwpa6k5anyf4nvf71l8251d7clzj6v09jl3vvfakaf6l37j";
+    url = "https://github.com/mltframework/mlt/archive/v${version}.tar.gz";
+    sha256 = "0vk1i2yrny6dbip4aha25ibgv4m2rdhpxmz6a74q9wz1cgzbb766";
   };
 
-  buildInputs =
-    [ SDL ffmpeg libdv libsamplerate libvorbis libxml2 pkgconfig qt4
-      sox # gtk2 /*optional*/
-    ];
+  buildInputs = [
+    SDL frei0r jack2 libav libdv libsamplerate libvorbis libxml2
+    makeWrapper movit pkgconfig qt sox
+  ];
 
   # Mostly taken from:
   # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
-  configureFlags = [ "--enable-gpl" "--enable-gpl3" "--avformat-swscale" ];
+  configureFlags = [
+    "--avformat-swscale" "--enable-gpl" "--enable-gpl" "--enable-gpl3"
+    "--enable-opengl"
+  ];
 
   enableParallelBuilding = true;
 
-  meta = {
-    homepage = http://www.mltframework.org/;
+  postInstall = ''
+    wrapProgram $out/bin/melt --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
+  '';
+
+  meta = with stdenv.lib; {
     description = "Open source multimedia framework, designed for television broadcasting";
-    license = "GPLv3";
+    homepage = http://www.mltframework.org/;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/movit/default.nix b/pkgs/development/libraries/movit/default.nix
new file mode 100644
index 000000000000..bfd474c88e71
--- /dev/null
+++ b/pkgs/development/libraries/movit/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, SDL, eigen, epoxy, fftw, gtest, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "movit-${version}";
+  version = "1.1.1";
+
+  src = fetchurl {
+    url = "http://movit.sesse.net/${name}.tar.gz";
+    sha256 = "1k3qbkxapcplpsx22xh4m4ccp9fhsjfcj3pjzbcnrc51103aklag";
+  };
+
+  GTEST_DIR = "${gtest}";
+
+  propagatedBuildInputs = [ eigen epoxy ];
+
+  buildInputs = [ SDL fftw gtest pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "High-performance, high-quality video filters for the GPU";
+    homepage = http://movits.sesse.net;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/portaudio/default.nix b/pkgs/development/libraries/portaudio/default.nix
index f405e30433fb..46d512814015 100644
--- a/pkgs/development/libraries/portaudio/default.nix
+++ b/pkgs/development/libraries/portaudio/default.nix
@@ -33,6 +33,9 @@ stdenv.mkDerivation rec {
     cp -r lib "$out"
   '' else ''
     make install
+
+    # fixup .pc file to find alsa library
+    sed -i "s|-lasound|-L${alsaLib}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/qt-5/default.nix b/pkgs/development/libraries/qt-5/default.nix
index d33c7e0329fe..e03f4ec88c72 100644
--- a/pkgs/development/libraries/qt-5/default.nix
+++ b/pkgs/development/libraries/qt-5/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
   patches =
     [ ./glib-2.32.patch
       (substituteAll {
-        src = ./dlopen-absolute-paths.patch;
+        src = ./qt-5.2-dlopen-absolute-paths.patch;
         inherit cups icu libXfixes;
         glibc = stdenv.gcc.libc;
         openglDriver = if mesaSupported then mesa.driverLink else "/no-such-path";
diff --git a/pkgs/development/libraries/qt-5/dlopen-absolute-paths.patch b/pkgs/development/libraries/qt-5/qt-5.2-dlopen-absolute-paths.patch
index 3163e235d02c..3163e235d02c 100644
--- a/pkgs/development/libraries/qt-5/dlopen-absolute-paths.patch
+++ b/pkgs/development/libraries/qt-5/qt-5.2-dlopen-absolute-paths.patch
diff --git a/pkgs/development/libraries/qt-5/qt-5.3-dlopen-absolute-paths.patch b/pkgs/development/libraries/qt-5/qt-5.3-dlopen-absolute-paths.patch
new file mode 100644
index 000000000000..66cf342c1076
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/qt-5.3-dlopen-absolute-paths.patch
@@ -0,0 +1,24 @@
+diff -ruN qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/network/kernel/qhostinfo_unix.cpp qt-everywhere-opensource-src-5.1.1/qtbase/src/network/kernel/qhostinfo_unix.cpp
+--- qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/network/kernel/qhostinfo_unix.cpp	2013-08-25 20:03:35.000000000 +0200
++++ qt-everywhere-opensource-src-5.1.1/qtbase/src/network/kernel/qhostinfo_unix.cpp	2013-09-25 17:43:14.047015411 +0200
+@@ -103,7 +103,7 @@
+     if (!lib.load())
+ #endif
+     {
+-        lib.setFileName(QLatin1String("resolv"));
++        lib.setFileName(QLatin1String("@glibc@/lib/libresolv"));
+         if (!lib.load())
+             return;
+     }
+diff -ruN qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp
+--- qt-everywhere-opensource-src-5.1.1-orig/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp	2013-08-25 20:03:35.000000000 +0200
++++ qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp	2013-09-25 17:51:29.834674976 +0200
+@@ -379,7 +379,7 @@
+             {
+                 extern const QString qt_gl_library_name();
+ //                QLibrary lib(qt_gl_library_name());
+-                QLibrary lib(QLatin1String("GL"));
++                QLibrary lib(QLatin1String("@openglDriver@/lib/libGL"));
+                 glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
+             }
+         }
diff --git a/pkgs/development/libraries/qt-5/qt-5.3.nix b/pkgs/development/libraries/qt-5/qt-5.3.nix
new file mode 100644
index 000000000000..fdda7559d7ae
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/qt-5.3.nix
@@ -0,0 +1,162 @@
+{ stdenv, fetchurl, substituteAll, libXrender, libXext
+, libXfixes, freetype, fontconfig, zlib, libjpeg, libpng
+, mesaSupported, mesa, mesa_glu, openssl, dbus, cups, pkgconfig
+, libtiff, glib, icu, mysql, postgresql, sqlite, perl, coreutils, libXi
+, gdk_pixbuf, python, gdb, xlibs, libX11, libxcb, xcbutil, xcbutilimage
+, xcbutilkeysyms, xcbutilwm,udev, libxml2, libxslt, pcre, libxkbcommon
+, alsaLib, gstreamer, gst_plugins_base
+, pulseaudio, bison, flex, gperf, ruby, libwebp
+, flashplayerFix ? false
+, gtkStyle ? false, libgnomeui, gtk, GConf, gnome_vfs
+, buildDocs ? false
+, buildExamples ? false
+, buildTests ? false
+, developerBuild ? false
+}:
+
+with stdenv.lib;
+
+let
+  v_maj = "5.3";
+  v_min = "0";
+  ver = "${v_maj}.${v_min}";
+in
+
+stdenv.mkDerivation rec {
+  name = "qt-${ver}";
+
+  src = fetchurl {
+    url = "http://download.qt-project.org/official_releases/qt/"
+      + "${v_maj}/${ver}/single/qt-everywhere-opensource-src-${ver}.tar.gz";
+    sha256 = "09gp19377zpqyfzk063b3pjz8gjm2x7xsj71bdpmnhs1scz0khcj";
+  };
+
+  # The version property must be kept because it will be included into the QtSDK package name
+  version = ver;
+
+  prePatch = ''
+    substituteInPlace configure --replace /bin/pwd pwd
+    substituteInPlace qtbase/configure --replace /bin/pwd pwd
+    substituteInPlace qtbase/src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
+    sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i qtbase/mkspecs/*/*.conf
+  '';
+
+  patches =
+    [ ./glib-2.32.patch
+      (substituteAll {
+        src = ./qt-5.3-dlopen-absolute-paths.patch;
+        inherit cups icu libXfixes;
+        glibc = stdenv.gcc.libc;
+        openglDriver = if mesaSupported then mesa.driverLink else "/no-such-path";
+      })
+    ] ++ optional gtkStyle (substituteAll {
+        src = ./dlopen-gtkstyle.patch;
+        # substituteAll ignores env vars starting with capital letter
+        gconf = GConf;
+        inherit gnome_vfs libgnomeui gtk;
+      })
+    ++ optional flashplayerFix (substituteAll {
+        src = ./dlopen-webkit-nsplugin.patch;
+        inherit gtk gdk_pixbuf;
+      });
+
+  preConfigure = ''
+    export LD_LIBRARY_PATH="$PWD/qtbase/lib:$PWD/qtbase/plugins/platforms:$PWD/qttools/lib:$LD_LIBRARY_PATH"
+    export MAKEFLAGS=-j$NIX_BUILD_CORES
+  '';
+
+  prefixKey = "-prefix ";
+
+  # -no-eglfs, -no-directfb, -no-linuxfb and -no-kms because of the current minimalist mesa
+  # TODO Remove obsolete and useless flags once the build will be totally mastered
+  configureFlags = ''
+    -verbose
+    -confirm-license
+    -opensource
+
+    -release
+    -shared
+    -c++11
+    ${optionalString developerBuild "-developer-build"}
+    -largefile
+    -accessibility
+    -rpath
+    -optimized-qmake
+    -strip
+    -reduce-relocations
+    -system-proxies
+
+    -gui
+    -widgets
+    -opengl desktop
+    -qml-debug
+    -nis
+    -iconv
+    -icu
+    -pch
+    -glib
+    -xcb
+    -qpa xcb
+    -${optionalString (cups == null) "no-"}cups
+
+    -no-eglfs
+    -no-directfb
+    -no-linuxfb
+    -no-kms
+
+    -system-zlib
+    -system-libpng
+    -system-libjpeg
+    -system-xcb
+    -system-xkbcommon
+    -openssl-linked
+    -dbus-linked
+
+    -system-sqlite
+    -${if mysql != null then "plugin" else "no"}-sql-mysql
+    -${if postgresql != null then "plugin" else "no"}-sql-psql
+
+    -make libs
+    -make tools
+    -${optionalString (buildExamples == false) "no"}make examples
+    -${optionalString (buildTests == false) "no"}make tests
+  '';
+
+  propagatedBuildInputs = [
+    xlibs.libXcomposite libX11 libxcb libXext libXrender libXi
+    fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre
+    zlib libjpeg libpng libtiff sqlite icu
+    libwebp alsaLib gstreamer gst_plugins_base pulseaudio
+    xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
+  ]
+  # Qt doesn't directly need GLU (just GL), but many apps use, it's small and
+  # doesn't remain a runtime-dep if not used
+  ++ optionals mesaSupported [ mesa mesa_glu ]
+  ++ optional (cups != null) cups
+  ++ optional (mysql != null) mysql
+  ++ optional (postgresql != null) postgresql;
+
+  buildInputs = [ gdb bison flex gperf ruby ];
+
+  nativeBuildInputs = [ python perl pkgconfig ];
+
+  postInstall =
+    ''
+      ${optionalString buildDocs ''
+        make docs && make install_docs
+      ''}
+
+      # Don't retain build-time dependencies like gdb and ruby.
+      sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $out/mkspecs/qconfig.pri
+    '';
+
+  enableParallelBuilding = true; # often fails on Hydra, as well as qt4
+
+  meta = {
+    homepage = http://qt-project.org;
+    description = "A cross-platform application framework for C++";
+    license = "GPL/LGPL";
+    maintainers = [ maintainers.bbenoist maintainers.qknight ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/rabbitmq-java-client/default.nix b/pkgs/development/libraries/rabbitmq-java-client/default.nix
new file mode 100644
index 000000000000..2183aa83e20e
--- /dev/null
+++ b/pkgs/development/libraries/rabbitmq-java-client/default.nix
@@ -0,0 +1,30 @@
+{ fetchurl, stdenv, ant, jdk, jre, python, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "rabbitmq-java-client-3.3.4";
+
+  src = fetchurl {
+    url = "http://www.rabbitmq.com/releases/rabbitmq-java-client/v3.3.4/rabbitmq-java-client-3.3.4.tar.gz";
+    sha256 = "03kspkgzzjsbq6f8yl2zj5m30qwgxv3l58hrbf6gcgxb5rpfk6sh";
+  };
+
+  buildInputs = [ ant jdk python makeWrapper ];
+
+  buildPhase = "ant dist";
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/java
+    cp build/lib/*.jar lib/*.jar $out/share/java
+
+    # There is a script in the source archive, but ours is cleaner
+    makeWrapper ${jre}/bin/java $out/bin/PerfTest \
+      --add-flags "-Djava.awt.headless=true -cp $out/share/java/\* com.rabbitmq.examples.PerfTest"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "RabbitMQ Java client library which allows Java code to interface to AMQP servers";
+    homepage = http://www.rabbitmq.com/java-client.html;
+    license = [ "MPLv1.1" "GPLv2" ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh
index 282aeca9ed1c..f81adf0bae93 100644
--- a/pkgs/development/python-modules/generic/wrap.sh
+++ b/pkgs/development/python-modules/generic/wrap.sh
@@ -26,6 +26,9 @@ wrapPythonProgramsIn() {
             # dont wrap EGG-INFO scripts since they are called from python
             if echo "$i" | grep -v EGG-INFO/scripts; then
                 echo "wrapping \`$i'..."
+                sed -i "$i" -e '1,/#!/ { /^#\!/,/^[^#]/ {
+                    /^[^#]/i import sys; sys.argv[0] = '"'$(basename "$i")'"'
+                }}'
                 wrapProgram "$i" \
                     --prefix PYTHONPATH ":" $program_PYTHONPATH \
                     --prefix PATH ":" $program_PATH
diff --git a/pkgs/development/tools/analysis/sparse/default.nix b/pkgs/development/tools/analysis/sparse/default.nix
index f860f05c36a8..6d0e28f0ab20 100644
--- a/pkgs/development/tools/analysis/sparse/default.nix
+++ b/pkgs/development/tools/analysis/sparse/default.nix
@@ -1,38 +1,25 @@
-{ fetchurl, stdenv, pkgconfig }:
+{ fetchurl, stdenv, pkgconfig, libxml2, llvm }:
 
 stdenv.mkDerivation rec {
-  name = "sparse-0.4.4";
+  name = "sparse-0.5.0";
 
   src = fetchurl {
-    url = "mirror://kernel/software/devel/sparse/dist/${name}.tar.gz";
-    sha256 = "5ad02110130fd8f8d82f2b030de5f2db6f924fd805593a5b8be8072a620414c6";
+    url = "mirror://kernel/software/devel/sparse/dist/${name}.tar.xz";
+    sha256 = "1mc86jc5xdrdmv17nqj2cam2yqygnj6ar1iqkwsx2y37ij8wy7wj";
   };
 
   preConfigure = ''
-    sed -i "Makefile" \
-        -e "s|^PREFIX *=.*$|PREFIX = $out|g"
+    sed -i Makefile -e "s|^PREFIX=.*$|PREFIX=$out|g"
   '';
 
-  buildInputs = [ pkgconfig ];
-
+  buildInputs = [ pkgconfig libxml2 llvm ];
   doCheck = true;
 
   meta = {
     description = "Sparse, a semantic parser for C";
-
-    longDescription = ''
-      Sparse, the semantic parser, provides a compiler frontend
-      capable of parsing most of ANSI C as well as many GCC
-      extensions, and a collection of sample compiler backends,
-      including a static analyzer also called "sparse".  Sparse
-      provides a set of annotations designed to convey semantic
-      information about types, such as what address space pointers
-      point to, or what locks a function acquires or releases.
-    '';
-
-    homepage = http://www.kernel.org/pub/software/devel/sparse/;
-
-    # See http://www.opensource.org/licenses/osl.php .
-    license = "Open Software License v1.1";
+    homepage    = "https://git.kernel.org/cgit/devel/sparse/sparse.git/";
+    license     = stdenv.lib.licenses.mit;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/development/tools/haskell/HaRe/default.nix b/pkgs/development/tools/haskell/HaRe/default.nix
index 377f3c6f08de..c6459b0e7f29 100644
--- a/pkgs/development/tools/haskell/HaRe/default.nix
+++ b/pkgs/development/tools/haskell/HaRe/default.nix
@@ -9,8 +9,8 @@
 
 cabal.mkDerivation (self: {
   pname = "HaRe";
-  version = "0.7.2.5";
-  sha256 = "09v0z1r03bzazgjf26fv54q1jpmv14zyl6w9083xcf2cs3yy6vfh";
+  version = "0.7.2.6";
+  sha256 = "0fvnif75sjgi4388in8fdvgvaxb0s9cgnqf7i583rxlxjibx44ai";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/codex/default.nix b/pkgs/development/tools/haskell/codex/default.nix
index 475c6018697b..fac145b14c20 100644
--- a/pkgs/development/tools/haskell/codex/default.nix
+++ b/pkgs/development/tools/haskell/codex/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "codex";
-  version = "0.1.0.2";
-  sha256 = "0dsc5dx5zcxf5wd2qf6gqzr8d613z1gkllmzzkbny3lxa512crsw";
+  version = "0.1.0.3";
+  sha256 = "0sbkri6y9f4wws120kbb93sv1z0z75hjw9pw5r3wadmmd0lygsn9";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/hlint/default.nix b/pkgs/development/tools/haskell/hlint/default.nix
index be3b7ef2930e..21825e787a07 100644
--- a/pkgs/development/tools/haskell/hlint/default.nix
+++ b/pkgs/development/tools/haskell/hlint/default.nix
@@ -6,15 +6,14 @@
 
 cabal.mkDerivation (self: {
   pname = "hlint";
-  version = "1.9";
-  sha256 = "1c8qpfrivsxx6raqnrz40li73hng4z0ygc1hl70qixbmsmv2a830";
+  version = "1.9.2";
+  sha256 = "1pbcd4rzavhca3vydynasi3lk36pz948mqxp58rlb2j5dan9sw78";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
     cmdargs cpphs filepath haskellSrcExts hscolour transformers
     uniplate
   ];
-  jailbreak = true;
   meta = {
     homepage = "http://community.haskell.org/~ndm/hlint/";
     description = "Source code suggestions";
diff --git a/pkgs/development/web/nodejs/build-node-package.nix b/pkgs/development/web/nodejs/build-node-package.nix
index 544634626b03..84b0da1674c4 100644
--- a/pkgs/development/web/nodejs/build-node-package.nix
+++ b/pkgs/development/web/nodejs/build-node-package.nix
@@ -1,6 +1,6 @@
 { stdenv, runCommand, nodejs, neededNatives}:
 
-args @ { name, src, deps ? [], peerDependencies ? [], flags ? [], ... }:
+args @ { name, src, deps ? [], peerDependencies ? [], flags ? [], preShellHook ? "",  postShellHook ? "", ... }:
 
 with stdenv.lib;
 
@@ -80,6 +80,16 @@ stdenv.mkDerivation ({
   preFixup = concatStringsSep "\n" (map (src: ''
     find $out -type f -print0 | xargs -0 sed -i 's|${src}|${src.name}|g'
   '') src);
+
+  shellHook = ''
+    ${preShellHook}
+    export PATH=${nodejs}/bin:$(pwd)/node_modules/.bin:$PATH
+    mkdir -p node_modules
+    ${concatStrings (concatMap (dep: map (name: ''
+      ln -sfv ${dep}/lib/node_modules/${name} node_modules/
+    '') dep.names) deps)}
+    ${postShellHook}
+  '';
 } // args // {
   # Run the node setup hook when this package is a build input
   propagatedNativeBuildInputs = (args.propagatedNativeBuildInputs or []) ++ [ nodejs ];
diff --git a/pkgs/games/exult/64bits.patch b/pkgs/games/exult/64bits.patch
deleted file mode 100644
index 49c67cd2f05e..000000000000
--- a/pkgs/games/exult/64bits.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ru exult-1.2-orig/usecode/useval.cc exult-1.2/usecode/useval.cc
---- exult-1.2-orig/usecode/useval.cc	2004-05-23 07:07:11.000000000 +0200
-+++ exult-1.2/usecode/useval.cc	2008-06-25 17:27:15.000000000 +0200
-@@ -464,7 +464,7 @@
- 		if (buflen < 5)
- 			return -1;
- 		*ptr++ = type;
--		Write4(ptr, (int)value.ptr);
-+		Write4(ptr, 0);
- 		break;
- 	case string_type:
- 		{
-@@ -525,7 +525,7 @@
- 	case pointer_type:
- 		if (buflen < 5)
- 			return false;
--		value.ptr = (Game_object*)Read4(ptr); //DON'T dereference this pointer!
-+		value.ptr = 0; //DON'T dereference this pointer!
- 		// Maybe add a new type "serialized_pointer" to prevent "accidents"?
- 		return true;
- 	case string_type:
diff --git a/pkgs/games/exult/arch.patch b/pkgs/games/exult/arch.patch
new file mode 100644
index 000000000000..70de34184a24
--- /dev/null
+++ b/pkgs/games/exult/arch.patch
@@ -0,0 +1,123 @@
+diff -aur exult-1.4.9rc1.orig/desktop/exult.desktop exult-1.4.9rc1/desktop/exult.desktop
+--- exult-1.4.9rc1.orig/desktop/exult.desktop	2008-07-11 05:41:06.000000000 +0600
++++ exult-1.4.9rc1/desktop/exult.desktop	2012-05-19 13:15:30.616084585 +0600
+@@ -1,9 +1,8 @@
+ [Desktop Entry]
+-Encoding=UTF-8
+ Name=Exult
+ Comment=Exult Ultima 7 Engine
+ Exec=exult
+-Icon=exult.png
++Icon=exult
+ Terminal=false
+ Type=Application
+-Categories=Application;Game;RolePlaying;
++Categories=Game;RolePlaying;
+diff -aur exult-1.4.9rc1.orig/files/databuf.h exult-1.4.9rc1/files/databuf.h
+--- exult-1.4.9rc1.orig/files/databuf.h	2010-03-10 09:07:05.000000000 +0500
++++ exult-1.4.9rc1/files/databuf.h	2012-05-19 12:50:16.856076030 +0600
+@@ -18,6 +18,7 @@
+ #define DATA_H
+ 
+ #include <cstdio>
++#include <cstddef>
+ #include <cstring>
+ #include <cassert>
+ #include <fstream>
+diff -aur exult-1.4.9rc1.orig/files/U7obj.h exult-1.4.9rc1/files/U7obj.h
+--- exult-1.4.9rc1.orig/files/U7obj.h	2010-02-25 07:52:07.000000000 +0500
++++ exult-1.4.9rc1/files/U7obj.h	2012-05-19 12:50:35.916076137 +0600
+@@ -26,6 +26,7 @@
+ #include <string>
+ #include <vector>
+ #include <cstring>
++#include <cstddef>
+ #include "common_types.h"
+ #include "utils.h"
+ 
+diff -aur exult-1.4.9rc1.orig/imagewin/manip.h exult-1.4.9rc1/imagewin/manip.h
+--- exult-1.4.9rc1.orig/imagewin/manip.h	2010-08-29 20:26:00.000000000 +0600
++++ exult-1.4.9rc1/imagewin/manip.h	2012-05-19 13:02:45.159413596 +0600
+@@ -319,7 +319,7 @@
+ 	static uintD copy(uintS src)
+ 	{
+ 		unsigned int r, g, b;
+-		split_source(src,r,g,b);
++		ManipBaseSrc<color_s,color_d>::split_source(src,r,g,b);
+ 		return ManipBaseDest<color_d>::rgb(r,g,b);
+ 	}
+ 	static void copy(uintD& dest, uintS src)
+diff -aur exult-1.4.9rc1.orig/istring.h exult-1.4.9rc1/istring.h
+--- exult-1.4.9rc1.orig/istring.h	2005-06-07 15:55:39.000000000 +0600
++++ exult-1.4.9rc1/istring.h	2012-05-19 13:01:14.886079750 +0600
+@@ -162,19 +162,19 @@
+ 
+ 	_Myt& operator+=(const _Myt& _Right)
+ 		{	// append _Right
+-		append(_Right);
++		this->append(_Right);
+ 		return (*this);
+ 		}
+ 
+ 	_Myt& operator+=(const _Elem *_Ptr)
+ 		{	// append [_Ptr, <null>)
+-		append(_Ptr);
++		this->append(_Ptr);
+ 		return (*this);
+ 		}
+ 
+ 	_Myt& operator+=(_Elem _Ch)
+ 		{	// append 1 * _Ch
+-		append(static_cast<size_type>(1), _Ch);
++		this->append(static_cast<size_type>(1), _Ch);
+ 		return (*this);
+ 		}
+ 
+diff -aur exult-1.4.9rc1.orig/shapes/pngio.cc exult-1.4.9rc1/shapes/pngio.cc
+--- exult-1.4.9rc1.orig/shapes/pngio.cc	2010-02-15 18:48:11.000000000 -0200
++++ exult-1.4.9rc1/shapes/pngio.cc	2013-09-22 20:56:37.809763588 -0300
+@@ -26,6 +26,7 @@
+ #ifdef HAVE_CONFIG_H
+ #  include <config.h>
+ #endif
++#include <string.h>
+ 
+ #ifdef HAVE_PNG_H
+ 
+@@ -79,7 +80,7 @@
+ 		}
+ 					// Allocate info. structure.
+ 	png_infop info = png_create_info_struct(png);
+-	if (setjmp(png->jmpbuf))	// Handle errors.
++	if (setjmp(png_jmpbuf(png)))	// Handle errors.
+ 		{
+ 		png_destroy_read_struct(&png, &info, 0);
+ 		fclose(fp);
+@@ -208,7 +209,7 @@
+ 		}
+ 					// Allocate info. structure.
+ 	png_infop info = png_create_info_struct(png);
+-	if (setjmp(png->jmpbuf))	// Handle errors.
++	if (setjmp(png_jmpbuf(png)))	// Handle errors.
+ 		{
+ 		png_destroy_write_struct(&png, &info);
+ 		fclose(fp);
+@@ -306,7 +307,7 @@
+ 		}
+ 					// Allocate info. structure.
+ 	png_infop info = png_create_info_struct(png);
+-	if (setjmp(png->jmpbuf))	// Handle errors.
++	if (setjmp(png_jmpbuf(png)))	// Handle errors.
+ 		{
+ 		png_destroy_read_struct(&png, &info, 0);
+ 		fclose(fp);
+@@ -395,7 +396,7 @@
+ 		}
+ 					// Allocate info. structure.
+ 	png_infop info = png_create_info_struct(png);
+-	if (setjmp(png->jmpbuf))	// Handle errors.
++	if (setjmp(png_jmpbuf(png)))	// Handle errors.
+ 		{
+ 		png_destroy_write_struct(&png, &info);
+ 		fclose(fp);
+
diff --git a/pkgs/games/exult/default.nix b/pkgs/games/exult/default.nix
index b52109a8d9ef..a79b6f8d5d8d 100644
--- a/pkgs/games/exult/default.nix
+++ b/pkgs/games/exult/default.nix
@@ -1,56 +1,45 @@
-{stdenv, fetchurl, SDL, SDL_mixer, zlib, libpng, unzip}:
+{ stdenv, fetchurl, pkgconfig, SDL, libogg, libvorbis, zlib, unzip }:
 
 let
 
   # Digital recordings of the music on an original Roland MT-32.  So
   # we don't need actual MIDI playback capability.
-  musicFiles =
-    [ (fetchurl {
-        url = mirror://sourceforge/exult/U7MusicOGG_1of2.zip;
-        md5 = "7746d1a9164fd67509107797496553bf";
-      })
-      (fetchurl {
-        url = mirror://sourceforge/exult/U7MusicOGG_2of2.zip;
-        md5 = "cdae5956d7c52f35e90317913a660123";
-      })
-    ];
+  audio = fetchurl {
+    url = mirror://sourceforge/exult/exult_audio.zip;
+    sha256 = "0s5wvgy9qja06v38g0qwzpaw76ff96vzd6gb1i3lb9k4hvx0xqbj";
+  };
 
 in
 
-stdenv.mkDerivation {
-  name = "exult-1.2";
-  
+stdenv.mkDerivation rec {
+  name = "exult-1.4.9rc1";
+
   src = fetchurl {
-    url = mirror://sourceforge/exult/exult-1.2.tar.gz;
-    md5 = "0fc88dee74a91724d25373ba0a8670ba";
+    url = "mirror://sourceforge/exult/${name}.tar.gz";
+    sha256 = "0a03a2l3ji6h48n106d4w55l8v6lni1axniafnvvv5c5n3nz5bgd";
   };
 
-  # Patches for building on x86_64 and gcc 4.x.
-  patches = [
-    (fetchurl {
-      url = "http://www.rocklinux.net/sources/package/stf/exult/exult-gcc4.patch";
-      sha256 = "1jlikxcpsi3yfchan3jbyi66fcyr18m7kfmsa946lwh3kzckszm7";
-    })
+  configureFlags = "--disable-tools";
 
-    # From http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/games-engines/exult/files/exult-1.2-64bits.patch?rev=1.1
-    ./64bits.patch
-  ];
+  patches =
+    [ # Arch Linux patch set.
+      ./arch.patch
+    ];
+
+  buildInputs = [ pkgconfig SDL libogg libvorbis zlib unzip ];
 
-  buildInputs = [libpng SDL SDL_mixer zlib unzip];
-  
-  NIX_CFLAGS_COMPILE = "-I${SDL_mixer}/include/SDL";
+  enableParallelBuilding = true;
 
   postInstall =
     ''
       mkdir -p $out/share/exult/music
-      for i in $musicFiles; do
-          unzip -o -d $out/share/exult/music $i
-      done
-    '';
-  
+      unzip -o -d $out/share/exult ${audio}
+      chmod 644 $out/share/exult/*.flx
+    ''; # */
+
   meta = {
     homepage = http://exult.sourceforge.net/;
     description = "A reimplementation of the Ultima VII game engine";
-    maintainers = [stdenv.lib.maintainers.eelco];
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/games/minecraft/default.nix b/pkgs/games/minecraft/default.nix
index b4ec7eb311ff..9f79dd70c6a0 100644
--- a/pkgs/games/minecraft/default.nix
+++ b/pkgs/games/minecraft/default.nix
@@ -1,6 +1,8 @@
-{stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
+{ stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
 , mesa, openal, alsaOss }:
 
+assert jre ? architecture;
+
 stdenv.mkDerivation {
   name = "minecraft-2013.07.01";
 
diff --git a/pkgs/games/openra/default.nix b/pkgs/games/openra/default.nix
index 638d494131f2..35057a5de75c 100644
--- a/pkgs/games/openra/default.nix
+++ b/pkgs/games/openra/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, mono, makeWrapper
-, SDL2, freetype, openal, systemd
+{ stdenv, fetchurl, mono, makeWrapper, lua
+, SDL2, freetype, openal, systemd, pkgconfig
 }:
 
 let
-  version = "20131223";
+  version = "20140608";
 in stdenv.mkDerivation rec {
   name = "openra-${version}";
 
@@ -18,15 +18,17 @@ in stdenv.mkDerivation rec {
   src = fetchurl {
     name = "${name}.tar.gz";
     url = "https://github.com/OpenRA/OpenRA/archive/release-${version}.tar.gz";
-    sha256 = "1gfz6iiccajp86qc7xw5w843bng69k9zplvmipxxbspvr7byhw0c";
+    sha256 = "0k7siysxb2nk7zzrl7vz1cwky4nla46ixzgxgc8rq6ilmlidh96b";
   };
 
   dontStrip = true;
 
-  nativeBuildInputs = [ mono makeWrapper ];
+  buildInputs = [ lua ];
+  nativeBuildInputs = [ mono makeWrapper lua pkgconfig ];
 
   patchPhase = ''
     sed -i 's/^VERSION.*/VERSION = release-${version}/g' Makefile
+    substituteInPlace configure --replace /bin/bash "$shell" --replace /usr/local/lib "${lua}/lib"
   '';
 
   preConfigure = ''
@@ -35,10 +37,15 @@ in stdenv.mkDerivation rec {
   '';
 
   postInstall = with stdenv.lib; let
-    runtime = makeLibraryPath [ SDL2 freetype openal systemd ];
+    runtime = makeLibraryPath [ SDL2 freetype openal systemd lua ];
   in ''
-    wrapProgram $out/bin/openra \
+    wrapProgram $out/lib/openra/launch-game.sh \
       --prefix PATH : "${mono}/bin" \
+      --set PWD $out/lib/openra/ \
       --prefix LD_LIBRARY_PATH : "${runtime}"
+      
+    mkdir -p $out/bin
+    echo "cd $out/lib/openra && $out/lib/openra/launch-game.sh" > $out/bin/openra
+    chmod +x $out/bin/openra
   '';
 }
diff --git a/pkgs/misc/emulators/mednafen/default.nix b/pkgs/misc/emulators/mednafen/default.nix
index 786ed21deccb..c7ef57357500 100644
--- a/pkgs/misc/emulators/mednafen/default.nix
+++ b/pkgs/misc/emulators/mednafen/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, pkgconfig
 , libX11, mesa, freeglut
-, jackaudio, libcdio, libsndfile, libsamplerate
+, jack2, libcdio, libsndfile, libsamplerate
 , SDL, SDL_net, zlib
 }:
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = with stdenv.lib;
-  [ libX11 mesa freeglut jackaudio libcdio libsndfile libsamplerate SDL SDL_net zlib ];
+  [ libX11 mesa freeglut jack2 libcdio libsndfile libsamplerate SDL SDL_net zlib ];
   
   nativeBuildInputs = [ pkgconfig ];
 
diff --git a/pkgs/misc/emulators/snes9x-gtk/default.nix b/pkgs/misc/emulators/snes9x-gtk/default.nix
new file mode 100644
index 000000000000..760821e36543
--- /dev/null
+++ b/pkgs/misc/emulators/snes9x-gtk/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, nasm, SDL, zlib, libpng, ncurses, mesa, intltool, gtk, pkgconfig, libxml2, x11, pulseaudio}:
+
+stdenv.mkDerivation rec {
+  name = "snes9x-gtk-${version}";
+  version = "1.53";
+
+  src = fetchurl {
+    url = "http://files.ipherswipsite.com/snes9x/snes9x-${version}-src.tar.bz2";
+    sha256 = "9f7c5d2d0fa3fe753611cf94e8879b73b8bb3c0eab97cdbcb6ab7376efa78dc3";
+  };
+
+  buildInputs = [ nasm SDL zlib libpng ncurses mesa intltool gtk pkgconfig libxml2 x11 pulseaudio];
+
+  sourceRoot = "snes9x-${version}-src/gtk";
+
+  configureFlags = "--prefix=$out/ --with-opengl";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp snes9x-gtk $out/bin
+  '';
+
+  meta = {
+    description = "a portable, freeware Super Nintendo Entertainment System (SNES) emulator";
+    longDescription = "Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES) emulator. It basically allows you to play most games designed for the SNES and Super Famicom Nintendo game systems on your PC or Workstation; which includes some real gems that were only ever released in Japan.";
+    license = stdenv.lib.licenses.lgpl2;
+    maintainers = [ stdenv.lib.maintainers.qknight ];
+    homepage = http://www.snes9x.com/;
+  };
+}
diff --git a/pkgs/misc/jackaudio/default.nix b/pkgs/misc/jackaudio/default.nix
index 826924b8e8e2..4f9f071094bc 100644
--- a/pkgs/misc/jackaudio/default.nix
+++ b/pkgs/misc/jackaudio/default.nix
@@ -5,7 +5,7 @@
 assert firewireSupport -> ffado != null;
 
 stdenv.mkDerivation rec {
-  name = "jackdbus-${version}";
+  name = "jack2-${version}";
   version = "1.9.9.5";
 
   src = fetchurl {
diff --git a/pkgs/misc/jackaudio/jack1.nix b/pkgs/misc/jackaudio/jack1.nix
index 540735ab8108..d424452ecd58 100644
--- a/pkgs/misc/jackaudio/jack1.nix
+++ b/pkgs/misc/jackaudio/jack1.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, pkgconfig, alsaLib
+{ stdenv, fetchurl, pkgconfig, alsaLib, db, libuuid
 , firewireSupport ? false, ffado ? null }:
 
 assert firewireSupport -> ffado != null;
 
 stdenv.mkDerivation rec {
-  name = "jack-${version}";
-  version = "0.121.3";
+  name = "jack1-${version}";
+  version = "0.124.1";
 
   src = fetchurl {
     url = "http://jackaudio.org/downloads/jack-audio-connection-kit-${version}.tar.gz";
-    sha256 = "1ypa3gjwy4vmaskin0vczmmdwybckkl42wmkfabx3v5yx8yms2dp";
+    sha256 = "1mk1wnx33anp6haxfjjkfhwbaknfblsvj35nxvz0hvspcmhdyhpb";
   };
   
   preBuild = "echo ok";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = 
-    [ pkgconfig alsaLib
+    [ pkgconfig alsaLib db libuuid
     ] ++ (stdenv.lib.optional firewireSupport ffado);
   
   meta = {
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index 9f553b480e75..87014a9c7144 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, python, cmake, vim, perl, ruby, unzip, which, fetchgit, clang }:
+{ fetchurl, bash, stdenv, python, cmake, vim, perl, ruby, unzip, which, fetchgit, clang }:
 
 /*
 About Vim and plugins
@@ -111,11 +111,11 @@ in rec
   YouCompleteMe = stdenv.mkDerivation {
     src = fetchgit {
       url = "https://github.com/Valloric/YouCompleteMe.git";
-      rev = "abfc3ee36adab11c0c0b9d086a164a69006fec79";
-      sha256 = "1d25dp5kgqickl06hqvx4j3z51zblhsn3q3by2hayyj3g2zps4gm";
+      rev = "67288080ea7057ea3111cb4c863484e3b150e738";
+      sha256 = "1a3rwdl458z1yrp50jdwp629j4al0zld21n15sad28g51m8gw5ka";
      };
 
-    name = "youcompleteme-git-abfc3ee";
+    name = "youcompleteme-git-6728808";
     buildInputs = [ python cmake clang.clang ];
 
     configurePhase = ":";
@@ -125,10 +125,12 @@ in rec
       mkdir -p $target
       cp -a ./ $target
 
+
       mkdir $target/build
       cd $target/build
-      cmake -G "Unix Makefiles" . $target/cpp -DPYTHON_LIBRARIES:PATH=${python}/lib/libpython2.7.so -DPYTHON_INCLUDE_DIR:PATH=${python}/include/python2.7 -DUSE_CLANG_COMPLETER=ON -DUSE_SYSTEM_LIBCLANG=ON
-      make -j -j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
+      cmake -G "Unix Makefiles" . $target/third_party/ycmd/cpp -DPYTHON_LIBRARIES:PATH=${python}/lib/libpython2.7.so -DPYTHON_INCLUDE_DIR:PATH=${python}/include/python2.7 -DUSE_CLANG_COMPLETER=ON -DUSE_SYSTEM_LIBCLANG=ON
+      make ycm_support_libs -j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
+      ${bash}/bin/bash $target/install.sh --clang-completer
 
       ${vimHelpTags}
       vimHelpTags $target
diff --git a/pkgs/os-specific/linux/alsa-plugins/default.nix b/pkgs/os-specific/linux/alsa-plugins/default.nix
index 352576fbdf23..ed55018e555e 100644
--- a/pkgs/os-specific/linux/alsa-plugins/default.nix
+++ b/pkgs/os-specific/linux/alsa-plugins/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lib, pkgconfig, alsaLib, libogg, pulseaudio ? null, jackaudio ? null }:
+{ stdenv, fetchurl, lib, pkgconfig, alsaLib, libogg, pulseaudio ? null, jack2 ? null }:
 
 stdenv.mkDerivation rec {
   name = "alsa-plugins-1.0.28";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ pkgconfig alsaLib libogg ]
     ++ lib.optional (pulseaudio != null) pulseaudio
-    ++ lib.optional (jackaudio != null) jackaudio;
+    ++ lib.optional (jack2 != null) jack2;
 
   meta = with lib; {
     description = "Various plugins for ALSA";
diff --git a/pkgs/os-specific/linux/kernel/linux-3.12.nix b/pkgs/os-specific/linux/kernel/linux-3.12.nix
index de73ef265167..2035eef93211 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.12.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.12.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.12.24";
+  version = "3.12.25";
   extraMeta.branch = "3.12";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "01y9sz90d4l12m3f7gjmnasck85c2dqx74hwyccw5jk04r5pm2mx";
+    sha256 = "16jdqhhi7z6jkprz90cb48cd479zsqlrn9j3yp2xcyqp05nc7n2p";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/servers/amqp/rabbitmq-server/default.nix b/pkgs/servers/amqp/rabbitmq-server/default.nix
index da0ec89cbc66..09b091b323c8 100644
--- a/pkgs/servers/amqp/rabbitmq-server/default.nix
+++ b/pkgs/servers/amqp/rabbitmq-server/default.nix
@@ -4,11 +4,11 @@
 stdenv.mkDerivation rec {
   name = "rabbitmq-server-${version}";
 
-  version = "3.2.4";
+  version = "3.3.4";
 
   src = fetchurl {
     url = "http://www.rabbitmq.com/releases/rabbitmq-server/v${version}/${name}.tar.gz";
-    sha256 = "17rvqhzcb7rscp228vmgixk0rsqi42m820jzxj9g5wid6qmzjc59";
+    sha256 = "13nnsn34b44mz8w4b69bcpxmq4daqnxzd0lppg0f138pcssha43l";
   };
 
   buildInputs =
diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix
index 7deab6584f83..e164c21ec78d 100644
--- a/pkgs/servers/http/apache-httpd/2.4.nix
+++ b/pkgs/servers/http/apache-httpd/2.4.nix
@@ -14,12 +14,12 @@ assert sslSupport -> aprutil.sslSupport && openssl != null;
 assert ldapSupport -> aprutil.ldapSupport && openldap != null;
 
 stdenv.mkDerivation rec {
-  version = "2.4.9";
+  version = "2.4.10";
   name = "apache-httpd-${version}";
 
   src = fetchurl {
     url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
-    sha256 = "00vnhki0rdwlhl4cjgvkq5vpf8szx2sdd3yi7bcg7jj7z86wk37p";
+    sha256 = "0slwcqw9f7fnb3kyz27hlsgh8j4wiza4yzqyp6vhfpvl3an4sv0p";
   };
 
   buildInputs = [perl] ++
diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix
index 35922b3c46f0..0665222a9e04 100644
--- a/pkgs/servers/pulseaudio/default.nix
+++ b/pkgs/servers/pulseaudio/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, gnum4, gdbm, libtool, glib, dbus, avahi
 , gconf, gtk, intltool, gettext, alsaLib, libsamplerate, libsndfile, speex
 , bluez, sbc, udev, libcap, json_c
-, jackaudioSupport ? false, jackaudio ? null
+, jackaudioSupport ? false, jack2 ? null
 , x11Support ? false, xlibs
 , useSystemd ? false, systemd ? null }:
 
-assert jackaudioSupport -> jackaudio != null;
+assert jackaudioSupport -> jack2 != null;
 
 stdenv.mkDerivation rec {
   name = "pulseaudio-5.0";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ pkgconfig gnum4 libtool intltool glib dbus avahi libsamplerate libsndfile
       speex json_c ]
-    ++ stdenv.lib.optional jackaudioSupport jackaudio
+    ++ stdenv.lib.optional jackaudioSupport jack2
     ++ stdenv.lib.optionals x11Support [ xlibs.xlibs xlibs.libXtst xlibs.libXi ]
     ++ stdenv.lib.optional useSystemd systemd
     ++ stdenv.lib.optionals stdenv.isLinux [ alsaLib bluez sbc udev ];
diff --git a/pkgs/servers/search/elasticsearch/default.nix b/pkgs/servers/search/elasticsearch/default.nix
index 765ed3ee8e95..76e416d64724 100644
--- a/pkgs/servers/search/elasticsearch/default.nix
+++ b/pkgs/servers/search/elasticsearch/default.nix
@@ -33,5 +33,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Open Source, Distributed, RESTful Search Engine";
     license = "ASL2.0";
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/servers/search/elasticsearch/plugins.nix b/pkgs/servers/search/elasticsearch/plugins.nix
new file mode 100644
index 000000000000..c03a2feae5f2
--- /dev/null
+++ b/pkgs/servers/search/elasticsearch/plugins.nix
@@ -0,0 +1,53 @@
+{ pkgs,  stdenv, fetchurl, unzip, elasticsearch }:
+
+with pkgs.lib;
+
+let
+  esPlugin = a@{
+    pluginName, 
+    installPhase ? ''
+      mkdir -p $out
+      ES_HOME=$out ${elasticsearch}/bin/elasticsearch-plugin --install ${pluginName} --url file://$src
+    '', 
+    ...
+  }:
+    stdenv.mkDerivation (a // {
+      inherit installPhase;
+      unpackPhase = "true";
+      buildInputs = [ unzip ];
+      meta = a.meta // {
+        platforms = elasticsearch.meta.platforms;
+        maintainers = (a.meta.maintainers or []) ++ [ maintainers.offline ];
+      };
+    });
+in {
+  elasticsearch_river_jdbc = esPlugin rec {
+    name = "elasticsearch-river-jdbc-${version}";
+    pluginName = "jdbc";
+    version = "1.2.1.1";
+    src = fetchurl {
+      url = "http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/${version}/${name}-plugin.zip";
+      sha1 = "68e7e1fdf45d0e5852b21610a84740595223ea11";
+    };
+    meta = {
+      homepage = "https://github.com/jprante/elasticsearch-river-jdbc";
+      description = "Plugin to fetch data from JDBC sources for indexing into Elasticsearch";
+      license = licenses.asl20;
+    };
+  };
+
+  elasticsearch_analisys_lemmagen = esPlugin rec {
+    name = "elasticsearch-analysis-lemmagen-${version}";
+    pluginName = "elasticsearch-analysis-lemmagen";
+    version = "0.1";
+    src = fetchurl {
+      url = "https://github.com/vhyza/elasticsearch-analysis-lemmagen/releases/download/v${version}/${name}-plugin.zip";
+      sha256 = "bf7bf5ce3ccdd3afecd0e18cd6fce1ef56f824e41f4ef50553ae598caa5c366d";
+    };
+    meta = {
+      homepage = "https://github.com/vhyza/elasticsearch-analysis-lemmagen";
+      description = "LemmaGen Analysis plugin provides jLemmaGen lemmatizer as Elasticsearch token filter";
+      license = licenses.asl20;
+    };
+  };
+}
diff --git a/pkgs/servers/serfdom/default.nix b/pkgs/servers/serfdom/default.nix
index 2c11372ee316..48e5f2cea227 100644
--- a/pkgs/servers/serfdom/default.nix
+++ b/pkgs/servers/serfdom/default.nix
@@ -1,7 +1,7 @@
 { stdenv, lib, go, fetchurl, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
-  version = "0.6.2";
+  version = "0.6.3";
   name = "serfdom-${version}";
 
   src = import ./deps.nix {
diff --git a/pkgs/servers/serfdom/deps.nix b/pkgs/servers/serfdom/deps.nix
index b933c6088244..a4b4058a711e 100644
--- a/pkgs/servers/serfdom/deps.nix
+++ b/pkgs/servers/serfdom/deps.nix
@@ -77,8 +77,8 @@ let
       src = fetchFromGitHub {
         owner = "hashicorp";
         repo = "serf";
-        rev = "4232a3f7b52f755084caf6b2cc2789efa2948555";
-        sha256 = "1hxxqrjz08882d205ylakhvvwciahiqdzkwi2a7zwrmx6sxna7sr";
+        rev = "5e0771b8d61bee28986087a246f7611d6bd4a87a";
+        sha256 = "0ck77ji28bvm4ahzxyyi4sm17c3fxc16k0k5mihl1nlkgdd73m8y";
       };
     }
     {
diff --git a/pkgs/servers/sql/mysql/5.5.x.nix b/pkgs/servers/sql/mysql/5.5.x.nix
index 782019f8ee06..7c31bd7c5828 100644
--- a/pkgs/servers/sql/mysql/5.5.x.nix
+++ b/pkgs/servers/sql/mysql/5.5.x.nix
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
     md5 = "bf1d80c66d4822ec6036300399a33c03";
   };
 
+  preConfigure = stdenv.lib.optional stdenv.isDarwin ''
+    ln -s /bin/ps $TMPDIR/ps
+    export PATH=$PATH:$TMPDIR
+  '';
+
   buildInputs = [ cmake bison ncurses openssl readline zlib ]
      ++ stdenv.lib.optional stdenv.isDarwin perl;
 
diff --git a/pkgs/servers/xmpp/openfire/default.nix b/pkgs/servers/xmpp/openfire/default.nix
index 736517b53f19..3fb89d7a222b 100644
--- a/pkgs/servers/xmpp/openfire/default.nix
+++ b/pkgs/servers/xmpp/openfire/default.nix
@@ -1,34 +1,25 @@
-{ stdenv, fetchurl, builderDefs, jre }:
+{ stdenv, fetchurl, jre }:
 
-with builderDefs;
-  let 
-    version="3_6_3";
-    localDefs = builderDefs.passthru.function (rec {
-    src = /* put a fetchurl here */
-      fetchurl {
-        url = "http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_${version}.tar.gz";
-        sha256 = "0ibzhmh9qw4lmx45ir1i280p30npgwnj7vrkl432kj3zi7hp79q2";
-      };
+stdenv.mkDerivation rec {
+  name = "openfire-${version}";
+  version  = "3_6_3";
 
-    buildInputs = [jre];
-    configureFlags = [];
+  src = fetchurl {
+    url = "http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_${version}.tar.gz";
+    sha256 = "0ibzhmh9qw4lmx45ir1i280p30npgwnj7vrkl432kj3zi7hp79q2";
+  };
+
+  buildInputs = [ jre ];
+
+  installPhase = ''
+    sed -e 's@\(common_jvm_locations\)=.*@\1${jre}@' -i bin/openfire
+    cp -r . $out
+    rm -r $out/logs
+    mv $out/conf $out/conf.inst
+    ln -s /var/log/openfire $out/logs
+    ln -s /etc/openfire $out/conf
+  ''; 
 
-    installPhase = fullDepEntry (''
-      sed -e 's@\(common_jvm_locations\)=.*@\1${jre}@' -i bin/openfire
-      cp -r . $out
-      rm -r $out/logs
-      mv $out/conf $out/conf.inst
-      ln -s /var/log/openfire $out/logs
-      ln -s /etc/openfire $out/conf
-    '') 
-    ["minInit" "doUnpack" "addInputs"];
-  });
-  in with localDefs;
-stdenv.mkDerivation rec {
-  name = "openfire-"+version;
-  builder = writeScript (name + "-builder")
-    (textClosure localDefs 
-      [ installPhase doForceShare doPropagate]);
   meta = {
     description = "XMPP server in Java";
   };
diff --git a/pkgs/tools/X11/nitrogen/default.nix b/pkgs/tools/X11/nitrogen/default.nix
index 182c058e1c12..dd8b496fe66e 100644
--- a/pkgs/tools/X11/nitrogen/default.nix
+++ b/pkgs/tools/X11/nitrogen/default.nix
@@ -27,6 +27,6 @@ stdenv.mkDerivation rec {
     homepage = http://projects.l3ib.org/nitrogen/;
     license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.linux;
-    maintainer = [ stdenv.lib.maintainers.auntie ];
+    maintainers = [ stdenv.lib.maintainers.auntie ];
   };
 }
diff --git a/pkgs/tools/admin/gtk-vnc/default.nix b/pkgs/tools/admin/gtk-vnc/default.nix
index 14822d8b6e96..c502cee5415a 100644
--- a/pkgs/tools/admin/gtk-vnc/default.nix
+++ b/pkgs/tools/admin/gtk-vnc/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, gobjectIntrospection
 , python, gtk, pygtk, gnutls, cairo, libtool, glib, pkgconfig, libtasn1
-, libffi, cyrus_sasl, intltool, perl, perlPackages, firefoxPkgs, pulseaudio
+, libffi, cyrus_sasl, intltool, perl, perlPackages, pulseaudio
 , kbproto, libX11, libXext, xextproto, pygobject, libgcrypt, gtk3, vala
 , pygobject3, libogg, enableGTK3 ? false }:
 
diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix
index e0f9ce2a2bf7..58e023a6aaa7 100644
--- a/pkgs/tools/graphics/gnuplot/default.nix
+++ b/pkgs/tools/graphics/gnuplot/default.nix
@@ -13,29 +13,33 @@
 , pkgconfig ? null
 , fontconfig ? null
 , gnused ? null
-, coreutils ? null }:
+, coreutils ? null
+, qt ? null }:
 
 assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null);
 let
   withX = libX11 != null && !aquaterm;
+  withQt = qt != null;
 in
 stdenv.mkDerivation rec {
-  name = "gnuplot-4.6.3";
+  name = "gnuplot-4.6.5";
 
   src = fetchurl {
     url = "mirror://sourceforge/gnuplot/${name}.tar.gz";
-    sha256 = "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz";
+    sha256 = "0bcsa5b33msddjs6mj0rhi81cs19h9p3ykixkkl70ifhqwqg0l75";
   };
 
   buildInputs =
     [ zlib gd texinfo readline emacs lua texLive
       pango cairo pkgconfig makeWrapper ]
     ++ stdenv.lib.optionals withX              [ libX11 libXpm libXt libXaw ]
+    ++ stdenv.lib.optional withQt [ qt ]
     # compiling with wxGTK causes a malloc (double free) error on darwin
     ++ stdenv.lib.optional (!stdenv.isDarwin) wxGTK;
 
   configureFlags =
     (if withX then ["--with-x"] else ["--without-x"])
+    ++ (if withQt then ["--enable-qt"] else ["--disable-qt"])
     ++ (if aquaterm then ["--with-aquaterm"] else ["--without-aquaterm"])
     ;
 
diff --git a/pkgs/tools/misc/emv/default.nix b/pkgs/tools/misc/emv/default.nix
new file mode 100644
index 000000000000..ee8b12ad89b5
--- /dev/null
+++ b/pkgs/tools/misc/emv/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "emv-${version}";
+  version = "1.95";
+
+  src = fetchurl {
+    url = "http://www.i0i0.de/toolchest/emv";
+    sha256 = "7e0e12afa45ef5ed8025e5f2c6deea0ff5f512644a721f7b1b95b63406a8f7ce";
+  };
+
+  phases = [ "installPhase" ];
+
+  installPhase = ''
+    mkdir -pv $out/bin
+    cp $src $out/bin/emv
+    chmod +x $out/bin/emv
+  '';
+
+  meta = {
+    homepage = "http://www.i0i0.de/toolchest/emv";
+    description = "Editor Move: Rename files with your favourite text editor";
+    license = stdenv.lib.licenses.publicDomain;
+  };
+}
diff --git a/pkgs/tools/misc/kalibrate-rtl/default.nix b/pkgs/tools/misc/kalibrate-rtl/default.nix
new file mode 100644
index 000000000000..19870b8de5b8
--- /dev/null
+++ b/pkgs/tools/misc/kalibrate-rtl/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchgit, autoreconfHook, pkgconfig, fftw, rtl-sdr, libusb1 }:
+
+stdenv.mkDerivation rec {
+  name = "kalibrate-rtl-20131214";
+
+  # There are no tags/releases, so use the latest commit from git master.
+  # Currently, the latest commit is from 2013-12-14.
+  src = fetchgit {
+    url = "https://github.com/steve-m/kalibrate-rtl.git";
+    rev = "aae11c8a8dc79692a94ccfee39ba01e8c8c05d38";
+    sha256 = "1spbfflkqnw9s8317ppsf7b1nnkicqsmaqsnz1zf8i49ix70i6kn";
+  };
+
+  buildInputs = [ autoreconfHook pkgconfig fftw rtl-sdr libusb1 ];
+
+  meta = with stdenv.lib; {
+    description = "Calculate local oscillator frequency offset in RTL-SDR devices";
+    longDescription = ''
+      Kalibrate, or kal, can scan for GSM base stations in a given frequency
+      band and can use those GSM base stations to calculate the local
+      oscillator frequency offset.
+
+      This package is for RTL-SDR devices.
+    '';
+    homepage = https://github.com/steve-m/kalibrate-rtl;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/tools/misc/lrzsz/default.nix b/pkgs/tools/misc/lrzsz/default.nix
new file mode 100644
index 000000000000..729faa7a95d9
--- /dev/null
+++ b/pkgs/tools/misc/lrzsz/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "lrzsz-0.12.20";
+
+  src = fetchurl {
+    url = "https://ohse.de/uwe/releases/${name}.tar.gz";
+    sha256 = "1wcgfa9fsigf1gri74gq0pa7pyajk12m4z69x7ci9c6x9fqkd2y2";
+  };
+
+  configureFlags = [ "--program-transform-name=s/^l//" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://ohse.de/uwe/software/lrzsz.html;
+    description = "Communication package providing the XMODEM, YMODEM ZMODEM file transfer protocols";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/tools/misc/picocom/default.nix b/pkgs/tools/misc/picocom/default.nix
index 126725eaafcb..b55c973f60a1 100644
--- a/pkgs/tools/misc/picocom/default.nix
+++ b/pkgs/tools/misc/picocom/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, makeWrapper, lrzsz }:
 
 stdenv.mkDerivation rec {
   name = "picocom-1.7";
@@ -8,10 +8,15 @@ stdenv.mkDerivation rec {
     sha256 = "17hjq713naq02xar711aw24qqd52p591mj1h5n97cni1ga7irwyh";
   };
 
+  buildInputs = [ makeWrapper ];
+
   installPhase = ''
     mkdir -p $out/bin $out/share/man/man8
     cp picocom $out/bin
     cp picocom.8 $out/share/man/man8
+
+    wrapProgram $out/bin/picocom \
+      --prefix PATH ":" "${lrzsz}/bin"
   '';
 
   meta = {
diff --git a/pkgs/tools/misc/timidity/default.nix b/pkgs/tools/misc/timidity/default.nix
index 89ff6f4677fc..afe75c572c02 100644
--- a/pkgs/tools/misc/timidity/default.nix
+++ b/pkgs/tools/misc/timidity/default.nix
@@ -1,4 +1,4 @@
-{ composableDerivation, stdenv, fetchurl, alsaLib, jackaudio, ncurses }:
+{ composableDerivation, stdenv, fetchurl, alsaLib, jack2, ncurses }:
 
 let inherit (composableDerivation) edf; in
 
@@ -30,8 +30,8 @@ composableDerivation.composableDerivation {} {
     };
     jack = {
       audioModes = "jack";
-      buildInputs = [jackaudio];
-      NIX_LDFLAGS = ["-ljack -L${jackaudio}/lib64"];
+      buildInputs = [jack2];
+      NIX_LDFLAGS = ["-ljack -L${jack2}/lib64"];
     };
   } // edf { name = "ncurses"; enable = { buildInputs = [ncurses]; };};
 
diff --git a/pkgs/tools/misc/tmux/default.nix b/pkgs/tools/misc/tmux/default.nix
index 10e22c3aad03..5b656cc13e72 100644
--- a/pkgs/tools/misc/tmux/default.nix
+++ b/pkgs/tools/misc/tmux/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   pname = "tmux";
-  version = "1.9";
+  version = "1.9a";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${pname}/${name}.tar.gz";
-    sha256 = "09qykbcyvsspg6bfsdx2lp9b32dbybwn5k6kx4baib0k6l4wmriy";
+    sha256 = "1x9k4wfd4l5jg6fh7xkr3yyilizha6ka8m5b1nr0kw8wj0mv5qy5";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/networking/bud/default.nix b/pkgs/tools/networking/bud/default.nix
new file mode 100644
index 000000000000..34e1a3964f67
--- /dev/null
+++ b/pkgs/tools/networking/bud/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchgit, python, gyp, utillinux }:
+
+stdenv.mkDerivation rec {
+  name = "bud-${version}";
+
+  version = "0.25.0";
+
+  src = fetchgit {
+    url = "https://github.com/indutny/bud.git";
+    rev = "f65b9c3531dac1a5b3c962e01f3bed1d41ab5621";
+    sha256 = "000wwc88hsf6ccz8wxjn2af6l0nxm6a2fcad71xw35ymmdp9n5xg";
+  };
+
+  buildInputs = [
+    python gyp
+  ] ++ lib.optional stdenv.isLinux utillinux;
+ 
+  buildPhase = ''
+    python ./gyp_bud -f make
+    make -C out
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp out/Release/bud $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A TLS terminating proxy";
+    license     = licenses.mit;
+    platforms   = with platforms; linux;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/pkgs/tools/networking/socat/2.x.nix b/pkgs/tools/networking/socat/2.x.nix
index 74b9b1bdf6aa..fbd249463812 100644
--- a/pkgs/tools/networking/socat/2.x.nix
+++ b/pkgs/tools/networking/socat/2.x.nix
@@ -10,11 +10,13 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ openssl ];
 
+  configureFlags = stdenv.lib.optionalString stdenv.isDarwin "--disable-ip6";
+
   meta = {
     description = "A utility for bidirectional data transfer between two independent data channels";
     homepage = http://www.dest-unreach.org/socat/;
     repositories.git = git://repo.or.cz/socat.git;
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
     license = stdenv.lib.licenses.gpl2;
     maintainers = stdenv.lib.maintainers.eelco;
   };
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index 25a71a2d5073..ef673241c7ef 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -5,11 +5,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "nix-1.8pre3679_f609eec";
+  name = "nix-1.8pre3705_71a20d4";
 
   src = fetchurl {
-    url = "http://hydra.nixos.org/build/12606291/download/5/${name}.tar.xz";
-    sha256 = "d185c00db8c1ab977d37695da0130628290af8dc315b3e24aa24d3ee25cdf875";
+    url = "http://hydra.nixos.org/build/12722887/download/5/${name}.tar.xz";
+    sha256 = "832905be494280c8dcb377e389fb9c6c77993508bb457e11720ba2b53dd580ae";
   };
 
   nativeBuildInputs = [ perl pkgconfig ];
diff --git a/pkgs/tools/system/at/default.nix b/pkgs/tools/system/at/default.nix
index 252400bd7f46..c77890513656 100644
--- a/pkgs/tools/system/at/default.nix
+++ b/pkgs/tools/system/at/default.nix
@@ -1,12 +1,12 @@
 { fetchurl, stdenv, bison, flex, pam, ssmtp }:
 
 stdenv.mkDerivation {
-  name = "at-3.1.12";
+  name = "at-3.1.14";
 
   src = fetchurl {
     # Debian is apparently the last location where it can be found.
-    url = mirror://debian/pool/main/a/at/at_3.1.12.orig.tar.gz;
-    sha256 = "1wqqrj4lg2ix79ib5kz7lk4hbs1zpw72n6zkd2gdv2my9ymwcmbw";
+    url = mirror://debian/pool/main/a/at/at_3.1.14.orig.tar.gz;
+    sha256 = "cd092bf05d29c25b286f55a960ce8b8c3c5beb571d86ed8eb1dfb3b61291b3ae";
   };
 
   patches = [ ./install.patch ];
diff --git a/pkgs/tools/system/at/install.patch b/pkgs/tools/system/at/install.patch
index 9db336e9bfe3..0297d680aa46 100644
--- a/pkgs/tools/system/at/install.patch
+++ b/pkgs/tools/system/at/install.patch
@@ -1,6 +1,6 @@
---- at-3.1.10.1/Makefile.in	2005-08-29 10:08:28.000000000 +0200
-+++ at-3.1.10.1/Makefile.in	2008-04-01 11:05:38.000000000 +0200
-@@ -88,35 +88,28 @@ atrun: atrun.in
+--- at-3.1.14/Makefile.in	2013-09-08 14:43:53.000000000 +0200
++++ at-3.1.14/Makefile.in	2014-07-27 20:42:04.017703443 +0200
+@@ -91,35 +91,28 @@
  	$(CC) -c $(CFLAGS) $(DEFS) $*.c
  
  install: all
@@ -15,7 +15,7 @@
 -	chmod 600 $(IROOT)$(LFILE)
 -	chown $(DAEMON_USERNAME):$(DAEMON_GROUPNAME) $(IROOT)$(LFILE)
 -	test -f $(IROOT)$(etcdir)/at.allow || test -f $(IROOT)$(etcdir)/at.deny || $(INSTALL) -o root -g $(DAEMON_GROUPNAME) -m 640 at.deny $(IROOT)$(etcdir)/
--	$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 -s at $(IROOT)$(bindir)
+-	$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 at $(IROOT)$(bindir)
 +	$(INSTALL) -m 755 -d $(IROOT)$(bindir)
 +	$(INSTALL) -m 755 -d $(IROOT)$(sbindir)
 +	$(INSTALL) -m 755 -d $(IROOT)$(docdir)
@@ -27,7 +27,7 @@
 -	$(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man1dir)
 -	$(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man5dir)
 -	$(INSTALL) -d -o root -g root -m 755 $(IROOT)$(man8dir)
--	$(INSTALL) -g root -o root -m 755 -s atd $(IROOT)$(sbindir)
+-	$(INSTALL) -g root -o root -m 755 atd $(IROOT)$(sbindir)
 -	$(INSTALL) -g root -o root -m 755 atrun $(IROOT)$(sbindir)
 -	$(INSTALL) -g root -o root -m 644 at.1 $(IROOT)$(man1dir)/
 +	$(INSTALL) -m 755 batch $(IROOT)$(bindir)
@@ -44,12 +44,11 @@
 -	$(INSTALL) -g root -o root -m 644 tmpman $(IROOT)$(man8dir)/atrun.8
 +	$(INSTALL) -m 644 tmpman $(IROOT)$(man8dir)/atrun.8
  	rm -f tmpman
--	$(INSTALL) -g root -o root -m 644 at_allow.5 $(IROOT)$(man5dir)/
-+	$(INSTALL) -m 644 at_allow.5 $(IROOT)$(man5dir)/
- 	cd $(IROOT)$(man5dir) && $(LN_S) -f at_allow.5 at_deny.5 
+-	$(INSTALL) -g root -o root -m 644 at.allow.5 $(IROOT)$(man5dir)/
++	$(INSTALL) -m 644 at.allow.5 $(IROOT)$(man5dir)/
+ 	cd $(IROOT)$(man5dir) && $(LN_S) -f at.allow.5 at.deny.5
 -	$(INSTALL) -g root -o root -m 644 $(DOCS) $(IROOT)$(atdocdir)
 +	$(INSTALL) -m 644 $(DOCS) $(IROOT)$(atdocdir)
  	rm -f $(IROOT)$(mandir)/cat1/at.1* $(IROOT)$(mandir)/cat1/batch.1* \
  		$(IROOT)$(mandir)/cat1/atq.1*
  	rm -f $(IROOT)$(mandir)/cat1/atd.8*
-
diff --git a/pkgs/tools/system/evemu/default.nix b/pkgs/tools/system/evemu/default.nix
new file mode 100644
index 000000000000..90833b83683d
--- /dev/null
+++ b/pkgs/tools/system/evemu/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchgit, automake, autoconf, libtool, pkgconfig, pythonPackages
+, libevdev, linuxHeaders
+}:
+
+stdenv.mkDerivation rec {
+  name = "evemu-${version}";
+  version = "2.0.0";
+
+  # We could have downloaded a release tarball from cgit, but it changes hash
+  # each time it is downloaded :/
+  src = fetchgit {
+    url = git://git.freedesktop.org/git/evemu;
+    rev = "refs/tags/v${version}";
+    sha256 = "1509b524a2483054a45698c485968094dd8c0f857bba7333449e9d05acbfbd2c";
+  };
+
+  buildInputs = [
+    automake autoconf libtool pkgconfig pythonPackages.python
+    pythonPackages.evdev libevdev
+  ];
+
+  preConfigure = ''
+    ./autogen.sh --prefix=$out
+  '';
+
+  postPatch = ''
+    substituteInPlace src/make-event-names.py --replace "/usr/include/linux/input.h" "${linuxHeaders}/include/linux/input.h"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Records and replays device descriptions and events to emulate input devices through the kernel's input system";
+    homepage = http://www.freedesktop.org/wiki/Evemu/;
+    repositories.git = git://git.freedesktop.org/git/evemu;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.amorsillo ];
+  };
+}
diff --git a/pkgs/tools/system/monit/default.nix b/pkgs/tools/system/monit/default.nix
index 8e4848f2db62..41a94ff2f2e3 100644
--- a/pkgs/tools/system/monit/default.nix
+++ b/pkgs/tools/system/monit/default.nix
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
     homepage = http://mmonit.com/monit/;
     description = "Monitoring system";
     license = stdenv.lib.licenses.agpl3;
-    maintainer = with stdenv.lib.maintainers; [ raskin wmertens ];
+    maintainers = with stdenv.lib.maintainers; [ raskin wmertens ];
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ecc392df80f4..2bf5b5aca396 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -689,6 +689,10 @@ let
 
   btar = callPackage ../tools/backup/btar { };
 
+  bud = callPackage ../tools/networking/bud {
+    inherit (pythonPackages) gyp;
+  };
+
   bup = callPackage ../tools/backup/bup {
     inherit (pythonPackages) pyxattr pylibacl setuptools fuse;
     inherit (haskellPackages) pandoc;
@@ -941,8 +945,16 @@ let
 
   efivar = callPackage ../tools/system/efivar { };
 
+  evemu = callPackage ../tools/system/evemu { };
+
   elasticsearch = callPackage ../servers/search/elasticsearch { };
 
+  elasticsearchPlugins = recurseIntoAttrs (
+    callPackage ../servers/search/elasticsearch/plugins.nix { }
+  );
+
+  emv = callPackage ../tools/misc/emv { };
+
   enblendenfuse = callPackage ../tools/graphics/enblend-enfuse {
     boost = boost149;
   };
@@ -1140,6 +1152,8 @@ let
       else stdenv;
   };
 
+  gnuplot_qt = gnuplot.override { qt = qt4; };
+
   # must have AquaTerm installed separately
   gnuplot_aquaterm = gnuplot.override { aquaterm = true; };
 
@@ -1337,6 +1351,8 @@ let
 
   kazam = callPackage ../applications/video/kazam { };
 
+  kalibrate-rtl = callPackage ../tools/misc/kalibrate-rtl { };
+
   kexectools = callPackage ../os-specific/linux/kexectools { };
 
   keychain = callPackage ../tools/misc/keychain { };
@@ -1389,6 +1405,8 @@ let
 
   libestr = callPackage ../development/libraries/libestr { };
 
+  libevdev = callPackage ../development/libraries/libevdev { };
+
   liboauth = callPackage ../development/libraries/liboauth { };
 
   libtirpc = callPackage ../development/libraries/ti-rpc { };
@@ -2531,8 +2549,6 @@ let
 
   clang_34 = wrapClang llvmPackages_34.clang;
   clang_33 = wrapClang (clangUnwrapped llvm_33 ../development/compilers/llvm/3.3/clang.nix);
-  clang_32 = wrapClang (clangUnwrapped llvm_32 ../development/compilers/llvm/3.2/clang.nix);
-  clang_31 = wrapClang (clangUnwrapped llvm_31 ../development/compilers/llvm/3.1/clang.nix);
 
   clangAnalyzer = callPackage ../development/tools/analysis/clang-analyzer {
     clang = clang_34;
@@ -2602,22 +2618,6 @@ let
     inherit fetchurl stdenv noSysDirs;
   });
 
-  # XXX: GCC 4.2 (and possibly others) misdetects `makeinfo' when
-  # using Texinfo >= 4.10, just because it uses a stupid regexp that
-  # expects a single digit after the dot.  As a workaround, we feed
-  # GCC with Texinfo 4.9.  Stupid bug, hackish workaround.
-
-  gcc42 = wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2) {
-    inherit fetchurl stdenv noSysDirs;
-    profiledCompiler = false;
-  });
-
-  gcc43 = lowPrio (wrapGCC (makeOverridable (import ../development/compilers/gcc/4.3) {
-    inherit stdenv fetchurl gmp mpfr noSysDirs;
-    texinfo = texinfo4;
-    profiledCompiler = true;
-  }));
-
   gcc48_realCross = lib.addMetaAttrs { hydraPlatforms = []; }
     (callPackage ../development/compilers/gcc/4.8 {
       inherit noSysDirs;
@@ -2780,24 +2780,6 @@ let
       else null;
   }));
 
-  gcc49_multi =
-    if system == "x86_64-linux" then lowPrio (
-      wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi (gcc49.gcc.override {
-        stdenv = overrideGCC stdenv (wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi gcc.gcc);
-        profiledCompiler = false;
-        enableMultilib = true;
-      }))
-    else throw "Multilib gcc not supported on ‘${system}’";
-
-  gcc49_debug = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.9 {
-    stripped = false;
-
-    inherit noSysDirs;
-    cross = null;
-    libcCross = null;
-    binutilsCross = null;
-  }));
-
   gccApple =
     assert stdenv.isDarwin;
     wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2-apple64) {
@@ -3089,8 +3071,6 @@ let
 
   llvm_34 = llvmPackages_34.llvm;
   llvm_33 = llvm_v ../development/compilers/llvm/3.3/llvm.nix;
-  llvm_32 = llvm_v ../development/compilers/llvm/3.2;
-  llvm_31 = llvm_v ../development/compilers/llvm/3.1;
 
   llvm_v = path: callPackage path {
     stdenv = if stdenv.isDarwin
@@ -3298,10 +3278,6 @@ let
 
   ocamlnat = let callPackage = newScope pkgs.ocamlPackages_3_12_1; in callPackage ../development/ocaml-modules/ocamlnat { };
 
-  opencxx = callPackage ../development/compilers/opencxx {
-    gcc = gcc33;
-  };
-
   qcmm = callPackage ../development/compilers/qcmm {
     lua   = lua4;
     ocaml = ocaml_3_08_0;
@@ -3657,12 +3633,10 @@ let
 
   tcl = callPackage ../development/interpreters/tcl { };
 
-  xulrunnerWrapper = {application, launcher}:
-    import ../development/interpreters/xulrunner/wrapper {
-      inherit stdenv application launcher xulrunner;
-    };
-
-  xulrunner = pkgs.firefoxPkgs.xulrunner;
+  xulrunner = callPackage ../development/interpreters/xulrunner {
+    inherit (gnome) libIDL;
+    inherit (pythonPackages) pysqlite;
+  };
 
 
   ### DEVELOPMENT / MISC
@@ -4443,6 +4417,10 @@ let
 
   enginepkcs11 = callPackage ../development/libraries/enginepkcs11 { };
 
+  epoxy = callPackage ../development/libraries/epoxy {
+    inherit (xorg) utilmacros libX11;
+  };
+
   esdl = callPackage ../development/libraries/esdl { };
 
   exiv2 = callPackage ../development/libraries/exiv2 { };
@@ -4535,6 +4513,8 @@ let
 
   freetype = callPackage ../development/libraries/freetype { };
 
+  frei0r = callPackage ../development/libraries/frei0r { };
+
   fribidi = callPackage ../development/libraries/fribidi { };
 
   funambol = callPackage ../development/libraries/funambol { };
@@ -5695,7 +5675,17 @@ let
 
   mkvtoolnix = callPackage ../applications/video/mkvtoolnix { };
 
-  mlt = callPackage ../development/libraries/mlt { };
+  mlt-qt4 = callPackage ../development/libraries/mlt {
+    qt = qt4;
+    SDL = SDL_pulseaudio;
+  };
+
+  mlt-qt5 = callPackage ../development/libraries/mlt {
+    qt = qt5;
+    SDL = SDL_pulseaudio;
+  };
+
+  movit = callPackage ../development/libraries/movit { };
 
   mps = callPackage ../development/libraries/mps { };
 
@@ -5958,6 +5948,21 @@ let
     qtLib = qt48Full;
   };
 
+  qt53Full = qt53.override {
+    buildDocs = true;
+    buildExamples = true;
+    buildTests = true;
+    developerBuild = true;
+  };
+
+  qt53 = callPackage ../development/libraries/qt-5/qt-5.3.nix {
+    mesa = mesa_noglu;
+    cups = if stdenv.isLinux then cups else null;
+    # GNOME dependencies are not used unless gtkStyle == true
+    inherit (gnome) libgnomeui GConf gnome_vfs;
+    bison = bison2; # error: too few arguments to function 'int yylex(...
+  };
+
   qt5 = callPackage ../development/libraries/qt-5 {
     mesa = mesa_noglu;
     cups = if stdenv.isLinux then cups else null;
@@ -5992,6 +5997,8 @@ let
 
   rabbitmq-c = callPackage ../development/libraries/rabbitmq-c {};
 
+  rabbitmq-java-client = callPackage ../development/libraries/rabbitmq-java-client {};
+
   raul = callPackage ../development/libraries/audio/raul { };
 
   readline = readline6; # 6.2 works, 6.3 breaks python, parted
@@ -6052,6 +6059,9 @@ let
       else stdenv;
   };
 
+  # Fixes major problems with choppy sound in MLT / Kdenlive / Shotcut
+  SDL_pulseaudio = SDL.override { pulseaudioSupport = true; };
+
   SDL_gfx = callPackage ../development/libraries/SDL_gfx { };
 
   SDL_image = callPackage ../development/libraries/SDL_image {
@@ -7007,7 +7017,7 @@ let
   alsaLib = callPackage ../os-specific/linux/alsa-lib { };
 
   alsaPlugins = callPackage ../os-specific/linux/alsa-plugins {
-    jackaudio = null;
+    jack2 = null;
   };
 
   alsaPluginWrapper = callPackage ../os-specific/linux/alsa-plugins/wrapper.nix { };
@@ -7281,15 +7291,6 @@ let
       ];
   };
 
-  linux_3_10_tuxonice = linux_3_10.override (attrs: {
-    kernelPatches = attrs.kernelPatches ++ [
-      kernelPatches.tuxonice_3_10
-    ];
-    extraConfig = ''
-      TOI_CORE y
-    '';
-  });
-
   linux_3_12 = makeOverridable (import ../os-specific/linux/kernel/linux-3.12.nix) {
     inherit fetchurl stdenv perl buildLinux;
     kernelPatches = lib.optionals ((platform.kernelArch or null) == "mips")
@@ -7951,6 +7952,8 @@ let
 
   oldstandard = callPackage ../data/fonts/oldstandard { };
 
+  opensans-ttf = callPackage ../data/fonts/opensans-ttf { };
+
   poly = callPackage ../data/fonts/poly { };
 
   posix_man_pages = callPackage ../data/documentation/man-pages-posix { };
@@ -8327,24 +8330,6 @@ let
 
   emacs = emacs24;
 
-  emacs23 = callPackage ../applications/editors/emacs-23 {
-    stdenv =
-      if stdenv.isDarwin
-      /* On Darwin, use Apple-GCC, otherwise:
-           configure: error: C preprocessor "cc -E -no-cpp-precomp" fails sanity check */
-      then overrideGCC stdenv gccApple
-      else stdenv;
-
-    # use override to select the appropriate gui toolkit
-    libXaw = if stdenv.isDarwin then xlibs.libXaw else null;
-    Xaw3d = null;
-    gtk = if stdenv.isDarwin then null else gtk;
-    # TODO: these packages don't build on Darwin.
-    gconf = null /* if stdenv.isDarwin then null else gnome.GConf */;
-    librsvg = null /* if stdenv.isDarwin then null else librsvg */;
-    texinfo = texinfo4;
-  };
-
   emacs24 = callPackage ../applications/editors/emacs-24 {
     # use override to enable additional features
     libXaw = xlibs.libXaw;
@@ -8364,12 +8349,12 @@ let
     withX = false;
   }));
 
-  emacs24Macport = callPackage ../applications/editors/emacs-24/macport.nix {
+  emacs24Macport = lowPrio (callPackage ../applications/editors/emacs-24/macport.nix {
     # resolve unrecognised flag '-fconstant-cfstrings' errors
     stdenv = if stdenv.isDarwin
       then clangStdenv
       else stdenv;
-  };
+  });
 
   emacsPackages = emacs: self: let callPackage = newScope self; in rec {
     inherit emacs;
@@ -8378,6 +8363,8 @@ let
 
     bbdb = callPackage ../applications/editors/emacs-modes/bbdb { };
 
+    bbdb3 = callPackage ../applications/editors/emacs-modes/bbdb/3.nix {};
+
     cedet = callPackage ../applications/editors/emacs-modes/cedet { };
 
     calfw = callPackage ../applications/editors/emacs-modes/calfw { };
@@ -8500,7 +8487,6 @@ let
     xmlRpc = callPackage ../applications/editors/emacs-modes/xml-rpc { };
   };
 
-  emacs23Packages = emacsPackages emacs23 pkgs.emacs23Packages;
   emacs24Packages = recurseIntoAttrs (emacsPackages emacs24 pkgs.emacs24Packages);
 
   inherit (gnome3) empathy;
@@ -8611,27 +8597,18 @@ let
 
   filezilla = callPackage ../applications/networking/ftp/filezilla { };
 
-  firefox = pkgs.firefoxPkgs.firefox;
-
-  firefox36Pkgs = callPackage ../applications/networking/browsers/firefox/3.6.nix {
-    inherit (gnome) libIDL;
-  };
-
-  firefox36Wrapper = wrapFirefox { browser = firefox36Pkgs.firefox; };
-
   firefox13Pkgs = callPackage ../applications/networking/browsers/firefox/13.0.nix {
     inherit (gnome) libIDL;
   };
 
   firefox13Wrapper = wrapFirefox { browser = firefox13Pkgs.firefox; };
 
-  firefoxPkgs = callPackage ../applications/networking/browsers/firefox {
+  firefox = callPackage ../applications/networking/browsers/firefox {
     inherit (gnome) libIDL;
     inherit (pythonPackages) pysqlite;
-    libpng = libpng.override { apngSupport = true; };
   };
 
-  firefoxWrapper = wrapFirefox { browser = firefoxPkgs.firefox; };
+  firefoxWrapper = wrapFirefox { browser = pkgs.firefox; };
 
   firefox-bin = callPackage ../applications/networking/browsers/firefox-bin {
     gconf = pkgs.gnome.GConf;
@@ -8644,7 +8621,6 @@ let
 
   flashplayer = callPackage ../applications/networking/browsers/mozilla-plugins/flashplayer-11 {
     debug = config.flashplayer.debug or false;
-    # !!! Fix the dependency on two different builds of nss.
   };
 
   freecad = callPackage ../applications/graphics/freecad {
@@ -8748,7 +8724,6 @@ let
   gmu = callPackage ../applications/audio/gmu { };
 
   gnash = callPackage ../applications/video/gnash {
-    xulrunner = firefoxPkgs.xulrunner;
     inherit (gnome) gtkglext;
   };
 
@@ -9069,6 +9044,8 @@ let
 
   lmms = callPackage ../applications/audio/lmms { };
 
+  lrzsz = callPackage ../tools/misc/lrzsz { };
+
   lxdvdrip = callPackage ../applications/video/lxdvdrip { };
 
   handbrake = callPackage ../applications/video/handbrake { };
@@ -9244,6 +9221,8 @@ let
 
   ruby_ncursesw_sup = callPackage ../development/libraries/ruby_ncursesw_sup { };
 
+  shotcut = callPackage ../applications/video/shotcut { mlt = mlt-qt5; };
+
   smplayer = callPackage ../applications/video/smplayer { };
 
   sup = with rubyLibs; callPackage ../applications/networking/mailreaders/sup {
@@ -9541,6 +9520,8 @@ let
 
   slrn = callPackage ../applications/networking/newsreaders/slrn { };
 
+  spideroak = callPackage ../applications/networking/spideroak { };
+
   ssvnc = callPackage ../applications/networking/remote/ssvnc { };
 
   st = callPackage ../applications/misc/st {
@@ -9831,6 +9812,8 @@ let
     flags = [ "python" "X11" ]; # only flag "X11" by now
   });
 
+  vimpc = callPackage ../applications/audio/vimpc { };
+
   virtviewer = callPackage ../applications/virtualization/virt-viewer {
     gtkvnc = gtkvnc.override { enableGTK3 = true; };
     spice_gtk = spice_gtk.override { enableGTK3 = true; };
@@ -10074,6 +10057,8 @@ let
 
   zathura = zathuraCollection.zathuraWrapper;
 
+  zed = callPackage ../applications/editors/zed { };
+
   zeroc_ice = callPackage ../development/libraries/zeroc-ice { };
 
   girara = callPackage ../applications/misc/girara {
@@ -10168,10 +10153,7 @@ let
 
   egoboo = callPackage ../games/egoboo { };
 
-  exult = callPackage ../games/exult {
-    stdenv = overrideGCC stdenv gcc42;
-    libpng = libpng12;
-  };
+  exult = callPackage ../games/exult { };
 
   flightgear = callPackage ../games/flightgear { };
 
@@ -10543,7 +10525,7 @@ let
 
       kdeconnect = callPackage ../applications/misc/kdeconnect { };
 
-      kdenlive = callPackage ../applications/video/kdenlive { };
+      kdenlive = callPackage ../applications/video/kdenlive { mlt = mlt-qt4; };
 
       kdesvn = callPackage ../applications/version-management/kdesvn { };
 
@@ -10677,7 +10659,6 @@ let
 
   arb = callPackage ../applications/science/biology/arb {
     lesstif = lesstif93;
-    stdenv = overrideGCC stdenv gcc42;
   };
 
   archimedes = callPackage ../applications/science/electronics/archimedes { };
@@ -11035,9 +11016,9 @@ let
   hplipWithPlugin = hplip.override { withPlugin = true; };
 
   # using the new configuration style proposal which is unstable
-  jack1d = callPackage ../misc/jackaudio/jack1.nix { };
+  jack1 = callPackage ../misc/jackaudio/jack1.nix { };
 
-  jackaudio = callPackage ../misc/jackaudio { };
+  jack2 = callPackage ../misc/jackaudio { };
 
   keynav = callPackage ../tools/X11/keynav { };
 
@@ -11356,6 +11337,8 @@ let
 
   zsnes = callPackage_i686 ../misc/emulators/zsnes { };
 
+  snes9x-gtk = callPackage ../misc/emulators/snes9x-gtk { };
+
   misc = import ../misc/misc.nix { inherit pkgs stdenv; };
 
   bullet = callPackage ../development/libraries/bullet {};
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index b10ec37efbf9..2e587dbf9ab6 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -1048,8 +1048,6 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
 
   hasteCompiler = callPackage ../development/libraries/haskell/haste-compiler {};
 
-  hastePerch = callPackage ../development/libraries/haskell/haste-perch {};
-
   hcltest = callPackage ../development/libraries/haskell/hcltest {};
 
   hedis = callPackage ../development/libraries/haskell/hedis {};
@@ -1260,6 +1258,8 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
   HUnit_1_2_5_2 = callPackage ../development/libraries/haskell/HUnit/1.2.5.2.nix {};
   HUnit = self.HUnit_1_2_5_2;
 
+  HUnitApprox = callPackage ../development/libraries/haskell/HUnit-approx {};
+
   hweblib = callPackage ../development/libraries/haskell/hweblib/default.nix {};
 
   hxt = callPackage ../development/libraries/haskell/hxt {};
@@ -1745,9 +1745,8 @@ self : let callPackage = x : y : modifyPrio (newScope self x y); in
   parsec = self.parsec_3_1_5;
 
   parsers_0_10_3 = callPackage ../development/libraries/haskell/parsers/0.10.3.nix {};
-  parsers_0_11_0_3 = callPackage ../development/libraries/haskell/parsers/0.11.0.3.nix {};
   parsers_0_12 = callPackage ../development/libraries/haskell/parsers/0.12.nix {};
-  parsers = self.parsers_0_11_0_3; # the new version breaks trifecta
+  parsers = self.parsers_0_12;
 
   parsimony = callPackage ../development/libraries/haskell/parsimony {};
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index bb8256cce2e5..b2f3aca49cc5 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -2654,7 +2654,7 @@ rec {
       sed -i "/use_setuptools/d" setup.py
     '';
 
-    buildInputs = [ pkgs.alsaLib pkgs.jackaudio ];
+    buildInputs = [ pkgs.alsaLib pkgs.jack2 ];
 
     meta = with stdenv.lib; {
       description = "A Python wrapper for the RtMidi C++ library written with Cython";
@@ -4606,6 +4606,23 @@ rec {
   });
 
 
+  nbxmpp = buildPythonPackage rec {
+    name = "nbxmpp-0.5";
+
+    src = fetchurl {
+      name = "${name}.tar.gz";
+      url = "https://python-nbxmpp.gajim.org/downloads/5";
+      sha256 = "0y270c9v4i9n58p4ghlm18h50qcfichmfkgcpqd3bypx4fkmdx90";
+    };
+
+    meta = {
+      homepage = "https://python-nbxmpp.gajim.org/";
+      description = "Non-blocking Jabber/XMPP module";
+      license = stdenv.lib.licenses.gpl3;
+    };
+  };
+
+
   netaddr = buildPythonPackage rec {
     name = "netaddr-0.7.5";
 
@@ -5217,6 +5234,28 @@ rec {
     };
   };
 
+  pbr = buildPythonPackage rec {
+    name = "pbr-0.9.0";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/p/pbr/${name}.tar.gz";
+      sha256 = "e5a57c434b1faa509a00bf458d2c7af965199d9cced3d05a547bff9880f7e8cb";
+    };
+
+    # pip depend on $HOME setting
+    preConfigure = "export HOME=$TMPDIR";
+
+    doCheck = false;
+
+    buildInputs = [ pip ];
+
+    meta = {
+      description = "Python Build Reasonableness";
+      homepage = "http://docs.openstack.org/developer/pbr/";
+      license = licenses.asl20;
+    };
+  };
+
   pep8 = buildPythonPackage rec {
     name = "pep8-${version}";
     version = "1.5.7";
@@ -7135,6 +7174,23 @@ rec {
     };
   };
 
+  stevedore = buildPythonPackage rec {
+    name = "stevedore-0.15";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/s/stevedore/${name}.tar.gz";
+      sha256 = "bec9269cbfa58de4f0849ec79bb7d54eeeed9df8b5fbfa1637fbc68062822847";
+    };
+
+    buildInputs = [ pbr pip ];
+
+    meta = {
+      description = "Manage dynamic plugins for Python applications";
+      homepage = "https://pypi.python.org/pypi/stevedore";
+      license = licenses.asl20;
+    };
+  };
+
   pydns = buildPythonPackage rec {
     name = "pydns-2.3.6";
 
@@ -8093,6 +8149,32 @@ rec {
     };
   };
 
+  virtualenvwrapper = buildPythonPackage (rec {
+    name = "virtualenvwrapper-4.3";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/v/virtualenvwrapper/${name}.tar.gz";
+      sha256 = "514cbc22218347bf7b54bdbe49e1a5f550d2d53b1ad2491c10e91ddf48fb528f";
+    };
+
+    # pip depend on $HOME setting
+    preConfigure = "export HOME=$TMPDIR";
+
+    buildInputs = [ pbr pip pkgs.which ];
+    propagatedBuildInputs = [ stevedore virtualenv virtualenv-clone ];
+
+    patchPhase = ''
+      substituteInPlace "virtualenvwrapper.sh" --replace "which" "${pkgs.which}/bin/which"
+      substituteInPlace "virtualenvwrapper_lazy.sh" --replace "which" "${pkgs.which}/bin/which"
+    '';
+
+    meta = {
+      description = "Enhancements to virtualenv";
+      homepage = "https://pypi.python.org/pypi/virtualenvwrapper";
+      license = licenses.mit;
+    };
+  });
+
   waitress = buildPythonPackage rec {
     name = "waitress-0.8.7";
 
diff --git a/pkgs/top-level/release-small.nix b/pkgs/top-level/release-small.nix
index df0480bf82cb..341f12cbe474 100644
--- a/pkgs/top-level/release-small.nix
+++ b/pkgs/top-level/release-small.nix
@@ -48,7 +48,6 @@ with import ./release-lib.nix { inherit supportedSystems; };
   gcc = all;
   gcc33 = linux;
   gcc34 = linux;
-  gcc42 = linux;
   gcc44 = linux;
   gcj = linux;
   ghdl = linux;
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 56cc49abac63..fd94b405f6e4 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -98,7 +98,6 @@ let
       drgeo = linux;
       ejabberd = linux;
       elinks = linux;
-      emacs23 = gtkSupported;
       enscript = all;
       eprover = linux;
       evince = linux;
@@ -116,7 +115,6 @@ let
       gcc = linux;
       gcc33 = linux;
       gcc34 = linux;
-      gcc42 = linux;
       gcc44 = linux;
       gcj = linux;
       ghdl = linux;
@@ -342,17 +340,6 @@ let
       zsh = linux;
       zsnes = ["i686-linux"];
 
-      emacs23Packages = {
-        bbdb = linux;
-        cedet = linux;
-        emacsw3m = linux;
-        emms = linux;
-        jdee = linux;
-      };
-
-      firefox36Pkgs.firefox = linux;
-      firefoxPkgs.firefox = linux;
-
       gnome = {
         gnome_panel = linux;
         metacity = linux;