Attached patch for EPIC4 adding a perl flavor which lets you run perl scripts. Also included is 'CFLAGS+= -O0' which fixes a problem (on i386 at least), where hitting ctl-C (to add colours), hangs EPIC. If the latter needs to stay in my private tree until a better solution is found, I can submit a modified diff without it if needed.

To get source/perl.c compiled I had to remove the define for HAVE_SYS_SYSCTL_H which triggered the #include-ing of sys/sysctl.h which brings in uvm/uvm_map.h. This causes a conflict, since
#define min_offset              header.start
#define max_offset              header.end

in uvm_map.h breaks
struct reg_substr_datum {
    I32 min_offset;
    I32 max_offset;
    SV *substr;         /* non-utf8 variant */
    SV *utf8_substr;    /* utf8 variant */
    I32 end_shift;
};
in /usr/libdata/perl5/i386-openbsd/5.10.0/CORE/regexp.h

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/epic4/Makefile,v
retrieving revision 1.65
diff -u -r1.65 Makefile
--- Makefile    31 Mar 2009 13:31:18 -0000      1.65
+++ Makefile    11 Apr 2009 03:53:28 -0000
@@ -5,7 +5,7 @@
 VERSION=       2.10
 HELP_DATE=     20050315
 DISTNAME=      epic4-${VERSION}
-PKGNAME=       ${DISTNAME}p0
+PKGNAME=       ${DISTNAME}p1
 CATEGORIES=    net
 MASTER_SITES=  ftp://ftp.epicsol.org/pub/epic/EPIC4-PRODUCTION/
 DISTFILES=     epic4-${VERSION}.tar.bz2 epic4-help-${HELP_DATE}.tar.gz
@@ -17,6 +17,10 @@
 PERMIT_PACKAGE_FTP=    Yes
 PERMIT_DISTFILES_CDROM=        Yes
 PERMIT_DISTFILES_FTP=  Yes
+
+FLAVORS=        perl
+FLAVOR ?=
+
 WANTLIB=       c crypto m ncurses ssl
 
 DESTDIRNAME=   IP
@@ -25,8 +29,17 @@
 
 SEPARATE_BUILD=        simple
 CONFIGURE_STYLE=       gnu
-CONFIGURE_ARGS=        --without-perl \
-               --without-tcl
+# use a lower optimisation level prevents random hangs
+CFLAGS+= -O0
+
+CONFIGURE_ARGS=        --without-tcl
+
+.if ${FLAVOR:L:Mperl}
+CONFIGURE_ARGS+=--enable-perl
+WANTLIB+=       perl util
+.else
+CONFIGURE_ARGS+=--without-perl
+.endif
 
 INSTALL_TARGET=        install installhelp
 
Index: patches/patch-include_defs_h_in
===================================================================
RCS file: patches/patch-include_defs_h_in
diff -N patches/patch-include_defs_h_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_defs_h_in     11 Apr 2009 03:53:28 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- include/defs.h.in.orig     Fri Apr 10 19:58:56 2009
++++ include/defs.h.in  Fri Apr 10 20:00:44 2009
+@@ -333,8 +333,9 @@
+ /* Define if you have the <sys/select.h> header file.  */
+ #undef HAVE_SYS_SELECT_H
+ 
++/* This define triggers conflict between perl embed
++   headers and uvm_map's {max,min}_offset defines.     */
+ /* Define if you have the <sys/sysctl.h> header file.  */
+-#undef HAVE_SYS_SYSCTL_H
+ 
+ /* Define if you have the <sys/syslimits.h> header file.  */
+ #undef HAVE_SYS_SYSLIMITS_H
Index: pkg/DESCR
===================================================================
RCS file: /cvs/ports/net/epic4/pkg/DESCR,v
retrieving revision 1.4
diff -u -r1.4 DESCR
--- pkg/DESCR   15 Dec 2003 21:55:02 -0000      1.4
+++ pkg/DESCR   11 Apr 2009 03:53:28 -0000
@@ -3,3 +3,6 @@
 compatibility is undesirable have been found and fixed. No gratuitous 
 incompatibilities have been added, but lots of new code has been added to 
 make EPIC the best ircII client available.
+
+Flavor:
+  perl: script and control EPIC4 with Perl
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/epic4/pkg/PLIST,v
retrieving revision 1.36
diff -u -r1.36 PLIST
--- pkg/PLIST   14 Jun 2008 02:01:10 -0000      1.36
+++ pkg/PLIST   11 Apr 2009 03:53:29 -0000
@@ -1,5 +1,5 @@
 @comment $OpenBSD: PLIST,v 1.36 2008/06/14 02:01:10 pvalchev Exp $
-...@bin bin/epic
+bin/epic
 @bin bin/epic-EPIC4-${VERSION}
 @bin libexec/wserv4
 @man man/man1/epic.1

Reply via email to