2021-08-01 09:53:09 +01: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
|
2019-01-14 22:51:56 +00:00
|
|
|
, pgocaml, camlzip, ocaml_sqlite3
|
2021-05-19 10:09:43 +01:00
|
|
|
, makeWrapper
|
2015-09-16 17:08:57 +01:00
|
|
|
}:
|
|
|
|
|
2021-08-01 09:53:09 +01:00
|
|
|
let mkpath = p:
|
|
|
|
"${p}/lib/ocaml/${ocaml.version}/site-lib/stublibs";
|
2015-09-16 17:08:57 +01:00
|
|
|
in
|
2014-06-08 11:13:31 +01:00
|
|
|
|
2021-08-01 09:53:09 +01: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";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "ocsigenserver";
|
2015-05-15 15:35:42 +01:00
|
|
|
|
2021-08-01 09:53:09 +01:00
|
|
|
useDune2 = true;
|
|
|
|
minimalOCamlVersion = "4.08";
|
|
|
|
|
2019-01-14 22:51:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocsigen";
|
|
|
|
repo = "ocsigenserver";
|
|
|
|
rev = version;
|
2021-08-01 09:53:09 +01:00
|
|
|
sha256 = "0pid4irkmdmx1d6n2rvcvx5mnljl3hazzdqc3bql72by35izfac6";
|
2014-06-08 11:13:31 +01:00
|
|
|
};
|
|
|
|
|
2021-08-01 09:53:09 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper which ];
|
|
|
|
buildInputs = [ lwt_react pgocaml camlzip ocaml_sqlite3 ];
|
2019-01-14 22:51:56 +00:00
|
|
|
|
2021-08-01 09:53:09 +01:00
|
|
|
propagatedBuildInputs = [ cohttp cohttp-lwt-unix cryptokit hmap ipaddr lwt_log lwt_ssl
|
|
|
|
ocaml_pcre xml-light
|
2019-01-14 22:51:56 +00:00
|
|
|
];
|
2014-06-08 11:13:31 +01:00
|
|
|
|
2022-02-03 06:20:04 +00:00
|
|
|
configureFlags = [ "--root $(out)" "--prefix /" "--temproot ''" ];
|
2014-06-08 11:13:31 +01:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
2021-08-14 13:00:00 +01:00
|
|
|
dontAddStaticConfigureFlags = true;
|
|
|
|
configurePlatforms = [];
|
2014-06-08 11:13:31 +01:00
|
|
|
|
2021-08-01 09:53:09 +01:00
|
|
|
postConfigure = ''
|
|
|
|
make -C src confs
|
|
|
|
'';
|
2014-06-08 11:13:31 +01:00
|
|
|
|
2022-02-03 06:20:04 +00:00
|
|
|
postInstall = ''
|
|
|
|
make install.files
|
|
|
|
'';
|
|
|
|
|
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 \
|
2021-08-01 09:53:09 +01:00
|
|
|
--suffix CAML_LD_LIBRARY_PATH : "${caml_ld_library_path}"
|
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-08-01 09:53:09 +01:00
|
|
|
license = lib.licenses.lgpl21Only;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
}
|