From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jun 16 10:00:09 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C50121065685 for ; Mon, 16 Jun 2008 10:00:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A40118FC2E for ; Mon, 16 Jun 2008 10:00:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m5GA09Q7017370 for ; Mon, 16 Jun 2008 10:00:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5GA09TV017369; Mon, 16 Jun 2008 10:00:09 GMT (envelope-from gnats) Resent-Date: Mon, 16 Jun 2008 10:00:09 GMT Resent-Message-Id: <200806161000.m5GA09TV017369@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Kozlov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3862D1065676 for ; Mon, 16 Jun 2008 09:52:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 293198FC17 for ; Mon, 16 Jun 2008 09:52:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5G9q2u9037424 for ; Mon, 16 Jun 2008 09:52:02 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m5G9q2Ek037423; Mon, 16 Jun 2008 09:52:02 GMT (envelope-from nobody) Message-Id: <200806160952.m5G9q2Ek037423@www.freebsd.org> Date: Mon, 16 Jun 2008 09:52:02 GMT From: Alex Kozlov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/124637: [patch] games/powwow up to 1.2.13, sgtty -> termios conversion X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2008 10:00:09 -0000 >Number: 124637 >Category: ports >Synopsis: [patch] games/powwow up to 1.2.13, sgtty -> termios conversion >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 16 10:00:09 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Alex Kozlov >Release: FreeBSD 6.3 >Organization: private >Environment: >Description: - update to 1.2.13 - sgtty -> termios conversion >How-To-Repeat: >Fix: Patch attached with submission follows: Index: games/powwow/files/patch-follow.c @@ -1,11 +1,65 @@ ---- follow.c.orig Sat Oct 14 00:12:28 2006 -+++ follow.c Sat Oct 14 00:12:43 2006 -@@ -96,7 +96,7 @@ - ioctl(0, TIOCGLTC, <csave); - ttyb = ttybsave; - ttyb.sg_flags = (ttyb.sg_flags|O_CBREAK) & ~O_ECHO; -- ioctl(tty_read_fd, TIOCSETP, &ttyb); -+ ioctl(0, TIOCSETP, &ttyb); - ltc = ltcsave; - ltc.t_suspc = -1; +Index: follow.c +@@ -13,7 +13,9 @@ + #include + #include + +-#ifndef USE_SGTTY ++#ifdef POSIX ++# include ++#elif !defined(USE_SGTTY) + # ifdef APOLLO + # include "/sys5.3/usr/include/sys/termio.h" + # else +@@ -44,6 +46,9 @@ + # define O_CBREAK CBREAK + #endif + ++#ifdef POSIX ++typedef struct termios termiostruct; ++#else + #if defined(TCSETS) || defined(TCSETATTR) + # ifndef TCSETS /* cc for HP-UX SHOULD define this... */ + # define TCSETS TCSETATTR +@@ -55,6 +60,7 @@ + # define TCGETS TCGETA + typedef struct termio termiostruct; + #endif ++#endif /* POSIX */ + + #ifdef VSUSP + # define O_SUSP VSUSP +@@ -102,14 +108,22 @@ ioctl(0, TIOCSLTC, <c); + #else /* not USE_SGTTY */ + termiostruct ttyb; ++#if POSIX ++ tcgetattr(0, &ttyb); ++#else + ioctl(0, TCGETS, &ttyb); ++#endif + ttybsave = ttyb; + ttyb.c_lflag &= ~(ECHO|ICANON); + ttyb.c_cc[VTIME] = 0; + ttyb.c_cc[VMIN] = 1; + /* disable the special handling of the suspend key (handle it ourselves) */ + ttyb.c_cc[O_SUSP] = 0; ++#if POSIX ++ tcsetattr(0, TCSANOW, &ttyb); ++#else + ioctl(0, TCSETS, &ttyb); ++#endif + #endif /* USE_SGTTY */ + } + +@@ -123,7 +137,11 @@ + ioctl(0, TIOCSETC, &tcsave); + ioctl(0, TIOCSLTC, <csave); + #else /* not USE_SGTTY */ ++#if POSIX ++ tcsetattr(0, TCSANOW, &ttybsave); ++#else + ioctl(0, TCSETS, &ttybsave); ++#endif + #endif /* USE_SGTTY */ + } + Index: games/powwow/files/patch-ptr.c @@ -0,0 +1,17 @@ +Index: ptr.c +@@ -407,6 +407,7 @@ + return (char*)p; /* shortcut for NULL */ + } + ++#ifdef _GNU_SOURCE + /* + * find last occurrence of c in p + * return NULL if none found. +@@ -427,6 +428,7 @@ + else + return NULL; + } ++#endif + + char *ptrrchr __P2 (ptr,p, char,c) + { Index: games/powwow/files/patch-ptr.h @@ -0,0 +1,10 @@ +Index: ptr.h +@@ -65,7 +65,7 @@ + /* TODO: watch memrchr, it is defined differently here than under _GNU_SOURCE, + * so it could cause bizarre results if a module makes use of a library that + * uses it */ +-char *memrchr __P ((char *p, int lenp, char c)); ++//char *memrchr __P ((char *p, int lenp, char c)); + #endif + + #endif /* _PTR_H_ */ Index: games/powwow/files/patch-tty.c @@ -0,0 +1,88 @@ +Index: tty.c +@@ -33,7 +33,9 @@ + #include "tty.h" + #include "tcp.h" + +-#ifndef USE_SGTTY ++#ifdef POSIX ++# include ++#elif !defined(USE_SGTTY) + # ifdef APOLLO + # include "/sys5.3/usr/include/sys/termio.h" + # else +@@ -64,6 +66,9 @@ + # define O_CBREAK CBREAK + #endif + ++#ifdef POSIX ++typedef struct termios termiostruct; ++#else + #if defined(TCSETS) || defined(TCSETATTR) + # ifndef TCSETS /* cc for HP-UX SHOULD define this... */ + # define TCSETS TCSETATTR +@@ -75,6 +80,7 @@ + # define TCGETS TCGETA + typedef struct termio termiostruct; + #endif ++#endif /* POSIX */ + + #ifdef VSUSP + # define O_SUSP VSUSP +@@ -181,14 +187,22 @@ + ioctl(tty_read_fd, TIOCSLTC, <c); + #else /* not USE_SGTTY */ + termiostruct ttyb; ++#if POSIX ++ tcgetattr(tty_read_fd, &ttyb); ++#else + ioctl(tty_read_fd, TCGETS, &ttyb); ++#endif + ttybsave = ttyb; + ttyb.c_lflag &= ~(ECHO|ICANON); + ttyb.c_cc[VTIME] = 0; + ttyb.c_cc[VMIN] = 1; + /* disable the special handling of the suspend key (handle it ourselves) */ + ttyb.c_cc[O_SUSP] = 0; ++#if POSIX ++ tcsetattr(tty_read_fd, TCSANOW, &ttyb); ++#else + ioctl(tty_read_fd, TCSETS, &ttyb); ++#endif + #endif /* USE_SGTTY */ + + #ifdef USE_LOCALE +@@ -216,7 +230,11 @@ + ioctl(tty_read_fd, TIOCSETC, &tcsave); + ioctl(tty_read_fd, TIOCSLTC, <csave); + #else /* not USE_SGTTY */ ++#if POSIX ++ tcsetattr(tty_read_fd, TCSANOW, &ttybsave); ++#else + ioctl(tty_read_fd, TCSETS, &ttybsave); ++#endif + #endif /* USE_SGTTY */ + tty_puts(kpadend); + tty_flush(); +@@ -251,7 +269,11 @@ + #else /* not USE_SGTTY */ + int i; + termiostruct ttyb; ++#if POSIX ++ tcgetattr(tty_read_fd, &ttyb); ++#else + ioctl(tty_read_fd, TCGETS, &ttyb); ++#endif + if (linemode & LM_CHAR) { + /* char-by-char mode: disable all special keys and set raw mode */ + for(i = 0; i < NCCS; i++) +@@ -266,7 +288,11 @@ + /* set cooked mode */ + ttyb.c_oflag |= OPOST; + } ++#if POSIX ++ tcsetattr(tty_read_fd, TCSANOW, &ttyb); ++#else + ioctl(tty_read_fd, TCSETS, &ttyb); ++#endif + #endif /* USE_SGTTY */ + } Index: games/powwow/Makefile @@ -6,7 +6,7 @@ # PORTNAME= powwow -PORTVERSION= 1.2.10 +PORTVERSION= 1.2.13 CATEGORIES= games MASTER_SITES= http://hoopajoo.net/static/projects/ \ ftp://ftp.wilbury.sk/pub/FreeBSD/local/distfiles/ @@ -15,19 +15,15 @@ COMMENT= Client to play MUDs GNU_CONFIGURE= yes -CONFIGURE_ARGS+= --enable-bsd MAN6= powwow.6 .include -.if ${OSVERSION} >= 800034 -BROKEN= does not compile -.endif - pre-build: @${REINPLACE_CMD} -e 's|malloc.h|stdlib.h|' ${WRKSRC}/defines.h \ ${WRKSRC}/list.c ${WRKSRC}/main.c ${WRKSRC}/cmd2.c ${WRKSRC}/beam.c + @${REINPLACE_CMD} -e 's|^DEFS = |DEFS = -DPOSIX |' ${WRKSRC}/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/powwow ${PREFIX}/bin Index: games/powwow/distinfo @@ -1,3 +1,3 @@ -MD5 (powwow-1.2.10.tar.gz) = f8d948d5a0cb5fd1e74d05ad1420441a -SHA256 (powwow-1.2.10.tar.gz) = fd556e876529ac5b1c8be915b9750a45ff5cde8ec88e66befe88a56844f9799b -SIZE (powwow-1.2.10.tar.gz) = 257811 +MD5 (powwow-1.2.13.tar.gz) = 42240a569c7fba837aa140f084de55ed +SHA256 (powwow-1.2.13.tar.gz) = be22d1d8f12b89d70375e1657eb7d746a338d606a4afe29f8fa5b423bf7415ef +SIZE (powwow-1.2.13.tar.gz) = 274569 >Release-Note: >Audit-Trail: >Unformatted: