summaryrefslogtreecommitdiff
path: root/pkgs/development/ocaml-modules/dum/default.nix
blob: 78cae6f37866dd736129241f9d49b4df8ce813c1 (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
{
  lib,
  easy-format,
  buildDunePackage,
  fetchurl,
}:

buildDunePackage (finalAttrs: {
  pname = "dum";
  version = "1.0.3";

  src = fetchurl {
    url = "https://github.com/mjambon/dum/releases/download/${finalAttrs.version}/dum-${finalAttrs.version}.tbz";
    hash = "sha256-ZFojUD/IoxVTDfGyh2wveFsSz4D19pKkHrNuU+LFJlE=";
  };

  postPatch = ''
    substituteInPlace "dum.ml" \
    --replace-fail "Lazy.lazy_is_val" "Lazy.is_val" \
    --replace-fail "Obj.final_tag" "Obj.custom_tag"
  '';

  propagatedBuildInputs = [ easy-format ];

  meta = {
    homepage = "https://github.com/mjambon/dum";
    description = "Inspect the runtime representation of arbitrary OCaml values";
    longDescription = ''
      Dum is a library for inspecting the runtime representation of
      arbitrary OCaml values. Shared or cyclic data are detected
      and labelled. This guarantees that printing would always
      terminate. This makes it possible to print values such as closures,
      objects or exceptions in depth and without risk.
    '';
    license = lib.licenses.lgpl21Plus;
    maintainers = [ ];
  };
})