summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-09-24 18:54:31 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-09-24 18:54:31 +0200
commitfffc7638cda106c4864e0b986ff498b4f939a847 (patch)
tree12b83c1bc7d39a65df8dbff46390c8465347f202 /pkgs/development
parentd2965a7d85f7ce3f5ce265ca8dc3b73feaae226f (diff)
parente2a9617185321c38482cab343e5d4a6a182b7ce9 (diff)
downloadnixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar
nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.gz
nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.bz2
nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.lz
nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.xz
nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.tar.zst
nixlib-fffc7638cda106c4864e0b986ff498b4f939a847.zip
Merge branch 'master' into staging
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/as31/default.nix11
-rw-r--r--pkgs/development/compilers/ghdl/default.nix31
-rw-r--r--pkgs/development/compilers/mlton/default.nix2
-rw-r--r--pkgs/development/compilers/ocaml/4.01.0.nix85
-rw-r--r--pkgs/development/compilers/ocaml/4.02.nix83
-rw-r--r--pkgs/development/compilers/ocaml/4.03.nix6
-rw-r--r--pkgs/development/compilers/ocaml/generic.nix89
-rw-r--r--pkgs/development/compilers/openjdk/7.nix16
-rw-r--r--pkgs/development/interpreters/erlang/R19.nix13
-rw-r--r--pkgs/development/interpreters/php/default.nix4
-rw-r--r--pkgs/development/libraries/appstream-glib/default.nix8
-rw-r--r--pkgs/development/libraries/botan/unstable.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg/2.8.nix4
-rw-r--r--pkgs/development/libraries/jansson/default.nix4
-rw-r--r--pkgs/development/libraries/libxmlxx/default.nix10
-rw-r--r--pkgs/development/libraries/mesa/symlink-drivers.patch59
-rw-r--r--pkgs/development/libraries/openssl/1.0.1-CVE-2016-2177.diff256
-rw-r--r--pkgs/development/libraries/openssl/1.0.2-CVE-2016-2177.diff279
-rw-r--r--pkgs/development/libraries/openssl/default.nix20
-rw-r--r--pkgs/development/libraries/rabbitmq-c/0.4.nix21
-rw-r--r--pkgs/development/libraries/strigi/default.nix11
-rw-r--r--pkgs/development/libraries/webkitgtk/2.10.nix86
-rw-r--r--pkgs/development/libraries/webkitgtk/2.14.nix63
-rw-r--r--pkgs/development/node-packages/README.md6
-rw-r--r--pkgs/development/ocaml-modules/async/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/async_extra/default.nix10
-rw-r--r--pkgs/development/ocaml-modules/async_find/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/async_kernel/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/async_shell/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/async_ssl/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/async_unix/default.nix10
-rw-r--r--pkgs/development/ocaml-modules/cohttp/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/conduit/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/core/default.nix12
-rw-r--r--pkgs/development/ocaml-modules/core_extended/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/core_kernel/default.nix12
-rw-r--r--pkgs/development/ocaml-modules/cstruct/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/custom_printf/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/ezjsonm/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/frontc/default.nix35
-rw-r--r--pkgs/development/ocaml-modules/ipaddr/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/janestreet/async-extra.nix17
-rw-r--r--pkgs/development/ocaml-modules/janestreet/async-kernel.nix16
-rw-r--r--pkgs/development/ocaml-modules/janestreet/async-rpc-kernel.nix18
-rw-r--r--pkgs/development/ocaml-modules/janestreet/async-unix.nix17
-rw-r--r--pkgs/development/ocaml-modules/janestreet/async.nix16
-rw-r--r--pkgs/development/ocaml-modules/janestreet/bin_prot.nix17
-rw-r--r--pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix35
-rw-r--r--pkgs/development/ocaml-modules/janestreet/core-extended.nix22
-rw-r--r--pkgs/development/ocaml-modules/janestreet/core.nix20
-rw-r--r--pkgs/development/ocaml-modules/janestreet/core_kernel.nix19
-rw-r--r--pkgs/development/ocaml-modules/janestreet/fieldslib.nix19
-rw-r--r--pkgs/development/ocaml-modules/janestreet/js-build-tools-darwin.patch11
-rw-r--r--pkgs/development/ocaml-modules/janestreet/js-build-tools.nix29
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-assert.nix16
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-bench.nix18
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-compare.nix15
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-core.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix15
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-driver.nix15
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-expect.nix19
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-fail.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-here.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-jane.nix22
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-let.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix15
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-type-conv.nix15
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix14
-rw-r--r--pkgs/development/ocaml-modules/janestreet/re2.nix20
-rw-r--r--pkgs/development/ocaml-modules/janestreet/sexplib.nix18
-rw-r--r--pkgs/development/ocaml-modules/janestreet/textutils.nix18
-rw-r--r--pkgs/development/ocaml-modules/janestreet/typerep.nix20
-rw-r--r--pkgs/development/ocaml-modules/janestreet/variantslib.nix19
-rw-r--r--pkgs/development/ocaml-modules/pa_test/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/ppx_deriving/default.nix28
-rw-r--r--pkgs/development/ocaml-modules/ppx_tools/default.nix43
-rw-r--r--pkgs/development/ocaml-modules/re2/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/textutils/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/uri/default.nix4
-rw-r--r--pkgs/development/perl-modules/WWW-Curl-4.17-Skip-preprocessor-symbol-only-CURL_STRICTER.patch34
-rw-r--r--pkgs/development/ruby-modules/bundler/default.nix4
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix8
-rw-r--r--pkgs/development/ruby-modules/gem/nix-bundle-install.rb5
-rw-r--r--pkgs/development/tools/build-managers/bazel/default.nix19
-rw-r--r--pkgs/development/tools/build-managers/gradle/default.nix10
-rw-r--r--pkgs/development/tools/glide/default.nix16
-rw-r--r--pkgs/development/tools/misc/ccache/default.nix52
-rw-r--r--pkgs/development/tools/misc/cscope/default.nix25
-rw-r--r--pkgs/development/tools/misc/patchelf/unstable.nix26
-rw-r--r--pkgs/development/tools/ocaml/camlp4/4_03.nix45
-rw-r--r--pkgs/development/tools/ocaml/merlin/default.nix16
-rw-r--r--pkgs/development/tools/ocaml/ocamlbuild/default.nix42
-rw-r--r--pkgs/development/tools/ocaml/ocp-build/default.nix21
-rw-r--r--pkgs/development/tools/ocaml/ocp-index/default.nix33
103 files changed, 1421 insertions, 1037 deletions
diff --git a/pkgs/development/compilers/as31/default.nix b/pkgs/development/compilers/as31/default.nix
index 4db3b1b5a8de..fa34b3afe51b 100644
--- a/pkgs/development/compilers/as31/default.nix
+++ b/pkgs/development/compilers/as31/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, yacc }:
+{ stdenv, fetchpatch, fetchurl, yacc }:
 
 let
 
@@ -14,6 +14,15 @@ in stdenv.mkDerivation {
 
   buildInputs = [ yacc ];
 
+  patches = [
+    # CVE-2012-0808
+    (fetchpatch {
+       name = "as31-mkstemps.patch";
+       url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=655496;filename=as31-mkstemps.patch;msg=5";
+       sha256 = "0iia4wa8m141bwz4588yxb1dp2qwhapcii382sncm6jvwyngwh21";
+     })
+  ];
+
   preConfigure = ''
     chmod +x ./configure
   '';
diff --git a/pkgs/development/compilers/ghdl/default.nix b/pkgs/development/compilers/ghdl/default.nix
index d8b0598e2783..ff772864e625 100644
--- a/pkgs/development/compilers/ghdl/default.nix
+++ b/pkgs/development/compilers/ghdl/default.nix
@@ -1,16 +1,28 @@
-{ stdenv, fetchurl, gnat, zlib }:
+{ stdenv, fetchFromGitHub, gnat, zlib, llvm_35, ncurses, clang, flavour ? "mcode" }:
+
+# mcode only works on x86, while the llvm flavour works on both x86 and x86_64.
+
+
+assert flavour == "llvm" || flavour == "mcode";
+
 let
+  inherit (stdenv.lib) optional;
+  inherit (stdenv.lib) optionals;
   version = "0.33";
 in
 stdenv.mkDerivation rec {
-  name = "ghdl-mcode-${version}";
+  name = "ghdl-${flavour}-${version}";
 
-  src = fetchurl {
-    url = "https://github.com/tgingold/ghdl/archive/v${version}.tar.gz";
-    sha256 = "09yvgqyglbakd74v2dgr470clzm744i232nixyffcds55vkij5da";
+  src = fetchFromGitHub {
+    owner = "tgingold";
+    repo = "ghdl";
+    rev = "v${version}";
+    sha256 = "0g72rk2yzr0lrpncq2c1qcv71w3mi2hjq84r1yzgjr6d0qm87r2a";
   };
 
-  buildInputs = [ gnat zlib ];
+  buildInputs = [ gnat zlib ] ++ optionals (flavour == "llvm") [ clang ncurses ];
+
+  configureFlags = optional (flavour == "llvm") "--with-llvm=${llvm_35}";
 
   patchPhase = ''
     # Disable warnings-as-errors, because there are warnings (unused things)
@@ -23,11 +35,10 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://sourceforge.net/p/ghdl-updates/wiki/Home/";
-    description = "Free VHDL simulator, mcode flavour";
+    description = "Free VHDL simulator";
     maintainers = with stdenv.lib.maintainers; [viric];
-    # I think that mcode can only generate x86 code,
-    # so it fails to link pieces on x86_64.
-    platforms = with stdenv.lib.platforms; [ "i686-linux" ];
+    platforms = with stdenv.lib.platforms; (if flavour == "llvm" then [ "i686-linux" "x86_64-linux" ]
+      else [ "i686-linux" ]);
     license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix
index 2a72387028d2..9c5ce109b86b 100644
--- a/pkgs/development/compilers/mlton/default.nix
+++ b/pkgs/development/compilers/mlton/default.nix
@@ -61,6 +61,8 @@ stdenv.mkDerivation rec {
     done
 
     substituteInPlace $(pwd)/../${usr_prefix}/bin/mlton --replace '/${usr_prefix}/lib/mlton' $(pwd)/../${usr_prefix}/lib/mlton
+  '' + stdenv.lib.optionalString stdenv.cc.isClang ''
+    sed -i "s_	patch -s -p0 <gdtoa.hide-public-fns.patch_	patch -s -p0 <gdtoa.hide-public-fns.patch\n\tsed -i 's|printf(emptyfmt|printf(\"\"|g' ./gdtoa/arithchk.c_" ./runtime/Makefile
   '';
 
   preBuild = ''
diff --git a/pkgs/development/compilers/ocaml/4.01.0.nix b/pkgs/development/compilers/ocaml/4.01.0.nix
index 1d323ec0cba6..aa6cf68d2c96 100644
--- a/pkgs/development/compilers/ocaml/4.01.0.nix
+++ b/pkgs/development/compilers/ocaml/4.01.0.nix
@@ -1,82 +1,7 @@
-let
-  safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
-in
-
-{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }:
-
-if useX11 && !(safeX11 stdenv)
-  then throw "x11 not available in ocaml with arm or mips arch"
-  else # let the indentation flow
-
-let
-   useNativeCompilers = !stdenv.isMips;
-   inherit (stdenv.lib) optionals optionalString;
-in
-
-stdenv.mkDerivation rec {
-
-  x11env = buildEnv { name = "x11env"; paths = [libX11 xproto]; };
-  x11lib = x11env + "/lib";
-  x11inc = x11env + "/include";
-
-  name = "ocaml-4.01.0";
-
-  src = fetchurl {
-    url = "http://caml.inria.fr/pub/distrib/ocaml-4.01/${name}.tar.bz2";
-    sha256 = "b1ca708994180236917ae79e17606da5bd334ca6acd6873a550027e1c0ec874a";
-  };
-
+import ./generic.nix rec {
+  major_version = "4";
+  minor_version = "01";
+  patch_version = "0";
   patches = [ ./fix-clang-build-on-osx.diff ];
-
-  prefixKey = "-prefix ";
-  configureFlags = ["-no-tk"] ++ optionals useX11 [ "-x11lib" x11lib
-                                                    "-x11include" x11inc ];
-
-  buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
-  buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
-  installTargets = "install" + optionalString useNativeCompilers " installopt";
-  preConfigure = ''
-    CAT=$(type -tp cat)
-    sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
-  '';
-  postBuild = ''
-    mkdir -p $out/include
-    ln -sv $out/lib/ocaml/caml $out/include/caml
-  '';
-
-  passthru = {
-    nativeCompilers = useNativeCompilers;
-  };
-
-  meta = with stdenv.lib; {
-    homepage = http://caml.inria.fr/ocaml;
-    branch = "4.01";
-    license = with licenses; [
-      qpl /* compiler */
-      lgpl2 /* library */
-    ];
-    description = "Most popular variant of the Caml language";
-
-    longDescription =
-      ''
-        OCaml is the most popular variant of the Caml language.  From a
-        language standpoint, it extends the core Caml language with a
-        fully-fledged object-oriented layer, as well as a powerful module
-        system, all connected by a sound, polymorphic type system featuring
-        type inference.
-
-        The OCaml system is an industrial-strength implementation of this
-        language, featuring a high-performance native-code compiler (ocamlopt)
-        for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
-        Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
-        and an interactive read-eval-print loop (ocaml) for quick development
-        and portability.  The OCaml distribution includes a comprehensive
-        standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
-        parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
-        and a documentation generator (ocamldoc).
-      '';
-
-    platforms = with platforms; linux ++ darwin;
-  };
-
+  sha256 = "03d7ida94s1gpr3gadf4jyhmh5rrszd5s4m4z59daaib25rvfyv7";
 }
diff --git a/pkgs/development/compilers/ocaml/4.02.nix b/pkgs/development/compilers/ocaml/4.02.nix
index 91b543151e33..9ac53f567909 100644
--- a/pkgs/development/compilers/ocaml/4.02.nix
+++ b/pkgs/development/compilers/ocaml/4.02.nix
@@ -1,80 +1,7 @@
-let
-  safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
-in
-
-{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }:
-
-assert useX11 -> !stdenv.isArm && !stdenv.isMips;
-
-let
-   useNativeCompilers = !stdenv.isMips;
-   inherit (stdenv.lib) optionals optionalString;
-in
-
-stdenv.mkDerivation rec {
-
-  x11env = buildEnv { name = "x11env"; paths = [libX11 xproto]; };
-  x11lib = x11env + "/lib";
-  x11inc = x11env + "/include";
-
-  name = "ocaml-4.02.3";
-
-  src = fetchurl {
-    url = "http://caml.inria.fr/pub/distrib/ocaml-4.02/${name}.tar.xz";
-    sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3";
-  };
-
+import ./generic.nix rec {
+  major_version = "4";
+  minor_version = "02";
+  patch_version = "3";
   patches = [ ./ocamlbuild.patch ];
-
-  prefixKey = "-prefix ";
-  configureFlags = optionals useX11 [ "-x11lib" x11lib
-                                      "-x11include" x11inc ];
-
-  buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
-  buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
-  installTargets = "install" + optionalString useNativeCompilers " installopt";
-  preConfigure = ''
-    CAT=$(type -tp cat)
-    sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
-  '';
-  postBuild = ''
-    mkdir -p $out/include
-    ln -sv $out/lib/ocaml/caml $out/include/caml
-  '';
-
-  passthru = {
-    nativeCompilers = useNativeCompilers;
-  };
-
-  meta = with stdenv.lib; {
-    homepage = http://caml.inria.fr/ocaml;
-    branch = "4.02";
-    license = with licenses; [
-      qpl /* compiler */
-      lgpl2 /* library */
-    ];
-    description = "Most popular variant of the Caml language";
-
-    longDescription =
-      ''
-        OCaml is the most popular variant of the Caml language.  From a
-        language standpoint, it extends the core Caml language with a
-        fully-fledged object-oriented layer, as well as a powerful module
-        system, all connected by a sound, polymorphic type system featuring
-        type inference.
-
-        The OCaml system is an industrial-strength implementation of this
-        language, featuring a high-performance native-code compiler (ocamlopt)
-        for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
-        Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
-        and an interactive read-eval-print loop (ocaml) for quick development
-        and portability.  The OCaml distribution includes a comprehensive
-        standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
-        parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
-        and a documentation generator (ocamldoc).
-      '';
-
-    platforms = with platforms; linux ++ darwin;
-  };
-
+  sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3";
 }
diff --git a/pkgs/development/compilers/ocaml/4.03.nix b/pkgs/development/compilers/ocaml/4.03.nix
new file mode 100644
index 000000000000..c9536c487d05
--- /dev/null
+++ b/pkgs/development/compilers/ocaml/4.03.nix
@@ -0,0 +1,6 @@
+import ./generic.nix rec {
+  major_version = "4";
+  minor_version = "03";
+  patch_version = "0";
+  sha256 = "09p3iwwi55r6rbrpyp8f0wmkb0ppcgw67yxw6yfky60524wayp39";
+}
diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix
new file mode 100644
index 000000000000..f75d6384b905
--- /dev/null
+++ b/pkgs/development/compilers/ocaml/generic.nix
@@ -0,0 +1,89 @@
+{ minor_version, major_version, patch_version
+, url ? null
+, sha256, ...}@args:
+let
+  versionNoPatch = "${toString major_version}.${toString minor_version}";
+  version = "${versionNoPatch}.${toString patch_version}";
+  real_url = if url == null then
+    "http://caml.inria.fr/pub/distrib/ocaml-${versionNoPatch}/ocaml-${version}.tar.xz"
+  else url;
+  safeX11 = stdenv: !(stdenv.isArm || stdenv.isMips);
+in
+
+{ stdenv, fetchurl, ncurses, buildEnv, libX11, xproto, useX11 ? safeX11 stdenv }:
+
+assert useX11 -> !stdenv.isArm && !stdenv.isMips;
+
+let
+   useNativeCompilers = !stdenv.isMips;
+   inherit (stdenv.lib) optionals optionalString;
+   name = "ocaml-${version}";
+in
+
+stdenv.mkDerivation (args // rec {
+
+  x11env = buildEnv { name = "x11env"; paths = [libX11 xproto]; };
+  x11lib = x11env + "/lib";
+  x11inc = x11env + "/include";
+
+  inherit name;
+
+  src = fetchurl {
+    url = real_url;
+    inherit sha256;
+  };
+
+  prefixKey = "-prefix ";
+  configureFlags = optionals useX11 [ "-x11lib" x11lib
+                                      "-x11include" x11inc ];
+
+  buildFlags = "world" + optionalString useNativeCompilers " bootstrap world.opt";
+  buildInputs = [ncurses] ++ optionals useX11 [ libX11 xproto ];
+  installTargets = "install" + optionalString useNativeCompilers " installopt";
+  preConfigure = ''
+    CAT=$(type -tp cat)
+    sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
+  '';
+  postBuild = ''
+    mkdir -p $out/include
+    ln -sv $out/lib/ocaml/caml $out/include/caml
+  '';
+
+  passthru = {
+    nativeCompilers = useNativeCompilers;
+  };
+
+  meta = with stdenv.lib; {
+    homepage = http://caml.inria.fr/ocaml;
+    branch = "4.03";
+    license = with licenses; [
+      qpl /* compiler */
+      lgpl2 /* library */
+    ];
+    description = "Most popular variant of the Caml language";
+
+    longDescription =
+      ''
+        OCaml is the most popular variant of the Caml language.  From a
+        language standpoint, it extends the core Caml language with a
+        fully-fledged object-oriented layer, as well as a powerful module
+        system, all connected by a sound, polymorphic type system featuring
+        type inference.
+
+        The OCaml system is an industrial-strength implementation of this
+        language, featuring a high-performance native-code compiler (ocamlopt)
+        for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
+        Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
+        and an interactive read-eval-print loop (ocaml) for quick development
+        and portability.  The OCaml distribution includes a comprehensive
+        standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
+        parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
+        and a documentation generator (ocamldoc).
+      '';
+
+    platforms = with platforms; linux ++ darwin;
+  };
+
+})
+
+
diff --git a/pkgs/development/compilers/openjdk/7.nix b/pkgs/development/compilers/openjdk/7.nix
index e6186bc8f13c..6dcbb0a330f1 100644
--- a/pkgs/development/compilers/openjdk/7.nix
+++ b/pkgs/development/compilers/openjdk/7.nix
@@ -17,7 +17,7 @@ let
     else
       throw "openjdk requires i686-linux or x86_64 linux";
 
-  update = "91";
+  update = "111";
 
   build = "01";
 
@@ -28,31 +28,31 @@ let
   repover = "jdk7u${update}-b${build}";
   jdk7 = fetchurl {
     url = "${baseurl}/archive/${repover}.tar.gz";
-    sha256 = "08f7cbayyrryim3xbrs12cr12i1mczcikyc9rdlsyih0r4xvll28";
+    sha256 = "0wgb7hr2gipx1jg28fnsjh7xa744sh1mgr6z3xivmnsfy3dm91gi";
   };
   langtools = fetchurl {
     url = "${baseurl}/langtools/archive/${repover}.tar.gz";
-    sha256 = "0rmlzrgsacn60blpg1sp30k6p0sgzsml8wb41yc998km1bsnjxnh";
+    sha256 = "0x1xs923h6sma02cbp1whg735x8vcndh5k01b7rkf714g6rxwa0y";
   };
   hotspot = fetchurl {
     url = "${baseurl}/hotspot/archive/${repover}.tar.gz";
-    sha256 = "1w1n81y9jcvjzssl4049yzfc0gdfnh73ki6wg1d8pg22zlyhrrwv";
+    sha256 = "187apnsvnd4cfa7ss5g59dbh7x5ah8f1lwa2wvjfv055h2cmphpn";
   };
   corba = fetchurl {
     url = "${baseurl}/corba/archive/${repover}.tar.gz";
-    sha256 = "086yr927bxnlgljx7mw2cg6f6aip57hi4qpn1h35n6fsyvb4n67h";
+    sha256 = "0vmxf5sgjcmkm7i1scanaa2x75a1byj8b36vcajlr6j7qmdx6r8c";
   };
   jdk = fetchurl {
     url = "${baseurl}/jdk/archive/${repover}.tar.gz";
-    sha256 = "14r39ylj3qa63arpqxl0h84baah1kjgnyp3v9d7d4vd0yagpn66b";
+    sha256 = "1f8f2dgrjhx8aw1gzawrf8qggf5j0dygsla08bbsxhx5mc5a6cka";
   };
   jaxws = fetchurl {
     url = "${baseurl}/jaxws/archive/${repover}.tar.gz";
-    sha256 = "1p1739gb5gx9m4sm3i4javfk9lk41wnz92k6gis6sq99dd1bj1l5";
+    sha256 = "03982ajxm0hzany1jg009ym84vryx7a8qfi6wcgjxyxvk8vnz37c";
   };
   jaxp = fetchurl {
     url = "${baseurl}/jaxp/archive/${repover}.tar.gz";
-    sha256 = "1nl3kmbwqhhymcp25rnmf5mr3dn87lgdxvz9wgng7if6yqxlyakq";
+    sha256 = "0578h04y1ha60yjplsa8lqdjds9s2lxzgs9ybm9rs1rqzxmm0xmy";
   };
   openjdk = stdenv.mkDerivation rec {
     name = "openjdk-7u${update}b${build}";
diff --git a/pkgs/development/interpreters/erlang/R19.nix b/pkgs/development/interpreters/erlang/R19.nix
index 1cd68221fa70..ddeccb29b59d 100644
--- a/pkgs/development/interpreters/erlang/R19.nix
+++ b/pkgs/development/interpreters/erlang/R19.nix
@@ -20,7 +20,7 @@ with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "erlang-" + version + "${optionalString odbcSupport "-odbc"}"
   + "${optionalString javacSupport "-javac"}";
-  version = "19.0.2";
+  version = "19.1";
 
   # Minor OTP releases are not always released as tarbals at
   # http://erlang.org/download/ So we have to download from
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     owner = "erlang";
     repo = "otp";
     rev = "OTP-${version}";
-    sha256 = "1vsykghhzpgmc42jwj48crl11zzzpvrqvh2lk8lxfqbflzflxm6j";
+    sha256 = "0nnjj069d5pjhgcd8vvqbrkjdac3p1v4s3zb59i4h73vg7f5p736";
   };
 
   buildInputs =
@@ -42,15 +42,6 @@ stdenv.mkDerivation rec {
 
   debugInfo = enableDebugInfo;
 
-  envAndCpPatch = fetchurl {
-     url = "https://github.com/binarin/otp/commit/9f9841eb7327c9fe73e84e197fd2965a97b639cf.patch";
-     sha256 = "10h5348p6g279b4q01i5jdqlljww5chcvrx5b4b0dv79pk0p0m9f";
-  };
-
-  patches = [
-    envAndCpPatch
-  ];
-
   preConfigure = ''
     ./otp_build autoconf
   '';
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index 811b1a3817c3..7b816b49db53 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -300,8 +300,8 @@ let
 
 in {
   php56 = generic {
-    version = "5.6.25";
-    sha256 = "1pldn4z7pzcjm8li9xryrniz5cz542cbv4nlrr13wzzdmhr61kjq";
+    version = "5.6.26";
+    sha256 = "0dk2ifn50iv8jvw2jyw2pr9xqnkksxfv9qbpay84na54hf0anynl";
   };
 
   php70 = generic {
diff --git a/pkgs/development/libraries/appstream-glib/default.nix b/pkgs/development/libraries/appstream-glib/default.nix
index 8450def08452..caaa826ae67d 100644
--- a/pkgs/development/libraries/appstream-glib/default.nix
+++ b/pkgs/development/libraries/appstream-glib/default.nix
@@ -1,20 +1,20 @@
 { stdenv, fetchFromGitHub, pkgconfig, gettext, gtk3, intltool, glib
 , gtk_doc, autoconf, automake, libtool, libarchive, libyaml
 , gobjectIntrospection, sqlite, libsoup, gcab, attr, acl, docbook_xsl
-, libuuid, json_glib
+, libuuid, json_glib, autoconf-archive
 }:
 
 stdenv.mkDerivation rec {
-  name = "appstream-glib-0.5.12";
+  name = "appstream-glib-0.6.3";
 
   src = fetchFromGitHub {
     owner = "hughsie";
     repo = "appstream-glib";
     rev = stdenv.lib.replaceStrings ["." "-"] ["_" "_"] name;
-    sha256 = "00b0441f409vzgy0znn42k093w7hwv3495qvsakxnhvk1h1ws23s";
+    sha256 = "12l0vzhi9vpyrnf7vrpq21rb26mb6yskp5zgngdjyjanwhzmc617";
   };
 
-  nativeBuildInputs = [ autoconf automake libtool pkgconfig intltool ];
+  nativeBuildInputs = [ autoconf automake libtool pkgconfig intltool autoconf-archive ];
   buildInputs = [ glib gtk_doc gettext sqlite libsoup
                   gcab attr acl docbook_xsl libuuid json_glib
                   libarchive libyaml gtk3 gobjectIntrospection ];
diff --git a/pkgs/development/libraries/botan/unstable.nix b/pkgs/development/libraries/botan/unstable.nix
index 4e004da32175..170e7a757490 100644
--- a/pkgs/development/libraries/botan/unstable.nix
+++ b/pkgs/development/libraries/botan/unstable.nix
@@ -2,8 +2,8 @@
 
 callPackage ./generic.nix (args // {
   baseVersion = "1.11";
-  revision = "30";
-  sha256 = "09d1cvg6dnfi225wipc1fw691bq7xxdcmgkq8smldc5kivf3mbwd";
+  revision = "31";
+  sha256 = "1vnx75g5zzzbgsrwnmnhqdal29gcn63g0ldyj0g9cky8ha8iqx8f";
   openssl = null;
   postPatch = "sed '1i#include <cmath>' -i src/tests/test_bigint.cpp";
 })
diff --git a/pkgs/development/libraries/ffmpeg/2.8.nix b/pkgs/development/libraries/ffmpeg/2.8.nix
index 63e6ec2f6952..04336c9ee4d3 100644
--- a/pkgs/development/libraries/ffmpeg/2.8.nix
+++ b/pkgs/development/libraries/ffmpeg/2.8.nix
@@ -1,7 +1,7 @@
 { callPackage, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "${branch}.7";
+  version = "${branch}.8";
   branch = "2.8";
-  sha256 = "1rggcy8kflmlvdyf5yqv0zshycysyqz45fl06v8zsh2n6d5cwxw7";
+  sha256 = "19h6xmlcb933hgpfd40mjwkral8v389v25sx660a3p7aiyalh25p";
 })
diff --git a/pkgs/development/libraries/jansson/default.nix b/pkgs/development/libraries/jansson/default.nix
index f0f9cc65cb2b..a24005487bee 100644
--- a/pkgs/development/libraries/jansson/default.nix
+++ b/pkgs/development/libraries/jansson/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "jansson-2.7";
+  name = "jansson-2.8";
 
   src = fetchurl {
     url = "http://www.digip.org/jansson/releases/${name}.tar.gz";
-    sha256 = "1mvq9p85khsl818i4vbszyfab0fd45mdrwrxjkzw05mk1xcyc1br";
+    sha256 = "0v7v82mv7x44rpcxmrpnmb8hqimx67qwsp2cz9mv3y0f37iykwnf";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libxmlxx/default.nix b/pkgs/development/libraries/libxmlxx/default.nix
index 72afc1d55eb5..65e10c5a3995 100644
--- a/pkgs/development/libraries/libxmlxx/default.nix
+++ b/pkgs/development/libraries/libxmlxx/default.nix
@@ -1,11 +1,13 @@
 { stdenv, fetchurl, pkgconfig, libxml2, glibmm, perl }:
 
 stdenv.mkDerivation rec {
-  name = "libxml++-2.38.1";
+  name = "libxml++-${maj_ver}.${min_ver}";
+  maj_ver = "2.40";
+  min_ver = "1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/libxml++/2.38/${name}.tar.xz";
-    sha256 = "0px0ljcf9rsfa092dzmm097yn7wln6d5fgsvj9lnrnq3kcc2j9c8";
+    url = "mirror://gnome/sources/libxml++/${maj_ver}/${name}.tar.xz";
+    sha256 = "1sb3akryklvh2v6m6dihdnbpf1lkx441v972q9hlz1sq6bfspm2a";
   };
 
   nativeBuildInputs = [ pkgconfig perl ];
@@ -14,8 +16,6 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ libxml2 ];
 
-  configureFlags = "--disable-documentation"; #doesn't build without this for some reason
-
   meta = with stdenv.lib; {
     homepage = http://libxmlplusplus.sourceforge.net/;
     description = "C++ wrapper for the libxml2 XML parser library";
diff --git a/pkgs/development/libraries/mesa/symlink-drivers.patch b/pkgs/development/libraries/mesa/symlink-drivers.patch
index b96e8e0b816e..68c0f1da26b6 100644
--- a/pkgs/development/libraries/mesa/symlink-drivers.patch
+++ b/pkgs/development/libraries/mesa/symlink-drivers.patch
@@ -1,7 +1,7 @@
-diff -ru -x '*~' mesa-11.1.4-orig/src/gallium/targets/dri/Makefile.am mesa-11.1.4/src/gallium/targets/dri/Makefile.am
---- mesa-11.1.4-orig/src/gallium/targets/dri/Makefile.am	2016-05-09 14:20:52.000000000 +0200
-+++ mesa-11.1.4/src/gallium/targets/dri/Makefile.am	2016-05-22 17:56:03.396185082 +0200
-@@ -126,14 +126,13 @@
+diff -ru -x '*~' mesa-12.0.3-orig/src/gallium/targets/dri/Makefile.am mesa-12.0.3/src/gallium/targets/dri/Makefile.am
+--- mesa-12.0.3-orig/src/gallium/targets/dri/Makefile.am	2016-09-08 18:57:48.000000000 +0200
++++ mesa-12.0.3/src/gallium/targets/dri/Makefile.am	2016-09-22 14:42:19.173575498 +0200
+@@ -134,14 +134,13 @@
  	done;
  endif
  
@@ -19,9 +19,25 @@ diff -ru -x '*~' mesa-11.1.4-orig/src/gallium/targets/dri/Makefile.am mesa-11.1.
  
  uninstall-hook:
  	for i in $(TARGET_DRIVERS); do                                  \
-diff -ru -x '*~' mesa-11.1.4-orig/src/gallium/targets/vdpau/Makefile.am mesa-11.1.4/src/gallium/targets/vdpau/Makefile.am
---- mesa-11.1.4-orig/src/gallium/targets/vdpau/Makefile.am	2016-01-29 13:21:30.000000000 +0100
-+++ mesa-11.1.4/src/gallium/targets/vdpau/Makefile.am	2016-05-22 20:54:12.722358242 +0200
+diff -ru -x '*~' mesa-12.0.3-orig/src/gallium/targets/va/Makefile.am mesa-12.0.3/src/gallium/targets/va/Makefile.am
+--- mesa-12.0.3-orig/src/gallium/targets/va/Makefile.am	2016-09-08 18:57:48.000000000 +0200
++++ mesa-12.0.3/src/gallium/targets/va/Makefile.am	2016-09-22 14:45:39.635963339 +0200
+@@ -71,10 +71,10 @@
+ # gallium_drv_video.so in the set of final installed files.
+ install-data-hook:
+ 	for i in $(TARGET_DRIVERS); do                                  \
+-		ln -f $(DESTDIR)$(vadir)/gallium_drv_video.so                \
++		ln -srf $(DESTDIR)$(vadir)/gallium_drv_video.so                \
+ 		      $(DESTDIR)$(vadir)/$${i}_drv_video.so;                 \
+ 	done;                                                           \
+-	$(RM) $(DESTDIR)$(vadir)/gallium_drv_video.*
++	$(RM) $(DESTDIR)$(vadir)/gallium_drv_video.la
+ 
+ uninstall-hook:
+ 	for i in $(TARGET_DRIVERS); do                                  \
+diff -ru -x '*~' mesa-12.0.3-orig/src/gallium/targets/vdpau/Makefile.am mesa-12.0.3/src/gallium/targets/vdpau/Makefile.am
+--- mesa-12.0.3-orig/src/gallium/targets/vdpau/Makefile.am	2016-05-24 21:19:37.000000000 +0200
++++ mesa-12.0.3/src/gallium/targets/vdpau/Makefile.am	2016-09-22 14:42:19.173575498 +0200
 @@ -103,15 +103,14 @@
  	done;
  endif
@@ -49,10 +65,31 @@ diff -ru -x '*~' mesa-11.1.4-orig/src/gallium/targets/vdpau/Makefile.am mesa-11.
  
  uninstall-hook:
  	for i in $(TARGET_DRIVERS); do					\
-diff -ru -x '*~' mesa-11.1.4-orig/src/mesa/drivers/dri/Makefile.am mesa-11.1.4/src/mesa/drivers/dri/Makefile.am
---- mesa-11.1.4-orig/src/mesa/drivers/dri/Makefile.am	2016-01-18 08:39:26.000000000 +0100
-+++ mesa-11.1.4/src/mesa/drivers/dri/Makefile.am	2016-05-22 17:55:46.251244940 +0200
-@@ -86,14 +86,13 @@
+diff -ru -x '*~' mesa-12.0.3-orig/src/gallium/targets/xvmc/Makefile.am mesa-12.0.3/src/gallium/targets/xvmc/Makefile.am
+--- mesa-12.0.3-orig/src/gallium/targets/xvmc/Makefile.am	2016-05-24 21:19:37.000000000 +0200
++++ mesa-12.0.3/src/gallium/targets/xvmc/Makefile.am	2016-09-22 14:54:22.291014543 +0200
+@@ -73,7 +73,7 @@
+ 		j=libXvMCgallium.$(LIB_EXT);				\
+ 		k=libXvMC$${i}.$(LIB_EXT);				\
+ 		l=$${k}.$(XVMC_MAJOR).$(XVMC_MINOR).0;			\
+-		ln -f $${dest_dir}/$${j}.$(XVMC_MAJOR).$(XVMC_MINOR).0	\
++		ln -srf $${dest_dir}/$${j}.$(XVMC_MAJOR).$(XVMC_MINOR).0	\
+ 		      $${dest_dir}/$${l};				\
+ 		ln -sf $${l}						\
+ 		       $${dest_dir}/$${k}.$(XVMC_MAJOR).$(XVMC_MINOR);	\
+@@ -82,7 +82,7 @@
+ 		ln -sf $${l}						\
+ 		       $${dest_dir}/$${k};				\
+ 	done;								\
+-	$(RM) $${dest_dir}/libXvMCgallium.*
++	$(RM) $${dest_dir}/libXvMCgallium.la
+ 
+ uninstall-hook:
+ 	for i in $(TARGET_DRIVERS); do					\
+diff -ru -x '*~' mesa-12.0.3-orig/src/mesa/drivers/dri/Makefile.am mesa-12.0.3/src/mesa/drivers/dri/Makefile.am
+--- mesa-12.0.3-orig/src/mesa/drivers/dri/Makefile.am	2016-09-08 18:57:48.000000000 +0200
++++ mesa-12.0.3/src/mesa/drivers/dri/Makefile.am	2016-09-22 14:42:19.173575498 +0200
+@@ -94,14 +94,13 @@
  	done;
  endif
  
diff --git a/pkgs/development/libraries/openssl/1.0.1-CVE-2016-2177.diff b/pkgs/development/libraries/openssl/1.0.1-CVE-2016-2177.diff
deleted file mode 100644
index f8a4b7c22573..000000000000
--- a/pkgs/development/libraries/openssl/1.0.1-CVE-2016-2177.diff
+++ /dev/null
@@ -1,256 +0,0 @@
-From 6f35f6deb5ca7daebe289f86477e061ce3ee5f46 Mon Sep 17 00:00:00 2001
-From: Matt Caswell <matt@openssl.org>
-Date: Thu, 5 May 2016 11:10:26 +0100
-Subject: [PATCH] Avoid some undefined pointer arithmetic
-
-A common idiom in the codebase is:
-
-if (p + len > limit)
-{
-    return; /* Too long */
-}
-
-Where "p" points to some malloc'd data of SIZE bytes and
-limit == p + SIZE
-
-"len" here could be from some externally supplied data (e.g. from a TLS
-message).
-
-The rules of C pointer arithmetic are such that "p + len" is only well
-defined where len <= SIZE. Therefore the above idiom is actually
-undefined behaviour.
-
-For example this could cause problems if some malloc implementation
-provides an address for "p" such that "p + len" actually overflows for
-values of len that are too big and therefore p + len < limit!
-
-Issue reported by Guido Vranken.
-
-CVE-2016-2177
-
-Reviewed-by: Rich Salz <rsalz@openssl.org>
----
- ssl/s3_srvr.c  | 14 +++++++-------
- ssl/ssl_sess.c |  2 +-
- ssl/t1_lib.c   | 48 ++++++++++++++++++++++++++----------------------
- 3 files changed, 34 insertions(+), 30 deletions(-)
-
-diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
-index 04cf93a..6c74caa 100644
---- a/ssl/s3_srvr.c
-+++ b/ssl/s3_srvr.c
-@@ -1040,7 +1040,7 @@ int ssl3_get_client_hello(SSL *s)
- 
-         session_length = *(p + SSL3_RANDOM_SIZE);
- 
--        if (p + SSL3_RANDOM_SIZE + session_length + 1 >= d + n) {
-+        if (SSL3_RANDOM_SIZE + session_length + 1 >= (d + n) - p) {
-             al = SSL_AD_DECODE_ERROR;
-             SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-             goto f_err;
-@@ -1058,7 +1058,7 @@ int ssl3_get_client_hello(SSL *s)
-     /* get the session-id */
-     j = *(p++);
- 
--    if (p + j > d + n) {
-+    if ((d + n) - p < j) {
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-         goto f_err;
-@@ -1114,14 +1114,14 @@ int ssl3_get_client_hello(SSL *s)
- 
-     if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) {
-         /* cookie stuff */
--        if (p + 1 > d + n) {
-+        if ((d + n) - p < 1) {
-             al = SSL_AD_DECODE_ERROR;
-             SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-             goto f_err;
-         }
-         cookie_len = *(p++);
- 
--        if (p + cookie_len > d + n) {
-+        if ((d + n ) - p < cookie_len) {
-             al = SSL_AD_DECODE_ERROR;
-             SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-             goto f_err;
-@@ -1166,7 +1166,7 @@ int ssl3_get_client_hello(SSL *s)
-         p += cookie_len;
-     }
- 
--    if (p + 2 > d + n) {
-+    if ((d + n ) - p < 2) {
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-         goto f_err;
-@@ -1180,7 +1180,7 @@ int ssl3_get_client_hello(SSL *s)
-     }
- 
-     /* i bytes of cipher data + 1 byte for compression length later */
--    if ((p + i + 1) > (d + n)) {
-+    if ((d + n) - p < i + 1) {
-         /* not enough data */
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);
-@@ -1246,7 +1246,7 @@ int ssl3_get_client_hello(SSL *s)
- 
-     /* compression */
-     i = *(p++);
--    if ((p + i) > (d + n)) {
-+    if ((d + n) - p < i) {
-         /* not enough data */
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);
-diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
-index 48fc451..a97d060 100644
---- a/ssl/ssl_sess.c
-+++ b/ssl/ssl_sess.c
-@@ -602,7 +602,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len,
-     int r;
- #endif
- 
--    if (session_id + len > limit) {
-+    if (limit - session_id < len) {
-         fatal = 1;
-         goto err;
-     }
-diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
-index 0bdb77d..8ed1793 100644
---- a/ssl/t1_lib.c
-+++ b/ssl/t1_lib.c
-@@ -942,11 +942,11 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-         0x02, 0x03,             /* SHA-1/ECDSA */
-     };
- 
--    if (data >= (limit - 2))
-+    if (limit - data <= 2)
-         return;
-     data += 2;
- 
--    if (data > (limit - 4))
-+    if (limit - data < 4)
-         return;
-     n2s(data, type);
-     n2s(data, size);
-@@ -954,7 +954,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-     if (type != TLSEXT_TYPE_server_name)
-         return;
- 
--    if (data + size > limit)
-+    if (limit - data < size)
-         return;
-     data += size;
- 
-@@ -962,7 +962,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-         const size_t len1 = sizeof(kSafariExtensionsBlock);
-         const size_t len2 = sizeof(kSafariTLS12ExtensionsBlock);
- 
--        if (data + len1 + len2 != limit)
-+        if (limit - data != (int)(len1 + len2))
-             return;
-         if (memcmp(data, kSafariExtensionsBlock, len1) != 0)
-             return;
-@@ -971,7 +971,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-     } else {
-         const size_t len = sizeof(kSafariExtensionsBlock);
- 
--        if (data + len != limit)
-+        if (limit - data != (int)(len))
-             return;
-         if (memcmp(data, kSafariExtensionsBlock, len) != 0)
-             return;
-@@ -1019,19 +1019,19 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p,
-     if (data == limit)
-         goto ri_check;
- 
--    if (data > (limit - 2))
-+    if (limit - data < 2)
-         goto err;
- 
-     n2s(data, len);
- 
--    if (data + len != limit)
-+    if (limit - data != len)
-         goto err;
- 
--    while (data <= (limit - 4)) {
-+    while (limit - data >= 4) {
-         n2s(data, type);
-         n2s(data, size);
- 
--        if (data + size > (limit))
-+        if (limit - data < size)
-             goto err;
- # if 0
-         fprintf(stderr, "Received extension type %d size %d\n", type, size);
-@@ -1460,20 +1460,20 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
-                              SSL_TLSEXT_HB_DONT_SEND_REQUESTS);
- # endif
- 
--    if (data >= (d + n - 2))
-+    if ((d + n) - data <= 2)
-         goto ri_check;
- 
-     n2s(data, length);
--    if (data + length != d + n) {
-+    if ((d + n) - data != length) {
-         *al = SSL_AD_DECODE_ERROR;
-         return 0;
-     }
- 
--    while (data <= (d + n - 4)) {
-+    while ((d + n) - data >= 4) {
-         n2s(data, type);
-         n2s(data, size);
- 
--        if (data + size > (d + n))
-+        if ((d + n) - data < size)
-             goto ri_check;
- 
-         if (s->tlsext_debug_cb)
-@@ -2179,29 +2179,33 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len,
-     /* Skip past DTLS cookie */
-     if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) {
-         i = *(p++);
--        p += i;
--        if (p >= limit)
-+
-+        if (limit - p <= i)
-             return -1;
-+
-+        p += i;
-     }
-     /* Skip past cipher list */
-     n2s(p, i);
--    p += i;
--    if (p >= limit)
-+    if (limit - p <= i)
-         return -1;
-+    p += i;
-+
-     /* Skip past compression algorithm list */
-     i = *(p++);
--    p += i;
--    if (p > limit)
-+    if (limit - p < i)
-         return -1;
-+    p += i;
-+
-     /* Now at start of extensions */
--    if ((p + 2) >= limit)
-+    if (limit - p <= 2)
-         return 0;
-     n2s(p, i);
--    while ((p + 4) <= limit) {
-+    while (limit - p >= 4) {
-         unsigned short type, size;
-         n2s(p, type);
-         n2s(p, size);
--        if (p + size > limit)
-+        if (limit - p < size)
-             return 0;
-         if (type == TLSEXT_TYPE_session_ticket) {
-             int r;
--- 
-1.9.1
-
diff --git a/pkgs/development/libraries/openssl/1.0.2-CVE-2016-2177.diff b/pkgs/development/libraries/openssl/1.0.2-CVE-2016-2177.diff
deleted file mode 100644
index ca934c20a674..000000000000
--- a/pkgs/development/libraries/openssl/1.0.2-CVE-2016-2177.diff
+++ /dev/null
@@ -1,279 +0,0 @@
-From a004e72b95835136d3f1ea90517f706c24c03da7 Mon Sep 17 00:00:00 2001
-From: Matt Caswell <matt@openssl.org>
-Date: Thu, 5 May 2016 11:10:26 +0100
-Subject: [PATCH] Avoid some undefined pointer arithmetic
-
-A common idiom in the codebase is:
-
-if (p + len > limit)
-{
-    return; /* Too long */
-}
-
-Where "p" points to some malloc'd data of SIZE bytes and
-limit == p + SIZE
-
-"len" here could be from some externally supplied data (e.g. from a TLS
-message).
-
-The rules of C pointer arithmetic are such that "p + len" is only well
-defined where len <= SIZE. Therefore the above idiom is actually
-undefined behaviour.
-
-For example this could cause problems if some malloc implementation
-provides an address for "p" such that "p + len" actually overflows for
-values of len that are too big and therefore p + len < limit!
-
-Issue reported by Guido Vranken.
-
-CVE-2016-2177
-
-Reviewed-by: Rich Salz <rsalz@openssl.org>
----
- ssl/s3_srvr.c  | 14 +++++++-------
- ssl/ssl_sess.c |  2 +-
- ssl/t1_lib.c   | 56 ++++++++++++++++++++++++++++++--------------------------
- 3 files changed, 38 insertions(+), 34 deletions(-)
-
-diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
-index ab28702..ab7f690 100644
---- a/ssl/s3_srvr.c
-+++ b/ssl/s3_srvr.c
-@@ -980,7 +980,7 @@ int ssl3_get_client_hello(SSL *s)
- 
-         session_length = *(p + SSL3_RANDOM_SIZE);
- 
--        if (p + SSL3_RANDOM_SIZE + session_length + 1 >= d + n) {
-+        if (SSL3_RANDOM_SIZE + session_length + 1 >= (d + n) - p) {
-             al = SSL_AD_DECODE_ERROR;
-             SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-             goto f_err;
-@@ -998,7 +998,7 @@ int ssl3_get_client_hello(SSL *s)
-     /* get the session-id */
-     j = *(p++);
- 
--    if (p + j > d + n) {
-+    if ((d + n) - p < j) {
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-         goto f_err;
-@@ -1054,14 +1054,14 @@ int ssl3_get_client_hello(SSL *s)
- 
-     if (SSL_IS_DTLS(s)) {
-         /* cookie stuff */
--        if (p + 1 > d + n) {
-+        if ((d + n) - p < 1) {
-             al = SSL_AD_DECODE_ERROR;
-             SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-             goto f_err;
-         }
-         cookie_len = *(p++);
- 
--        if (p + cookie_len > d + n) {
-+        if ((d + n ) - p < cookie_len) {
-             al = SSL_AD_DECODE_ERROR;
-             SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-             goto f_err;
-@@ -1131,7 +1131,7 @@ int ssl3_get_client_hello(SSL *s)
-         }
-     }
- 
--    if (p + 2 > d + n) {
-+    if ((d + n ) - p < 2) {
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT);
-         goto f_err;
-@@ -1145,7 +1145,7 @@ int ssl3_get_client_hello(SSL *s)
-     }
- 
-     /* i bytes of cipher data + 1 byte for compression length later */
--    if ((p + i + 1) > (d + n)) {
-+    if ((d + n) - p < i + 1) {
-         /* not enough data */
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);
-@@ -1211,7 +1211,7 @@ int ssl3_get_client_hello(SSL *s)
- 
-     /* compression */
-     i = *(p++);
--    if ((p + i) > (d + n)) {
-+    if ((d + n) - p < i) {
-         /* not enough data */
-         al = SSL_AD_DECODE_ERROR;
-         SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH);
-diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
-index b182998..54ee783 100644
---- a/ssl/ssl_sess.c
-+++ b/ssl/ssl_sess.c
-@@ -573,7 +573,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len,
-     int r;
- #endif
- 
--    if (session_id + len > limit) {
-+    if (limit - session_id < len) {
-         fatal = 1;
-         goto err;
-     }
-diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
-index fb64607..cdac011 100644
---- a/ssl/t1_lib.c
-+++ b/ssl/t1_lib.c
-@@ -1867,11 +1867,11 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-         0x02, 0x03,             /* SHA-1/ECDSA */
-     };
- 
--    if (data >= (limit - 2))
-+    if (limit - data <= 2)
-         return;
-     data += 2;
- 
--    if (data > (limit - 4))
-+    if (limit - data < 4)
-         return;
-     n2s(data, type);
-     n2s(data, size);
-@@ -1879,7 +1879,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-     if (type != TLSEXT_TYPE_server_name)
-         return;
- 
--    if (data + size > limit)
-+    if (limit - data < size)
-         return;
-     data += size;
- 
-@@ -1887,7 +1887,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-         const size_t len1 = sizeof(kSafariExtensionsBlock);
-         const size_t len2 = sizeof(kSafariTLS12ExtensionsBlock);
- 
--        if (data + len1 + len2 != limit)
-+        if (limit - data != (int)(len1 + len2))
-             return;
-         if (memcmp(data, kSafariExtensionsBlock, len1) != 0)
-             return;
-@@ -1896,7 +1896,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
-     } else {
-         const size_t len = sizeof(kSafariExtensionsBlock);
- 
--        if (data + len != limit)
-+        if (limit - data != (int)(len))
-             return;
-         if (memcmp(data, kSafariExtensionsBlock, len) != 0)
-             return;
-@@ -2053,19 +2053,19 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
-     if (data == limit)
-         goto ri_check;
- 
--    if (data > (limit - 2))
-+    if (limit - data < 2)
-         goto err;
- 
-     n2s(data, len);
- 
--    if (data + len != limit)
-+    if (limit - data != len)
-         goto err;
- 
--    while (data <= (limit - 4)) {
-+    while (limit - data >= 4) {
-         n2s(data, type);
-         n2s(data, size);
- 
--        if (data + size > (limit))
-+        if (limit - data < size)
-             goto err;
- # if 0
-         fprintf(stderr, "Received extension type %d size %d\n", type, size);
-@@ -2472,18 +2472,18 @@ static int ssl_scan_clienthello_custom_tlsext(SSL *s,
-     if (s->hit || s->cert->srv_ext.meths_count == 0)
-         return 1;
- 
--    if (data >= limit - 2)
-+    if (limit - data <= 2)
-         return 1;
-     n2s(data, len);
- 
--    if (data > limit - len)
-+    if (limit - data < len)
-         return 1;
- 
--    while (data <= limit - 4) {
-+    while (limit - data >= 4) {
-         n2s(data, type);
-         n2s(data, size);
- 
--        if (data + size > limit)
-+        if (limit - data < size)
-             return 1;
-         if (custom_ext_parse(s, 1 /* server */ , type, data, size, al) <= 0)
-             return 0;
-@@ -2569,20 +2569,20 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p,
-                              SSL_TLSEXT_HB_DONT_SEND_REQUESTS);
- # endif
- 
--    if (data >= (d + n - 2))
-+    if ((d + n) - data <= 2)
-         goto ri_check;
- 
-     n2s(data, length);
--    if (data + length != d + n) {
-+    if ((d + n) - data != length) {
-         *al = SSL_AD_DECODE_ERROR;
-         return 0;
-     }
- 
--    while (data <= (d + n - 4)) {
-+    while ((d + n) - data >= 4) {
-         n2s(data, type);
-         n2s(data, size);
- 
--        if (data + size > (d + n))
-+        if ((d + n) - data < size)
-             goto ri_check;
- 
-         if (s->tlsext_debug_cb)
-@@ -3307,29 +3307,33 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len,
-     /* Skip past DTLS cookie */
-     if (SSL_IS_DTLS(s)) {
-         i = *(p++);
--        p += i;
--        if (p >= limit)
-+
-+        if (limit - p <= i)
-             return -1;
-+
-+        p += i;
-     }
-     /* Skip past cipher list */
-     n2s(p, i);
--    p += i;
--    if (p >= limit)
-+    if (limit - p <= i)
-         return -1;
-+    p += i;
-+
-     /* Skip past compression algorithm list */
-     i = *(p++);
--    p += i;
--    if (p > limit)
-+    if (limit - p < i)
-         return -1;
-+    p += i;
-+
-     /* Now at start of extensions */
--    if ((p + 2) >= limit)
-+    if (limit - p <= 2)
-         return 0;
-     n2s(p, i);
--    while ((p + 4) <= limit) {
-+    while (limit - p >= 4) {
-         unsigned short type, size;
-         n2s(p, type);
-         n2s(p, size);
--        if (p + size > limit)
-+        if (limit - p < size)
-             return 0;
-         if (type == TLSEXT_TYPE_session_ticket) {
-             int r;
--- 
-1.9.1
-
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index c023965c0f63..f684969f9054 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -106,26 +106,18 @@ let
 in {
 
   openssl_1_0_1 = common {
-    version = "1.0.1t";
-    sha256 = "4a6ee491a2fdb22e519c76fdc2a628bb3cec12762cd456861d207996c8a07088";
-    patches = [
-      # https://git.openssl.org/?p=openssl.git;a=commit;h=6f35f6deb5ca7daebe289f86477e061ce3ee5f46
-      ./1.0.1-CVE-2016-2177.diff
-    ];
+    version = "1.0.1u";
+    sha256 = "0fb7y9pwbd76pgzd7xzqfrzibmc0vf03sl07f34z5dhm2b5b84j3";
   };
 
   openssl_1_0_2 = common {
-    version = "1.0.2h";
-    sha256 = "1d4007e53aad94a5b2002fe045ee7bb0b3d98f1a47f8b2bc851dcd1c74332919";
-    patches = [
-      # https://git.openssl.org/?p=openssl.git;a=commit;h=a004e72b95835136d3f1ea90517f706c24c03da7
-      ./1.0.2-CVE-2016-2177.diff
-    ];
+    version = "1.0.2i";
+    sha256 = "0vyy038676cv3m2523fi9ll9nkjxadqdnz18zdp5nm6925yli1wj";
   };
 
   openssl_1_1_0 = common {
-    version = "1.1.0";
-    sha256 = "10lcpmnxap9nw8ymdglys93cgkwd1lf1rz4fhq5whwhlmkwrzipm";
+    version = "1.1.0a";
+    sha256 = "0as40a1lipl9qfax7495jc1xfb049ygavkaxxk4y5kcn8birdrn2";
   };
 
 }
diff --git a/pkgs/development/libraries/rabbitmq-c/0.4.nix b/pkgs/development/libraries/rabbitmq-c/0.4.nix
deleted file mode 100644
index 2c92ba5618cf..000000000000
--- a/pkgs/development/libraries/rabbitmq-c/0.4.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv, fetchurl, cmake, openssl, popt, xmlto }:
-
-stdenv.mkDerivation rec {
-  version = "0.4.1";
-  name = "rabbitmq-c-${version}";
-
-  src = fetchurl {
-    name = "${name}.tar.gz";
-    url = "https://github.com/alanxz/rabbitmq-c/releases/download/v${version}/${name}.tar.gz";
-    sha256 = "01m4n043hzhhxky8z67zj3r4gbg3mwcqbwqr9nms9lqbfaa70x93";
-  };
-
-  buildInputs = [ cmake openssl popt xmlto ];
-
-  meta = {
-    description = "RabbitMQ C AMQP client library";
-    homepage = https://github.com/alanxz/rabbitmq-c;
-    license = stdenv.lib.licenses.mit;
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/development/libraries/strigi/default.nix b/pkgs/development/libraries/strigi/default.nix
index ee89eda327d0..faba57d155fb 100644
--- a/pkgs/development/libraries/strigi/default.nix
+++ b/pkgs/development/libraries/strigi/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     url = "http://www.vandenoever.info/software/strigi/${name}.tar.bz2";
     sha256 = "12grxzqwnvbyqw7q1gnz42lypadxmq89vk2qpxczmpmc4nk63r23";
   };
-  
+
   includeAllQtDirs = true;
 
   CLUCENE_HOME = clucene_core;
@@ -24,6 +24,15 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  # Strigi installs some libraries in an incorrect place
+  # ($out/$out/lib instead of $out/lib), so move them to the right
+  # place.
+  postInstall =
+    ''
+      mv $out/$out/lib/* $out/lib
+      rm -rf $out/nix
+    '';
+
   meta = {
     homepage = http://strigi.sourceforge.net;
     description = "A very fast and efficient crawler to index data on your harddrive";
diff --git a/pkgs/development/libraries/webkitgtk/2.10.nix b/pkgs/development/libraries/webkitgtk/2.10.nix
deleted file mode 100644
index e74cc6421b24..000000000000
--- a/pkgs/development/libraries/webkitgtk/2.10.nix
+++ /dev/null
@@ -1,86 +0,0 @@
-{ stdenv, fetchurl, fetchpatch, perl, python, ruby, bison, gperf, cmake
-, pkgconfig, gettext, gobjectIntrospection, libnotify
-, gtk2, gtk3, wayland, libwebp, enchant
-, libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs
-, enableGeoLocation ? false, geoclue2, sqlite, xorg
-, enableCredentialStorage ? !stdenv.isDarwin
-, gst-plugins-base, readline, libedit
-}:
-
-assert enableGeoLocation -> geoclue2 != null;
-assert stdenv.isDarwin -> !enableCredentialStorage;
-
-with stdenv.lib;
-stdenv.mkDerivation rec {
-  name = "webkitgtk-${version}";
-  version = "2.10.9";
-
-  meta = {
-    description = "Web content rendering engine, GTK+ port";
-    homepage = "http://webkitgtk.org/";
-    license = licenses.bsd2;
-    platforms = platforms.linux;
-    hydraPlatforms = [];
-    maintainers = with maintainers; [ koral ];
-  };
-
-  preConfigure = "patchShebangs Tools";
-
-  src = fetchurl {
-    url = "http://webkitgtk.org/releases/${name}.tar.xz";
-    sha256 = "0sg935wpkgyd5ypd5fj25vd7ri8s6sbrmssb53xbgcc02xs8vcdv";
-  };
-
-  patches = [
-    ./finding-harfbuzz-icu.patch
-  ] ++ optional stdenv.isDarwin ./adding-libintl.patch;
-
-  cmakeFlags = [
-    "-DPORT=GTK"
-    "-DUSE_LIBHYPHEN=OFF"
-  ] ++ optionals (!enableCredentialStorage) [
-    "-DENABLE_CREDENTIAL_STORAGE=OFF"
-  ] ++ optionals (!enableGeoLocation) [
-    "-DENABLE_GEOLOCATION=OFF"
-  ] ++ optionals stdenv.isDarwin [
-    "-DENABLE_WEBKIT=ON"
-    "-DENABLE_X11_TARGET=OFF"
-    "-DENABLE_QUARTZ_TARGET=ON"
-    "-DENABLE_TOOLS=ON"
-    "-DENABLE_MINIBROWSER=ON"
-    "-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
-    "-DENABLE_VIDEO=OFF"
-    "-DENABLE_WEB_AUDIO=OFF"
-    "-DENABLE_OPENGL=OFF"
-    "-DENABLE_INTROSPECTION=OFF"
-    "-DUSE_LIBNOTIFY=OFF"
-    "-DCMAKE_SHARED_LINKER_FLAGS=-L/path/to/nonexistent/folder"
-  ];
-
-  # XXX: WebKit2 missing include path for gst-plugins-base.
-  # Filled: https://bugs.webkit.org/show_bug.cgi?id=148894
-  NIX_CFLAGS_COMPILE = "-I${gst-plugins-base.dev}/include/gstreamer-1.0";
-
-  nativeBuildInputs = [
-    cmake perl python ruby bison gperf sqlite
-    pkgconfig gettext gobjectIntrospection
-  ];
-
-  buildInputs = [
-    gtk2 libwebp enchant libnotify
-    libxml2 libxslt harfbuzz libpthreadstubs
-    gst-plugins-base xorg.libXt
-  ] ++ optionals enableCredentialStorage [
-    libsecret
-  ] ++ (if stdenv.isDarwin then [
-    readline libedit
-  ] else [
-    wayland
-  ]) ++ optional enableGeoLocation geoclue2;
-
-  propagatedBuildInputs = [
-    libsoup gtk3
-  ];
-
-  enableParallelBuilding = true;
-}
diff --git a/pkgs/development/libraries/webkitgtk/2.14.nix b/pkgs/development/libraries/webkitgtk/2.14.nix
new file mode 100644
index 000000000000..fca358ed4305
--- /dev/null
+++ b/pkgs/development/libraries/webkitgtk/2.14.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl, perl, python, ruby, bison, gperf, cmake
+, pkgconfig, gettext, gobjectIntrospection, libnotify, gnutls
+, gtk2, gtk3, wayland, libwebp, enchant, xlibs, libxkbcommon, epoxy, at_spi2_core
+, libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs
+, enableGeoLocation ? true, geoclue2, sqlite
+, gst-plugins-base
+}:
+
+assert enableGeoLocation -> geoclue2 != null;
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "webkitgtk-${version}";
+  version = "2.14.0";
+
+  meta = {
+    description = "Web content rendering engine, GTK+ port";
+    homepage = "http://webkitgtk.org/";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    hydraPlatforms = [];
+    maintainers = with maintainers; [ ];
+  };
+
+  preConfigure = "patchShebangs Tools";
+
+  src = fetchurl {
+    url = "http://webkitgtk.org/releases/${name}.tar.xz";
+    sha256 = "02paj0anbnqn1z3hn5c4csmq9nga995rzagiplj3sjk2dj1ss4q5";
+  };
+
+  # see if we can clean this up....
+
+  patches = [ ./finding-harfbuzz-icu.patch ];
+
+  cmakeFlags = [ 
+  "-DPORT=GTK"
+  "-DUSE_LIBHYPHEN=0"
+  "-DENABLE_GLES2=ON"
+  ];
+
+  # XXX: WebKit2 missing include path for gst-plugins-base.
+  # Filled: https://bugs.webkit.org/show_bug.cgi?id=148894
+  #NIX_CFLAGS_COMPILE = "-I${gst-plugins-base.dev}/include/gstreamer-1.0";
+
+  nativeBuildInputs = [
+    cmake perl python ruby bison gperf sqlite
+    pkgconfig gettext gobjectIntrospection
+  ];
+
+  buildInputs = [
+    gtk2 wayland libwebp enchant libnotify gnutls
+    libxml2 libsecret libxslt harfbuzz libpthreadstubs
+    gst-plugins-base libxkbcommon epoxy at_spi2_core
+  ] ++ optional enableGeoLocation geoclue2
+    ++ (with xlibs; [ libXdmcp libXt libXtst ]);
+
+  propagatedBuildInputs = [
+    libsoup gtk3
+  ];
+
+  enableParallelBuilding = true;
+}
diff --git a/pkgs/development/node-packages/README.md b/pkgs/development/node-packages/README.md
index d1820e765b9b..138d1475c2fe 100644
--- a/pkgs/development/node-packages/README.md
+++ b/pkgs/development/node-packages/README.md
@@ -1,5 +1,7 @@
-NPM packages
-===========
+Node.js packages
+===============
+To add a package from [NPM](https://www.npmjs.com/) to nixpkgs:
+
  1. Install node2nix: `nix-env -f '<nixpkgs>' -iA node2nix`.
  2. Modify `pkgs/development/node-packages/node-packages.json`, to add, update,
     or remove package entries.
diff --git a/pkgs/development/ocaml-modules/async/default.nix b/pkgs/development/ocaml-modules/async/default.nix
index 2b84519036c7..498315f9cbfd 100644
--- a/pkgs/development/ocaml-modules/async/default.nix
+++ b/pkgs/development/ocaml-modules/async/default.nix
@@ -1,5 +1,5 @@
-{stdenv, buildOcaml, fetchurl, async_kernel,
- async_unix, async_extra, pa_ounit}:
+{stdenv, buildOcaml, fetchurl, async_kernel_p4,
+ async_unix_p4, async_extra_p4, pa_ounit}:
 
 buildOcaml rec {
   name = "async";
@@ -12,7 +12,7 @@ buildOcaml rec {
     sha256 = "ecc4ca939ab098e689332921b110dbaacd06d9f8d8bf697023dfff3ca37dc1e9";
   };
 
-  propagatedBuildInputs = [ async_kernel async_unix async_extra pa_ounit ];
+  propagatedBuildInputs = [ async_kernel_p4 async_unix_p4 async_extra_p4 pa_ounit ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/async;
diff --git a/pkgs/development/ocaml-modules/async_extra/default.nix b/pkgs/development/ocaml-modules/async_extra/default.nix
index 2d1e1dea69cc..80addcfc3bb4 100644
--- a/pkgs/development/ocaml-modules/async_extra/default.nix
+++ b/pkgs/development/ocaml-modules/async_extra/default.nix
@@ -1,6 +1,6 @@
-{stdenv, buildOcaml, fetchurl, async_kernel, async_unix,
- bin_prot, core, custom_printf, fieldslib, herelib, pa_ounit,
- pipebang, pa_test, sexplib}:
+{stdenv, buildOcaml, fetchurl, async_kernel_p4, async_unix_p4,
+ bin_prot_p4, core_p4, custom_printf, fieldslib_p4, herelib, pa_ounit,
+ pipebang, pa_test, sexplib_p4}:
 
 buildOcaml rec {
   name = "async_extra";
@@ -14,8 +14,8 @@ buildOcaml rec {
   };
 
   buildInputs = [ pa_test pa_ounit ];
-  propagatedBuildInputs = [ async_kernel async_unix core bin_prot custom_printf
-                            fieldslib herelib pipebang sexplib ];
+  propagatedBuildInputs = [ async_kernel_p4 async_unix_p4 core_p4 bin_prot_p4 custom_printf
+                            fieldslib_p4 herelib pipebang sexplib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/async_extra;
diff --git a/pkgs/development/ocaml-modules/async_find/default.nix b/pkgs/development/ocaml-modules/async_find/default.nix
index ae10e931ce25..d0e89940433c 100644
--- a/pkgs/development/ocaml-modules/async_find/default.nix
+++ b/pkgs/development/ocaml-modules/async_find/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, async, core, sexplib}:
+{stdenv, buildOcaml, fetchurl, async_p4, core_p4, sexplib_p4}:
 
 buildOcaml rec {
   name = "async_find";
@@ -11,7 +11,7 @@ buildOcaml rec {
     sha256 = "4e3fda72f50174f05d96a5a09323f236c041b1a685890c155822956f3deb8803";
   };
 
-  propagatedBuildInputs = [ async core sexplib ];
+  propagatedBuildInputs = [ async_p4 core_p4 sexplib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/async_find;
diff --git a/pkgs/development/ocaml-modules/async_kernel/default.nix b/pkgs/development/ocaml-modules/async_kernel/default.nix
index 8c0d8d7c851e..43fde1631ac7 100644
--- a/pkgs/development/ocaml-modules/async_kernel/default.nix
+++ b/pkgs/development/ocaml-modules/async_kernel/default.nix
@@ -1,6 +1,6 @@
-{stdenv, buildOcaml, fetchurl, core_kernel,
- bin_prot, fieldslib, pa_ounit, pa_test,
- sexplib, herelib}:
+{stdenv, buildOcaml, fetchurl, core_kernel_p4,
+ bin_prot_p4, fieldslib_p4, pa_ounit, pa_test,
+ sexplib_p4, herelib}:
 
 buildOcaml rec {
   name = "async_kernel";
@@ -14,7 +14,7 @@ buildOcaml rec {
   };
 
   buildInputs = [ pa_test pa_ounit ];
-  propagatedBuildInputs = [ core_kernel bin_prot fieldslib herelib sexplib ];
+  propagatedBuildInputs = [ core_kernel_p4 bin_prot_p4 fieldslib_p4 herelib sexplib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/async_kernel;
diff --git a/pkgs/development/ocaml-modules/async_shell/default.nix b/pkgs/development/ocaml-modules/async_shell/default.nix
index 75755833a5f5..6b1e772bc7d1 100644
--- a/pkgs/development/ocaml-modules/async_shell/default.nix
+++ b/pkgs/development/ocaml-modules/async_shell/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, async, core, core_extended}:
+{stdenv, buildOcaml, fetchurl, async_p4, core_p4, core_extended_p4}:
 
 buildOcaml rec {
   name = "async_shell";
@@ -11,7 +11,7 @@ buildOcaml rec {
     sha256 = "0b4497bea9124c5a665ee58fb0a73c5cbf2f757479df902e6870627196e6c105";
   };
 
-  propagatedBuildInputs = [ async core core_extended ];
+  propagatedBuildInputs = [ async_p4 core_p4 core_extended_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/async_shell;
diff --git a/pkgs/development/ocaml-modules/async_ssl/default.nix b/pkgs/development/ocaml-modules/async_ssl/default.nix
index 527d56ceaa01..2bace35aa8b6 100644
--- a/pkgs/development/ocaml-modules/async_ssl/default.nix
+++ b/pkgs/development/ocaml-modules/async_ssl/default.nix
@@ -1,5 +1,5 @@
-{stdenv, buildOcaml, fetchurl, async, comparelib, core, ctypes, openssl,
- fieldslib, herelib, pa_bench, pa_ounit, pipebang, pa_test, sexplib}:
+{stdenv, buildOcaml, fetchurl, async_p4, comparelib, core_p4, ctypes, openssl,
+ fieldslib_p4, herelib, pa_bench, pa_ounit, pipebang, pa_test, sexplib_p4}:
 
 buildOcaml rec {
   name = "async_ssl";
@@ -13,8 +13,8 @@ buildOcaml rec {
   };
 
   buildInputs = [ pa_bench pa_test ];
-  propagatedBuildInputs = [ ctypes async comparelib core fieldslib pa_ounit
-                            herelib pipebang sexplib openssl ];
+  propagatedBuildInputs = [ ctypes async_p4 comparelib core_p4 fieldslib_p4 pa_ounit
+                            herelib pipebang sexplib_p4 openssl ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/async_ssl;
diff --git a/pkgs/development/ocaml-modules/async_unix/default.nix b/pkgs/development/ocaml-modules/async_unix/default.nix
index 81fbd6a99182..6119bcac876a 100644
--- a/pkgs/development/ocaml-modules/async_unix/default.nix
+++ b/pkgs/development/ocaml-modules/async_unix/default.nix
@@ -1,6 +1,6 @@
-{stdenv, buildOcaml, fetchurl, async_kernel,
- bin_prot, comparelib, core, fieldslib, herelib, pa_ounit,
- pipebang, pa_test, sexplib}:
+{stdenv, buildOcaml, fetchurl, async_kernel_p4,
+ bin_prot_p4, comparelib, core_p4, fieldslib_p4, herelib, pa_ounit,
+ pipebang, pa_test, sexplib_p4}:
 
 buildOcaml rec {
   name = "async_unix";
@@ -15,8 +15,8 @@ buildOcaml rec {
 
   hasSharedObjects = true;
   buildInputs = [ pa_ounit ];
-  propagatedBuildInputs = [ async_kernel core bin_prot comparelib
-                            fieldslib herelib pipebang pa_test sexplib ];
+  propagatedBuildInputs = [ async_kernel_p4 core_p4 bin_prot_p4 comparelib
+                            fieldslib_p4 herelib pipebang pa_test sexplib_p4 ];
 
    meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/async_unix;
diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix
index 9a30a5e4615e..dcf3c8c13d79 100644
--- a/pkgs/development/ocaml-modules/cohttp/default.nix
+++ b/pkgs/development/ocaml-modules/cohttp/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, cmdliner, re, uri, fieldslib, sexplib, conduit,
+{stdenv, buildOcaml, fetchurl, cmdliner, re, uri, fieldslib_p4, sexplib_p4, conduit,
  stringext, base64, magic-mime, ounit, alcotest, lwt ? null,
  async ? null, async_ssl ? null}:
 
@@ -14,7 +14,7 @@ buildOcaml rec {
   };
 
   buildInputs = [ alcotest ];
-  propagatedBuildInputs = [ cmdliner re uri fieldslib sexplib sexplib
+  propagatedBuildInputs = [ cmdliner re uri fieldslib_p4 sexplib_p4 sexplib_p4
                             conduit stringext base64 magic-mime ounit async
                             async_ssl lwt ];
 
diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix
index dbb83f4c8cf0..26accd99db67 100644
--- a/pkgs/development/ocaml-modules/conduit/default.nix
+++ b/pkgs/development/ocaml-modules/conduit/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, sexplib, stringext, uri, cstruct, ipaddr,
+{stdenv, buildOcaml, fetchurl, sexplib_p4, stringext, uri, cstruct, ipaddr,
  async ? null, async_ssl ? null, lwt ? null}:
 
 buildOcaml rec {
@@ -10,7 +10,7 @@ buildOcaml rec {
     sha256 = "5cf1a46aa0254345e5143feebe6b54bdef96314e9987f44e69f24618d620faa1";
   };
 
-  propagatedBuildInputs = ([ sexplib stringext uri cstruct ipaddr ]
+  propagatedBuildInputs = ([ sexplib_p4 stringext uri cstruct ipaddr ]
                             ++ stdenv.lib.optional (lwt != null) lwt
                             ++ stdenv.lib.optional (async != null) async
                             ++ stdenv.lib.optional (async_ssl != null) async_ssl);
diff --git a/pkgs/development/ocaml-modules/core/default.nix b/pkgs/development/ocaml-modules/core/default.nix
index 96fd80087d66..4da4d16df7dd 100644
--- a/pkgs/development/ocaml-modules/core/default.nix
+++ b/pkgs/development/ocaml-modules/core/default.nix
@@ -1,7 +1,7 @@
 {stdenv, buildOcaml, fetchurl, type_conv,
- core_kernel, bin_prot, comparelib, custom_printf, enumerate,
- fieldslib, herelib, pa_bench, pa_test, pa_ounit,
- pipebang, sexplib, typerep, variantslib}:
+ core_kernel_p4, bin_prot_p4, comparelib, custom_printf, enumerate,
+ fieldslib_p4, herelib, pa_bench, pa_test, pa_ounit,
+ pipebang, sexplib_p4, typerep_p4, variantslib_p4}:
 
 buildOcaml rec {
   name = "core";
@@ -17,9 +17,9 @@ buildOcaml rec {
   hasSharedObjects = true;
 
   buildInputs = [ pa_bench pa_test pa_ounit ];
-  propagatedBuildInputs = [ type_conv core_kernel bin_prot comparelib
-                            custom_printf enumerate fieldslib herelib
-                            pipebang sexplib typerep variantslib ];
+  propagatedBuildInputs = [ type_conv core_kernel_p4 bin_prot_p4 comparelib
+                            custom_printf enumerate fieldslib_p4 herelib
+                            pipebang sexplib_p4 typerep_p4 variantslib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/core;
diff --git a/pkgs/development/ocaml-modules/core_extended/default.nix b/pkgs/development/ocaml-modules/core_extended/default.nix
index f311aae3d304..fef4fd81158f 100644
--- a/pkgs/development/ocaml-modules/core_extended/default.nix
+++ b/pkgs/development/ocaml-modules/core_extended/default.nix
@@ -1,5 +1,5 @@
-{stdenv, buildOcaml, fetchurl, bin_prot, comparelib, core, custom_printf,
- fieldslib, pa_bench, pa_ounit, pipebang, pa_test, textutils, re2, sexplib}:
+{stdenv, buildOcaml, fetchurl, bin_prot_p4, comparelib, core_p4, custom_printf,
+ fieldslib_p4, pa_bench, pa_ounit, pipebang, pa_test, textutils_p4, re2_p4, sexplib_p4}:
 
 buildOcaml rec {
   name = "core_extended";
@@ -14,8 +14,8 @@ buildOcaml rec {
 
   hasSharedObjects = true;
   buildInputs = [ pa_bench pa_test pa_ounit ];
-  propagatedBuildInputs = [bin_prot comparelib core custom_printf fieldslib
-                           pipebang textutils re2 sexplib ];
+  propagatedBuildInputs = [bin_prot_p4 comparelib core_p4 custom_printf fieldslib_p4
+                           pipebang textutils_p4 re2_p4 sexplib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/core_extended;
diff --git a/pkgs/development/ocaml-modules/core_kernel/default.nix b/pkgs/development/ocaml-modules/core_kernel/default.nix
index 0fed12b195d6..75b248a6a5e6 100644
--- a/pkgs/development/ocaml-modules/core_kernel/default.nix
+++ b/pkgs/development/ocaml-modules/core_kernel/default.nix
@@ -1,7 +1,7 @@
 {stdenv, buildOcaml, fetchurl, type_conv,
- bin_prot, comparelib, custom_printf, enumerate,
- fieldslib, herelib, pa_bench, pa_test, pa_ounit,
- pipebang, sexplib, typerep, variantslib}:
+ bin_prot_p4, comparelib, custom_printf, enumerate,
+ fieldslib_p4, herelib, pa_bench, pa_test, pa_ounit,
+ pipebang, sexplib_p4, typerep_p4, variantslib_p4}:
 
 buildOcaml rec {
   name = "core_kernel";
@@ -17,9 +17,9 @@ buildOcaml rec {
   hasSharedObjects = true;
 
   buildInputs = [ pa_test pa_ounit ];
-  propagatedBuildInputs = [ type_conv pa_bench bin_prot comparelib custom_printf
-                            enumerate fieldslib herelib pipebang sexplib
-                            typerep variantslib ];
+  propagatedBuildInputs = [ type_conv pa_bench bin_prot_p4 comparelib custom_printf
+                            enumerate fieldslib_p4 herelib pipebang sexplib_p4
+                            typerep_p4 variantslib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/core_kernel;
diff --git a/pkgs/development/ocaml-modules/cstruct/default.nix b/pkgs/development/ocaml-modules/cstruct/default.nix
index 57a057e0eaa9..c9f04918d172 100644
--- a/pkgs/development/ocaml-modules/cstruct/default.nix
+++ b/pkgs/development/ocaml-modules/cstruct/default.nix
@@ -1,5 +1,5 @@
-{stdenv, writeText, fetchurl, ocaml, ocplib-endian, sexplib, findlib,
- async ? null, lwt ? null, camlp4}:
+{stdenv, writeText, fetchurl, ocaml, ocplib-endian, sexplib_p4, findlib,
+ async_p4 ? null, lwt ? null, camlp4}:
 
 assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
 
@@ -12,9 +12,9 @@ stdenv.mkDerivation {
   };
 
   configureFlags = stdenv.lib.strings.concatStringsSep " " ((if lwt != null then ["--enable-lwt"] else []) ++
-                                          (if async != null then ["--enable-async"] else []));
+                                          (if async_p4 != null then ["--enable-async"] else []));
   buildInputs = [ocaml findlib camlp4];
-  propagatedBuildInputs = [ocplib-endian sexplib lwt async];
+  propagatedBuildInputs = [ocplib-endian sexplib_p4 lwt async_p4];
 
   createFindlibDestdir = true;
   dontStrip = true;
diff --git a/pkgs/development/ocaml-modules/custom_printf/default.nix b/pkgs/development/ocaml-modules/custom_printf/default.nix
index 05a8ecfe616b..16c31fc3861a 100644
--- a/pkgs/development/ocaml-modules/custom_printf/default.nix
+++ b/pkgs/development/ocaml-modules/custom_printf/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, type_conv, sexplib, pa_ounit}:
+{stdenv, buildOcaml, fetchurl, type_conv, sexplib_p4, pa_ounit}:
 
 buildOcaml rec {
   name = "custom_printf";
@@ -12,7 +12,7 @@ buildOcaml rec {
   };
 
   buildInputs = [ pa_ounit ];
-  propagatedBuildInputs = [ type_conv sexplib ];
+  propagatedBuildInputs = [ type_conv sexplib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/custom_printf;
diff --git a/pkgs/development/ocaml-modules/ezjsonm/default.nix b/pkgs/development/ocaml-modules/ezjsonm/default.nix
index fd8ce1c33898..4d63b0c3f95f 100644
--- a/pkgs/development/ocaml-modules/ezjsonm/default.nix
+++ b/pkgs/development/ocaml-modules/ezjsonm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, ocaml, findlib, jsonm, hex, sexplib, lwt }:
+{ stdenv, fetchzip, ocaml, findlib, jsonm, hex, sexplib_p4, lwt }:
 
 let version = "0.4.1"; in
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ ocaml findlib ];
-  propagatedBuildInputs = [ jsonm hex sexplib lwt ];
+  propagatedBuildInputs = [ jsonm hex sexplib_p4 lwt ];
   createFindlibDestdir = true;
 
   configureFlags = "--enable-lwt";
diff --git a/pkgs/development/ocaml-modules/frontc/default.nix b/pkgs/development/ocaml-modules/frontc/default.nix
new file mode 100644
index 000000000000..ecf1ddc8fbae
--- /dev/null
+++ b/pkgs/development/ocaml-modules/frontc/default.nix
@@ -0,0 +1,35 @@
+{lib, buildOcaml, fetchurl}:
+
+buildOcaml rec {
+  name = "FrontC";
+  version = "3.4";
+
+  src = fetchurl {
+    url = "http://www.irit.fr/recherches/ARCHI/MARCH/frontc/Frontc-${version}.tgz";
+    sha256 = "16dz153s92dgbw1rrfwbhscy73did87kfmjwyh3qpvs748h1sc4g";
+  };
+
+  meta = with lib; {
+    homepage = https://www.irit.fr/recherches/ARCHI/MARCH/rubrique.php3?id_rubrique=61;
+    description = "C Parsing Library";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.maurer ];
+  };
+
+  meta_file = fetchurl {
+    url = https://raw.githubusercontent.com/ocaml/opam-repository/0f0e610f6499bdf0151e4170411b4f05e4d076d4/packages/FrontC/FrontC.3.4/files/META;
+    sha256 = "1flhvwr01crn7d094kby0418s1m4198np85ymjp3b4maz0n7m2mx";
+  };
+
+  opam_patch = fetchurl {
+    url = https://raw.githubusercontent.com/ocaml/opam-repository/0f0e610f6499bdf0151e4170411b4f05e4d076d4/packages/FrontC/FrontC.3.4/files/opam.patch;
+    sha256 = "0xf83ixx0mf3mznwpwp2mjflii0njdzikhhfxpnms7vhnnmlfzy5";
+  };
+
+  patches = [ opam_patch ];
+  patchFlags = "-p4";
+
+  makeFlags = "PREFIX=$(out) OCAML_SITE=$(OCAMLFIND_DESTDIR)";
+
+  postInstall = "cp ${meta_file} $OCAMLFIND_DESTDIR/FrontC/META";
+}
diff --git a/pkgs/development/ocaml-modules/ipaddr/default.nix b/pkgs/development/ocaml-modules/ipaddr/default.nix
index 749b6a1d94e3..cdc273d6ecfd 100644
--- a/pkgs/development/ocaml-modules/ipaddr/default.nix
+++ b/pkgs/development/ocaml-modules/ipaddr/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, sexplib}:
+{stdenv, buildOcaml, fetchurl, sexplib_p4}:
 
 buildOcaml rec {
   name = "ipaddr";
@@ -9,7 +9,7 @@ buildOcaml rec {
     sha256 = "7051013d8f58abff433187d70cd7ddd7a6b49a6fbe6cad1893f571f65b8ed3d0";
   };
 
-  propagatedBuildInputs = [ sexplib ];
+  propagatedBuildInputs = [ sexplib_p4 ];
 
   configurePhase = ''
    ocaml setup.ml -configure --prefix $out
diff --git a/pkgs/development/ocaml-modules/janestreet/async-extra.nix b/pkgs/development/ocaml-modules/janestreet/async-extra.nix
new file mode 100644
index 000000000000..4a283cc9910b
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/async-extra.nix
@@ -0,0 +1,17 @@
+{stdenv, buildOcamlJane, fetchurl, async_kernel, async_unix,
+ bin_prot, core, ppx_custom_printf, fieldslib, herelib,
+ pipebang, sexplib, async_rpc_kernel}:
+
+buildOcamlJane rec {
+  name = "async_extra";
+  hash = "1xdwab19fycr4cdm3dh9vmx42f8lvf9s4f9pjgdydxfrm7yzyrfh";
+  propagatedBuildInputs = [ async_kernel async_unix core bin_prot ppx_custom_printf
+                            fieldslib herelib pipebang sexplib async_rpc_kernel ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/async_extra;
+    description = "Jane Street Capital's asynchronous execution library (extra)";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/async-kernel.nix b/pkgs/development/ocaml-modules/janestreet/async-kernel.nix
new file mode 100644
index 000000000000..4d7213a8603e
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/async-kernel.nix
@@ -0,0 +1,16 @@
+{stdenv, buildOcamlJane, fetchurl, core_kernel,
+ bin_prot, fieldslib,
+ sexplib, herelib, opam, js_build_tools, ocaml_oasis}:
+
+buildOcamlJane rec {
+  name = "async_kernel";
+  hash = "1n6ifbrq6q6hq8bxh6b9vhg11mv9r6jgp1b7vfw7mh5s2nrd4b60";
+  propagatedBuildInputs = [ core_kernel bin_prot fieldslib herelib sexplib ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/async_kernel;
+    description = "Jane Street Capital's asynchronous execution library (core) ";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/async-rpc-kernel.nix b/pkgs/development/ocaml-modules/janestreet/async-rpc-kernel.nix
new file mode 100644
index 000000000000..1f5ff6b9646f
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/async-rpc-kernel.nix
@@ -0,0 +1,18 @@
+{stdenv, buildOcamlJane, async_kernel, bin_prot, core_kernel,
+ fieldslib, ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test,
+ ppx_jane, sexplib, typerep, variantslib}:
+
+buildOcamlJane rec {
+  name = "async_rpc_kernel";
+  hash = "0pvys7giqix1nfidw1f4i3r94cf03ba1mvhadpm2zpdir3av91sw";
+  propagatedBuildInputs = [ async_kernel bin_prot core_kernel fieldslib
+    ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane
+    sexplib typerep variantslib ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/async_rpc_kernel;
+    description = "Platform-independent core of Async RPC library";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/async-unix.nix b/pkgs/development/ocaml-modules/janestreet/async-unix.nix
new file mode 100644
index 000000000000..5621d2ec704b
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/async-unix.nix
@@ -0,0 +1,17 @@
+{stdenv, buildOcamlJane, fetchurl, async_kernel,
+ bin_prot, comparelib, core, fieldslib, herelib,
+ pipebang, sexplib}:
+
+buildOcamlJane rec {
+  name = "async_unix";
+  hash = "03ng7f0s22wwzspakiqj442vs1a7yf834109jcj9r3g1awwfhcy7";
+  propagatedBuildInputs = [ async_kernel core bin_prot comparelib
+                            fieldslib herelib pipebang sexplib ];
+
+  meta = with stdenv.lib; {
+   homepage = https://github.com/janestreet/async_unix;
+   description = "Jane Street Capital's asynchronous execution library (unix)";
+   license = licenses.asl20;
+   maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/async.nix b/pkgs/development/ocaml-modules/janestreet/async.nix
new file mode 100644
index 000000000000..2e776e273be1
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/async.nix
@@ -0,0 +1,16 @@
+{stdenv, buildOcamlJane, fetchurl, async_kernel,
+ async_unix, async_extra}:
+
+buildOcamlJane rec {
+  name = "async";
+  version = "113.33.03";
+  hash = "0wyspkp8k833fh03r3h016nbfn6kjfhvb2bg42cly6agcak59fmr";
+  propagatedBuildInputs = [ async_kernel async_unix async_extra ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/async;
+    description = "Jane Street Capital's asynchronous execution library";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/bin_prot.nix b/pkgs/development/ocaml-modules/janestreet/bin_prot.nix
new file mode 100644
index 000000000000..11e6189e6c1e
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/bin_prot.nix
@@ -0,0 +1,17 @@
+{stdenv, buildOcamlJane, type_conv}:
+
+buildOcamlJane rec {
+  name = "bin_prot";
+  version = "113.33.03";
+  minimumSupportedOcamlVersion = "4.02";
+  hash = "0jlarpfby755j0kikz6vnl1l6q0ga09b9zrlw6i84r22zchnqdsh";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/bin_prot;
+    description = "Binary protocol generator ";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
new file mode 100644
index 000000000000..61b2038bfd29
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix
@@ -0,0 +1,35 @@
+{ buildOcaml, opam, js_build_tools, ocaml_oasis, fetchurl } :
+
+{ name, version ? "113.33.03", buildInputs ? [],
+  hash ? "",
+  minimumSupportedOcamlVersion ? "4.02", ...
+}@args:
+
+buildOcaml (args // {
+  inherit name version minimumSupportedOcamlVersion;
+  src = fetchurl {
+    url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz";
+    sha256 = hash;
+  };
+
+  hasSharedObjects = true;
+
+  buildInputs = [ ocaml_oasis js_build_tools opam ] ++ buildInputs;
+
+  dontAddPrefix = true;
+
+  configurePhase = "./configure --prefix $out";
+
+  buildPhase = "OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make";
+
+  installPhase = ''
+    opam-installer -i --prefix $prefix --libdir `ocamlfind printconf destdir` --stubsdir `ocamlfind printconf destdir`/${name} ${name}.install
+    if [ -d $out/lib/${name} ]
+      then if [ "$(ls -A $out/lib/${name})" ]
+        then mv $out/lib/${name}/* `ocamlfind printconf destdir`/${name}
+      fi
+      rmdir $out/lib/${name}
+    fi
+  '';
+
+})
diff --git a/pkgs/development/ocaml-modules/janestreet/core-extended.nix b/pkgs/development/ocaml-modules/janestreet/core-extended.nix
new file mode 100644
index 000000000000..df7f6903cd24
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/core-extended.nix
@@ -0,0 +1,22 @@
+{stdenv, buildOcamlJane, fetchurl,
+ core,
+ bin_prot, fieldslib, sexplib, typerep, variantslib,
+ ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test, ppx_jane,
+ re2, textutils,
+ ocaml_oasis, opam, js_build_tools}:
+
+buildOcamlJane rec {
+  name = "core_extended";
+  hash = "1j4ipcn741j8w3h4gpv5sygjzg6b5g6gc2jcrr4n0jyn5dq8b0p5";
+  propagatedBuildInputs =
+    [ core bin_prot fieldslib sexplib typerep variantslib
+      ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane
+      re2 textutils ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/core_extended;
+    description = "Jane Street Capital's standard library overlay";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/core.nix b/pkgs/development/ocaml-modules/janestreet/core.nix
new file mode 100644
index 000000000000..05ea4d5d566b
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/core.nix
@@ -0,0 +1,20 @@
+{stdenv, buildOcamlJane, fetchurl,
+ core_kernel,
+ bin_prot, fieldslib, sexplib, typerep, variantslib,
+ ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test, ppx_jane,
+ ocaml_oasis, opam, js_build_tools}:
+
+buildOcamlJane rec {
+  name = "core";
+  hash = "0nz6d5glgymbpchvcpw77yis9jgi2bll32knzy9vx99wn83zdrmd";
+  propagatedBuildInputs =
+    [ core_kernel bin_prot fieldslib sexplib typerep variantslib
+      ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/core;
+    description = "Jane Street Capital's standard library overlay";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/core_kernel.nix b/pkgs/development/ocaml-modules/janestreet/core_kernel.nix
new file mode 100644
index 000000000000..93fcdde5bb38
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/core_kernel.nix
@@ -0,0 +1,19 @@
+{stdenv, buildOcamlJane, fetchurl,
+ bin_prot, fieldslib, sexplib, typerep, variantslib,
+ ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test, ppx_jane,
+ ocaml_oasis, opam, js_build_tools}:
+
+buildOcamlJane rec {
+  name = "core_kernel";
+  hash = "13gamj056nlib04l7yh80lqpdx0pnswzlb52fkqa01awwp5nf3z6";
+  propagatedBuildInputs =
+    [ bin_prot fieldslib sexplib typerep variantslib
+      ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/core_kernel;
+    description = "Jane Street Capital's standard library overlay (kernel)";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/fieldslib.nix b/pkgs/development/ocaml-modules/janestreet/fieldslib.nix
new file mode 100644
index 000000000000..8823a0c8054d
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/fieldslib.nix
@@ -0,0 +1,19 @@
+{ stdenv, type_conv, buildOcamlJane }:
+
+buildOcamlJane rec {
+  name = "fieldslib";
+  version = "113.33.03";
+
+  minimumSupportedOcamlVersion = "4.02";
+
+  hash = "0mkbix32f8sq32q81hb10z2q31bw5f431jxv0jafbdrif0vr6xqd";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with stdenv.lib; {
+    homepage = https://ocaml.janestreet.com/;
+    description = "OCaml syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.vbgl ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/js-build-tools-darwin.patch b/pkgs/development/ocaml-modules/janestreet/js-build-tools-darwin.patch
new file mode 100644
index 000000000000..8878b4be68b8
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/js-build-tools-darwin.patch
@@ -0,0 +1,11 @@
+--- a/ocamlbuild_goodies/jane_street_ocamlbuild_goodies.ml
++++ b/ocamlbuild_goodies/jane_street_ocamlbuild_goodies.ml
+@@ -65,7 +65,7 @@ let track_external_deps = function
+
+     let stat, md5sum =
+       match run_and_read "uname" |> String.trim with
+-      | "Darwin" ->
++      | "FreeBSD" | "NetBSD" ->
+         (S [A "stat"; A "-f"; A "%d:%i:%m"],
+          A "md5")
+       | _ ->
diff --git a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix
new file mode 100644
index 000000000000..bf697eda8007
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix
@@ -0,0 +1,29 @@
+{stdenv, buildOcaml, fetchurl, ocaml_oasis, opam}:
+
+buildOcaml rec {
+  name = "js-build-tools";
+  version = "113.33.06";
+
+  minimumSupportedOcamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/janestreet/${name}/archive/${version}.tar.gz";
+    sha256 = "1nvgyp4gsnlnpix3li6kr90b12iin5ihichv298p03i6h2809dia";
+  };
+
+  hasSharedObjects = true;
+
+  buildInputs = [ ocaml_oasis opam ];
+
+  dontAddPrefix = true;
+  configurePhase = "./configure --prefix $prefix";
+  installPhase = "opam-installer -i --prefix $prefix --libdir `ocamlfind printconf destdir` ${name}.install";
+
+  patches = [ ./js-build-tools-darwin.patch ];
+
+  meta = with stdenv.lib; {
+    description = "Jane Street Build Tools";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-assert.nix b/pkgs/development/ocaml-modules/janestreet/ppx-assert.nix
new file mode 100644
index 000000000000..b61874d3a7ea
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-assert.nix
@@ -0,0 +1,16 @@
+{stdenv, buildOcamlJane,
+ ppx_compare, ppx_core, ppx_driver, ppx_here, ppx_sexp_conv, ppx_tools, ppx_type_conv, sexplib}:
+
+buildOcamlJane rec {
+  name = "ppx_assert";
+  hash = "0n7fa1j79ykbkhp8xz0ksg5096asri5d0msshsaqhw5fz18chvz4";
+  propagatedBuildInputs =
+    [ ppx_compare ppx_core ppx_driver ppx_here ppx_sexp_conv ppx_tools
+      ppx_type_conv sexplib ];
+
+  meta = with stdenv.lib; {
+    description = "Assert-like extension nodes that raise useful errors on failure";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-bench.nix b/pkgs/development/ocaml-modules/janestreet/ppx-bench.nix
new file mode 100644
index 000000000000..56a124c5b691
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-bench.nix
@@ -0,0 +1,18 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_inline_test, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_bench";
+  minimumSupportedOcamlVersion = "4.02";
+  hash = "1l5jlwy1d1fqz70wa2fkf7izngp6nx3g4s9bmnd6ca4dx1x5bksk";
+
+  hasSharedObjects = true;
+
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_inline_test ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "Syntax extension for writing in-line benchmarks in ocaml code";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix b/pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix
new file mode 100644
index 000000000000..9dffbed69600
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-bin-prot.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, bin_prot}:
+
+buildOcamlJane rec {
+  name = "ppx_bin_prot";
+  hash = "0kwmrrrybdkmphqczsr3lg3imsxcjb8iy41syvn44s3kcjfyyzbz";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv bin_prot ];
+
+  meta = with stdenv.lib; {
+    description = "Generation of bin_prot readers and writers from types";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-compare.nix b/pkgs/development/ocaml-modules/janestreet/ppx-compare.nix
new file mode 100644
index 000000000000..d70fe6ddd550
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-compare.nix
@@ -0,0 +1,15 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_tools, ppx_type_conv}:
+
+buildOcamlJane rec {
+  name = "ppx_compare";
+  hash = "05cnwxfxm8201lpfmcqkcqfy6plh5c2151jbj4qsnxhlvvjli459";
+  propagatedBuildInputs =
+    [ppx_core ppx_driver ppx_tools ppx_type_conv ];
+
+  meta = with stdenv.lib; {
+    description = "Generation of fast comparison functions from type expressions and definitions";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-core.nix b/pkgs/development/ocaml-modules/janestreet/ppx-core.nix
new file mode 100644
index 000000000000..4f5bb87b7675
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-core.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_core";
+  hash = "0df7vyai488lfkyh8szw2hvn22jsyrkfvq1b91j1s0g0y27nnfax";
+  propagatedBuildInputs =
+    [ ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "PPX standard library";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix b/pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix
new file mode 100644
index 000000000000..3fe78e3e7e2e
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-custom-printf.nix
@@ -0,0 +1,15 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_sexp_conv, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_custom_printf";
+  hash = "06y85m6ky376byja4w7gdwd339di5ag0xrf0czkylzjsnylhdr85";
+
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_sexp_conv ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "Extensions to printf-style format-strings for user-defined string conversion";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-driver.nix b/pkgs/development/ocaml-modules/janestreet/ppx-driver.nix
new file mode 100644
index 000000000000..7844756c7bfb
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-driver.nix
@@ -0,0 +1,15 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_optcomp}:
+
+buildOcamlJane rec {
+  name = "ppx_driver";
+  hash = "19cpfdn1n36vl5l9d6h7c61ffn0wmiipprn5by0354i5aywj8gpn";
+  propagatedBuildInputs =
+    [ ppx_core ppx_optcomp ];
+
+  meta = with stdenv.lib; {
+    description = "A driver is an executable created from a set of OCaml AST transformers linked together with a command line frontend";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix b/pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix
new file mode 100644
index 000000000000..8dbf34ed2329
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-enumerate.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv}:
+
+buildOcamlJane rec {
+  name = "ppx_enumerate";
+  hash = "0m11921q2pjzkwckf21fynd2qfy83n9jjsgks23yagdai8a7ym16";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv ];
+
+  meta = with stdenv.lib; {
+    description = "Generate a list containing all values of a finite type";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-expect.nix b/pkgs/development/ocaml-modules/janestreet/ppx-expect.nix
new file mode 100644
index 000000000000..7e688a1dc1c8
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-expect.nix
@@ -0,0 +1,19 @@
+{stdenv, buildOcamlJane,
+ ppx_assert, ppx_compare, ppx_core, ppx_custom_printf, ppx_driver,
+ ppx_fields_conv, ppx_here, ppx_inline_test, ppx_sexp_conv, ppx_tools,
+ ppx_variants_conv, re, sexplib, variantslib, fieldslib}:
+
+buildOcamlJane rec {
+  name = "ppx_expect";
+  hash = "0cwagb4cj3x1vsr19kyfa9pxlvaz9a5v863cahi5glinsh4mzgdx";
+  propagatedBuildInputs =
+    [ ppx_assert ppx_compare ppx_core ppx_custom_printf ppx_driver
+      ppx_fields_conv ppx_here ppx_inline_test ppx_sexp_conv ppx_tools
+      ppx_variants_conv re sexplib variantslib fieldslib ];
+
+  meta = with stdenv.lib; {
+    description = "Cram-like framework for OCaml";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-fail.nix b/pkgs/development/ocaml-modules/janestreet/ppx-fail.nix
new file mode 100644
index 000000000000..187d5db19995
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-fail.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_here, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_fail";
+  hash = "1ms5axpc0zg469zj4799nz3wwxi6rmmyvqj52dy03crmpj71s18l";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_here ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "Syntax extension that makes failwith include a position";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix b/pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix
new file mode 100644
index 000000000000..a05cf149b268
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-fields-conv.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv}:
+
+buildOcamlJane rec {
+  name = "ppx_fields_conv";
+  hash = "11w9wfjgkv7yxv3rwlwi6m193zan6rhmi45q7n3ddi2s8ls3gra7";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv ];
+
+  meta = with stdenv.lib; {
+    description = "Generation of accessor and iteration functions for ocaml records";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-here.nix b/pkgs/development/ocaml-modules/janestreet/ppx-here.nix
new file mode 100644
index 000000000000..3aa157a68c5b
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-here.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver}:
+
+buildOcamlJane rec {
+  name = "ppx_here";
+  hash = "1mzdgn8k171zkwmbizf1a48l525ny0w3363c7gknpnifcinxniiw";
+  propagatedBuildInputs = [ ppx_core ppx_driver ];
+
+  meta = with stdenv.lib; {
+    description = "A ppx rewriter that defines an extension node whose value is its source position";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix b/pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix
new file mode 100644
index 000000000000..cd16d7c32864
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-inline-test.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_inline_test";
+  hash = "0ygapa54i0wwcj3jcqwiimrc6z0b7aafgjhbk37h6vvclnm5n7f6";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "Syntax extension for writing in-line tests in ocaml code";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-jane.nix b/pkgs/development/ocaml-modules/janestreet/ppx-jane.nix
new file mode 100644
index 000000000000..86394f228e9d
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-jane.nix
@@ -0,0 +1,22 @@
+{stdenv, buildOcamlJane,
+ ppx_assert,
+ ppx_bench, ppx_bin_prot, ppx_compare, ppx_custom_printf, ppx_driver,
+ ppx_enumerate, ppx_expect, ppx_fail, ppx_fields_conv, ppx_here,
+ ppx_inline_test, ppx_let, ppx_pipebang, ppx_sexp_conv, ppx_sexp_message,
+ ppx_sexp_value, ppx_typerep_conv, ppx_variants_conv}:
+
+buildOcamlJane rec {
+  name = "ppx_jane";
+  hash  = "1la0rp8fhzfglwb15gqh1pl1ld8ls4cnidaw9mjc5q1hb0yj1qd9";
+  propagatedBuildInputs =
+    [ ppx_assert ppx_bench ppx_bin_prot ppx_compare ppx_custom_printf
+      ppx_driver ppx_enumerate ppx_expect ppx_fail ppx_fields_conv
+      ppx_here ppx_inline_test ppx_let ppx_pipebang ppx_sexp_conv
+      ppx_sexp_message ppx_sexp_value ppx_typerep_conv ppx_variants_conv ];
+
+  meta = with stdenv.lib; {
+    description = "A ppx_driver including all standard ppx rewriters";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-let.nix b/pkgs/development/ocaml-modules/janestreet/ppx-let.nix
new file mode 100644
index 000000000000..3498affeb090
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-let.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver}:
+
+buildOcamlJane rec {
+  name = "ppx_let";
+  hash = "0whnfq4rgkq4apfqnvc100wlk25pmqdyvy6s21dsn3fcm9hff467";
+  propagatedBuildInputs = [ ppx_core ppx_driver ];
+
+  meta = with stdenv.lib; {
+    description = "A ppx rewriter for monadic and applicative let bindings and match statements";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix b/pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix
new file mode 100644
index 000000000000..5dcfc97bfa37
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-optcomp.nix
@@ -0,0 +1,15 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_optcomp";
+  hash = "09m2x2a5ics4bz1j29n5slhh1rlyhcwdfmf44v1jfxcby3f0riwd";
+  propagatedBuildInputs =
+    [ ppx_core ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "ppx_optcomp stands for Optional Compilation. It is a tool used to handle optional compilations of pieces of code depending of the word size, the version of the compiler, etc.";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix b/pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix
new file mode 100644
index 000000000000..f3f4bcdead59
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-pipebang.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_pipebang";
+  hash = "0k25bhj9ziiw89xvs4svz7cgazbbmprba9wbic2llffg55fp7acc";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "A ppx rewriter that inlines reverse application operators |> and |!";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix b/pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix
new file mode 100644
index 000000000000..bf4a7b214dec
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-sexp-conv.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, sexplib}:
+
+buildOcamlJane rec {
+  name = "ppx_sexp_conv";
+  hash = "1kgbmlc11w5jhbhmy5n0f734l44zwyry48342dm5qydi9sfzcgq2";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv sexplib];
+
+  meta = with stdenv.lib; {
+    description = "PPX syntax extension that generates code for converting OCaml types to and from s-expressions, as defined in the sexplib library";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix b/pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix
new file mode 100644
index 000000000000..e83aaa2c2723
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-sexp-message.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_here, ppx_sexp_conv, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_sexp_message";
+  hash = "0inbff25qii868p141jb1y8n3vjfyz66jpnsl9nma6nkkyjkp05j";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_here ppx_sexp_conv ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "Easy construction of S-Expressions";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix b/pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix
new file mode 100644
index 000000000000..a1a1080d73d7
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-sexp-value.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_driver, ppx_here, ppx_sexp_conv, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_sexp_value";
+  hash = "04602ppqfwx33ghjywam00hlqqzsz4d99r60k9q0v1mynk9pjhj0";
+  propagatedBuildInputs = [ ppx_core ppx_driver ppx_here ppx_sexp_conv ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "A ppx rewriter that simplifies building S-Expression from OCaml Values";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-type-conv.nix b/pkgs/development/ocaml-modules/janestreet/ppx-type-conv.nix
new file mode 100644
index 000000000000..fc6d9ca03459
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-type-conv.nix
@@ -0,0 +1,15 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_deriving, ppx_driver, ppx_tools}:
+
+buildOcamlJane rec {
+  name = "ppx_type_conv";
+  hash = "0gv0mqwn97dwrfm6rj442565y8dz7kiq8s8vadnhywrl7j4znqyq";
+  propagatedBuildInputs =
+    [ ppx_core ppx_deriving ppx_driver ppx_tools ];
+
+  meta = with stdenv.lib; {
+    description = "The type_conv library factors out functionality needed by different preprocessors that generate code from type specifications";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix b/pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix
new file mode 100644
index 000000000000..e6d23e0dbdd0
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-typerep-conv.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, typerep}:
+
+buildOcamlJane rec {
+  name = "ppx_typerep_conv";
+  hash = "0dldlx73r07j6w0i7h4hxly0v678naa79na5rafsk2974gs5ih9g";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv typerep ];
+
+  meta = with stdenv.lib; {
+    description = "Automatic generation of runtime types from type definitions";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix b/pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix
new file mode 100644
index 000000000000..e5efb786a943
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/ppx-variants-conv.nix
@@ -0,0 +1,14 @@
+{stdenv, buildOcamlJane,
+ ppx_core, ppx_tools, ppx_type_conv, sexplib}:
+
+buildOcamlJane rec {
+  name = "ppx_variants_conv";
+  hash = "0kgal8b9yh7wrd75hllb9fyl6zbksfnr9k7pykpzdm3js98dirhn";
+  propagatedBuildInputs = [ ppx_core ppx_tools ppx_type_conv sexplib];
+
+  meta = with stdenv.lib; {
+    description = "Generation of accessor and iteration functions for ocaml variant types";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/re2.nix b/pkgs/development/ocaml-modules/janestreet/re2.nix
new file mode 100644
index 000000000000..6604a8d012c6
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/re2.nix
@@ -0,0 +1,20 @@
+{stdenv, buildOcamlJane,
+ bin_prot, core_kernel, fieldslib, sexplib, typerep, variantslib,
+ ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test, ppx_jane,
+ rsync}:
+
+buildOcamlJane rec {
+  name = "re2";
+  hash = "0fw5jscb1i17aw8v4l965zw20kyimhfnmf4w83wqaaxkqy3l6fqw";
+  buildInputs = [ rsync ];
+  propagatedBuildInputs =
+    [ bin_prot core_kernel fieldslib sexplib typerep variantslib
+      ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/re2;
+    description = "OCaml bindings for RE2";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/sexplib.nix b/pkgs/development/ocaml-modules/janestreet/sexplib.nix
new file mode 100644
index 000000000000..4a785d199c8c
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/sexplib.nix
@@ -0,0 +1,18 @@
+{stdenv, buildOcamlJane, type_conv}:
+
+buildOcamlJane rec {
+  minimumSupportedOcamlVersion = "4.02";
+  name = "sexplib";
+  version = "113.33.03";
+
+  hash = "1klar4qw4s7bj47ig7kxz2m4j1q3c60pfppis4vxrxv15r0kfh22";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with stdenv.lib; {
+    homepage = https://ocaml.janestreet.com/;
+    description = "Library for serializing OCaml values to and from S-expressions";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/textutils.nix b/pkgs/development/ocaml-modules/janestreet/textutils.nix
new file mode 100644
index 000000000000..459743f055ab
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/textutils.nix
@@ -0,0 +1,18 @@
+{stdenv, buildOcamlJane,
+ bin_prot, core, fieldslib, sexplib, typerep, variantslib,
+ ppx_assert, ppx_bench, ppx_driver, ppx_expect, ppx_inline_test, ppx_jane}:
+
+buildOcamlJane rec {
+  name = "textutils";
+  hash = "0mkjm9b3k7db7zzrq4403v8qbkgqgkjlz120vcbqh6z7d7ql65vb";
+  propagatedBuildInputs =
+    [ bin_prot core fieldslib sexplib typerep variantslib
+      ppx_assert ppx_bench ppx_driver ppx_expect ppx_inline_test ppx_jane ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/textutils;
+    description = "Text output utilities";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/typerep.nix b/pkgs/development/ocaml-modules/janestreet/typerep.nix
new file mode 100644
index 000000000000..81e6c4be9cbc
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/typerep.nix
@@ -0,0 +1,20 @@
+{stdenv, buildOcamlJane, type_conv}:
+
+buildOcamlJane rec {
+  name = "typerep";
+  version = "113.33.03";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  hash = "1ss34nq20vfgx8hwi5sswpmn3my9lvrpdy5dkng746xchwi33ar7";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/typerep;
+    description = "Runtime types for OCaml (beta version)";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+
+}
diff --git a/pkgs/development/ocaml-modules/janestreet/variantslib.nix b/pkgs/development/ocaml-modules/janestreet/variantslib.nix
new file mode 100644
index 000000000000..d9acadbb6158
--- /dev/null
+++ b/pkgs/development/ocaml-modules/janestreet/variantslib.nix
@@ -0,0 +1,19 @@
+{stdenv, buildOcamlJane, type_conv}:
+
+buildOcamlJane rec {
+  name = "variantslib";
+  version = "113.33.03";
+
+  minimumSupportedOcamlVersion = "4.00";
+
+  hash = "1hv0f75msrryxsl6wfnbmhc0n8kf7qxs5f82ry3b8ldb44s3wigp";
+
+  propagatedBuildInputs = [ type_conv ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/janestreet/variantslib;
+    description = "OCaml variants as first class values";
+    license = licenses.asl20;
+    maintainers = [ maintainers.maurer maintainers.ericbmerritt ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/pa_test/default.nix b/pkgs/development/ocaml-modules/pa_test/default.nix
index faf17e20dc1e..5acf931b2eac 100644
--- a/pkgs/development/ocaml-modules/pa_test/default.nix
+++ b/pkgs/development/ocaml-modules/pa_test/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, type_conv, pa_ounit, sexplib, herelib}:
+{stdenv, buildOcaml, fetchurl, type_conv, pa_ounit, sexplib_p4, herelib}:
 
 buildOcaml rec {
   name = "pa_test";
@@ -12,7 +12,7 @@ buildOcaml rec {
   };
 
   buildInputs = [ pa_ounit ];
-  propagatedBuildInputs = [ type_conv sexplib herelib ];
+  propagatedBuildInputs = [ type_conv sexplib_p4 herelib ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/pa_test;
diff --git a/pkgs/development/ocaml-modules/ppx_deriving/default.nix b/pkgs/development/ocaml-modules/ppx_deriving/default.nix
new file mode 100644
index 000000000000..4b4056a69d72
--- /dev/null
+++ b/pkgs/development/ocaml-modules/ppx_deriving/default.nix
@@ -0,0 +1,28 @@
+{stdenv, buildOcaml, fetchurl,
+ cppo, ppx_tools, result, ounit}:
+
+buildOcaml rec {
+  name = "ppx_deriving";
+  version = "v3.3";
+
+  minimumSupportedOcamlVersion = "4.02";
+
+  src = fetchurl {
+    url = "https://github.com/whitequark/${name}/archive/${version}.tar.gz";
+    sha256 = "1j20c6r2v7h05a4v9m8z5m1yqgwif41yrp63mik14pf3dkrj8x3f";
+  };
+
+  hasSharedObjects = true;
+
+  buildInputs = [ cppo ounit ];
+  propagatedBuildInputs =
+    [ ppx_tools result ];
+
+  installPhase = "OCAMLPATH=$OCAMLPATH:`ocamlfind printconf destdir` make install";
+
+  meta = with stdenv.lib; {
+    description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02.";
+    maintainers = [ maintainers.maurer ];
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/ocaml-modules/ppx_tools/default.nix b/pkgs/development/ocaml-modules/ppx_tools/default.nix
index 377dc32751a7..33bf180cd7f3 100644
--- a/pkgs/development/ocaml-modules/ppx_tools/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_tools/default.nix
@@ -1,21 +1,30 @@
-{ stdenv, fetchzip, ocaml, findlib }:
+{ stdenv, fetchFromGitHub, ocaml, findlib }:
 
-stdenv.mkDerivation {
-  name = "ocaml-ppx_tools-5.0+4.02";
-  src = fetchzip {
-    url = https://github.com/alainfrisch/ppx_tools/archive/5.0+4.02.0.tar.gz;
-    sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8";
-  };
+let
+  version =
+  if stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.03" then "5.0+4.03.0" else "5.0+4.02.0";
+in
+  stdenv.mkDerivation {
+    name = "ocaml-ppx_tools-${version}";
+    src = fetchFromGitHub {
+      owner = "alainfrisch";
+      repo = "ppx_tools";
+      rev = version;
+      sha256 = if version == "5.0+4.03.0"
+      then "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"
+      else "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"
+      ;
+    };
 
-  buildInputs = [ ocaml findlib ];
+    buildInputs = [ ocaml findlib ];
 
-  createFindlibDestdir = true;
+    createFindlibDestdir = true;
 
-  meta = with stdenv.lib; {
-    description = "Tools for authors of ppx rewriters";
-    homepage = http://www.lexifi.com/ppx_tools;
-    license = licenses.mit;
-    platforms = ocaml.meta.platforms or [];
-    maintainers = with maintainers; [ vbgl ];
-  };
-}
+    meta = with stdenv.lib; {
+      description = "Tools for authors of ppx rewriters";
+      homepage = http://www.lexifi.com/ppx_tools;
+      license = licenses.mit;
+      platforms = ocaml.meta.platforms or [];
+      maintainers = with maintainers; [ vbgl ];
+    };
+  }
diff --git a/pkgs/development/ocaml-modules/re2/default.nix b/pkgs/development/ocaml-modules/re2/default.nix
index e89e28fe1e55..9b26c4040959 100644
--- a/pkgs/development/ocaml-modules/re2/default.nix
+++ b/pkgs/development/ocaml-modules/re2/default.nix
@@ -1,5 +1,5 @@
-{stdenv, buildOcaml, fetchurl, ocaml, core, pa_ounit, pa_test,
- bin_prot, comparelib, sexplib, rsync}:
+{stdenv, buildOcaml, fetchurl, ocaml, core_p4, pa_ounit, pa_test,
+ bin_prot_p4, comparelib, sexplib_p4, rsync}:
 
 buildOcaml rec {
   name = "re2";
@@ -16,7 +16,7 @@ buildOcaml rec {
             else null;
 
   buildInputs = [ pa_ounit pa_test rsync ];
-  propagatedBuildInputs = [ core bin_prot comparelib sexplib ];
+  propagatedBuildInputs = [ core_p4 bin_prot_p4 comparelib sexplib_p4 ];
 
   hasSharedObjects = true;
 
diff --git a/pkgs/development/ocaml-modules/textutils/default.nix b/pkgs/development/ocaml-modules/textutils/default.nix
index 377b94eff8b8..6f35b9702280 100644
--- a/pkgs/development/ocaml-modules/textutils/default.nix
+++ b/pkgs/development/ocaml-modules/textutils/default.nix
@@ -1,4 +1,4 @@
-{stdenv, buildOcaml, fetchurl, core, pa_ounit, pa_test, sexplib}:
+{stdenv, buildOcaml, fetchurl, core_p4, pa_ounit, pa_test, sexplib_p4}:
 
 buildOcaml rec {
   name = "textutils";
@@ -12,7 +12,7 @@ buildOcaml rec {
   };
 
   buildInputs = [ pa_test ];
-  propagatedBuildInputs = [ core pa_ounit sexplib ];
+  propagatedBuildInputs = [ core_p4 pa_ounit sexplib_p4 ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/janestreet/textutils;
diff --git a/pkgs/development/ocaml-modules/uri/default.nix b/pkgs/development/ocaml-modules/uri/default.nix
index dca989c88efd..a6335274f737 100644
--- a/pkgs/development/ocaml-modules/uri/default.nix
+++ b/pkgs/development/ocaml-modules/uri/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, ocaml, findlib, re, sexplib, stringext, ounit }:
+{ stdenv, fetchzip, ocaml, findlib, re, sexplib_p4, stringext, ounit }:
 
 assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4";
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ ocaml findlib ounit ];
-  propagatedBuildInputs = [ re sexplib stringext ];
+  propagatedBuildInputs = [ re sexplib_p4 stringext ];
 
   configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
   buildPhase = ''
diff --git a/pkgs/development/perl-modules/WWW-Curl-4.17-Skip-preprocessor-symbol-only-CURL_STRICTER.patch b/pkgs/development/perl-modules/WWW-Curl-4.17-Skip-preprocessor-symbol-only-CURL_STRICTER.patch
new file mode 100644
index 000000000000..34221c0d20c7
--- /dev/null
+++ b/pkgs/development/perl-modules/WWW-Curl-4.17-Skip-preprocessor-symbol-only-CURL_STRICTER.patch
@@ -0,0 +1,34 @@
+From 0be0223422e6e5f4091c6e4e058d213623eed105 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Mon, 12 Sep 2016 14:40:44 +0200
+Subject: [PATCH] Skip preprocessor symbol only CURL_STRICTER
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+CURL_STRICTER leaked into curl-constants.c when building against
+curl-7.50.2. This is a preprocessor only macro without a value.
+
+CPAN RT#117793
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ Makefile.PL | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index f9170bb..ad2bd3d 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -127,7 +127,7 @@ if (!defined($curl_h)) {
+     close H;
+ 
+     for my $e (sort @syms) {
+-       if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {
++       if($e =~ /(OBSOLETE|^CURL_EXTERN|^CURL_STRICTER\z|_LAST\z|_LASTENTRY\z)/) {
+           next;
+        }
+        my ($group) = $e =~ m/^([^_]+_)/;
+-- 
+2.7.4
+
diff --git a/pkgs/development/ruby-modules/bundler/default.nix b/pkgs/development/ruby-modules/bundler/default.nix
index c3c544d52689..bc2d51f7f26b 100644
--- a/pkgs/development/ruby-modules/bundler/default.nix
+++ b/pkgs/development/ruby-modules/bundler/default.nix
@@ -4,8 +4,8 @@ buildRubyGem rec {
   inherit ruby;
   name = "${gemName}-${version}";
   gemName = "bundler";
-  version = "1.12.5";
-  sha256 = "1q84xiwm9j771lpmiply0ls9l2bpvl5axn3jblxjvrldh8di2pkc";
+  version = "1.13.1";
+  sha256 = "02gbjbv7wq33a17pzp83s36v4yg5r2l3rynkhrq1qlq6vc1n47yg";
   dontPatchShebangs = true;
 
   postFixup = ''
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 683677d05fc3..a9b16f0db2c5 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -21,8 +21,8 @@
 , libiconv, postgresql, v8_3_16_14, clang, sqlite, zlib, imagemagick
 , pkgconfig , ncurses, xapian, gpgme, utillinux, fetchpatch, tzdata, icu, libffi
 , cmake, libssh2, openssl, mysql, darwin, git, perl, gecode_3, curl
-, libmsgpack, qt48, libsodium
-}:
+, libmsgpack, qt48, libsodium, snappy
+}@args:
 
 let
   v8 = v8_3_16_14;
@@ -145,6 +145,10 @@ in
     buildInputs = [ cmake pkgconfig openssl libssh2 zlib ];
   };
 
+  snappy = attrs: {
+    buildInputs = [ args.snappy ];
+  };
+
   sqlite3 = attrs: {
     buildFlags = [
       "--with-sqlite3-include=${sqlite.dev}/include"
diff --git a/pkgs/development/ruby-modules/gem/nix-bundle-install.rb b/pkgs/development/ruby-modules/gem/nix-bundle-install.rb
index 48ab5270c22f..8eac766554e1 100644
--- a/pkgs/development/ruby-modules/gem/nix-bundle-install.rb
+++ b/pkgs/development/ruby-modules/gem/nix-bundle-install.rb
@@ -6,6 +6,11 @@ require 'fileutils'
 require 'pathname'
 require 'tmpdir'
 
+if defined?(Encoding.default_internal)
+  Encoding.default_internal = Encoding::UTF_8
+  Encoding.default_external = Encoding::UTF_8
+end
+
 # Options:
 #
 #   name        - the gem name
diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix
index e49697084e45..002d3bde201e 100644
--- a/pkgs/development/tools/build-managers/bazel/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/default.nix
@@ -1,19 +1,24 @@
-{ stdenv, fetchFromGitHub, jdk, zip, zlib, protobuf2_5, pkgconfig, libarchive, unzip, which, makeWrapper }:
-
+{ stdenv, fetchFromGitHub, jdk, zip, zlib, protobuf3_0, pkgconfig, libarchive, unzip, which, makeWrapper }:
 stdenv.mkDerivation rec {
-  name = "bazel-20150326.981b7bc1";
+  version = "0.3.1";
+  name = "bazel-${version}";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "bazel";
-    rev = "981b7bc1";
-    sha256 = "0i9gxgqhfmix7hmkb15s7h9f8ssln08pixqm26pd1d20g0kfyxj7";
+    rev = version;
+    sha256 = "1cm8zjxf8y3ai6h9wndxvflfsijjqhg87fll9ar7ff0hbbbdf6l5";
   };
 
-  buildInputs = [ pkgconfig protobuf2_5 zlib zip jdk libarchive unzip which makeWrapper ];
+  buildInputs = [ pkgconfig protobuf3_0 zlib zip libarchive unzip which makeWrapper jdk ];
+
+  buildPhase = ''
+    export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [ stdenv.cc.cc.lib ]}"
+
+    bash compile.sh
+  '';
 
   installPhase = ''
-    PROTOC=protoc bash compile.sh
     mkdir -p $out/bin $out/share
     cp -R output $out/share/bazel
     ln -s $out/share/bazel/bazel $out/bin/bazel
diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix
index 86058e03e413..b995e76f63ab 100644
--- a/pkgs/development/tools/build-managers/gradle/default.nix
+++ b/pkgs/development/tools/build-managers/gradle/default.nix
@@ -21,10 +21,10 @@ rec {
       let arch = if stdenv.is64bit then "amd64" else "i386"; in ''
         mkdir patching
         pushd patching
-        jar xf $out/lib/gradle/lib/native-platform-linux-${arch}-0.10.jar
+        jar xf $out/lib/gradle/lib/native-platform-linux-${arch}-0.11.jar
         patchelf --set-rpath "${stdenv.cc.cc.lib}/lib:${stdenv.cc.cc.lib}/lib64" net/rubygrapefruit/platform/linux-${arch}/libnative-platform.so
-        jar cf native-platform-linux-${arch}-0.10.jar .
-        mv native-platform-linux-${arch}-0.10.jar $out/lib/gradle/lib/
+        jar cf native-platform-linux-${arch}-0.11.jar .
+        mv native-platform-linux-${arch}-0.11.jar $out/lib/gradle/lib/
         popd
 
         # The scanner doesn't pick up the runtime dependency in the jar.
@@ -52,11 +52,11 @@ rec {
   };
 
   gradle_latest = gradleGen rec {
-    name = "gradle-3.0";
+    name = "gradle-3.1";
 
     src = fetchurl {
       url = "http://services.gradle.org/distributions/${name}-bin.zip";
-      sha256 = "103z2nzlpc6x3mav0mqardd84rj1si718f6wpnpl8i273aa0dj9r";
+      sha256 = "1z0h60w0wvdg2rlxg5izcbhnrzdmr3mdgs7p09cm4lr28d139pn7";
     };
   };
 
diff --git a/pkgs/development/tools/glide/default.nix b/pkgs/development/tools/glide/default.nix
index c3d9104018df..66335412b497 100644
--- a/pkgs/development/tools/glide/default.nix
+++ b/pkgs/development/tools/glide/default.nix
@@ -1,16 +1,22 @@
-{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
+{ stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   name = "glide-${version}";
-  version = "0.10.2";
-  rev = "${version}";
+  version = "0.12.2";
   
   goPackagePath = "github.com/Masterminds/glide";
 
   src = fetchFromGitHub {
-    inherit rev;
+    rev = "v${version}";
     owner = "Masterminds";
     repo = "glide";
-    sha256 = "1qb2n5i04gabb2snnwfr8wv4ypcp1pdzvgga62m9xkhk4p2w6pwl";
+    sha256 = "15cdrcslkiggd6sg5j40amflydpqz1s63f13mvlg309adfhsk4qz";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = https://glide.sh;
+    description = "Package management for Go";
+    license = licenses.mit;
+    maintainers = [ maintainers.rushmorem ];
   };
 }
diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix
index c90e356e044f..99348e907a94 100644
--- a/pkgs/development/tools/misc/ccache/default.nix
+++ b/pkgs/development/tools/misc/ccache/default.nix
@@ -18,44 +18,46 @@ let ccache = stdenv.mkDerivation rec {
   doCheck = !stdenv.isDarwin;
 
   passthru = let
-      cc = stdenv.cc.cc;
-      ccname = if stdenv.cc.isClang then "clang" else "gcc";
-      cxxname = if stdenv.cc.isClang then "clang++" else "g++";
+      unwrappedCC = stdenv.cc.cc;
     in {
     # A derivation that provides gcc and g++ commands, but that
     # will end up calling ccache for the given cacheDir
     links = extraConfig: stdenv.mkDerivation rec {
       name = "ccache-links";
       passthru = {
-        inherit (stdenv.cc) isClang;
-        inherit (cc) isGNU;
+        isClang = unwrappedCC.isClang or false;
+        isGNU = unwrappedCC.isGNU or false;
       };
-      inherit (cc) lib;
+      inherit (unwrappedCC) lib;
       buildCommand = ''
         mkdir -p $out/bin
-        if [ -x "${cc}/bin/${ccname}" ]; then
-          cat > $out/bin/${ccname} << EOF
-          #!/bin/sh
-          ${extraConfig}
-          exec ${ccache}/bin/ccache ${cc}/bin/${ccname} "\$@"
-        EOF
-          chmod +x $out/bin/${ccname}
-        fi
-        if [ -x "${cc}/bin/${cxxname}" ]; then
-          cat > $out/bin/${cxxname} << EOF
-          #!/bin/sh
-          ${extraConfig}
-          exec ${ccache}/bin/ccache ${cc}/bin/${cxxname} "\$@"
+
+        wrap() {
+          local cname="$1"
+          if [ -x "${unwrappedCC}/bin/$cname" ]; then
+            cat > $out/bin/$cname << EOF
+        #!/bin/sh
+        ${extraConfig}
+        exec ${ccache}/bin/ccache ${unwrappedCC}/bin/$cname "\$@"
         EOF
-          chmod +x $out/bin/${cxxname}
-        fi
-        for executable in $(ls ${cc}/bin); do
+            chmod +x $out/bin/$cname
+          fi
+        }
+
+        wrap cc
+        wrap c++
+        wrap gcc
+        wrap g++
+        wrap clang
+        wrap clang++
+
+        for executable in $(ls ${unwrappedCC}/bin); do
           if [ ! -x "$out/bin/$executable" ]; then
-            ln -s ${cc}/bin/$executable $out/bin/$executable
+            ln -s ${unwrappedCC}/bin/$executable $out/bin/$executable
           fi
         done
-        for file in $(ls ${cc} | grep -vw bin); do
-          ln -s ${cc}/$file $out/$file
+        for file in $(ls ${unwrappedCC} | grep -vw bin); do
+          ln -s ${unwrappedCC}/$file $out/$file
         done
       '';
     };
diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix
index 4685787af5f7..2dff98a212d6 100644
--- a/pkgs/development/tools/misc/cscope/default.nix
+++ b/pkgs/development/tools/misc/cscope/default.nix
@@ -1,29 +1,28 @@
-{ fetchurl, stdenv, ncurses, pkgconfig, emacs}:
+{ fetchurl, stdenv, ncurses
+, emacsSupport ? true, emacs
+}:
 
 stdenv.mkDerivation rec {
-  name = "cscope-15.8a";
+  name = "cscope-15.8b";
 
   src = fetchurl {
     url = "mirror://sourceforge/cscope/${name}.tar.gz";
-    sha256 = "07jdhxvp3dv7acvp0pwsdab1g2ncxjlcf838lj7vxgjs1p26lwzb";
+    sha256 = "1byk29rcpyygrnr03h5j3y8j0aqxldd9dr5ihi9q982sy28x12a8";
   };
 
-  preConfigure = ''
-    sed -i "contrib/xcscope/cscope-indexer" \
-        -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g"
-    sed -i "contrib/xcscope/xcscope.el" \
-        -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g";
-  '';
-
   configureFlags = "--with-ncurses=${ncurses.dev}";
 
   buildInputs = [ ncurses ];
-  nativeBuildInputs = [ pkgconfig emacs ];
+  nativeBuildInputs = stdenv.lib.optional emacsSupport emacs;
 
-  postInstall = ''
-    # Install Emacs mode.
+  postInstall = stdenv.lib.optionalString emacsSupport ''
     cd "contrib/xcscope"
 
+    sed -i "cscope-indexer" \
+        -"es|^PATH=.*$|PATH=\"$out/bin:\$PATH\"|g"
+    sed -i "xcscope.el" \
+        -"es|\"cscope-indexer\"|\"$out/libexec/cscope/cscope-indexer\"|g";
+
     mkdir -p "$out/libexec/cscope"
     cp "cscope-indexer" "$out/libexec/cscope"
 
diff --git a/pkgs/development/tools/misc/patchelf/unstable.nix b/pkgs/development/tools/misc/patchelf/unstable.nix
new file mode 100644
index 000000000000..5f434c13abc6
--- /dev/null
+++ b/pkgs/development/tools/misc/patchelf/unstable.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "patchelf-0.10-pre-20160920";
+
+  src = fetchFromGitHub {
+    owner = "NixOS";
+    repo = "patchelf";
+    rev = "327d80443672c397970738f9e216a7e86cbf3ad7";
+    sha256 = "0nghzywda4jrj70gvn4dnrzasafgdp0basj04wfir1smvsi047zr";
+  };
+
+  setupHook = [ ./setup-hook.sh ];
+
+  buildInputs = [ autoreconfHook ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = http://nixos.org/patchelf.html;
+    license = "GPL";
+    description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/tools/ocaml/camlp4/4_03.nix b/pkgs/development/tools/ocaml/camlp4/4_03.nix
new file mode 100644
index 000000000000..f05a556c3886
--- /dev/null
+++ b/pkgs/development/tools/ocaml/camlp4/4_03.nix
@@ -0,0 +1,45 @@
+{stdenv, fetchzip, which, ocaml, ocamlbuild}:
+let
+  ocaml_version = (stdenv.lib.getVersion ocaml);
+  version = "4.03+1";
+
+in
+
+assert stdenv.lib.versionAtLeast ocaml_version "4.02";
+
+stdenv.mkDerivation {
+  name = "camlp4-${version}";
+  src = fetchzip {
+    url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
+    sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq";
+  };
+
+  buildInputs = [ which ocaml ocamlbuild ];
+
+  dontAddPrefix = true;
+
+  preConfigure = ''
+    configureFlagsArray=(
+      --bindir=$out/bin
+      --libdir=$out/lib/ocaml/${ocaml_version}/site-lib
+      --pkgdir=$out/lib/ocaml/${ocaml_version}/site-lib
+    )
+  '';
+
+  postConfigure = ''
+    substituteInPlace camlp4/META.in \
+    --replace +camlp4 $out/lib/ocaml/${ocaml_version}/site-lib/camlp4
+  '';
+
+
+  makeFlags = "all";
+
+  installTargets = "install install-META";
+
+  meta = with stdenv.lib; {
+    description = "A software system for writing extensible parsers for programming languages";
+    homepage = https://github.com/ocaml/camlp4;
+    platforms = ocaml.meta.platforms or [];
+  };
+}
+
diff --git a/pkgs/development/tools/ocaml/merlin/default.nix b/pkgs/development/tools/ocaml/merlin/default.nix
index 9538d8e1cc21..ed441ea8c10b 100644
--- a/pkgs/development/tools/ocaml/merlin/default.nix
+++ b/pkgs/development/tools/ocaml/merlin/default.nix
@@ -1,9 +1,19 @@
-{ stdenv, fetchzip, ocaml, findlib, yojson, menhir
+{ stdenv, fetchzip, ocaml, findlib, yojson, menhir, lib
 , withEmacsMode ? false, emacs }:
 
 assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.00";
 
-let version = "2.3.1"; in
+let
+  version = if lib.versionOlder (lib.getVersion ocaml) "4.02.0"
+  then
+    "2.3.1"
+  else
+    "2.5.0";
+  hashes = {
+    "2.3.1" = "192jamcc7rmvadlqqsjkzsl6hlgwhg9my1qc89fxh1lmd4qdsrpn";
+    "2.5.0" = "1q09mnq4qmh6vfn45qxh2v81l364iazcpjs5dyczmlhln8b25bff";
+  };
+in
 
 stdenv.mkDerivation {
 
@@ -11,7 +21,7 @@ stdenv.mkDerivation {
 
   src = fetchzip {
     url = "https://github.com/the-lambda-church/merlin/archive/v${version}.tar.gz";
-    sha256 = "192jamcc7rmvadlqqsjkzsl6hlgwhg9my1qc89fxh1lmd4qdsrpn";
+    sha256 = hashes."${version}";
   };
 
   buildInputs = [ ocaml findlib yojson menhir ]
diff --git a/pkgs/development/tools/ocaml/ocamlbuild/default.nix b/pkgs/development/tools/ocaml/ocamlbuild/default.nix
new file mode 100644
index 000000000000..6feab7645f17
--- /dev/null
+++ b/pkgs/development/tools/ocaml/ocamlbuild/default.nix
@@ -0,0 +1,42 @@
+{stdenv, fetchFromGitHub, ocaml, findlib, buildOcaml, type_conv, camlp4,
+ ocamlmod, ocamlify, ounit, expect}:
+let
+  version = "0.9.2";
+in
+stdenv.mkDerivation {
+  name = "ocamlbuild";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "ocaml";
+    repo = "ocamlbuild";
+    rev = version;
+    sha256 = "0q4bvik08v444g1pill9zgwal48xs50jf424lbryfvqghhw5xjjc";
+  };
+
+  createFindlibDestdir = true;
+
+  buildInputs = [ ocaml findlib ];
+
+  configurePhase = ''
+  make -f configure.make Makefile.config \
+    "OCAMLBUILD_PREFIX=$out" \
+    "OCAMLBUILD_BINDIR=$out/bin" \
+    "OCAMLBUILD_LIBDIR=$OCAMLFIND_DESTDIR"
+  '';
+
+  # configurePhase = "ocaml setup.ml -configure --prefix $out";
+  # buildPhase     = "ocaml setup.ml -build";
+  # installPhase   = "ocaml setup.ml -install";
+
+  # meta = with stdenv.lib; {
+  #   homepage = http://oasis.forge.ocamlcore.org/;
+  #   description = "Configure, build and install system for OCaml projects";
+  #   license = licenses.lgpl21;
+  #   platforms = ocaml.meta.platforms or [];
+  #   maintainers = with maintainers; [
+  #     vbgl z77z
+  #   ];
+  # };
+}
+
diff --git a/pkgs/development/tools/ocaml/ocp-build/default.nix b/pkgs/development/tools/ocaml/ocp-build/default.nix
index 5ae27b476b41..503616511e5b 100644
--- a/pkgs/development/tools/ocaml/ocp-build/default.nix
+++ b/pkgs/development/tools/ocaml/ocp-build/default.nix
@@ -1,20 +1,25 @@
-{ stdenv, fetchFromGitHub, ocaml, findlib, ncurses }:
+{ stdenv, fetchFromGitHub, ocaml, findlib, ncurses, buildOcaml }:
+let
+  version = "1.99.17-beta";
+in
+buildOcaml {
 
-let version = "1.99.16-beta"; in
-
-stdenv.mkDerivation {
-
-  name = "ocp-build-${version}";
+  name = "ocp-build";
+  inherit version;
 
   src = fetchFromGitHub {
     owner = "OCamlPro";
     repo = "ocp-build";
     rev = version;
-    sha256 = "1nkd7wlf1vrc4p20bs94vbkd970q2ag23csh9a897ka65rk08gvw";
+    sha256 = "0k1gi5v9as5l8h5illgl5prsd5z1i14y5j2k920ay1a3rv697b02";
   };
 
-  buildInputs = [ ocaml findlib ncurses ];
+  buildInputs = [ ocaml ];
+  propagatedBuildInputs = [ ncurses ];
   preInstall = "mkdir -p $out/bin";
+  preConfigure = ''
+  export configureFlags="$configureFlags --with-metadir=$OCAMLFIND_DESTDIR"
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://www.typerex.org/ocp-build.html;
diff --git a/pkgs/development/tools/ocaml/ocp-index/default.nix b/pkgs/development/tools/ocaml/ocp-index/default.nix
index 37f90c41100a..5ca1aed810cf 100644
--- a/pkgs/development/tools/ocaml/ocp-index/default.nix
+++ b/pkgs/development/tools/ocaml/ocp-index/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchzip, ocaml, findlib, ocpBuild, ocpIndent, opam, cmdliner, ncurses, re, lambdaTerm, libev }:
+{ stdenv, fetchFromGitHub, ocaml, findlib, ocpBuild, ocpIndent, opam, cmdliner, ncurses, re, lambdaTerm, libev }:
 
 let inherit (stdenv.lib) getVersion versionAtLeast optional; in
 
@@ -7,23 +7,34 @@ assert versionAtLeast (getVersion ocpBuild) "1.99.6-beta";
 assert versionAtLeast (getVersion ocpIndent) "1.4.2";
 
 let
-  version = "1.1.2";
-  patch402 = fetchurl {
-    url = https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/ocp-index/ocp-index.1.1.2/files/ocaml.4.02.patch;
-    sha256 = "1wcpn2pv7h8ia3ybmzdlm8v5hfvq1rgmlj02wwj0yh3vqjvxqvsm";
+  version = "1.1.4";
+  ocaml_version = getVersion ocaml;
+  srcs = {
+    "4.03.0" = {
+      rev = "${version}-4.03";
+      sha256 = "0c6s5radwyvxf9hrq2y9lirk72z686k9yzd0vgzy98yrrp1w56mv";
+    };
+    "4.02.3" = {
+      rev = "${version}-4.02";
+      sha256 = "057ss3lz754b2pznkb3zda5h65kjgqnvabvfqwqcz4qqxxki2yc8";
+    };
+    "4.01.0" = {
+      rev = "${version}";
+      sha256 = "106bnc8jhmjnychcl8k3gl9n6b50bc66qc5hqf1wkbkk9kz4vc9d";
+    };
   };
+
+  src = fetchFromGitHub ({
+    owner = "OCamlPro";
+    repo = "ocp-index";
+  } // srcs."${ocaml_version}");
 in
 
 stdenv.mkDerivation {
 
   name = "ocp-index-${version}";
 
-  src = fetchzip {
-    url = "http://github.com/OCamlPro/ocp-index/archive/${version}.tar.gz";
-    sha256 = "0cz0bz5nisc5r23b1w07q2bl489gd09mg8rp9kyq9m6rj669b18l";
-  };
-
-  patches = optional (versionAtLeast (getVersion ocaml) "4.02") patch402;
+  inherit src;
 
   buildInputs = [ ocaml findlib ocpBuild opam cmdliner ncurses re libev ]
   ++ optional (versionAtLeast (getVersion lambdaTerm) "1.7") lambdaTerm;