diff --git a/games/eboard/Makefile b/games/eboard/Makefile index c39eb84eb9cf..183a2b2b56a4 100644 --- a/games/eboard/Makefile +++ b/games/eboard/Makefile @@ -1,86 +1,80 @@ # Created by: petef@FreeBSD.org PORTNAME= eboard PORTVERSION= 1.1.3 DISTVERSIONPREFIX= v CATEGORIES= games MASTER_SITES= SF/${PORTNAME}/eboard-extras/pack%201%20patchlevel%202/:p1 \ SF/${PORTNAME}/eboard-extras/pack%202/:p2 DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ eboard-extras-1pl2.tar.gz:p1 \ eboard-extras-2.tar.gz:p2 EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= rhurlin@FreeBSD.org COMMENT= GTK+ chess board interface (mainly for FICS and chessd) +LICENSE= GPLv2 + LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libpng.so:graphics/png -EXTRAS= 1pl2 2 USES= compiler:c++11-lang gnome perl5 pkgconfig shebangfix tar:bzip2 -HAS_CONFIGURE= yes -USE_PERL5= build +USE_GITHUB= yes +GH_ACCOUNT= fbergo USE_GNOME= cairo gdkpixbuf2 gtk20 USE_GSTREAMER1= yes -SHEBANG_FILES= configure +USE_PERL5= build -USE_GITHUB= yes -GH_ACCOUNT= fbergo +SHEBANG_FILES= configure +HAS_CONFIGURE= yes CONFIGURE_ARGS= --prefix=${PREFIX} \ --extra-inc=${LOCALBASE}/include \ --extra-ld=${LOCALBASE}/lib INSTALL_TARGET= install install-man -OPTIONS_DEFINE= JOYSTICK DOCS -JOYSTICK_DESC= Enable joystick support -JOYSTICK_BUILD_DEPENDS= ${LOCALBASE}/include/linux/joystick.h:devel/evdev-proto - DESKTOP_ENTRIES="eboard" \ "Play chess" \ "${PREFIX}/share/pixmaps/eboard.xpm" \ "eboard" \ "Game;BoardGame;GTK;" \ true -.include +OPTIONS_DEFINE= DOCS + +EXTRAS= 1pl2 2 post-extract: .for e in ${EXTRAS} @cd ${WRKDIR} && ${GZIP_CMD} -dc \ ${_DISTDIR}/eboard-extras-${e}.tar.gz | ${TAR} -xf - .endfor post-patch: @${REINPLACE_CMD} -e 's,g++,${CXX},' -e 's|-O6|${CXXFLAGS}|' \ ${WRKSRC}/configure -.if empty(PORT_OPTIONS:MJOYSTICK) -post-configure: - @${REINPLACE_CMD} -e '/^#define HAVE_LINUX_JOYSTICK_H 1/ d' \ - ${WRKSRC}/config.h -.endif - pre-install: @${MKDIR} ${STAGEDIR}${DATADIR} post-install: - @${LN} -sf ${LOCALBASE}/bin/timeseal \ - ${STAGEDIR}${DATADIR}/timeseal.FreeBSD -.if ${PORT_OPTIONS:MDOCS} +# There is no timeseal port ATM :( +# @${LN} -sf ${LOCALBASE}/bin/timeseal \ +# ${STAGEDIR}${DATADIR}/timeseal.FreeBSD +.for extra in ${EXTRAS} + @cd ${WRKDIR}/eboard-extras-${extra} && ${SETENV} EBOARDCONFIG=${STAGEDIR}${PREFIX}/bin/eboard-config ${CONFIGURE_CMD} --prefix=${PREFIX} + @cd ${WRKDIR}/eboard-extras-${extra} && ${SETENV} ${MAKE_ENV} ${MAKE} install DATADIR=${STAGEDIR}${DATADIR} +.endfor + +post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} .for file in Crafty.txt FICS-Timeseal.txt GNUChess4.txt GNUChess5.txt \ Scripts.txt Sjeng.txt Themes.txt ${INSTALL_DATA} ${WRKSRC}/Documentation/${file} ${STAGEDIR}${DOCSDIR} .endfor -.endif -.for extra in ${EXTRAS} - @cd ${WRKDIR}/eboard-extras-${extra} && ${SETENV} EBOARDCONFIG=${STAGEDIR}${PREFIX}/bin/eboard-config ${CONFIGURE_CMD} --prefix=${PREFIX} - @cd ${WRKDIR}/eboard-extras-${extra} && ${SETENV} ${MAKE_ENV} ${MAKE} install DATADIR=${STAGEDIR}${DATADIR} -.endfor .include diff --git a/games/eboard/files/patch-c++11 b/games/eboard/files/patch-c++11 deleted file mode 100644 index 68b47b914a39..000000000000 --- a/games/eboard/files/patch-c++11 +++ /dev/null @@ -1,17 +0,0 @@ -libc++ doesn't like "using namespace std" in C++11 - -network.cc:466:59: error: invalid operands to binary expression ('__bind' and 'int') - if (bind(netsocket,(struct sockaddr *) &sin,sizeof(sin))==-1) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ~~ - ---- network.cc.orig 2008-02-22 15:51:22 UTC -+++ network.cc -@@ -463,7 +463,7 @@ int IncomingConnection::createSocket() { - sin.sin_addr.s_addr = INADDR_ANY; - sin.sin_port = htons(Port); - -- if (bind(netsocket,(struct sockaddr *) &sin,sizeof(sin))==-1) { -+ if (::bind(netsocket,(struct sockaddr *) &sin,sizeof(sin))==-1) { - snprintf(errorMessage,128,_("Unable to bind on port %d."),Port); - return(-1); - } diff --git a/games/eboard/files/patch-configure b/games/eboard/files/patch-configure index 82f935bd6683..66f7415044e9 100644 --- a/games/eboard/files/patch-configure +++ b/games/eboard/files/patch-configure @@ -1,52 +1,52 @@ ---- configure.orig 2021-03-13 13:18:59.466284000 -0800 -+++ configure 2021-03-13 13:18:59.474328000 -0800 -@@ -106,7 +106,7 @@ +--- configure.orig 2021-05-06 14:10:24 UTC ++++ configure +@@ -106,7 +106,7 @@ sub run_cmd { } sub cplusplus_lang { - my @compilers = ( $cxx, 'g++', 'c++' ); -+ my @compilers = ( $cxx, 'g++9', 'c++' ); ++ my @compilers = ( $cxx, 'g++10', 'c++' ); my $x; my $program = < -@@ -357,7 +357,7 @@ +@@ -357,7 +357,7 @@ sub header_check { log_file("test.cc"); - if (run_cmd($cxx,@cxxflags,"-c","test.cc","-o","xxtest.o") != 0) { + if (0) { print ": no\n"; $y = header_def($x); print CONFIGH "#undef $y\n"; -@@ -511,17 +511,9 @@ +@@ -511,17 +511,9 @@ if (!header_check("stdio.h","stdlib.h","string.h","uni #optional headers header_check("strings.h"); -$t1=macro_check("netinet/in.h","IPPROTO_TCP","HAVE_IPPROTO_TCP_ON_IN_H"); -$t2=macro_check("netinet/in.h","TCP_NODELAY","HAVE_TCP_NODELAY_ON_IN_H"); -$t3=macro_check("netinet/in.h","SOL_TCP","HAVE_SOL_TCP_ON_IN_H"); - -$t4=macro_check("netinet/tcp.h","IPPROTO_TCP","HAVE_IPPROTO_TCP_ON_TCP_H"); -$t5=macro_check("netinet/tcp.h","TCP_NODELAY","HAVE_TCP_NODELAY_ON_TCP_H"); -$t6=macro_check("netinet/tcp.h","SOL_TCP","HAVE_SOL_TCP_ON_TCP_H"); - print " net options: "; -if ($t2 != 0) { +if (0) { cppdef("USE_SOCK_OPTS"); if ($t1!=0 && $t3!=0) { cppundef("NEED_TCP_H"); -@@ -535,10 +527,10 @@ +@@ -535,10 +527,10 @@ if ($t2 != 0) { print "netinet/tcp.h not required, SOL_TCP present.\n"; } } else { - if ($t5 != 0 && ($t1!=0 || $t4!=0) && ($t3!=0 || $t6!=0) ) { + if (1) { cppdef("NEED_TCP_H"); cppdef("USE_SOCK_OPTS"); - if ($t1!=0 || $t4!=0) { + if (1) { cppdef("USE_IPPROTO_TCP"); print "netinet/tcp.h required, IPPROTO_TCP present.\n"; } else { diff --git a/games/eboard/files/patch-network.cc b/games/eboard/files/patch-network.cc index 7940e08087f1..69e3d26ceb88 100644 --- a/games/eboard/files/patch-network.cc +++ b/games/eboard/files/patch-network.cc @@ -1,56 +1,65 @@ ---- network.cc.orig 2008-02-22 16:51:22.000000000 +0100 -+++ network.cc 2008-12-29 11:24:10.000000000 +0100 -@@ -566,6 +566,7 @@ +--- network.cc.orig 2018-07-31 18:02:19 UTC ++++ network.cc +@@ -501,7 +501,7 @@ int IncomingConnection::createSocket() { + sin.sin_addr.s_addr = INADDR_ANY; + sin.sin_port = htons(Port); + +- if (bind(netsocket,(struct sockaddr *) &sin,sizeof(sin))==-1) { ++ if (::bind(netsocket,(struct sockaddr *) &sin,sizeof(sin))==-1) { + snprintf(errorMessage,128,_("Unable to bind on port %d."),Port); + return(-1); + } +@@ -604,6 +604,7 @@ PipeConnection::PipeConnection(int _pin,int _pout) { strcpy(HostName,"local pipe"); snprintf(HostAddress,96,"pipe[%d,%d]",pin,pout); Quiet=0; + use_execve=0; MaxWaitTime = 60000.0; // 1 minute } -@@ -577,6 +578,7 @@ +@@ -615,6 +616,7 @@ void PipeConnection::init() { strcpy(HostAddress,"unknown"); memset(HelperBin,0,512); Quiet=0; + use_execve=0; handshake.erase(); MaxWaitTime = 60000.0; // 1 minute } -@@ -612,6 +614,25 @@ +@@ -652,6 +654,25 @@ PipeConnection::PipeConnection(const char *host,int po Port=port; g_strlcpy(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) snprintf(z,256,"%s.%s",helperbin,helpersuffix); -@@ -728,7 +749,10 @@ +@@ -768,7 +789,10 @@ int PipeConnection::open() { 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 index c948b094d892..c63c8c331913 100644 --- a/games/eboard/files/patch-network.h +++ b/games/eboard/files/patch-network.h @@ -1,10 +1,10 @@ ---- network.h.orig Mon Jan 15 23:59:58 2007 -+++ network.h Wed Jan 17 19:39:10 2007 -@@ -235,6 +235,7 @@ +--- network.h.orig 2018-07-31 18:02:19 UTC ++++ network.h +@@ -253,6 +253,7 @@ class PipeConnection : public BufferedConnection, int pid; int toid; // timeout string handshake; + int use_execve; double MaxWaitTime; // msecs - }; + }; diff --git a/games/eboard/pkg-descr b/games/eboard/pkg-descr index 87ce6d479602..3973f2a12af9 100644 --- a/games/eboard/pkg-descr +++ b/games/eboard/pkg-descr @@ -1,5 +1,5 @@ eboard is a GTK+ chess interface. It provides a chess board interface to ICS (Internet Chess Servers) like FICS and chessd, and to chess engines like GNU Chess, Sjeng and Crafty. -WWW: http://www.bergo.eng.br/eboard/ +WWW: https://www.bergo.eng.br/eboard/ diff --git a/games/eboard/pkg-message b/games/eboard/pkg-message deleted file mode 100644 index b5c1af0f9850..000000000000 --- a/games/eboard/pkg-message +++ /dev/null @@ -1,9 +0,0 @@ -[ -{ type: install - message: <