2021-08-08 23:34:03 +00:00
|
|
|
{ lib, buildDunePackage, fetchFromGitHub, which, ocaml, lwt_react, ssl, lwt_ssl
|
|
|
|
, bigstringaf, lwt, cstruct, mirage-crypto, zarith, mirage-crypto-ec, ptime, mirage-crypto-rng, mtime, ca-certs
|
|
|
|
, cohttp, cohttp-lwt-unix, hmap
|
|
|
|
, lwt_log, ocaml_pcre, cryptokit, xml-light, ipaddr
|
2020-04-24 23:36:52 +00:00
|
|
|
, pgocaml, camlzip, ocaml_sqlite3
|
2021-05-28 09:39:13 +00:00
|
|
|
, makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
let mkpath = p:
|
|
|
|
"${p}/lib/ocaml/${ocaml.version}/site-lib/stublibs";
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
let caml_ld_library_path =
|
|
|
|
lib.concatMapStringsSep ":" mkpath [
|
|
|
|
bigstringaf lwt ssl cstruct mirage-crypto zarith mirage-crypto-ec ptime mirage-crypto-rng mtime ca-certs cryptokit ocaml_pcre
|
|
|
|
]
|
|
|
|
; in
|
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
version = "4.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "ocsigenserver";
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
useDune2 = true;
|
|
|
|
minimalOCamlVersion = "4.08";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocsigen";
|
|
|
|
repo = "ocsigenserver";
|
|
|
|
rev = version;
|
2021-08-08 23:34:03 +00:00
|
|
|
sha256 = "0pid4irkmdmx1d6n2rvcvx5mnljl3hazzdqc3bql72by35izfac6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper which ];
|
|
|
|
buildInputs = [ lwt_react pgocaml camlzip ocaml_sqlite3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
propagatedBuildInputs = [ cohttp cohttp-lwt-unix cryptokit hmap ipaddr lwt_log lwt_ssl
|
|
|
|
ocaml_pcre xml-light
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
configureFlags = [ "--root $(out)" "--prefix /" "--temproot ''" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
2021-09-18 10:52:07 +00:00
|
|
|
dontAddStaticConfigureFlags = true;
|
|
|
|
configurePlatforms = [];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
postConfigure = ''
|
|
|
|
make -C src confs
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
postInstall = ''
|
|
|
|
make install.files
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postFixup =
|
|
|
|
''
|
|
|
|
rm -rf $out/var/run
|
|
|
|
wrapProgram $out/bin/ocsigenserver \
|
2021-08-08 23:34:03 +00:00
|
|
|
--suffix CAML_LD_LIBRARY_PATH : "${caml_ld_library_path}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://ocsigen.org/ocsigenserver/";
|
|
|
|
description = "A full featured Web server";
|
|
|
|
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-08-08 23:34:03 +00:00
|
|
|
license = lib.licenses.lgpl21Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = [ lib.maintainers.gal_bolle ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|