depot/third_party/nixpkgs/pkgs/development/ocaml-modules/lwt/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

35 lines
932 B
Nix

{ lib, fetchFromGitHub, libev, buildDunePackage
, ocaml, cppo, dune-configurator, ocplib-endian
}:
buildDunePackage rec {
pname = "lwt";
version = "5.6.1";
minimalOCamlVersion = "4.08";
src = fetchFromGitHub {
owner = "ocsigen";
repo = "lwt";
rev = version;
sha256 = "sha256-XstKs0tMwliCyXnP0Vzi5WC27HKJGnATUYtbbQmH1TE=";
};
postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") ''
substituteInPlace src/core/dune \
--replace "(libraries bytes)" ""
substituteInPlace src/unix/dune \
--replace "libraries bigarray lwt" "libraries lwt"
'';
nativeBuildInputs = [ cppo ];
buildInputs = [ dune-configurator ];
propagatedBuildInputs = [ libev ocplib-endian ];
meta = {
homepage = "https://ocsigen.org/lwt/";
description = "A cooperative threads library for OCaml";
maintainers = [ lib.maintainers.vbgl ];
license = lib.licenses.mit;
};
}