about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/gperf
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/misc/gperf')
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix35
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gperf/default.nix33
-rw-r--r--nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch46
3 files changed, 114 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix b/nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix
new file mode 100644
index 000000000000..4a8b2e8daaba
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gperf/3.0.x.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "gperf-3.0.4";
+
+  src = fetchurl {
+    url = "mirror://gnu/gperf/${name}.tar.gz";
+    sha256 = "0gnnm8iqcl52m8iha3sxrzrl9mcyhg7lfrhhqgdn4zj00ji14wbn";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  patches = [ ./gperf-ar-fix.patch ];
+  meta = {
+    description = "Perfect hash function generator";
+
+    longDescription = ''
+      GNU gperf is a perfect hash function generator.  For a given
+      list of strings, it produces a hash function and hash table, in
+      form of C or C++ code, for looking up a value depending on the
+      input string.  The hash function is perfect, which means that
+      the hash table has no collisions, and the hash table lookup
+      needs a single string comparison only.
+
+      GNU gperf is highly customizable.  There are options for
+      generating C or C++ code, for emitting switch statements or
+      nested ifs instead of a hash table, and for tuning the algorithm
+      employed by gperf.
+    '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    homepage = https://www.gnu.org/software/gperf/;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gperf/default.nix b/nixpkgs/pkgs/development/tools/misc/gperf/default.nix
new file mode 100644
index 000000000000..cd0854d2beb8
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gperf/default.nix
@@ -0,0 +1,33 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "gperf-3.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/gperf/${name}.tar.gz";
+    sha256 = "1qispg6i508rq8pkajh26cznwimbnj06wq9sd85vg95v8nwld1aq";
+  };
+
+  meta = {
+    description = "Perfect hash function generator";
+
+    longDescription = ''
+      GNU gperf is a perfect hash function generator.  For a given
+      list of strings, it produces a hash function and hash table, in
+      form of C or C++ code, for looking up a value depending on the
+      input string.  The hash function is perfect, which means that
+      the hash table has no collisions, and the hash table lookup
+      needs a single string comparison only.
+
+      GNU gperf is highly customizable.  There are options for
+      generating C or C++ code, for emitting switch statements or
+      nested ifs instead of a hash table, and for tuning the algorithm
+      employed by gperf.
+    '';
+
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    homepage = https://www.gnu.org/software/gperf/;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch b/nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch
new file mode 100644
index 000000000000..942d726d76ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch
@@ -0,0 +1,46 @@
+--- gperf-3.0.4/lib/configure.ac	2009-01-15 02:24:31.000000000 +0200
++++ gperf-3.0.4.patched/lib/configure.ac	2018-11-29 06:37:20.968627533 +0300
+@@ -21,10 +21,12 @@
+ 
+ AC_PREREQ([2.60])
+ AC_INIT([hash.cc])
++m4_include([../aclocal.m4])
+ AC_PROG_MAKE_SET
+ dnl
+ dnl           checks for programs
+ dnl
++AC_SUBST([AR])
+ AC_PROG_CC
+                       dnl sets variable CC
+ AC_PROG_CPP
+--- gperf-3.0.4/lib/Makefile.in	2008-08-23 21:52:48.000000000 +0300
++++ gperf-3.0.4.patched/lib/Makefile.in	2018-11-29 06:36:43.161998888 +0300
+@@ -41,7 +41,7 @@
+ # Both C and C++ compiler
+ OBJEXT = @OBJEXT@
+ # Other
+-AR = ar
++AR = @AR@
+ AR_FLAGS = rc
+ RANLIB = @RANLIB@
+ MV = mv
+--- gperf-3.0.4/doc/configure.ac	2009-01-15 02:24:31.000000000 +0200
++++ gperf-3.0.4.patched/doc/configure.ac	2018-11-29 06:36:00.961288421 +0300
+@@ -21,6 +21,7 @@
+ 
+ AC_PREREQ([2.60])
+ AC_INIT([gperf.1])
++m4_include([../aclocal.m4])
+ PACKAGE=gperf
+ AC_SUBST([PACKAGE])
+ AC_PROG_MAKE_SET
+--- gperf-3.0.4/src/configure.ac	2009-01-15 02:24:30.000000000 +0200
++++ gperf-3.0.4.patched/src/configure.ac	2018-11-29 06:34:21.718576658 +0300
+@@ -21,6 +21,7 @@
+ 
+ AC_PREREQ([2.60])
+ AC_INIT([main.cc])
++m4_include([../aclocal.m4])
+ AC_CONFIG_HEADER([config.h])
+ AC_PROG_MAKE_SET
+ dnl