From cff15fae198f031986cb7456f62d73c654618e75 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 20 Apr 2025 06:33:16 +0100 Subject: [PATCH 1/2] gperf_3_0: remove, no users in `nixpkgs` --- pkgs/development/tools/misc/gperf/3.0.x.nix | 53 ------------------- .../tools/misc/gperf/gperf-ar-fix.patch | 46 ---------------- pkgs/top-level/all-packages.nix | 2 - 3 files changed, 101 deletions(-) delete mode 100644 pkgs/development/tools/misc/gperf/3.0.x.nix delete mode 100644 pkgs/development/tools/misc/gperf/gperf-ar-fix.patch diff --git a/pkgs/development/tools/misc/gperf/3.0.x.nix b/pkgs/development/tools/misc/gperf/3.0.x.nix deleted file mode 100644 index 9fb2caa7b845..000000000000 --- a/pkgs/development/tools/misc/gperf/3.0.x.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - autoreconfHook, -}: - -stdenv.mkDerivation rec { - pname = "gperf"; - version = "3.0.4"; - - src = fetchurl { - url = "mirror://gnu/gperf/gperf-${version}.tar.gz"; - sha256 = "0gnnm8iqcl52m8iha3sxrzrl9mcyhg7lfrhhqgdn4zj00ji14wbn"; - }; - - nativeBuildInputs = [ autoreconfHook ]; - patches = [ - ./gperf-ar-fix.patch - # Clang 16 defaults to C++17, which does not allow `register` as a storage class specifier. - ./gperf-c++17-register-fix.patch - ]; - - # Replace the conditional inclusion of `string.h` on VMS with unconditional inclusion on all - # platforms. Otherwise, clang 16 fails to build gperf due to use of undeclared library functions. - postPatch = '' - sed '/#ifdef VMS/{N;N;N;N;N;s/.*/#include /}' -i lib/getopt.c - ''; - - meta = { - description = "Perfect hash function generator"; - mainProgram = "gperf"; - - 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 = lib.licenses.gpl3Plus; - - homepage = "https://www.gnu.org/software/gperf/"; - platforms = lib.platforms.unix; - }; -} diff --git a/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch b/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch deleted file mode 100644 index 942d726d76ea..000000000000 --- a/pkgs/development/tools/misc/gperf/gperf-ar-fix.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- 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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 83f48cfe8b1f..6361e3d67038 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8399,8 +8399,6 @@ with pkgs; gradle = wrapGradle gradle-unwrapped "gradle-unwrapped"; gperf = callPackage ../development/tools/misc/gperf { }; - # 3.1 changed some parameters from int to size_t, leading to mismatches. - gperf_3_0 = callPackage ../development/tools/misc/gperf/3.0.x.nix { }; griffe = with python3Packages; toPythonApplication griffe; From 51d30ce737699e90507a58aa06cfad6d707cf476 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 20 Apr 2025 06:26:07 +0100 Subject: [PATCH 2/2] gperf: 3.1 -> 3.3 Changes: - https://lists.gnu.org/archive/html/info-gnu/2025-04/msg00004.html - https://lists.gnu.org/archive/html/info-gnu/2025-04/msg00013.html --- pkgs/development/tools/misc/gperf/default.nix | 9 ++------- .../tools/misc/gperf/gperf-c++17-register-fix.patch | 13 ------------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 pkgs/development/tools/misc/gperf/gperf-c++17-register-fix.patch diff --git a/pkgs/development/tools/misc/gperf/default.nix b/pkgs/development/tools/misc/gperf/default.nix index 150a0cf0c6e9..a6b789f4faa8 100644 --- a/pkgs/development/tools/misc/gperf/default.nix +++ b/pkgs/development/tools/misc/gperf/default.nix @@ -6,18 +6,13 @@ stdenv.mkDerivation rec { pname = "gperf"; - version = "3.1"; + version = "3.3"; src = fetchurl { url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz"; - sha256 = "1qispg6i508rq8pkajh26cznwimbnj06wq9sd85vg95v8nwld1aq"; + hash = "sha256-/Yfgq6fkOuBUg3r9bNTbA6PyaT3rNhkIXm7Z2NlgStg="; }; - patches = [ - # Clang 16 defaults to C++17, which does not allow `register` as a storage class specifier. - ./gperf-c++17-register-fix.patch - ]; - enableParallelBuilding = true; meta = { diff --git a/pkgs/development/tools/misc/gperf/gperf-c++17-register-fix.patch b/pkgs/development/tools/misc/gperf/gperf-c++17-register-fix.patch deleted file mode 100644 index bb8c414a1a26..000000000000 --- a/pkgs/development/tools/misc/gperf/gperf-c++17-register-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/getline.cc b/lib/getline.cc -index c57c633..0984a7c 100644 ---- a/lib/getline.cc -+++ b/lib/getline.cc -@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset) - - for (;;) - { -- register int c = getc (stream); -+ int c = getc (stream); - - /* We always want at least one char left in the buffer, since we - always (unless we get an error while reading the first char)