summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2015-09-16 18:08:57 +0200
committerVincent Laporte <Vincent.Laporte@gmail.com>2015-09-17 20:58:35 +0200
commitfb09fca7b78d49f7e251b67af3482a43b58f1197 (patch)
treec945fc35cc8bca71a71363fe4401903bdc193549 /pkgs/development/ocaml-modules
parent47a7742c62175327d309915e997fdff3b7b01231 (diff)
downloadnixpkgs-fb09fca7b78d49f7e251b67af3482a43b58f1197.tar
nixpkgs-fb09fca7b78d49f7e251b67af3482a43b58f1197.tar.gz
nixpkgs-fb09fca7b78d49f7e251b67af3482a43b58f1197.tar.bz2
nixpkgs-fb09fca7b78d49f7e251b67af3482a43b58f1197.tar.lz
nixpkgs-fb09fca7b78d49f7e251b67af3482a43b58f1197.tar.xz
nixpkgs-fb09fca7b78d49f7e251b67af3482a43b58f1197.tar.zst
nixpkgs-fb09fca7b78d49f7e251b67af3482a43b58f1197.zip
ocsigen-server: fix the bytecode server
Dynamically loaded OCaml libraries are now properly found
Diffstat (limited to 'pkgs/development/ocaml-modules')
-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 58d8b047ec1..a6361ce1237 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;