summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ocsigen-server/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ocaml-modules/ocsigen-server/default.nix')
-rw-r--r--pkgs/development/ocaml-modules/ocsigen-server/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/development/ocaml-modules/ocsigen-server/default.nix b/pkgs/development/ocaml-modules/ocsigen-server/default.nix
index 58d8b047ec1d..a6361ce1237a 100644
--- a/pkgs/development/ocaml-modules/ocsigen-server/default.nix
+++ b/pkgs/development/ocaml-modules/ocsigen-server/default.nix
@@ -1,6 +1,12 @@
 {stdenv, fetchurl, ocaml, findlib, which, ocaml_react, ocaml_ssl,
 ocaml_lwt, ocamlnet, ocaml_pcre, cryptokit, tyxml, ipaddr, zlib,
-libev, openssl, ocaml_sqlite3, tree, uutf}:
+libev, openssl, ocaml_sqlite3, tree, uutf, makeWrapper
+}:
+
+let mkpath = p: n:
+  let v = stdenv.lib.getVersion ocaml; in
+  "${p}/lib/ocaml/${v}/site-lib/${n}";
+in
 
 stdenv.mkDerivation {
   name = "ocsigenserver-2.5";
@@ -12,7 +18,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ocaml which findlib ocaml_react ocaml_ssl ocaml_lwt
   ocamlnet ocaml_pcre cryptokit tyxml ipaddr zlib libev openssl
-  ocaml_sqlite3 tree uutf];
+  ocaml_sqlite3 tree uutf makeWrapper ];
 
   configureFlags = "--root $(out) --prefix /";
 
@@ -23,6 +29,8 @@ stdenv.mkDerivation {
   postFixup =
   ''
   rm -rf $out/var/run
+  wrapProgram $out/bin/ocsigenserver \
+    --prefix CAML_LD_LIBRARY_PATH : "${mkpath ocaml_ssl "ssl"}:${mkpath ocaml_lwt "lwt"}:${mkpath ocamlnet "netsys"}:${mkpath ocamlnet "netstring"}:${mkpath ocaml_pcre "pcre"}:${mkpath cryptokit "cryptokit"}:${mkpath ocaml_sqlite3 "sqlite3"}"
   '';
 
   dontPatchShebangs = true;