From dc39edb79096e8039293b17469434780527198dc Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 12 Oct 2022 11:28:45 +0200 Subject: man-db: fix gnulib issue (#33149) Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> --- .../repos/builtin/packages/man-db/gnulib.patch | 39 ++++++++++++++++++++++ var/spack/repos/builtin/packages/man-db/package.py | 4 +++ 2 files changed, 43 insertions(+) create mode 100644 var/spack/repos/builtin/packages/man-db/gnulib.patch diff --git a/var/spack/repos/builtin/packages/man-db/gnulib.patch b/var/spack/repos/builtin/packages/man-db/gnulib.patch new file mode 100644 index 0000000000..90537142e3 --- /dev/null +++ b/var/spack/repos/builtin/packages/man-db/gnulib.patch @@ -0,0 +1,39 @@ +From 84863a1c4dc8cca8fb0f6f670f67779cdd2d543b Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Sat, 30 Apr 2022 14:09:00 +0200 +Subject: [PATCH] string: Avoid syntax error on glibc systems with GCC 11. + +Reported by Tom Tromey in + +and by Satadru Pramanik in +. + +* lib/string.in.h (strndup): Don't rededeclare strndup if it is defined +as a macro. +--- + ChangeLog | 10 ++++++++++ + lib/string.in.h | 4 ++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/lib/string.in.h b/lib/string.in.h +index b6840fa91..33160b252 100644 +--- a/lib/string.in.h ++++ b/lib/string.in.h +@@ -583,7 +583,7 @@ _GL_FUNCDECL_RPL (strndup, char *, + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); + _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); + # else +-# if !@HAVE_DECL_STRNDUP@ || __GNUC__ >= 11 ++# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup) + _GL_FUNCDECL_SYS (strndup, char *, + (char const *__s, size_t __n) + _GL_ARG_NONNULL ((1)) +@@ -593,7 +593,7 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); + # endif + _GL_CXXALIASWARN (strndup); + #else +-# if __GNUC__ >= 11 ++# if __GNUC__ >= 11 && !defined strndup + /* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ + _GL_FUNCDECL_SYS (strndup, char *, + (char const *__s, size_t __n) diff --git a/var/spack/repos/builtin/packages/man-db/package.py b/var/spack/repos/builtin/packages/man-db/package.py index 0c91a6f5fe..bb3211a08b 100644 --- a/var/spack/repos/builtin/packages/man-db/package.py +++ b/var/spack/repos/builtin/packages/man-db/package.py @@ -30,6 +30,10 @@ class ManDb(AutotoolsPackage): depends_on("gdbm") depends_on("groff", type=("build", "link", "run")) + # gnulib bug introduced in commit cbdb5ea63cb5348d9ead16dc46bedda77a4c3d7d. + # fix is from commit 84863a1c4dc8cca8fb0f6f670f67779cdd2d543b + patch("gnulib.patch", when="@2.10.2", working_dir="gl") + # TODO: add gzip support via a new package. # man pages are typically compressed, include all available # compression libraries -- cgit v1.2.3-70-g09d2