From 43faad80633a17c269a78691d531cebeabe6c44c Mon Sep 17 00:00:00 2001 From: Christophe Raffalli Date: Tue, 4 Jun 2013 20:37:29 +0200 Subject: [PATCH] Upgraded ocamlnet to 3.6.3. Also enabled mot functionality of ocamlnet like nethttp --- .../ocaml-modules/ocamlnet/configure.patch | 63 +++++++++++++++++++ .../ocaml-modules/ocamlnet/default.nix | 18 ++++-- 2 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/ocaml-modules/ocamlnet/configure.patch diff --git a/pkgs/development/ocaml-modules/ocamlnet/configure.patch b/pkgs/development/ocaml-modules/ocamlnet/configure.patch new file mode 100644 index 000000000000..38b240f3c2c4 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlnet/configure.patch @@ -0,0 +1,63 @@ +diff -Naur ocamlnet-3.6.3.ori/configure ocamlnet-3.6.3/configure +--- ocamlnet-3.6.3.ori/configure 2013-01-14 00:04:59.000000000 +0000 ++++ ocamlnet-3.6.3/configure 2013-06-02 21:33:08.000000000 +0000 +@@ -642,59 +642,6 @@ + exit 1 + fi + +- printf "%s" "Checking whether lablgtk2 has GMain.Io.remove... " +- mkdir -p tmp +- cat <tmp/gtk.ml +-let _ = GMain.Io.remove;; +-EOF +- +- if ocamlfind ocamlc -package lablgtk2 -c tmp/gtk.ml >/dev/null 2>/dev/null; +- then +- echo "yes" +- else +- echo "no" +- echo "Your version of lablgtk2 is too old!" +- exit 1 +- fi +- +- printf "%s" "Checking whether lablgtk2 has GMain.Io.add_watch with list support... " +- mkdir -p tmp +- cat <<'EOF' >tmp/gtk.ml +-open GMain.Io +-let _ = (add_watch : cond:condition list -> callback:(condition list -> bool) -> ?prio:int -> channel -> id);; +-exit 0 +-EOF +- # Note: this newer API is never broken in the sense checked below, i.e. +- # such lablgtk2 versions do not exist. +- if ocamlfind ocamlc -package unix,lablgtk2 -linkpkg -o tmp/gtk tmp/gtk.ml >/dev/null 2>/dev/null && tmp/gtk; then +- echo "yes" +- gtk2_io_add_watch_supports_lists="-ppopt -DGTK2_IO_ADD_WATCH_SUPPORTS_LISTS" +- else +- echo "no" +- printf "%s" "Checking whether lablgtk2's GMain.Io.add_watch is broken... " +- mkdir -p tmp +- cat <<'EOF' >tmp/gtk.ml +-GMain.Main.init();; +-let ch = GMain.Io.channel_of_descr (Unix.stdout) in +-let w = GMain.Io.add_watch +- ~cond:`OUT ~callback:(fun () -> true) ch in +-(* add_watch is broken when it just returns Val_unit, and ok when it +- * returns a positive int +- *) +-if (Obj.magic w : int) > 0 then +- exit 0 +-else +- exit 1 +-EOF +- if ocamlfind ocamlc -package unix,lablgtk2 -linkpkg -o tmp/gtk tmp/gtk.ml >/dev/null 2>/dev/null && tmp/gtk; then +- echo "no" +- else +- echo "yes" +- echo "You should apply the patch-ab-ml_glib.c to lablgtk2 to fix this!" +- exit 1 +- fi +- fi +- + for f in Makefile uq_gtk.ml uq_gtk.mli uq_gtk_helper.ml; do + rm -f src/equeue-gtk2/$f + ln -s ../equeue-gtk1/$f src/equeue-gtk2 diff --git a/pkgs/development/ocaml-modules/ocamlnet/default.nix b/pkgs/development/ocaml-modules/ocamlnet/default.nix index 4d9e934b6283..c1960d4706e4 100644 --- a/pkgs/development/ocaml-modules/ocamlnet/default.nix +++ b/pkgs/development/ocaml-modules/ocamlnet/default.nix @@ -1,18 +1,22 @@ -{stdenv, fetchurl, ncurses, ocaml, findlib, ocaml_pcre, camlzip, openssl, ocaml_ssl}: +{stdenv, fetchurl, ncurses, ocaml, findlib, ocaml_pcre, camlzip, openssl, ocaml_ssl, lablgtk, cryptokit }: let ocaml_version = (builtins.parseDrvName ocaml.name).version; in stdenv.mkDerivation { - name = "ocamlnet-3.6"; + name = "ocamlnet-3.6.3"; src = fetchurl { - url = http://download.camlcity.org/download/ocamlnet-3.6.tar.gz; - sha256 = "306c20aee6512be3564c0f39872b70f929c06e1e893cfcf528ac47ae35cf7a69"; + url = http://download.camlcity.org/download/ocamlnet-3.6.3.tar.gz; + sha256 = "c62fe0a4db6c63c04e24c8d76bcb504054f0b59a7a41c1abcbb8dd504afc9f29"; }; - buildInputs = [ncurses ocaml findlib ocaml_pcre camlzip openssl ocaml_ssl]; + buildInputs = [ncurses ocaml findlib ocaml_pcre camlzip openssl ocaml_ssl lablgtk cryptokit]; + + propagatedbuildInputs = [ncurses ocaml_pcre camlzip openssl ocaml_ssl lablgtk cryptokit]; + + patches = [ ./configure.patch ]; createFindlibDestdir = true; @@ -23,6 +27,10 @@ stdenv.mkDerivation { -bindir $out/bin -enable-ssl -enable-zip + -enable-pcre + -enable-crypto + -disable-gtk2 + -with-nethttpd -datadir $out/lib/ocaml/${ocaml_version}/ocamlnet ) '';