aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorjylefort <jylefort@FreeBSD.org>2006-04-09 01:04:33 +0800
committerjylefort <jylefort@FreeBSD.org>2006-04-09 01:04:33 +0800
commit6714c9c621bd58a8aed1bd1bdafc76c754575fbe (patch)
tree9a27e23c8853f7523357d3e6bbea9be6701c2728 /games
parent88fdd5ca8d3d4ec213c95a7390f9d0f6cd838a88 (diff)
downloadfreebsd-ports-gnome-6714c9c621bd58a8aed1bd1bdafc76c754575fbe.tar.gz
freebsd-ports-gnome-6714c9c621bd58a8aed1bd1bdafc76c754575fbe.tar.zst
freebsd-ports-gnome-6714c9c621bd58a8aed1bd1bdafc76c754575fbe.zip
- Add games/timeseal support
- Take maintainership PR: ports/93709 Submitted by: jylefort Approved by: maintainer timeout (44 days)
Diffstat (limited to 'games')
-rw-r--r--games/eboard/Makefile6
-rw-r--r--games/eboard/files/patch-network.cc56
-rw-r--r--games/eboard/files/patch-network.h10
-rw-r--r--games/eboard/pkg-message7
-rw-r--r--games/eboard/pkg-plist1
5 files changed, 78 insertions, 2 deletions
diff --git a/games/eboard/Makefile b/games/eboard/Makefile
index 2dc0f1790d69..2600fb97a1da 100644
--- a/games/eboard/Makefile
+++ b/games/eboard/Makefile
@@ -7,14 +7,14 @@
PORTNAME= eboard
PORTVERSION= 0.9.5
-PORTREVISION= 3
+PORTREVISION= 4
EXTRAS= 1pl2 2
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} eboard-extras-1pl2.tar.gz eboard-extras-2.tar.gz
-MAINTAINER= petef@FreeBSD.org
+MAINTAINER= jylefort@FreeBSD.org
COMMENT= GTK+ chess board interface (mainly for FICS and chessd)
HAS_CONFIGURE= yes
@@ -41,6 +41,7 @@ post-patch:
${WRKSRC}/configure
post-install:
+ ${LN} -sf ${LOCALBASE}/bin/timeseal ${DATADIR}/timeseal.FreeBSD
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
@@ -55,5 +56,6 @@ post-install:
.endfor
${MKDIR} ${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKSRC}/icon-eboard.xpm ${PREFIX}/share/pixmaps/eboard.xpm
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>
diff --git a/games/eboard/files/patch-network.cc b/games/eboard/files/patch-network.cc
new file mode 100644
index 000000000000..fb79071b3d31
--- /dev/null
+++ b/games/eboard/files/patch-network.cc
@@ -0,0 +1,56 @@
+--- network.cc.orig Thu Nov 27 00:48:49 2003
++++ network.cc Wed Feb 22 16:33:40 2006
+@@ -554,6 +554,7 @@
+ strcpy(HostName,"local pipe");
+ sprintf(HostAddress,"pipe[%d,%d]",pin,pout);
+ Quiet=0;
++ use_execve=0;
+ }
+
+ void PipeConnection::init() {
+@@ -564,6 +565,7 @@
+ strcpy(HostAddress,"unknown");
+ memset(HelperBin,0,512);
+ Quiet=0;
++ use_execve=0;
+ handshake.erase();
+ }
+
+@@ -594,6 +596,25 @@
+ Port=port;
+ strncpy(HostName,host,128);
+
++ // Special handling for timeseal on FreeBSD:
++ //
++ // On FreeBSD, the games/timeseal port provides an a.out timeseal
++ // binary. However, a.out support is disabled by default on FreeBSD
++ // >= 5.x. If the a.out kernel module is not loaded, or if a.out
++ // support is not compiled into the kernel, execvp()ing timeseal
++ // will not return (because it fallbacks to the shell when execve()
++ // returns NOEXEC): eboard will not notice the failure (in
++ // PipeConnection::open()) and will therefore not fallback to a
++ // direct connection.
++ //
++ // We solve the problem by executing timeseal with execve(), which
++ // will fail if a.out support is not available. Note that unlike
++ // execvp(), execve() does not search for the program in the path,
++ // but this is not a problem since eboard uses the absolute path to
++ // timeseal.
++ if (! strcmp(helperbin, "timeseal"))
++ use_execve = 1;
++
+ // build helper path
+ if (helpersuffix)
+ sprintf(z,"%s.%s",helperbin,helpersuffix);
+@@ -702,7 +723,10 @@
+ dup2(1,2);
+
+ setpgid(getpid(),0); // to broadcast SIGKILL later
+- execvp(HelperBin,arguments);
++ if (use_execve)
++ execve(HelperBin,arguments,NULL);
++ else
++ execvp(HelperBin,arguments);
+ write(1,"exec failed\n",12);
+ global.debug("exec failed",HelperBin);
+ _exit(2); // eek
diff --git a/games/eboard/files/patch-network.h b/games/eboard/files/patch-network.h
new file mode 100644
index 000000000000..cc0e82a99a3e
--- /dev/null
+++ b/games/eboard/files/patch-network.h
@@ -0,0 +1,10 @@
+--- network.h.orig Thu Nov 27 00:48:49 2003
++++ network.h Wed Feb 22 16:22:04 2006
+@@ -229,6 +229,7 @@
+ int pid;
+ int toid; // timeout
+ string handshake;
++ int use_execve;
+ };
+
+ class FallBackConnection : public NetConnection {
diff --git a/games/eboard/pkg-message b/games/eboard/pkg-message
new file mode 100644
index 000000000000..0abd89e0b1df
--- /dev/null
+++ b/games/eboard/pkg-message
@@ -0,0 +1,7 @@
+===============================================================================
+
+If you want to make FICS games fairer by accounting for network lag,
+install the games/timeseal port (when timeseal is active, the
+bottom-left icon changes to a orange/yellow locked clock).
+
+===============================================================================
diff --git a/games/eboard/pkg-plist b/games/eboard/pkg-plist
index 3047cb03d711..813562e81dc7 100644
--- a/games/eboard/pkg-plist
+++ b/games/eboard/pkg-plist
@@ -70,6 +70,7 @@ share/eboard/ghouls.png
share/eboard/plastic.png
share/eboard/themeconf.extras1
share/eboard/themeconf.extras2
+share/eboard/timeseal.FreeBSD
share/pixmaps/eboard.xpm
@dirrm share/eboard
%%PORTDOCS%%@dirrm %%DOCSDIR%%