2018-02-02 08:51:23 +01:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, which, react, ssl
|
|
|
|
, ocamlnet, ocaml_pcre, cryptokit, tyxml, ipaddr, zlib,
|
2017-02-18 22:54:02 +01:00
|
|
|
libev, openssl, ocaml_sqlite3, tree, uutf, makeWrapper, camlp4
|
2018-02-02 08:51:23 +01:00
|
|
|
, camlzip, pgocaml, lwt2, lwt_react, lwt_ssl
|
2015-09-16 18:08:57 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let mkpath = p: n:
|
|
|
|
let v = stdenv.lib.getVersion ocaml; in
|
|
|
|
"${p}/lib/ocaml/${v}/site-lib/${n}";
|
|
|
|
in
|
2014-06-08 12:13:31 +02:00
|
|
|
|
2018-02-02 08:51:23 +01:00
|
|
|
let param =
|
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.03" then {
|
|
|
|
version = "2.9";
|
|
|
|
sha256 = "0na3qa4h89f2wv31li63nfpg4151d0g8fply0bq59j3bhpyc85nd";
|
|
|
|
buildInputs = [ lwt_react lwt_ssl ];
|
|
|
|
ldpath = "";
|
|
|
|
} else {
|
|
|
|
version = "2.8";
|
|
|
|
sha256 = "1v44qv2ixd7i1qinyhlzzqiffawsdl7xhhh6ysd7lf93kh46d5sy";
|
|
|
|
buildInputs = [ lwt2 ];
|
|
|
|
ldpath = "${mkpath lwt2 "lwt"}";
|
|
|
|
}
|
|
|
|
; in
|
|
|
|
|
2014-06-08 12:13:31 +02:00
|
|
|
stdenv.mkDerivation {
|
2018-02-02 08:51:23 +01:00
|
|
|
name = "ocsigenserver-${param.version}";
|
2015-05-15 16:35:42 +02:00
|
|
|
|
2014-06-08 12:13:31 +02:00
|
|
|
src = fetchurl {
|
2018-02-02 08:51:23 +01:00
|
|
|
url = "https://github.com/ocsigen/ocsigenserver/archive/${param.version}.tar.gz";
|
|
|
|
inherit (param) sha256;
|
2014-06-08 12:13:31 +02:00
|
|
|
};
|
|
|
|
|
2018-02-02 08:51:23 +01:00
|
|
|
buildInputs = [ocaml which findlib react ssl
|
2015-05-15 16:35:42 +02:00
|
|
|
ocamlnet ocaml_pcre cryptokit tyxml ipaddr zlib libev openssl
|
2018-02-02 08:51:23 +01:00
|
|
|
ocaml_sqlite3 tree uutf makeWrapper camlp4 pgocaml camlzip ]
|
|
|
|
++ (param.buildInputs or []);
|
2014-06-08 12:13:31 +02:00
|
|
|
|
2018-07-25 23:44:21 +02:00
|
|
|
configureFlags = [ "--root $(out) --prefix /" ];
|
2014-06-08 12:13:31 +02:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2015-05-15 16:35:42 +02:00
|
|
|
postFixup =
|
2014-06-08 12:13:31 +02:00
|
|
|
''
|
|
|
|
rm -rf $out/var/run
|
2015-09-16 18:08:57 +02:00
|
|
|
wrapProgram $out/bin/ocsigenserver \
|
2018-02-02 08:51:23 +01:00
|
|
|
--prefix CAML_LD_LIBRARY_PATH : "${mkpath ssl "ssl"}:${param.ldpath}:${mkpath ocamlnet "netsys"}:${mkpath ocamlnet "netstring"}:${mkpath ocaml_pcre "pcre"}:${mkpath cryptokit "cryptokit"}:${mkpath ocaml_sqlite3 "sqlite3"}"
|
2014-06-08 12:13:31 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://ocsigen.org/ocsigenserver/;
|
2014-09-06 12:45:20 +02:00
|
|
|
description = "A full featured Web server";
|
2014-09-06 10:44:20 +02:00
|
|
|
longDescription =''
|
|
|
|
A full featured Web server. It implements most features of the HTTP protocol, and has a very powerful extension mechanism that make very easy to plug your own OCaml modules for generating pages.
|
|
|
|
'';
|
2014-09-18 12:37:49 +02:00
|
|
|
license = stdenv.lib.licenses.lgpl21;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-06-08 12:13:31 +02:00
|
|
|
maintainers = [ stdenv.lib.maintainers.gal_bolle ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|