diff --git a/pkgs/development/ocaml-modules/domain_shims/default.nix b/pkgs/development/ocaml-modules/domain_shims/default.nix new file mode 100644 index 000000000000..5846d068ae54 --- /dev/null +++ b/pkgs/development/ocaml-modules/domain_shims/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchFromGitLab, buildDunePackage }: + +buildDunePackage rec { + pname = "domain_shims"; + version = "0.1.0"; + + src = fetchFromGitLab { + owner = "gasche"; + repo = "domain-shims"; + rev = version; + hash = "sha256-/5Cw+M0A1rnT7gFqzryd4Z0tylN0kZgSBXtn9jr8u1c="; + }; + + minimalOCamlVersion = "4.12"; + + meta = { + homepage = "https://gitlab.com/gasche/domain-shims/"; + description = "A non-parallel implementation of Domains compatible with OCaml 4"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/domainslib/default.nix b/pkgs/development/ocaml-modules/domainslib/default.nix index 8a36285fe697..096ba5434996 100644 --- a/pkgs/development/ocaml-modules/domainslib/default.nix +++ b/pkgs/development/ocaml-modules/domainslib/default.nix @@ -1,26 +1,28 @@ { lib , fetchurl , buildDunePackage -, lockfree +, saturn +, domain-local-await +, kcas , mirage-clock-unix +, qcheck-stm }: buildDunePackage rec { pname = "domainslib"; - version = "0.5.0"; + version = "0.5.1"; - duneVersion = "3"; minimalOCamlVersion = "5.0"; src = fetchurl { - url = "https://github.com/ocaml-multicore/domainslib/releases/download/v${version}/domainslib-${version}.tbz"; - hash = "sha256-rty+9DUhTUEcN7BPl8G6Q/G/MJ6z/UAn0RPkG8hACwA="; + url = "https://github.com/ocaml-multicore/domainslib/releases/download/${version}/domainslib-${version}.tbz"; + hash = "sha256-KMJd+6XZmUSXNsXW/KXgvnFtgY9vODeW3vhL77mDXQE="; }; - propagatedBuildInputs = [ lockfree ]; + propagatedBuildInputs = [ domain-local-await saturn ]; doCheck = true; - checkInputs = [ mirage-clock-unix ]; + checkInputs = [ kcas mirage-clock-unix qcheck-stm ]; meta = { homepage = "https://github.com/ocaml-multicore/domainslib"; diff --git a/pkgs/development/ocaml-modules/lockfree/default.nix b/pkgs/development/ocaml-modules/lockfree/default.nix deleted file mode 100644 index c3400d4583e0..000000000000 --- a/pkgs/development/ocaml-modules/lockfree/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ lib, fetchurl, buildDunePackage -, dscheck -, qcheck, qcheck-alcotest -}: - -buildDunePackage rec { - pname = "lockfree"; - version = "0.3.0"; - - minimalOCamlVersion = "5.0"; - duneVersion = "3"; - - src = fetchurl { - url = "https://github.com/ocaml-multicore/lockfree/releases/download/${version}/lockfree-${version}.tbz"; - hash = "sha256-XdJR5ojFsA7bJ4aZ5rh10NjopE0NjfqQ9KitOLMh3Jo="; - }; - - propagatedBuildInputs = [ dscheck ]; - - doCheck = true; - checkInputs = [ qcheck qcheck-alcotest ]; - - meta = { - description = "Lock-free data structures for multicore OCaml"; - homepage = "https://github.com/ocaml-multicore/lockfree"; - license = lib.licenses.isc; - maintainers = [ lib.maintainers.vbgl ]; - }; -} diff --git a/pkgs/development/ocaml-modules/saturn/default.nix b/pkgs/development/ocaml-modules/saturn/default.nix new file mode 100644 index 000000000000..855935aff672 --- /dev/null +++ b/pkgs/development/ocaml-modules/saturn/default.nix @@ -0,0 +1,21 @@ +{ lib, fetchurl, buildDunePackage, ocaml +, saturn_lockfree +, dscheck +, qcheck, qcheck-alcotest, qcheck-stm +}: + +buildDunePackage rec { + pname = "saturn"; + + inherit (saturn_lockfree) src version; + + propagatedBuildInputs = [ saturn_lockfree ]; + + doCheck = lib.versionAtLeast ocaml.version "5.0"; + checkInputs = [ dscheck qcheck qcheck-alcotest qcheck-stm ]; + + meta = saturn_lockfree.meta // { + description = "Parallelism-safe data structures for multicore OCaml"; + }; + +} diff --git a/pkgs/development/ocaml-modules/saturn/lockfree.nix b/pkgs/development/ocaml-modules/saturn/lockfree.nix new file mode 100644 index 000000000000..42858626e58d --- /dev/null +++ b/pkgs/development/ocaml-modules/saturn/lockfree.nix @@ -0,0 +1,24 @@ +{ lib, fetchurl, buildDunePackage +, domain_shims +}: + +buildDunePackage rec { + pname = "saturn_lockfree"; + version = "0.4.0"; + + minimalOCamlVersion = "4.12"; + + src = fetchurl { + url = "https://github.com/ocaml-multicore/saturn/releases/download/${version}/saturn-${version}.tbz"; + hash = "sha256-fHvslaJwVbQaqDVA/MHGqHybetYbxRGlMrhgXqM3iPs="; + }; + + propagatedBuildInputs = [ domain_shims ]; + + meta = { + description = "Lock-free data structures for multicore OCaml"; + homepage = "https://github.com/ocaml-multicore/lockfree"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index ad03d1c14d5a..4b9ce4d1b9eb 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -347,6 +347,8 @@ let domain-name = callPackage ../development/ocaml-modules/domain-name { }; + domain_shims = callPackage ../development/ocaml-modules/domain_shims { }; + domainslib = callPackage ../development/ocaml-modules/domainslib { }; dose3 = callPackage ../development/ocaml-modules/dose3 { }; @@ -874,8 +876,6 @@ let lo = callPackage ../development/ocaml-modules/lo { }; - lockfree = callPackage ../development/ocaml-modules/lockfree { }; - logs = callPackage ../development/ocaml-modules/logs { }; lru = callPackage ../development/ocaml-modules/lru { }; @@ -1535,6 +1535,10 @@ let samplerate = callPackage ../development/ocaml-modules/samplerate { }; + saturn = callPackage ../development/ocaml-modules/saturn { }; + + saturn_lockfree = callPackage ../development/ocaml-modules/saturn/lockfree.nix { }; + sawja = callPackage ../development/ocaml-modules/sawja { }; secp256k1 = callPackage ../development/ocaml-modules/secp256k1 {