Skip to content

Commit

Permalink
games/eboard: Take maintainership and rework the port a bit
Browse files Browse the repository at this point in the history
- Add license
- Remove nonfunctional joystick option
- Comment out timeseal link; remove pkg-message for now
- Remake all patchfiles
- Change PORT_OPTIONS:MDOCS into post-install-DOCS-on target
- pkg-descr: Use secured URL

PR:		254278
  • Loading branch information
rhurlin committed May 6, 2021
1 parent 35c6c84 commit 76f2c06
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 70 deletions.
46 changes: 20 additions & 26 deletions games/eboard/Makefile
Expand Up @@ -11,42 +11,41 @@ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
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 <bsd.port.options.mk>
OPTIONS_DEFINE= DOCS

EXTRAS= 1pl2 2

post-extract:
.for e in ${EXTRAS}
Expand All @@ -58,29 +57,24 @@ 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 <bsd.port.mk>
17 changes: 0 additions & 17 deletions games/eboard/files/patch-c++11

This file was deleted.

14 changes: 7 additions & 7 deletions games/eboard/files/patch-configure
@@ -1,15 +1,15 @@
--- 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 = <<EOF;
#include <list>
@@ -357,7 +357,7 @@
@@ -357,7 +357,7 @@ sub header_check {

log_file("test.cc");

Expand All @@ -18,7 +18,7 @@
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");

Expand All @@ -37,7 +37,7 @@
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 {
Expand Down
21 changes: 15 additions & 6 deletions games/eboard/files/patch-network.cc
@@ -1,22 +1,31 @@
--- 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);

Expand All @@ -42,7 +51,7 @@
// 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
Expand Down
8 changes: 4 additions & 4 deletions 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
};

};
2 changes: 1 addition & 1 deletion games/eboard/pkg-descr
Expand Up @@ -2,4 +2,4 @@ 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/
9 changes: 0 additions & 9 deletions games/eboard/pkg-message

This file was deleted.

0 comments on commit 76f2c06

Please sign in to comment.