Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, fetchFromGitHub, libev, buildDunePackage
2, ocaml, cppo, dune-configurator, ocplib-endian
3}:
4
5buildDunePackage rec {
6 pname = "lwt";
7 version = "5.6.1";
8
9 minimalOCamlVersion = "4.08";
10
11 src = fetchFromGitHub {
12 owner = "ocsigen";
13 repo = "lwt";
14 rev = version;
15 sha256 = "sha256-XstKs0tMwliCyXnP0Vzi5WC27HKJGnATUYtbbQmH1TE=";
16 };
17
18 postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") ''
19 substituteInPlace src/core/dune \
20 --replace "(libraries bytes)" ""
21 substituteInPlace src/unix/dune \
22 --replace "libraries bigarray lwt" "libraries lwt"
23 '';
24
25 nativeBuildInputs = [ cppo ];
26 buildInputs = [ dune-configurator ];
27 propagatedBuildInputs = [ libev ocplib-endian ];
28
29 meta = {
30 homepage = "https://ocsigen.org/lwt/";
31 description = "A cooperative threads library for OCaml";
32 maintainers = [ lib.maintainers.vbgl ];
33 license = lib.licenses.mit;
34 };
35}