Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, python3, fetchFromGitHub }:
2python3.pkgs.buildPythonApplication rec {
3 pname = "perfect-hash";
4 version = "0.4.1";
5
6 # Archive on pypi does not contain examples, which are very helpful to
7 # understand how to use this program, so we use git source.
8 src = fetchFromGitHub {
9 owner = "ilanschnell";
10 repo = "perfect-hash";
11 rev = version;
12 sha256 = "0gkc3n613hl0q4jknrh2nm1n96j97p36q9jjgarb9d8yii9q7792";
13 };
14
15 postInstall = ''
16 mkdir -p $out/share/doc/perfect-hash
17 cp README.md $out/share/doc/perfect-hash
18 cp -r examples $out/share/doc/perfect-hash
19 '';
20
21 meta = with lib; {
22 description = "Minimal perfect hash function generator";
23 longDescription = ''
24 Generate a minimal perfect hash function for a given set of keys.
25 A given code template is filled with parameters, such that the
26 output is code which implements the hash function. Templates can
27 easily be constructed for any programming language.
28 '';
29 license = licenses.bsd3;
30 maintainers = [ maintainers.kaction ];
31
32 homepage = "https://github.com/ilanschnell/perfect-hash";
33 platforms = platforms.unix;
34 };
35}