2021-01-15 09:52:05 +00:00
|
|
|
{ lib, buildDunePackage, fetchurl
|
2021-03-16 12:07:17 +00:00
|
|
|
, ocaml, dune-configurator, cmdliner
|
|
|
|
, lwt, withLwt ? lib.versionAtLeast ocaml.version "4.07"
|
2021-01-15 09:52:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "hxd";
|
2021-03-16 12:07:17 +00:00
|
|
|
version = "0.3.1";
|
2021-01-15 09:52:05 +00:00
|
|
|
|
|
|
|
useDune2 = true;
|
|
|
|
|
|
|
|
minimumOCamlVersion = "4.06";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/dinosaure/hxd/releases/download/v${version}/hxd-v${version}.tbz";
|
2021-03-16 12:07:17 +00:00
|
|
|
sha256 = "1c226c91e17cd329dec0c287bfd20f36302aa533069ff9c6ced32721f96b29bc";
|
2021-01-15 09:52:05 +00:00
|
|
|
};
|
|
|
|
|
2021-03-16 12:07:17 +00:00
|
|
|
# ignore yes stderr output due to trapped SIGPIPE
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's|yes ".\+"|& 2> /dev/null|' test/*.t
|
|
|
|
'';
|
|
|
|
|
2021-01-15 09:52:05 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
dune-configurator
|
|
|
|
];
|
|
|
|
|
2021-03-16 12:07:17 +00:00
|
|
|
propagatedBuildInputs = lib.optional withLwt lwt;
|
|
|
|
|
2021-01-15 09:52:05 +00:00
|
|
|
buildInputs = [
|
|
|
|
cmdliner
|
|
|
|
];
|
|
|
|
|
2021-03-16 12:07:17 +00:00
|
|
|
doCheck = true;
|
2021-01-15 09:52:05 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Hexdump in OCaml";
|
|
|
|
homepage = "https://github.com/dinosaure/hxd";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
|
|
};
|
|
|
|
}
|