diff --git a/devel/libgnuregex/Makefile b/devel/libgnuregex/Makefile index 3bf76386fbb8..97b562041893 100644 --- a/devel/libgnuregex/Makefile +++ b/devel/libgnuregex/Makefile @@ -1,36 +1,48 @@ PORTNAME= libgnuregex PORTVERSION= 6.0 CATEGORIES= devel MASTER_SITES= # Nothing to fetch DISTFILES= # Nothing to fetch MAINTAINER= kevans@FreeBSD.org COMMENT= GNU Regex Library WWW= https://www.gnu.org/software/gnulib/ LICENSE= LGPL20+ 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} pre-install: ${MKDIR} ${STAGEDIR}${PREFIX}/include/gnu .include 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 @@ -1,13 +1,15 @@ #define _REGEX_RE_COMP 1 #define HAVE_LANGINFO_H 1 #define HAVE_LANGINFO_CODESET 1 #define HAVE_LOCALE_H 1 #define HAVE_WCHAR_H 1 #define HAVE_WCTYPE_H 1 #define HAVE_ISBLANK 1 #define HAVE_WCRTOMB 1 #define HAVE_MBRTOWC 1 #define HAVE_WCSCOLL 1 #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 @@ - . */ - - #ifndef _LIBC --# include -+# 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 , which correctly #undefs RE_DUP_MAX and sets it to the right value. */ #include ++#include --#include -+#include "regex.h" + #include #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,11 +1,11 @@ ---- 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. */ -#ifdef _GNU_SOURCE +#if defined(_GNU_SOURCE) || defined(__BSD_VISIBLE) # define __USE_GNU 1 #endif 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 - #endif -