2021-01-11 12:49:15 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, which, ocaml, findlib, lwt_react, ssl, lwt_ssl
|
2019-01-14 22:51:56 +00:00
|
|
|
, lwt_log, ocamlnet, ocaml_pcre, cryptokit, tyxml, xml-light, ipaddr
|
|
|
|
, pgocaml, camlzip, ocaml_sqlite3
|
2020-07-21 22:52:52 +01:00
|
|
|
, makeWrapper, fetchpatch
|
2015-09-16 17:08:57 +01:00
|
|
|
}:
|
|
|
|
|
2021-01-11 12:49:15 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.06.1"
|
2019-01-14 22:51:56 +00:00
|
|
|
then throw "ocsigenserver is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2015-09-16 17:08:57 +01:00
|
|
|
let mkpath = p: n:
|
2019-01-14 22:51:56 +00:00
|
|
|
"${p}/lib/ocaml/${ocaml.version}/site-lib/${n}";
|
2015-09-16 17:08:57 +01:00
|
|
|
in
|
2014-06-08 11:13:31 +01:00
|
|
|
|
2019-01-14 22:51:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-07-22 11:56:26 +01:00
|
|
|
version = "2.16.0";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "ocsigenserver";
|
2015-05-15 15:35:42 +01:00
|
|
|
|
2019-01-14 22:51:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocsigen";
|
|
|
|
repo = "ocsigenserver";
|
|
|
|
rev = version;
|
2020-07-22 11:56:26 +01:00
|
|
|
sha256 = "0dd7zfk8dlajv0297dswaaqh96hjk2ppy8zb67jbkd26nimahk9y";
|
2014-06-08 11:13:31 +01:00
|
|
|
};
|
|
|
|
|
2020-07-21 22:52:52 +01:00
|
|
|
# unreleased fix for Makefile typos breaking compilation
|
|
|
|
patches = [ (fetchpatch {
|
|
|
|
url = "https://github.com/ocsigen/ocsigenserver/commit/014aefc4e460686a361b974f16ebb7e0c993b36b.patch";
|
|
|
|
sha256 = "0xda4fj8p5102lh9xmrn5mv3s0ps6yykqj3mpjf72gf4zd6fzcn7";
|
|
|
|
}) ];
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ which ocaml findlib lwt_react pgocaml camlzip ocaml_sqlite3 ];
|
2019-01-14 22:51:56 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ cryptokit ipaddr lwt_log lwt_ssl ocamlnet
|
|
|
|
ocaml_pcre tyxml xml-light
|
|
|
|
];
|
2014-06-08 11:13:31 +01:00
|
|
|
|
2019-01-14 22:51:56 +00:00
|
|
|
configureFlags = [ "--root $(out)" "--prefix /" ];
|
2014-06-08 11:13:31 +01:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2015-05-15 15:35:42 +01:00
|
|
|
postFixup =
|
2014-06-08 11:13:31 +01:00
|
|
|
''
|
|
|
|
rm -rf $out/var/run
|
2015-09-16 17:08:57 +01:00
|
|
|
wrapProgram $out/bin/ocsigenserver \
|
2019-11-14 18:44:07 +00: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 11:13:31 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://ocsigen.org/ocsigenserver/";
|
2014-09-06 11:45:20 +01:00
|
|
|
description = "A full featured Web server";
|
2014-09-06 09:44:20 +01: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 12:49:15 +00:00
|
|
|
license = lib.licenses.lgpl21;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2021-01-11 12:49:15 +00:00
|
|
|
maintainers = [ lib.maintainers.gal_bolle ];
|
2014-06-08 11:13:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|