From eb33e01ac77c711b3efc92a8c4345b37a662f7ea Mon Sep 17 00:00:00 2001 From: Marco Maggesi Date: Tue, 21 Dec 2010 09:37:35 +0000 Subject: [PATCH] * Add variable createFindlibDestdir to the setupHook of findlib * Set createFindlibDestdir to various ocaml packages. svn path=/nixpkgs/trunk/; revision=25220 --- pkgs/development/ocaml-modules/camlzip/default.nix | 2 ++ pkgs/development/ocaml-modules/camomile/0.7.3.nix | 2 +- pkgs/development/ocaml-modules/camomile/0.8.1.nix | 6 +++++- pkgs/development/ocaml-modules/cryptgps/default.nix | 2 ++ pkgs/development/ocaml-modules/menhir/default.nix | 2 ++ pkgs/development/ocaml-modules/ounit/default.nix | 2 ++ pkgs/development/ocaml-modules/pcre/default.nix | 2 ++ pkgs/development/ocaml-modules/sqlite3/default.nix | 2 ++ pkgs/development/ocaml-modules/ssl/default.nix | 2 ++ pkgs/development/tools/ocaml/findlib/default.nix | 3 +++ 10 files changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/camlzip/default.nix b/pkgs/development/ocaml-modules/camlzip/default.nix index 9e991a811e6b..03a6dbef23ee 100644 --- a/pkgs/development/ocaml-modules/camlzip/default.nix +++ b/pkgs/development/ocaml-modules/camlzip/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation { patches = [ ./makefile.patch ]; + createFindlibDestdir = true; + postPatch = '' substitute ${./META} META --subst-var-by VERSION "${version}" substituteInPlace Makefile \ diff --git a/pkgs/development/ocaml-modules/camomile/0.7.3.nix b/pkgs/development/ocaml-modules/camomile/0.7.3.nix index b770b36abf66..12b816dec36a 100644 --- a/pkgs/development/ocaml-modules/camomile/0.7.3.nix +++ b/pkgs/development/ocaml-modules/camomile/0.7.3.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { buildInputs = [ocaml findlib]; - #dontAddPrefix = true; + createFindlibDestdir = true; meta = { homepage = http://camomile.sourceforge.net/; diff --git a/pkgs/development/ocaml-modules/camomile/0.8.1.nix b/pkgs/development/ocaml-modules/camomile/0.8.1.nix index 8d9ab69dfc65..29ce5c59b443 100644 --- a/pkgs/development/ocaml-modules/camomile/0.8.1.nix +++ b/pkgs/development/ocaml-modules/camomile/0.8.1.nix @@ -15,7 +15,11 @@ stdenv.mkDerivation { buildInputs = [ocaml findlib]; - #dontAddPrefix = true; + preInstall = '' + ensureDir $OCAMLFIND_DESTDIR + ''; + + createFindlibDestdir = true; meta = { homepage = http://camomile.sourceforge.net/; diff --git a/pkgs/development/ocaml-modules/cryptgps/default.nix b/pkgs/development/ocaml-modules/cryptgps/default.nix index 63a25dd0b471..7379a62d4244 100644 --- a/pkgs/development/ocaml-modules/cryptgps/default.nix +++ b/pkgs/development/ocaml-modules/cryptgps/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation { configurePhase = "true"; # Skip configure phase + createFindlibDestdir = true; + meta = { homepage = http://projects.camlcity.org/projects/cryptgps.html; description = "Cryptographic functions for OCaml"; diff --git a/pkgs/development/ocaml-modules/menhir/default.nix b/pkgs/development/ocaml-modules/menhir/default.nix index 4d92cda5553d..ea706ef511fa 100644 --- a/pkgs/development/ocaml-modules/menhir/default.nix +++ b/pkgs/development/ocaml-modules/menhir/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation { configurePhase = "true"; # Skip configure + createFindlibDestdir = true; + preBuild = '' #Fix makefiles. RM=$(type -p rm) diff --git a/pkgs/development/ocaml-modules/ounit/default.nix b/pkgs/development/ocaml-modules/ounit/default.nix index 62bf7f89c491..b6d14383d5e5 100644 --- a/pkgs/development/ocaml-modules/ounit/default.nix +++ b/pkgs/development/ocaml-modules/ounit/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation { checkTarget = "test"; + createFindlibDestdir = true; + meta = { homepage = http://www.xs4all.nl/~mmzeeman/ocaml/; description = "Unit test framework for OCaml"; diff --git a/pkgs/development/ocaml-modules/pcre/default.nix b/pkgs/development/ocaml-modules/pcre/default.nix index d16093a6feb9..fdc527791c0b 100644 --- a/pkgs/development/ocaml-modules/pcre/default.nix +++ b/pkgs/development/ocaml-modules/pcre/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation { buildInputs = [pcre ocaml findlib]; + createFindlibDestdir = true; + configurePhase = "true"; # Skip configure phase meta = { diff --git a/pkgs/development/ocaml-modules/sqlite3/default.nix b/pkgs/development/ocaml-modules/sqlite3/default.nix index d542cfe14f62..9b477fed8517 100644 --- a/pkgs/development/ocaml-modules/sqlite3/default.nix +++ b/pkgs/development/ocaml-modules/sqlite3/default.nix @@ -23,6 +23,8 @@ stdenv.mkDerivation { ensureDir $out/bin ''; + createFindlibDestdir = true; + meta = { homepage = "http://ocaml.info/home/ocaml_sources.html#ocaml-sqlite3"; description = "OCaml bindings to the SQLite 3 database access library"; diff --git a/pkgs/development/ocaml-modules/ssl/default.nix b/pkgs/development/ocaml-modules/ssl/default.nix index 56ac189b7ba4..9a495002f1de 100644 --- a/pkgs/development/ocaml-modules/ssl/default.nix +++ b/pkgs/development/ocaml-modules/ssl/default.nix @@ -19,6 +19,8 @@ stdenv.mkDerivation { configureFlags = "--disable-ldconf"; + createFindlibDestdir = true; + meta = { homepage = http://savonet.rastageeks.org/; description = "OCaml bindings for libssl "; diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index 9a2a6b0d94ab..9a5b9acbef9c 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -40,6 +40,9 @@ stdenv.mkDerivation { export OCAMLPATH="''${OCAMLPATH}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml_version}/site-lib/" fi export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml_version}/site-lib/" + if test -n $createFindlibDestdir; then + ensureDir $OCAMLFIND_DESTDIR + fi } envHooks=(''${envHooks[@]} addOCamlPath)