summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/hxd/default.nix
blob: 0b05a83dd7ef53bc6e18ee74fd59e448756480e3 (plain) (blame)
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
{ lib, buildDunePackage, fetchurl
, ocaml, dune-configurator, cmdliner
, lwt, withLwt ? lib.versionAtLeast ocaml.version "4.07"
}:

buildDunePackage rec {
  pname = "hxd";
  version = "0.3.1";

  useDune2 = true;

  minimumOCamlVersion = "4.06";

  src = fetchurl {
    url = "https://github.com/dinosaure/hxd/releases/download/v${version}/hxd-v${version}.tbz";
    sha256 = "1c226c91e17cd329dec0c287bfd20f36302aa533069ff9c6ced32721f96b29bc";
  };

  # ignore yes stderr output due to trapped SIGPIPE
  postPatch = ''
    sed -i 's|yes ".\+"|& 2> /dev/null|' test/*.t
  '';

  propagatedBuildInputs = lib.optional withLwt lwt;

  buildInputs = [
    cmdliner
    dune-configurator
  ];

  doCheck = true;

  meta = with lib; {
    description = "Hexdump in OCaml";
    homepage = "https://github.com/dinosaure/hxd";
    license = licenses.mit;
    maintainers = [ maintainers.sternenseemann ];
  };
}