about summary refs log tree commit diff
path: root/pkgs/by-name/tr/triehash/package.nix
blob: e9d8a92e2c2e312a93d57f8d9f8c83046ba2c453 (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
40
41
42
43
44
45
46
47
48
49
{ lib
, stdenv
, fetchFromGitHub
, perlPackages
}:

stdenv.mkDerivation rec {
  pname = "triehash";
  version = "0.3";

  src = fetchFromGitHub {
    owner = "julian-klode";
    repo = "triehash";
    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/triehash/ $out/share/triehash/
    install triehash.pl $out/bin/triehash
    install README.md $out/share/doc/triehash/
    cp -r tests/ $out/share/triehash/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;
    mainProgram = "triehash";
  };
}