From aa1983c003c8a3315b9eaa291c296d48589d3049 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Thu, 2 Sep 2021 11:03:21 -0300 Subject: triehash: init at 0.3 --- pkgs/tools/misc/triehash/default.nix | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 pkgs/tools/misc/triehash/default.nix (limited to 'pkgs/tools/misc/triehash') diff --git a/pkgs/tools/misc/triehash/default.nix b/pkgs/tools/misc/triehash/default.nix new file mode 100644 index 00000000000..b916214fab5 --- /dev/null +++ b/pkgs/tools/misc/triehash/default.nix @@ -0,0 +1,48 @@ +{ lib +, stdenv +, fetchFromGitHub +, perlPackages +}: + +stdenv.mkDerivation rec { + pname = "triehash"; + version = "0.3"; + + src = fetchFromGitHub { + owner = "julian-klode"; + repo = pname; + rev = "debian/0.3-3"; + hash = "sha256-LxVcYj2WKHbhNu5x/DFkxQPOYrVkNvwiE/qcODq52Lc="; + }; + + nativeBuildInputs = [ + perlPackages.perl + ]; + + postPatch = '' + patchShebangs triehash.pl + ''; + + dontConfigure = true; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + install -d $out/bin $out/share/doc/${pname}/ $out/share/${pname}/ + install triehash.pl $out/bin/triehash + install README.md $out/share/doc/${pname}/ + cp -r tests/ $out/share/${pname}/tests/ + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/julian-klode/triehash"; + description = "Order-preserving minimal perfect hash function generator"; + license = with licenses; mit; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = perlPackages.perl.meta.platforms; + }; +} -- cgit 1.4.1