Use gopher_re_{comp,exec} #defines to deal with the various #ifdefs.
The port uses
  AC_CHECK_LIB(compat, re_comp, REGEXLIBS="$REGEXLIBS -lcompat")
so it will link in libcompat if present, but it shouldn't matter when we
get rid of it.  POSIX regexps are checked for first in Regex.h.

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/gopher/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile    11 Mar 2013 11:35:47 -0000      1.7
+++ Makefile    29 Nov 2013 17:19:40 -0000
@@ -5,7 +5,7 @@ COMMENT=        distributed document delivery c
 V=             3.0.11
 DISTNAME=      gopher_${V}
 PKGNAME=       gopher-${V}
-REVISION=      1
+REVISION=      2
 CATEGORIES=    net
 
 HOMEPAGE=      http://quux.org/devel/gopher/Downloads/
Index: patches/patch-gopher_Makefile_in
===================================================================
RCS file: /cvs/ports/net/gopher/patches/patch-gopher_Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-gopher_Makefile_in
--- patches/patch-gopher_Makefile_in    13 Dec 2006 23:14:29 -0000      1.2
+++ patches/patch-gopher_Makefile_in    29 Nov 2013 18:14:43 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-gopher_Makefile_in,v 1.2 2006/12/13 23:14:29 deanna Exp $
---- gopher/Makefile.in.orig    Fri Jul 28 20:19:27 2006
-+++ gopher/Makefile.in Fri Jul 28 20:20:44 2006
-@@ -132,7 +132,7 @@ OBJS       = manager.o gopher.o globals.o ouru
+--- gopher/Makefile.in.orig    Wed Jul 20 17:28:52 2005
++++ gopher/Makefile.in Fri Nov 29 18:31:23 2013
+@@ -132,7 +132,7 @@ OBJS       = manager.o gopher.o globals.o ourutils.o cso.o 
\
  
  CCFLAGS       = $(OPT) $(DEBUGGING) -I.. -I$(top_srcdir) 
-I$(top_srcdir)/object \
          $(INTLOPTS) $(CLIENTOPTS)  -DGOPHERLIB=\"$(CLIENTLIB)\" \
Index: patches/patch-object_GSgopherobj_c
===================================================================
RCS file: patches/patch-object_GSgopherobj_c
diff -N patches/patch-object_GSgopherobj_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-object_GSgopherobj_c  29 Nov 2013 17:18:46 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+--- object/GSgopherobj.c.orig  Wed Jul 20 17:28:53 2005
++++ object/GSgopherobj.c       Fri Nov 29 18:18:13 2013
+@@ -1870,9 +1870,9 @@ GSfromLink(
+              }
+ 
+              /** Check for domain using regexps **/
+-             if (re_comp(host))
++             if (gopher_re_comp(host))
+                   break;
+-             if (re_exec(peer) == 1)
++             if (gopher_re_exec(peer) == 1)
+                   BadDomain = TestResult;
+              else
+                   BadDomain = !TestResult;
Index: patches/patch-object_Regex_h
===================================================================
RCS file: /cvs/ports/net/gopher/patches/patch-object_Regex_h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-object_Regex_h
--- patches/patch-object_Regex_h        31 Jul 2006 12:52:20 -0000      1.1.1.1
+++ patches/patch-object_Regex_h        29 Nov 2013 18:15:12 -0000
@@ -1,18 +1,20 @@
 $OpenBSD: patch-object_Regex_h,v 1.1.1.1 2006/07/31 12:52:20 steven Exp $
---- object/Regex.h.orig        Wed Jul 26 12:56:33 2006
-+++ object/Regex.h     Wed Jul 26 12:56:44 2006
-@@ -171,14 +171,6 @@
- #warning REGEX_POSIX defined but REG_EXTENDED not found.
- #endif
+--- object/Regex.h.orig        Wed Jul 20 17:28:53 2005
++++ object/Regex.h     Fri Nov 29 19:13:00 2013
+@@ -177,10 +177,14 @@ in unistd.h.  Eww. */
  
--/* These are named posix_re_comp and then #defined to the original names
--because MacOS X is nice enough to typedef re_comp and re_exec differently
--in unistd.h.  Eww. */
--
--char *posix_re_comp(char *regex);
--int posix_re_exec(char *string);
+ char *posix_re_comp(char *regex);
+ int posix_re_exec(char *string);
 -#define re_comp(a) (posix_re_comp(a))
 -#define re_exec(a) (posix_re_exec(a))
++#define gopher_re_comp(a) (posix_re_comp(a))
++#define gopher_re_exec(a) (posix_re_exec(a))
++
  #else
  
++#define gopher_re_comp(a) (re_comp(a))
++#define gopher_re_exec(a) (re_comp(a))
++
  /* ********** Try to figure out what else they have. */
+ 
+ #ifdef HAVE_RE_COMP

Reply via email to