From a748ffdb6edbfc19eac10c522cb2e45af86c8e08 Mon Sep 17 00:00:00 2001 From: toastal Date: Sat, 6 May 2023 13:40:06 +0700 Subject: [PATCH] ocamlPackages.eio: init at 0.10 --- .../development/ocaml-modules/eio/default.nix | 60 +++++++++++++++++++ pkgs/development/ocaml-modules/eio/linux.nix | 23 +++++++ pkgs/development/ocaml-modules/eio/main.nix | 23 +++++++ pkgs/development/ocaml-modules/eio/posix.nix | 28 +++++++++ pkgs/top-level/ocaml-packages.nix | 5 ++ 5 files changed, 139 insertions(+) create mode 100644 pkgs/development/ocaml-modules/eio/default.nix create mode 100644 pkgs/development/ocaml-modules/eio/linux.nix create mode 100644 pkgs/development/ocaml-modules/eio/main.nix create mode 100644 pkgs/development/ocaml-modules/eio/posix.nix diff --git a/pkgs/development/ocaml-modules/eio/default.nix b/pkgs/development/ocaml-modules/eio/default.nix new file mode 100644 index 000000000000..c925928433a0 --- /dev/null +++ b/pkgs/development/ocaml-modules/eio/default.nix @@ -0,0 +1,60 @@ +{ lib +, buildDunePackage +, bigstringaf +, cstruct +, domain-local-await +, dune-configurator +, fetchurl +, fmt +, hmap +, lwt-dllist +, mtime +, optint +, psq +, alcotest +, crowbar +, mdx +}: + +buildDunePackage rec { + pname = "eio"; + version = "0.10"; + + minimalOCamlVersion = "5.0"; + duneVersion = "3"; + + src = fetchurl { + url = "https://github.com/ocaml-multicore/${pname}/releases/download/v${version}/${pname}-${version}.tbz"; + sha256 = "OQ94FFB7gTPWwl46Z6dC1zHHymYlKyh7H7DjrU0Q7sw="; + }; + + propagatedBuildInputs = [ + bigstringaf + cstruct + domain-local-await + fmt + hmap + lwt-dllist + mtime + optint + psq + ]; + + checkInputs = [ + alcotest + crowbar + mdx + ]; + + nativeCheckInputs = [ + mdx.bin + ]; + + meta = { + homepage = "https://github.com/ocaml-multicore/ocaml-${pname}"; + changelog = "https://github.com/ocaml-multicore/ocaml-${pname}/raw/v${version}/CHANGES.md"; + description = "Effects-Based Parallel IO for OCaml"; + license = with lib.licenses; [ isc ]; + maintainers = with lib.maintainers; [ toastal ]; + }; +} diff --git a/pkgs/development/ocaml-modules/eio/linux.nix b/pkgs/development/ocaml-modules/eio/linux.nix new file mode 100644 index 000000000000..62f9800790b5 --- /dev/null +++ b/pkgs/development/ocaml-modules/eio/linux.nix @@ -0,0 +1,23 @@ +{ buildDunePackage +, eio +, fmt +, logs +, uring +}: + +buildDunePackage { + pname = "eio_linux"; + inherit (eio) meta src version; + + minimalOCamlVersion = "5.0"; + duneVersion = "3"; + + dontStrip = true; + + propagatedBuildInputs = [ + eio + fmt + logs + uring + ]; +} diff --git a/pkgs/development/ocaml-modules/eio/main.nix b/pkgs/development/ocaml-modules/eio/main.nix new file mode 100644 index 000000000000..32a6affef0e0 --- /dev/null +++ b/pkgs/development/ocaml-modules/eio/main.nix @@ -0,0 +1,23 @@ +{ lib +, stdenv +, buildDunePackage +, eio +, eio_posix +, uring +}: + +buildDunePackage { + pname = "eio_main"; + inherit (eio) meta src version; + + minimalOCamlVersion = "5.0"; + duneVersion = "3"; + + dontStrip = true; + + propagatedBuildInputs = [ + eio_posix + ] ++ lib.optionals stdenv.isLinux [ + uring + ]; +} diff --git a/pkgs/development/ocaml-modules/eio/posix.nix b/pkgs/development/ocaml-modules/eio/posix.nix new file mode 100644 index 000000000000..6c3042e65fae --- /dev/null +++ b/pkgs/development/ocaml-modules/eio/posix.nix @@ -0,0 +1,28 @@ +{ buildDunePackage +, dune-configurator +, eio +, fmt +, logs +, iomux +}: + +buildDunePackage { + pname = "eio_posix"; + inherit (eio) meta src version; + + minimalOCamlVersion = "5.0"; + duneVersion = "3"; + + dontStrip = true; + + buildInputs = [ + dune-configurator + ]; + + propagatedBuildInputs = [ + eio + fmt + logs + iomux + ]; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index c29f7b187bb5..64fabf5d1b32 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -419,6 +419,11 @@ let eigen = callPackage ../development/ocaml-modules/eigen { }; + eio = callPackage ../development/ocaml-modules/eio { }; + eio_linux = callPackage ../development/ocaml-modules/eio/linux.nix { }; + eio_main = callPackage ../development/ocaml-modules/eio/main.nix { }; + eio_posix = callPackage ../development/ocaml-modules/eio/posix.nix { }; + either = callPackage ../development/ocaml-modules/either { }; elina = callPackage ../development/ocaml-modules/elina { };