aboutsummaryrefslogtreecommitdiff
path: root/games/xboard
diff options
context:
space:
mode:
authorJohan van Selst <johans@FreeBSD.org>2014-09-11 19:50:14 +0000
committerJohan van Selst <johans@FreeBSD.org>2014-09-11 19:50:14 +0000
commitbccf4e5abecbf02d05464168cd9f492c4453cba4 (patch)
tree9ac499c2453a5c7aee707951d3438e273333c054 /games/xboard
parent7906cf2f144b68775b11138af522f9448650cf42 (diff)
downloadports-bccf4e5abecbf02d05464168cd9f492c4453cba4.tar.gz
ports-bccf4e5abecbf02d05464168cd9f492c4453cba4.zip
Notes
Diffstat (limited to 'games/xboard')
-rw-r--r--games/xboard/Makefile118
1 files changed, 91 insertions, 27 deletions
diff --git a/games/xboard/Makefile b/games/xboard/Makefile
index 5680f4fa9d14..051d79031e48 100644
--- a/games/xboard/Makefile
+++ b/games/xboard/Makefile
@@ -1,71 +1,135 @@
# Created by: xaa@stack.nl
# $FreeBSD$
-PORTNAME= xboard
-PORTVERSION= 4.7.3
-PORTREVISION= 1
-CATEGORIES= games
-MASTER_SITES= GNU
+PORTNAME?= xboard
+PORTVERSION?= 4.7.3
+PORTREVISION?= 2
+PORTEPOCH?=
+CATEGORIES?= games
+MASTER_SITES?= GNU
-MAINTAINER= johans@FreeBSD.org
-COMMENT= X frontend for Crafty, GNUChess, Chess Servers, or e-mail chess
+MAINTAINER?= johans@FreeBSD.org
+COMMENT?= X frontend for Crafty, GNUChess, Chess Servers, or e-mail chess
-LIB_DEPENDS= libcairo.so:${PORTSDIR}/graphics/cairo
+LICENSE?= GPLv3
-OPTIONS_DEFINE= NLS ZIPPY CRAFTY FAIRYMAX GNUCHESS KNIGHTCAP PHALANX DOCS
-OPTIONS_DEFAULT=
-OPTIONS_SUB= yes
+LIB_DEPENDS?= libcairo.so:${PORTSDIR}/graphics/cairo
+
+CONFLICTS?= xboard-devel-[0-9]*
+
+OPTIONS_DEFINE?= NLS DOCS ZIPPY
+OPTIONS_SINGLE?= FRONTEND
+OPTIONS_SINGLE_FRONTEND?= XAW XAW3D GTK2
+OPTIONS_GROUP?= ENGINES
+OPTIONS_GROUP_ENGINES?= FAIRYMAX CRAFTY GNUCHESS KNIGHTCAP PHALANX
+OPTIONS_RADIO?= SOUND
+OPTIONS_RADIO_SOUND?= SOX ALSA
+OPTIONS_DEFAULT?= XAW
+OPTIONS_SUB?= yes
ZIPPY_DESC= Add Zippy capability (computer player on ICS)
+ENGINES_DESC= Chess Engines
CRAFTY_DESC= Install crafty engine
-FAIRYMAX_DESC= Install fairymax engine
+FAIRYMAX_DESC= Install fairymax engine (many chess variants)
GNUCHESS_DESC= Install GnuChess engine
KNIGHTCAP_DESC= Install KnightCap engine
PHALANX_DESC= Install phalanx engine
-NLS_USES= gettext
-NLS_CONFIGURE_ENABLE= nls
-ZIPPY_CONFIGURE_ENABLE= zippy
+FRONTEND_DESC= Front End
+XAW_DESC= Xaw GUI toolkit support (default)
+XAW3D_DESC= Xaw3d GUI toolkit support (not fully supported)
+GTK2_DESC= GTK+ 2 GUI toolkit support (experimental)
+SOUND_DESC= Sound Output (optional)
+SOX_DESC= SoX audio support
CRAFTY_RUN_DEPENDS+= crafty:${PORTSDIR}/games/crafty
FAIRYMAX_RUN_DEPENDS+= fairymax:${PORTSDIR}/games/fairymax
GNUCHESS_RUN_DEPENDS+= gnuchess:${PORTSDIR}/games/gnuchess
KNIGHTCAP_RUN_DEPENDS+= KnightCap:${PORTSDIR}/games/KnightCap
PHALANX_RUN_DEPENDS+= phalanx:${PORTSDIR}/games/phalanx
+XAW3D_DEPENDS+= libXaw3d.so:${PORTSDIR}/x11-toolkits/Xaw3d
+SOX_RUN_DEPENDS+= play:${PORTSDIR}/audio/sox
+ALSA_RUN_DEPENDS+= aplay:${PORTSDIR}/audio/alsa-utils
+NLS_USES= gettext
+NLS_CONFIGURE_ENABLE= nls
+ZIPPY_CONFIGURE_ENABLE= zippy
+XAW_CONFIGURE_WITH= Xaw
+XAW3D_CONFIGURE_WITH= Xaw3d
+GTK2_CONFIGURE_WITH= gtk
-USES= desktop-file-utils makeinfo perl5 pkgconfig shared-mime-info
-USE_XORG= xt xpm xaw
-USE_GNOME= librsvg2
+.include <bsd.port.options.mk>
+
+USES+= desktop-file-utils makeinfo perl5 pkgconfig shared-mime-info
+USE_XORG+= xt xpm
+USE_GNOME+= librsvg2
+.if ${PORT_OPTIONS:MXAW}
+USE_XORG+= xaw
+.endif
+.if ${PORT_OPTIONS:MGTK2}
+USE_GNOME+= gtk20
+.endif
GNU_CONFIGURE= yes
-CONFIGURE_ARGS+=MKDIR_P="${MKDIR}" PERLPATH=${LOCALBASE}/bin
+CONFIGURE_ARGS+=MKDIR_P="${MKDIR}" PERLPATH=${PERL}
CFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
INFO= xboard
USE_PERL5= build
INSTALLS_ICONS= yes
-DATADIR= ${PREFIX}/share/games/${PORTNAME}
+DATADIR?= ${PREFIX}/share/games/${PORTNAME}
-PORTDOCS= AUTHORS ChangeLog NEWS README SHORTLOG TODO
+PORTDOCS= AUTHORS COPYING COPYRIGHT ChangeLog DIFFSTAT FAQ.html NEWS README SHORTLOG TODO
BROKEN_sparc64= Does not install on sparc64
-.include <bsd.port.options.mk>
-
.if ${PORT_OPTIONS:MZIPPY}
PORTDOCS+= zippy.README
.endif
+.if ${PORT_OPTIONS:MNLS}
+PORTDOCS+= ABOUT-NLS
+.endif
+
post-patch:
- @${REINPLACE_CMD} -e 's/fairymax/gnuchessx/' ${WRKSRC}/xboard.conf.in
+ @${ECHO_CMD} -n "" > ${WRKSRC}/engineEntries.txt
+ @${ECHO_CMD} -n "" > ${WRKSRC}/firstEngine.txt
+.if ${PORT_OPTIONS:MCRAFTY}
+ @${ECHO_CMD} "\"Crafty\" -fcp crafty\\" >> ${WRKSRC}/engineEntries.txt
+ @${ECHO_CMD} -n "crafty" > ${WRKSRC}/firstEngine.txt
+.endif
+.if ${PORT_OPTIONS:MGNUCHESS}
+ @${ECHO_CMD} "\"GNU Chess\" -fcp gnuchess\\" >> ${WRKSRC}/engineEntries.txt
+ @${ECHO_CMD} -n "gnuchess" > ${WRKSRC}/firstEngine.txt
+.endif
+.if ${PORT_OPTIONS:MKNIGHTCAP}
+ @${ECHO_CMD} "\"KnightCap\" -fcp \"KnightCap -n -X -A -f ${PREFIX}/share/games/KnightCap/coeffs.dat\"\\" >> ${WRKSRC}/engineEntries.txt
+ @${ECHO_CMD} -n "KnightCap" > ${WRKSRC}/firstEngine.txt
+.endif
+.if ${PORT_OPTIONS:MPHALANX}
+ @${ECHO_CMD} "\"Phalanx\" -fcp phalanx\\" >> ${WRKSRC}/engineEntries.txt
+ @${ECHO_CMD} -n "phalanx" > ${WRKSRC}/firstEngine.txt
+.endif
+.if ${PORT_OPTIONS:MFAIRYMAX}
+ @${ECHO_CMD} "\"FairyMax\" -fcp fairymax\\" >> ${WRKSRC}/engineEntries.txt
+ @${ECHO_CMD} -n "fairymax" > ${WRKSRC}/firstEngine.txt
+.endif
+ @firstEngine=`cat ${WRKSRC}/firstEngine.txt` && \
+ ${REINPLACE_CMD} -e "s|\(-firstChessProgram\) .*|\1 $${firstEngine}|" ${WRKSRC}/xboard.conf.in
+ @engineEntries=`cat ${WRKSRC}/engineEntries.txt` && \
+ ${REINPLACE_CMD} -e "s|\(firstChessProgramNames[ ]*{\)[ ]*.*|\1$${engineEntries}}|" ${WRKSRC}/xboard.conf.in
@${REINPLACE_CMD} -e '/^#include..malloc.h/d' \
${WRKSRC}/engineoutput.c ${WRKSRC}/uci.c
- @${REINPLACE_CMD} -e 's:INSTALL.*sysconfdir):&/$$$$files.dist:' \
- ${WRKSRC}/Makefile.in
.if ${PORT_OPTIONS:MZIPPY}
@cd ${WRKSRC} && ${PATCH} < ${PATCHDIR}/OPTION_ZIPPY__patch-xboard.texi
@${REINPLACE_CMD} -e 's|%%DOCSDIR%%|${DOCSDIR}|g' ${WRKSRC}/xboard.texi
.endif
+.if ${PORT_OPTIONS:MSOX}
+ @${REINPLACE_CMD} -e "s|\(soundProgram\) .*|\1 \"play -q\"|" ${WRKSRC}/xboard.conf.in
+.elif ${PORT_OPTIONS:MALSA}
+ @${REINPLACE_CMD} -e "s|\(soundProgram\) .*|\1 \"aplay -q\"|" ${WRKSRC}/xboard.conf.in
+.else
+ @${REINPLACE_CMD} -e "s|\(soundProgram\) .*|\1 \"\"|" ${WRKSRC}/xboard.conf.in
+.endif
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/cmail ${STAGEDIR}${PREFIX}/bin/
- ${MV} ${STAGEDIR}${PREFIX}/etc/xboard.conf.dist \
+ ${MV} ${STAGEDIR}${PREFIX}/etc/xboard.conf \
${STAGEDIR}${PREFIX}/etc/xboard.conf.sample
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}