ocsigen-server: fix the bytecode server

Dynamically loaded OCaml libraries are now properly found
This commit is contained in:
Vincent Laporte 2015-09-16 18:08:57 +02:00
parent 47a7742c62
commit fb09fca7b7

View File

@ -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;