about summary refs log tree commit diff
path: root/pkgs/development/tools/misc
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2023-09-16 15:29:03 +0200
committerVladimír Čunát <v@cunat.cz>2023-09-16 15:29:03 +0200
commit52504abc0e5d05fa7e58a18e34252e39114c9b5b (patch)
tree5688310805ba2ee9a5eafb7128b88f257a138848 /pkgs/development/tools/misc
parentffbbca6e2dff52463771493cdfb6712026f9836c (diff)
parentb9a010e21350218264ece5757f0bea1a2c1760d4 (diff)
downloadnixlib-52504abc0e5d05fa7e58a18e34252e39114c9b5b.tar
nixlib-52504abc0e5d05fa7e58a18e34252e39114c9b5b.tar.gz
nixlib-52504abc0e5d05fa7e58a18e34252e39114c9b5b.tar.bz2
nixlib-52504abc0e5d05fa7e58a18e34252e39114c9b5b.tar.lz
nixlib-52504abc0e5d05fa7e58a18e34252e39114c9b5b.tar.xz
nixlib-52504abc0e5d05fa7e58a18e34252e39114c9b5b.tar.zst
nixlib-52504abc0e5d05fa7e58a18e34252e39114c9b5b.zip
Merge #252245: gperf_3_0: fix build with clang 16
...into staging
Diffstat (limited to 'pkgs/development/tools/misc')
-rw-r--r--pkgs/development/tools/misc/gperf/3.0.x.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/development/tools/misc/gperf/3.0.x.nix b/pkgs/development/tools/misc/gperf/3.0.x.nix
index f83b245417ee..8a2fdf6ec4b3 100644
--- a/pkgs/development/tools/misc/gperf/3.0.x.nix
+++ b/pkgs/development/tools/misc/gperf/3.0.x.nix
@@ -10,7 +10,18 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ autoreconfHook ];
-  patches = [ ./gperf-ar-fix.patch ];
+  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 <string.h>/}' -i lib/getopt.c
+  '';
+
   meta = {
     description = "Perfect hash function generator";