aboutsummaryrefslogtreecommitdiff
path: root/games/gnubg
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2007-11-27 22:49:06 +0000
committerMartin Wilke <miwi@FreeBSD.org>2007-11-27 22:49:06 +0000
commit17ea8b00dc993abd8e0236b5ed56bc3d293a548c (patch)
tree4d0b2a5e08bfb15ffcd2bad32523750a6819c786 /games/gnubg
parentae47d2196b6088234931aa55d769a69982d2a63d (diff)
downloadports-17ea8b00dc993abd8e0236b5ed56bc3d293a548c.tar.gz
ports-17ea8b00dc993abd8e0236b5ed56bc3d293a548c.zip
Notes
Diffstat (limited to 'games/gnubg')
-rw-r--r--games/gnubg/Makefile14
-rw-r--r--games/gnubg/files/patch-eval.c11
-rw-r--r--games/gnubg/files/patch-htmlimages.c10
-rw-r--r--games/gnubg/files/patch-lib_neuralnet.c46
-rw-r--r--games/gnubg/files/patch-rollout.h11
5 files changed, 80 insertions, 12 deletions
diff --git a/games/gnubg/Makefile b/games/gnubg/Makefile
index 1b7bae321de7..f7e4424ddfaa 100644
--- a/games/gnubg/Makefile
+++ b/games/gnubg/Makefile
@@ -17,7 +17,7 @@ DISTFILES= ${DISTNAME}.tar.gz \
DIST_SUBDIR= ${PORTNAME}
EXTRACT_ONLY= ${DISTNAME}.tar.gz
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= gahr@gahr.ch
COMMENT= GNU Backgammon
LIB_DEPENDS= gdbm.3:${PORTSDIR}/databases/gdbm \
@@ -67,16 +67,6 @@ CONFIGURE_ARGS+= --with-python
CONFIGURE_ARGS+= --without-python
.endif
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 700042
-BROKEN= Broken with gcc 4.2
-.endif
-
-.if ${ARCH} == "sparc64"
-BROKEN= does not compile on sparc64
-.endif
-
post-extract:
${GUNZIP_CMD} --stdout ${DISTDIR}/${DIST_SUBDIR}/gnubg.weights-${GNUBG_WEIGHTS_VERSION}.gz > ${WRKSRC}/gnubg.weights
${GUNZIP_CMD} --stdout ${DISTDIR}/${DIST_SUBDIR}/gnubg_os0.bd.gz > ${WRKSRC}/gnubg_os0.bd
@@ -87,4 +77,4 @@ post-patch:
${REINPLACE_CMD} -e 's|"getopt\.h"|<getopt.h>|g' ${WRKSRC}/${file}
.endfor
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/gnubg/files/patch-eval.c b/games/gnubg/files/patch-eval.c
new file mode 100644
index 000000000000..8c721d4b9fc6
--- /dev/null
+++ b/games/gnubg/files/patch-eval.c
@@ -0,0 +1,11 @@
+--- eval.c.orig 2007-11-25 23:01:11.000000000 +0100
++++ eval.c 2007-11-25 23:02:20.000000000 +0100
+@@ -798,7 +798,7 @@
+ if( !fstat( h, &st ) &&
+ ( p = mmap( NULL, st.st_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE, h, 0 ) ) ) {
+- ( (float *) p ) += 2; /* skip magic number and version */
++ p += 2; /* skip magic number and version */
+ fReadWeights =
+ ( p = NeuralNetCreateDirect( &nnContact, p ) ) &&
+ ( p = NeuralNetCreateDirect( &nnRace, p ) ) &&
diff --git a/games/gnubg/files/patch-htmlimages.c b/games/gnubg/files/patch-htmlimages.c
new file mode 100644
index 000000000000..e4a60ac29dd3
--- /dev/null
+++ b/games/gnubg/files/patch-htmlimages.c
@@ -0,0 +1,10 @@
+--- htmlimages.c.orig 2007-11-25 23:07:11.000000000 +0100
++++ htmlimages.c 2007-11-25 23:07:24.000000000 +0100
+@@ -30,6 +30,7 @@
+ #endif
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+
+ #if HAVE_SYS_TYPES_H
diff --git a/games/gnubg/files/patch-lib_neuralnet.c b/games/gnubg/files/patch-lib_neuralnet.c
new file mode 100644
index 000000000000..8ee6bab0bbd0
--- /dev/null
+++ b/games/gnubg/files/patch-lib_neuralnet.c
@@ -0,0 +1,46 @@
+--- lib/neuralnet.c.orig 2007-11-25 22:55:20.000000000 +0100
++++ lib/neuralnet.c 2007-11-25 23:00:22.000000000 +0100
+@@ -384,15 +384,17 @@
+
+ return 0;
+ }
+-extern void *NeuralNetCreateDirect( neuralnet *pnn, void *p ) {
++extern void *NeuralNetCreateDirect( neuralnet *pnn, void *v_p ) {
++ int *p = v_p;
++ float *fp = v_p;
+
+ pnn->cInput = *( ( (int *) p )++ );
+ pnn->cHidden = *( ( (int *) p )++ );
+ pnn->cOutput = *( ( (int *) p )++ );
+ pnn->nTrained = *( ( (int *) p )++ );
+ pnn->fDirect = TRUE;
+- pnn->rBetaHidden = *( ( (float *) p )++ );
+- pnn->rBetaOutput = *( ( (float *) p )++ );
++ pnn->rBetaHidden = *( ( fp )++ );
++ pnn->rBetaOutput = *( ( fp )++ );
+
+ if( pnn->cInput < 1 || pnn->cHidden < 1 || pnn->cOutput < 1 ||
+ pnn->nTrained < 0 || pnn->rBetaHidden <= 0.0 ||
+@@ -402,14 +404,14 @@
+ return NULL;
+ }
+
+- pnn->arHiddenWeight = p;
+- ( (float *) p ) += pnn->cInput * pnn->cHidden;
+- pnn->arOutputWeight = p;
+- ( (float *) p ) += pnn->cHidden * pnn->cOutput;
+- pnn->arHiddenThreshold = p;
+- ( (float *) p ) += pnn->cHidden;
+- pnn->arOutputThreshold = p;
+- ( (float *) p ) += pnn->cOutput;
++ pnn->arHiddenWeight = fp;
++ fp += pnn->cInput * pnn->cHidden;
++ pnn->arOutputWeight = fp;
++ fp += pnn->cHidden * pnn->cOutput;
++ pnn->arHiddenThreshold = fp;
++ fp += pnn->cHidden;
++ pnn->arOutputThreshold = fp;
++ fp += pnn->cOutput;
+
+ pnn->savedBase = malloc( pnn->cHidden * sizeof( float ) );
+ pnn->savedIBase = malloc( pnn->cInput * sizeof( float ) );
diff --git a/games/gnubg/files/patch-rollout.h b/games/gnubg/files/patch-rollout.h
new file mode 100644
index 000000000000..e59630803224
--- /dev/null
+++ b/games/gnubg/files/patch-rollout.h
@@ -0,0 +1,11 @@
+--- rollout.h.orig 2007-11-25 23:05:53.000000000 +0100
++++ rollout.h 2007-11-25 23:06:00.000000000 +0100
+@@ -59,8 +59,6 @@
+
+ } rolloutstat;
+
+-extern int nSkip;
+-
+ typedef void
+ (rolloutprogressfunc) ( float arOutput[][ NUM_ROLLOUT_OUTPUTS ],
+ float arStdDev[][ NUM_ROLLOUT_OUTPUTS ],