1{lib, stdenv, fetchurl}:
2
3stdenv.mkDerivation rec {
4 pname = "gperf";
5 version = "3.1";
6
7 src = fetchurl {
8 url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
9 sha256 = "1qispg6i508rq8pkajh26cznwimbnj06wq9sd85vg95v8nwld1aq";
10 };
11
12 meta = {
13 description = "Perfect hash function generator";
14
15 longDescription = ''
16 GNU gperf is a perfect hash function generator. For a given
17 list of strings, it produces a hash function and hash table, in
18 form of C or C++ code, for looking up a value depending on the
19 input string. The hash function is perfect, which means that
20 the hash table has no collisions, and the hash table lookup
21 needs a single string comparison only.
22
23 GNU gperf is highly customizable. There are options for
24 generating C or C++ code, for emitting switch statements or
25 nested ifs instead of a hash table, and for tuning the algorithm
26 employed by gperf.
27 '';
28
29 license = lib.licenses.gpl3Plus;
30
31 homepage = "https://www.gnu.org/software/gperf/";
32 platforms = lib.platforms.unix;
33 };
34}