summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/bigstringaf/default.nix
blob: fd2fd76ff3041dad7b66e142f80d9700acdb5a31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  fetchFromGitHub,
  buildDunePackage,
  alcotest,
  pkg-config,
  dune-configurator,
}:

buildDunePackage (finalAttrs: {
  pname = "bigstringaf";
  version = "0.10.0";

  minimalOCamlVersion = "4.08";

  src = fetchFromGitHub {
    owner = "inhabitedtype";
    repo = "bigstringaf";
    tag = finalAttrs.version;
    hash = "sha256-p1hdB3ArOd2UX7S6YvXCFbYjEiXdMDmBaC/lFQgua7Q=";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ dune-configurator ];

  checkInputs = [ alcotest ];
  doCheck = true;

  meta = {
    description = "Bigstring intrinsics and fast blits based on memcpy/memmove";
    longDescription = ''
      Bigstring intrinsics and fast blits based on memcpy/memmove

      The OCaml compiler has a bunch of intrinsics for Bigstrings, but they're not
      widely-known, sometimes misused, and so programs that use Bigstrings are slower
      than they have to be. And even if a library got that part right and exposed the
      intrinsics properly, the compiler doesn't have any fast blits between
      Bigstrings and other string-like types.

      So here they are. Go crazy.
    '';
    changelog = "https://github.com/inhabitedtype/bigstringaf/releases/tag/${finalAttrs.version}";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.vbgl ];
    inherit (finalAttrs.src.meta) homepage;
  };
})