Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2020 05:41:13 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r559542 - in head/devel: . libgnuregex libgnuregex/files
Message-ID:  <202012290541.0BT5fDjX014866@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Dec 29 05:41:12 2020
New Revision: 559542
URL: https://svnweb.freebsd.org/changeset/ports/559542

Log:
  [NEW PORT] devel/libgnuregex: GNU regex(3) extension library
  
  This version of libgnuregex is based on the latest version of devel/gnulib
  in the tree, and is intended as a direct replacement for the libgnuregex
  that has been historically provided in base.
  
  A port was chosen over all consumers dragging in devel/gnulib to save
  rebuilds since more than ~5 consumers need libgnuregex, and this also makes
  for an easier migration as ports just need to bring in the port and make
  sure LOCALBASE/lib and LOCALBASE/inclue are included.
  
  It is currently expected that ports dependant on this will fully specify the
  shlib version against ports tree convention so that we can provide a
  consistent experience across all versions of FreeBSD, past and future, using
  a less-broken version of the library.
  
  PR:		252245

Added:
  head/devel/libgnuregex/
  head/devel/libgnuregex/Makefile   (contents, props changed)
  head/devel/libgnuregex/files/
  head/devel/libgnuregex/files/Makefile   (contents, props changed)
  head/devel/libgnuregex/files/config.h   (contents, props changed)
  head/devel/libgnuregex/files/gnuregex.h   (contents, props changed)
  head/devel/libgnuregex/files/patch-regex.c   (contents, props changed)
  head/devel/libgnuregex/files/patch-regex.h   (contents, props changed)
  head/devel/libgnuregex/files/patch-regex__internal.h   (contents, props changed)
  head/devel/libgnuregex/pkg-descr   (contents, props changed)
  head/devel/libgnuregex/pkg-plist   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Tue Dec 29 04:04:14 2020	(r559541)
+++ head/devel/Makefile	Tue Dec 29 05:41:12 2020	(r559542)
@@ -1194,6 +1194,7 @@
     SUBDIR += libglade2
     SUBDIR += libglademm24
     SUBDIR += libgnt
+    SUBDIR += libgnuregex
     SUBDIR += libgpc
     SUBDIR += libgpkg
     SUBDIR += libgrading

Added: head/devel/libgnuregex/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/Makefile	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+PORTNAME=	libgnuregex
+PORTVERSION=	6.0
+CATEGORIES=	devel
+MASTER_SITES=	# Nothing to fetch
+DISTFILES=	# Nothing to fetch
+
+MAINTAINER=	kevans@FreeBSD.org
+COMMENT=	GNU Regex Library
+
+LICENSE=	LGPL20+
+
+EXTRACT_DEPENDS=	gnulib>0:devel/gnulib
+
+USES=		uidfix
+USE_LDCONFIG=	yes
+
+MAKE_ENV+=	INCLUDEDIR="${PREFIX}/include" LIBDIR="${PREFIX}/lib"
+
+REGEX_FILES=	lib/regex.c \
+		lib/regex.h \
+		lib/regex_internal.c \
+		lib/regex_internal.h \
+		lib/regexec.c \
+		lib/regcomp.c
+
+do-extract:
+	${MKDIR} ${WRKSRC}
+	${CP} -a ${REGEX_FILES:C,^,${LOCALBASE}/share/gnulib/,} ${WRKSRC}
+	${CP} -a ${FILESDIR}/config.h ${FILESDIR}/gnuregex.h \
+		${FILESDIR}/Makefile ${WRKSRC}
+
+pre-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/include/gnu
+
+.include <bsd.port.mk>

Added: head/devel/libgnuregex/files/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/files/Makefile	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+LIB=			gnuregex
+SHLIB_MAJOR=	6
+
+MK_PROFILE:=	no
+
+SRCS=		regex.c
+
+INCSGROUPS=     INCS WRINCS
+INCS=           regex.h
+INCSDIR=        ${INCLUDEDIR}/gnu
+WRINCS=         gnuregex.h
+
+.include <bsd.lib.mk>

Added: head/devel/libgnuregex/files/config.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/files/config.h	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,15 @@
+/* $FreeBSD$ */
+
+#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

Added: head/devel/libgnuregex/files/gnuregex.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/files/gnuregex.h	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,33 @@
+/*-
+ * Copyright (c) 2004 David E. O'Brien
+ * Copyright (c) 2004 Andrey A. Chernov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifdef __GNUC__
+#warning "Use -I/usr/include/gnu and <regex.h> instead of <gnuregex.h>"
+#endif
+#include <gnu/regex.h>

Added: head/devel/libgnuregex/files/patch-regex.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/files/patch-regex.c	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,20 @@
+--- regex.c.orig	2014-02-03 00:48:46 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 @@
+    #undefs RE_DUP_MAX and sets it to the right value.  */
+ #include <limits.h>
+ 
+-#include <regex.h>
++#include "regex.h"
+ #include "regex_internal.h"
+ 
+ #include "regex_internal.c"

Added: head/devel/libgnuregex/files/patch-regex.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/files/patch-regex.h	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,11 @@
+--- regex.h.orig	2020-12-28 19:24:49 UTC
++++ regex.h
+@@ -30,7 +30,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
+ 

Added: head/devel/libgnuregex/files/patch-regex__internal.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/files/patch-regex__internal.h	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,11 @@
+--- 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
+ 

Added: head/devel/libgnuregex/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/pkg-descr	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,11 @@
+libgnuregex is the regex subset of Gnulib, the GNU portability library. The
+regex subset offers an extension of the regex(3) API to allow more flexibility
+in the flavor of regular expressions. libgnuregex also enhances POSIX
+regular expressions with more features and shorthand, such as:
+
+- \b and \B (word boundary, not word boundary)
+- \s and \S ([[:space:]], [^[:space:]])
+- \w and \W ([[:alnum:]], [^[:alnum:]])
+- \` and \' (beginning of subject, end of subject)
+
+WWW: http://www.gnu.org/software/gnulib/

Added: head/devel/libgnuregex/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/libgnuregex/pkg-plist	Tue Dec 29 05:41:12 2020	(r559542)
@@ -0,0 +1,5 @@
+include/gnu/regex.h
+include/gnuregex.h
+lib/libgnuregex.a
+lib/libgnuregex.so
+lib/libgnuregex.so.6



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012290541.0BT5fDjX014866>