2021-01-11 13:49:15 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, which, ocaml, findlib, lwt_react, ssl, lwt_ssl
|
2019-01-14 23:51:56 +01:00
|
|
|
, lwt_log, ocamlnet, ocaml_pcre, cryptokit, tyxml, xml-light, ipaddr
|
|
|
|
, pgocaml, camlzip, ocaml_sqlite3
|
2021-05-19 11:09:43 +02:00
|
|
|
, makeWrapper
|
2015-09-16 18:08:57 +02:00
|
|
|
}:
|
|
|
|
|
2021-01-11 13:49:15 +01:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.06.1"
|
2019-01-14 23:51:56 +01:00
|
|
|
then throw "ocsigenserver is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2015-09-16 18:08:57 +02:00
|
|
|
let mkpath = p: n:
|
2019-01-14 23:51:56 +01:00
|
|
|
"${p}/lib/ocaml/${ocaml.version}/site-lib/${n}";
|
2015-09-16 18:08:57 +02:00
|
|
|
in
|
2014-06-08 12:13:31 +02:00
|
|
|
|
2019-01-14 23:51:56 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-19 11:09:43 +02:00
|
|
|
version = "2.18.0";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ocsigenserver";
|
2015-05-15 16:35:42 +02:00
|
|
|
|
2019-01-14 23:51:56 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocsigen";
|
|
|
|
repo = "ocsigenserver";
|
|
|
|
rev = version;
|
2021-05-19 11:09:43 +02:00
|
|
|
sha256 = "0c61wkq8ddy3qxb2x1jz04rz0722hk92r6jl1zvgikh74m5p5ipp";
|
2014-06-08 12:13:31 +02:00
|
|
|
};
|
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ which ocaml findlib lwt_react pgocaml camlzip ocaml_sqlite3 ];
|
2019-01-14 23:51:56 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ cryptokit ipaddr lwt_log lwt_ssl ocamlnet
|
|
|
|
ocaml_pcre tyxml xml-light
|
|
|
|
];
|
2014-06-08 12:13:31 +02:00
|
|
|
|
2019-01-14 23:51:56 +01: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 \
|
2019-11-14 19:44:07 +01:00
|
|
|
--suffix CAML_LD_LIBRARY_PATH : "${mkpath ssl "ssl"}:${mkpath ocamlnet "netsys"}:${mkpath ocamlnet "netstring"}:${mkpath ocaml_pcre "pcre"}:${mkpath ocaml_sqlite3 "sqlite3"}"
|
2014-06-08 12:13:31 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
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.
|
|
|
|
'';
|
2021-01-11 13:49:15 +01:00
|
|
|
license = lib.licenses.lgpl21;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2021-01-11 13:49:15 +01:00
|
|
|
maintainers = [ lib.maintainers.gal_bolle ];
|
2014-06-08 12:13:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|