git: 852c6720aa0d - main - devel/libgnuregex: Fix building after gnulib update
Date: Wed, 15 Apr 2026 13:25:03 UTC
The branch main has been updated by arrowd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=852c6720aa0ddf896adc7d4f8e713c4b5834a2e9
commit 852c6720aa0ddf896adc7d4f8e713c4b5834a2e9
Author: Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2026-04-14 09:10:55 +0000
Commit: Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2026-04-15 13:24:58 +0000
devel/libgnuregex: Fix building after gnulib update
Approved by: kevans (maintainer)
Differential Revision: https://reviews.freebsd.org/D56386
---
devel/libgnuregex/Makefile | 18 +++++++++++++++---
devel/libgnuregex/files/config.h | 2 ++
devel/libgnuregex/files/patch-regex.c | 20 +++++---------------
devel/libgnuregex/files/patch-regex.h | 4 ++--
devel/libgnuregex/files/patch-regex__internal.h | 11 -----------
5 files changed, 24 insertions(+), 31 deletions(-)
diff --git a/devel/libgnuregex/Makefile b/devel/libgnuregex/Makefile
index 3bf76386fbb8..97b562041893 100644
--- a/devel/libgnuregex/Makefile
+++ b/devel/libgnuregex/Makefile
@@ -15,18 +15,30 @@ EXTRACT_DEPENDS= gnulib>0:devel/gnulib
USES= uidfix
USE_LDCONFIG= yes
+CFLAGS= -I${WRKSRC}
MAKE_ENV+= INCLUDEDIR="${PREFIX}/include" LIBDIR="${PREFIX}/lib"
-REGEX_FILES= lib/regex.c \
+REGEX_FILES= lib/attribute.h \
+ lib/cdefs.h \
+ lib/dynarray.h \
+ lib/gettext.h \
+ lib/intprops.h \
+ lib/intprops-internal.h \
+ lib/libc-config.h \
+ lib/regex.c \
lib/regex.h \
lib/regex_internal.c \
lib/regex_internal.h \
lib/regexec.c \
- lib/regcomp.c
+ lib/regcomp.c \
+ lib/verify.h
+REGEX_MALLOC_FILES= lib/malloc/dynarray.h \
+ lib/malloc/dynarray-skeleton.c
do-extract:
- ${MKDIR} ${WRKSRC}
+ ${MKDIR} -p ${WRKSRC}/malloc
${CP} -a ${REGEX_FILES:C,^,${LOCALBASE}/share/gnulib/,} ${WRKSRC}
+ ${CP} -a ${REGEX_MALLOC_FILES:C,^,${LOCALBASE}/share/gnulib/,} ${WRKSRC}/malloc
${CP} -a ${FILESDIR}/config.h ${FILESDIR}/gnuregex.h \
${FILESDIR}/Makefile ${WRKSRC}
diff --git a/devel/libgnuregex/files/config.h b/devel/libgnuregex/files/config.h
index b117619d0b02..f196bad93147 100644
--- a/devel/libgnuregex/files/config.h
+++ b/devel/libgnuregex/files/config.h
@@ -11,3 +11,5 @@
#define HAVE_ALLOCA 1
#define HAVE_STDBOOL_H 1
#define HAVE_STDINT_H 1
+#define _GL_CONFIG_H_INCLUDED 1
+#define _GL_ATTRIBUTE_FALLTHROUGH __attribute__((fallthrough));
diff --git a/devel/libgnuregex/files/patch-regex.c b/devel/libgnuregex/files/patch-regex.c
index 8f7c831cb18c..68a84ef0d3b3 100644
--- a/devel/libgnuregex/files/patch-regex.c
+++ b/devel/libgnuregex/files/patch-regex.c
@@ -1,20 +1,10 @@
---- regex.c.orig 2014-02-03 00:48:46 UTC
+--- regex.c.orig 2026-01-27 18:52:19 UTC
+++ regex.c
-@@ -18,7 +18,7 @@
- <http://www.gnu.org/licenses/>. */
-
- #ifndef _LIBC
--# include <config.h>
-+# include "config.h"
-
- # if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
- # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
-@@ -64,7 +64,7 @@
+@@ -63,6 +63,7 @@
+ GNU regex allows. Include it before <regex.h>, which correctly
#undefs RE_DUP_MAX and sets it to the right value. */
#include <limits.h>
++#include <stdbool.h>
--#include <regex.h>
-+#include "regex.h"
+ #include <regex.h>
#include "regex_internal.h"
-
- #include "regex_internal.c"
diff --git a/devel/libgnuregex/files/patch-regex.h b/devel/libgnuregex/files/patch-regex.h
index f76971296606..148444cb380d 100644
--- a/devel/libgnuregex/files/patch-regex.h
+++ b/devel/libgnuregex/files/patch-regex.h
@@ -1,6 +1,6 @@
---- regex.h.orig 2020-12-28 19:24:49 UTC
+--- regex.h.orig 2026-01-27 18:52:19 UTC
+++ regex.h
-@@ -30,7 +30,7 @@ extern "C" {
+@@ -29,7 +29,7 @@ extern "C" {
/* Define __USE_GNU to declare GNU extensions that violate the
POSIX name space rules. */
diff --git a/devel/libgnuregex/files/patch-regex__internal.h b/devel/libgnuregex/files/patch-regex__internal.h
deleted file mode 100644
index ebe4102924ee..000000000000
--- a/devel/libgnuregex/files/patch-regex__internal.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- regex_internal.h.orig 2020-12-28 19:25:52 UTC
-+++ regex_internal.h
-@@ -481,7 +481,7 @@ static unsigned int re_string_context_at (const re_str
- #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
- #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
-
--#if defined _LIBC || HAVE_ALLOCA
-+#if defined _LIBC || (HAVE_ALLOCA && HAVE_ALLOCA_H)
- # include <alloca.h>
- #endif
-