nixpkgs/pkgs/by-name/pe/perfect-hash/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

37 lines
1.2 KiB
Nix

{ 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;
};
}