Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildDunePackage, fetchFromGitHub, which, ocaml, lwt_react, ssl, lwt_ssl, findlib
2, bigstringaf, lwt, cstruct, mirage-crypto, zarith, mirage-crypto-ec, ptime, mirage-crypto-rng, mtime, ca-certs
3, cohttp, cohttp-lwt-unix, hmap
4, lwt_log, ocaml_pcre, cryptokit, xml-light, ipaddr
5, camlzip
6, makeWrapper
7}:
8
9let mkpath = p:
10 "${p}/lib/ocaml/${ocaml.version}/site-lib/stublibs";
11in
12
13let caml_ld_library_path =
14 lib.concatMapStringsSep ":" mkpath [
15 bigstringaf lwt ssl cstruct mirage-crypto zarith mirage-crypto-ec ptime mirage-crypto-rng mtime ca-certs cryptokit ocaml_pcre
16 ]
17; in
18
19buildDunePackage rec {
20 version = "5.0.1";
21 pname = "ocsigenserver";
22
23 duneVersion = "3";
24 minimalOCamlVersion = "4.08";
25
26 src = fetchFromGitHub {
27 owner = "ocsigen";
28 repo = "ocsigenserver";
29 rev = version;
30 sha256 = "sha256:1vzza33hd41740dqrx4854rqpyd8wv7kwpsvvmlpck841i9lh8h5";
31 };
32
33 nativeBuildInputs = [ makeWrapper which ];
34 buildInputs = [ lwt_react camlzip findlib ];
35
36 propagatedBuildInputs = [ cohttp cohttp-lwt-unix cryptokit hmap ipaddr lwt_log lwt_ssl
37 ocaml_pcre xml-light
38 ];
39
40 patches = [ ./cohttp-5.patch ];
41
42 configureFlags = [ "--root $(out)" "--prefix /" "--temproot ''" ];
43
44 dontAddPrefix = true;
45 dontAddStaticConfigureFlags = true;
46 configurePlatforms = [];
47
48 postConfigure = ''
49 make -C src confs
50 '';
51
52 postInstall = ''
53 make install.files
54 '';
55
56 postFixup =
57 ''
58 rm -rf $out/var/run
59 wrapProgram $out/bin/ocsigenserver \
60 --suffix CAML_LD_LIBRARY_PATH : "${caml_ld_library_path}"
61 '';
62
63 dontPatchShebangs = true;
64
65 meta = {
66 homepage = "http://ocsigen.org/ocsigenserver/";
67 description = "A full featured Web server";
68 longDescription =''
69 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.
70 '';
71 license = lib.licenses.lgpl21Only;
72 inherit (ocaml.meta) platforms;
73 maintainers = [ lib.maintainers.gal_bolle ];
74 };
75
76}