about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/perfect-hash/default.nix
blob: 124758e571e9ad8c7914d0e2c52ebe71188ec43a (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
{ lib, python3, fetchFromGitHub }:
python3.pkgs.buildPythonApplication rec {
  pname = "perfect-hash";
  version = "0.4.1";

  # Archive on pypi does not contain examples, which are very helpful to
  # understand how to use this program, so we use git source.
  src = fetchFromGitHub {
    owner = "ilanschnell";
    repo = "perfect-hash";
    rev = version;
    sha256 = "0gkc3n613hl0q4jknrh2nm1n96j97p36q9jjgarb9d8yii9q7792";
  };

  postInstall = ''
    mkdir -p $out/share/doc/perfect-hash
    cp README.md $out/share/doc/perfect-hash
    cp -r examples $out/share/doc/perfect-hash
  '';

  meta = with lib; {
    description = "Minimal perfect hash function generator";
    mainProgram = "perfect-hash";
    longDescription = ''
      Generate a minimal perfect hash function for a given set of keys.
      A given code template is filled with parameters, such that the
      output is code which implements the hash function. Templates can
      easily be constructed for any programming language.
    '';
    license = licenses.bsd3;
    maintainers = [ maintainers.kaction ];

    homepage = "https://github.com/ilanschnell/perfect-hash";
    platforms = platforms.unix;
  };
}