Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jun 2004 09:42:29 -0700 (PDT)
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/68522: WITH_MENUCOLORS update (link with gnuregex lib), and new WITH_MAIL tweak
Message-ID:  <200406301642.i5UGgTvK036116@pentarou.parodius.com>
Resent-Message-ID: <200406301650.i5UGoMGj060431@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         68522
>Category:       ports
>Synopsis:       WITH_MENUCOLORS update (link with gnuregex lib), and new WITH_MAIL tweak
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 30 16:50:21 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jeremy Chadwick
>Release:        FreeBSD 4.10-PRERELEASE i386
>Organization:
Parodius Networking
>Environment:
System: FreeBSD pentarou.parodius.com 4.10-PRERELEASE FreeBSD 4.10-PRERELEASE #0: Wed May 5 03:33:17 PDT 2004 root@pentarou.parodius.com:/usr/obj/usr/src/sys/PENTAROU i386
>Description:
	Seems my previous WITH_MENUCOLORS patch was good, but did not work on 5.x due to
	missing -lgnuregex during link-time.  Now, using WITH_MENUCOLORS forces -lgnuregex
	regardless of OS (since it's on 4.x and 5.x), just to be safe.  Strange that
	it linked fine on 4.x without -lgnuregex, though...

	I've also added a WITH_MAIL tweak. By default, support for nethack reading an mbox
	spool remains disabled, but some of us appreciate the novelty of having it enabled.
	This shouldn't break people using Maildir, since by default MAIL is off.

	Finally, a note for Volker Stolz <vs@FreeBSD.org> -- I'd be happy to take over
	as MAINTAINER, except that I don't use X11 (GNOME or QT).  If this is a problem
	(it may be; your call as a ports submitter), then it's best to leave it how it
	is.  I *am* the maintainer of games/nethack34-nox11, although my Email address
	needs to be updated there.  :-)  Otherwise, happy to be aboard!
>How-To-Repeat:
	Not applicable.
>Fix:
	Apply below patch.

diff -ruN nethack34.orig/Makefile nethack34/Makefile
--- nethack34.orig/Makefile	Wed Jun 30 08:03:09 2004
+++ nethack34/Makefile	Wed Jun 30 09:25:25 2004
@@ -49,6 +49,7 @@
 PATCHFILES+=	nh343-menucolor.diff
 PATCH_SITES+=	http://www.cs.joensuu.fi/~pkalli/code/
 PATCH_DIST_STRIP=	-p1
+MAKE_ENV+=	LIBTTY="-lgnuregex"
 .endif
 .elif ${PKGNAMESUFFIX} == "-qt"
 USE_QT_VER=	3
@@ -59,6 +60,17 @@
 .endif
 .endif
 
+.include <bsd.port.pre.mk>
+
+# FreeBSD 5.2.1-RELEASE (or, well, almost) and above use include/gnu/regex.h
+# while prior releases use include/gnuregex.h.  This simply gets rid of the
+# repetitive warning during the build process on 5.x.
+.if ${OSVERSION} >= 502010
+GNU_REGEX_H=	<gnu/regex.h>
+.else
+GNU_REGEX_H=	<gnuregex.h>
+.endif
+
 pre-everything::
 	@if [ "${PKGBASE}" != "nethack" ]; then \
 	${ECHO_MSG} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ; \
@@ -73,13 +85,16 @@
 .for f in include/config.h sys/unix/Makefile.src sys/unix/Makefile.top
 	${REINPLACE_CMD} -e 's|%%HACKNAME%%|${HACKNAME}|g;s|%%HACKDIR%%|${PREFIX}/${HACKDIR}|g' ${WRKSRC}/${f}
 .endfor
-	${REINPLACE_CMD} -e 's|<regex.h>|<gnuregex.h>|g' ${WRKSRC}/src/sounds.c
+	${REINPLACE_CMD} -e 's|<regex.h>|${GNU_REGEX_H}|g' ${WRKSRC}/src/sounds.c
 	${REINPLACE_CMD} -e 's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/win/Qt/qt_win.cpp
 .if defined(WITHOUT_SHELL)
-	@${REINPLACE_CMD} -e 's|#define SHELL|/* #define SHELL|' ${WRKSRC}/include/unixconf.h
+	${REINPLACE_CMD} -e 's|#define SHELL|/* #define SHELL|' ${WRKSRC}/include/unixconf.h
 .endif
 .if defined(WITH_MENUCOLORS)
-	${REINPLACE_CMD} -e 's|<regex.h>|<gnuregex.h>|g' ${WRKSRC}/include/color.h
+	${REINPLACE_CMD} -e 's|<regex.h>|${GNU_REGEX_H}|g' ${WRKSRC}/include/color.h
+.endif
+.if defined(WITH_MAIL)
+	${REINPLACE_CMD} -e 's|/\* #define MAIL \*/|#define MAIL|' ${WRKSRC}/include/unixconf.h
 .endif
 
 pre-configure:
@@ -92,4 +107,4 @@
 	${INSTALL_DATA} ${WRKSRC}/doc/Guidebook.txt ${PREFIX}/${HACKDOCSDIR}
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ruN nethack34.orig/files/patch-ad nethack34/files/patch-ad
--- nethack34.orig/files/patch-ad	Sun Sep 28 04:51:31 2003
+++ nethack34/files/patch-ad	Wed Jun 30 08:27:53 2004
@@ -1,5 +1,6 @@
---- sys/unix/Makefile.src.orig	Sat Aug 30 09:08:04 2003
-+++ sys/unix/Makefile.src	Mon Sep  1 23:12:45 2003
+diff -ruN sys.orig/unix/Makefile.src sys/unix/Makefile.src
+--- sys.orig/unix/Makefile.src	Sun Dec  7 15:39:13 2003
++++ sys/unix/Makefile.src	Wed Jun 30 08:27:32 2004
 @@ -146,19 +146,29 @@
  # directories.  The ones given below is the usual spot for linux systems.
  # The paths are for glibconfig.h and gnomesupport.h respectively.
@@ -61,7 +62,12 @@
  
  # on some systems the termcap library is in -ltermcap or -lcurses
  # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
-@@ -235,19 +264,19 @@
+@@ -231,23 +260,23 @@
+ # WINTTYLIB = -lcurses
+ # WINTTYLIB = -lcurses16
+ # WINTTYLIB = -lncurses
+-WINTTYLIB = -ltermlib
++WINTTYLIB = -ltermlib ${LIBTTY}
  #
  # libraries for X11
  # If USE_XPM is defined in config.h, you will also need -lXpm here.
>Release-Note:
>Audit-Trail:
>Unformatted:



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