From 1c59a2d71b9d558b9ebe48f89a1cfe4c506b27c1 Mon Sep 17 00:00:00 2001 From: Mutsuha Asada Date: Tue, 10 Jun 2025 18:23:30 +0900 Subject: [PATCH] ocamlPackages-ancient: init at 0.10.0 --- .../ocaml-modules/ancient/default.nix | 42 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/ocaml-modules/ancient/default.nix diff --git a/pkgs/development/ocaml-modules/ancient/default.nix b/pkgs/development/ocaml-modules/ancient/default.nix new file mode 100644 index 000000000000..65743757be89 --- /dev/null +++ b/pkgs/development/ocaml-modules/ancient/default.nix @@ -0,0 +1,42 @@ +{ + lib, + buildDunePackage, + fetchurl, +}: +buildDunePackage rec { + pname = "ancient"; + version = "0.10.0"; + + minimalOCamlVersion = "4.12"; + + src = fetchurl { + url = "https://github.com/OCamlPro/ocaml-ancient/releases/download/${version}/ancient-${version}.tbz"; + hash = "sha256-XeVUPrdg7QSV7V0Tz8Mkj5jvzKtYD9DON+tt9kkuCHM="; + }; + + doCheck = true; + + meta = { + description = "Use data structures larger than available memory"; + longDescription = '' + This module allows you to use in-memory data structures which are + larger than available memory and so are kept in swap. If you try this + in normal OCaml code, you'll find that the machine quickly descends + into thrashing as the garbage collector repeatedly iterates over + swapped memory structures. This module lets you break that + limitation. Of course the module doesn't work by magic :-) If your + program tries to access these large structures, they still need to be + swapped back in, but it is suitable for large, sparsely accessed + structures. + + Secondly, this module allows you to share those structures between + processes. In this mode, the structures are backed by a disk file, + and any process that has read/write access that disk file can map that + file in and see the structures. + ''; + homepage = "https://github.com/OCamlPro/ocaml-ancient"; + changelog = "https://raw.githubusercontent.com/OCamlPro/ocaml-ancient/refs/tags/${version}/CHANGES.md"; + license = lib.licenses.lgpl21Plus; + maintainers = with lib.maintainers; [ momeemt ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 506c88df82cd..e7f5691bbee6 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -30,6 +30,8 @@ let alsa = callPackage ../development/ocaml-modules/alsa { }; + ancient = callPackage ../development/ocaml-modules/ancient { }; + angstrom = callPackage ../development/ocaml-modules/angstrom { }; angstrom-async = callPackage ../development/ocaml-modules/angstrom-async { };