Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
Sjeng is an attempt to create a bughouse- and crazyhouse-playing program
that can attain a level comparable to what the best human players are
capable of. Sjeng also can play standard, suicide, giveaway and losers
chess.
+48
View File
@@ -0,0 +1,48 @@
# $NetBSD: Makefile,v 1.19 2012/10/06 11:54:55 asau Exp $
DISTNAME= Sjeng-Free-11.0
PKGNAME= sjeng-11.0
PKGREVISION= 5
CATEGORIES= games
MASTER_SITES= http://sjeng.sourceforge.net/ftp/ \
${MASTER_SITE_SOURCEFORGE:=sjeng/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.sjeng.org/
COMMENT= Engine for chess variations (bughouse, suicide, etc.)
GNU_CONFIGURE= YES
USE_LANGUAGES= c c++
LIBS+= -lm # floor()
MAKE_ENV+= BOOKDIR="${BOOKDIR}/"
BOOKDIR= ${PREFIX}/lib/sjeng
TBDIR= ${PREFIX}/share/egtb
DOCDIR= ${PREFIX}/share/doc/sjeng
EGDIR= ${PREFIX}/share/examples/sjeng
.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "arm32"
GCC_REQD+= 3.0
.endif
post-build:
cd ${WRKSRC}; \
file="sjeng.rc"; \
for file in $${files}; do \
${SED} -e "s|/wwwindows/crafty/TB|${TBDIR}|g" \
$${file} > $${file}.fixed; \
${MV} -f $${file}.fixed $${file}; \
done
INSTALLATION_DIRS+= ${DOCDIR} ${EGDIR} ${BOOKDIR}
post-install:
${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${DOCDIR}
${CAT} ${WRKSRC}/sjeng.rc | ${TR} -d "\015" > ${WRKDIR}/sample.sjengrc
${INSTALL_DATA} ${WRKDIR}/sample.sjengrc ${DESTDIR}${EGDIR}
${INSTALL_DATA} ${WRKSRC}/books/*.opn ${DESTDIR}${BOOKDIR}
.include "../../databases/gdbm/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
+7
View File
@@ -0,0 +1,7 @@
@comment $NetBSD: PLIST,v 1.3 2009/06/14 17:56:56 joerg Exp $
bin/sjeng
lib/sjeng/bug.opn
lib/sjeng/losers.opn
lib/sjeng/suicide.opn
share/doc/sjeng/README
share/examples/sjeng/sample.sjengrc
+11
View File
@@ -0,0 +1,11 @@
$NetBSD: distinfo,v 1.3 2013/01/11 23:26:36 joerg Exp $
SHA1 (Sjeng-Free-11.0.tar.gz) = cfcbefc5a5872d6340b83fbe64d2c46cf85a8b0f
RMD160 (Sjeng-Free-11.0.tar.gz) = ff45c8a14e1b6fde2062107eecab6ebf050acc0d
Size (Sjeng-Free-11.0.tar.gz) = 173443 bytes
SHA1 (patch-aa) = c0d98382bccc158a887328577757b5d98574c0ad
SHA1 (patch-ab) = 7f87c3a8b2bc249352c07e1db73c6dc0799e3553
SHA1 (patch-ac) = 94c8e903e821f9a77c8faa51033d5b01558d90f6
SHA1 (patch-ad) = 94b3d1f4636262cd6669d03f3f14ca8ed40d0204
SHA1 (patch-segtb.c) = cf9140aadb535d1f3194ebc6a9b80e8f381473db
SHA1 (patch-sjeng.h) = e71d2af72223c346dd425c42735e3990a85db1c0
+13
View File
@@ -0,0 +1,13 @@
$NetBSD: patch-aa,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
--- Makefile.in.orig Wed Sep 12 05:57:11 2001
+++ Makefile.in
@@ -75,7 +75,7 @@
PROGRAMS = $(bin_PROGRAMS)
-DEFS = @DEFS@ -I. -I$(srcdir) -I.
+DEFS = @DEFS@ -I. -I$(srcdir) -I. -DBOOKDIR=\"${BOOKDIR}\"
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
+36
View File
@@ -0,0 +1,36 @@
$NetBSD: patch-ab,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
--- book.c.orig Mon Jul 16 08:04:48 2001
+++ book.c
@@ -64,26 +64,31 @@
if (Variant == Normal)
{
if ((f_book = fopen ("normal.opn", "r")) == NULL)
+ if ((f_book = fopen (BOOKDIR "normal.opn", "r")) == NULL)
return FALSE;
}
else if (Variant == Crazyhouse)
{
if ((f_book = fopen ("zh.opn", "r")) == NULL)
+ if ((f_book = fopen (BOOKDIR "zh.opn", "r")) == NULL)
return FALSE;
}
else if (Variant == Suicide)
{
if ((f_book = fopen ("suicide.opn", "r")) == NULL)
+ if ((f_book = fopen (BOOKDIR "suicide.opn", "r")) == NULL)
return FALSE;
}
else if (Variant == Losers)
{
if ((f_book = fopen ("losers.opn", "r")) == NULL)
+ if ((f_book = fopen (BOOKDIR "losers.opn", "r")) == NULL)
return FALSE;
}
else
{
if ((f_book = fopen ("bug.opn", "r")) == NULL)
+ if ((f_book = fopen (BOOKDIR "bug.opn", "r")) == NULL)
return FALSE;
}
+63
View File
@@ -0,0 +1,63 @@
$NetBSD: patch-ac,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
--- newbook.c.orig Wed Jun 6 18:12:39 2001
+++ newbook.c
@@ -465,14 +465,19 @@
srand(time(0));
- if (Variant == Normal)
- binbook = gdbm_open("nbook.bin", 16384, GDBM_READER, 0, NULL);
- else if (Variant == Suicide)
- binbook = gdbm_open("sbook.bin", 16384, GDBM_READER, 0, NULL);
- else if (Variant == Losers)
- binbook = gdbm_open("lbook.bin", 16384, GDBM_READER, 0, NULL);
- else
- binbook = gdbm_open("zbook.bin", 16384, GDBM_READER, 0, NULL);
+ if (Variant == Normal) {
+ if ((binbook = gdbm_open("nbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "nbook.bin", 16384, GDBM_READER, 0, NULL);
+ } else if (Variant == Suicide) {
+ if ((binbook = gdbm_open("sbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "sbook.bin", 16384, GDBM_READER, 0, NULL);
+ } else if (Variant == Losers) {
+ if ((binbook = gdbm_open("lbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "lbook.bin", 16384, GDBM_READER, 0, NULL);
+ } else {
+ if ((binbook = gdbm_open("zbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "zbook.bin", 16384, GDBM_READER, 0, NULL);
+ }
if (binbook == NULL)
@@ -606,16 +611,21 @@
if (bookidx == 0) return;
- if (Variant == Normal)
- binbook = gdbm_open("nbook.bin", 16384, GDBM_WRITER, 0, NULL);
- else if (Variant == Suicide)
- binbook = gdbm_open("sbook.bin", 16384, GDBM_WRITER, 0, NULL);
- else if (Variant == Losers)
- binbook = gdbm_open("lbook.bin", 16384, GDBM_WRITER, 0, NULL);
- else if (Variant == Crazyhouse)
- binbook = gdbm_open("zbook.bin", 16384, GDBM_WRITER, 0, NULL);
- else if (Variant == Bughouse)
+ if (Variant == Normal) {
+ if ((binbook = gdbm_open("nbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "nbook.bin", 16384, GDBM_WRITER, 0, NULL);
+ } else if (Variant == Suicide) {
+ if ((binbook = gdbm_open("sbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "sbook.bin", 16384, GDBM_WRITER, 0, NULL);
+ } else if (Variant == Losers) {
+ if ((binbook = gdbm_open("lbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "lbook.bin", 16384, GDBM_WRITER, 0, NULL);
+ } else if (Variant == Crazyhouse) {
+ if ((binbook = gdbm_open("zbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
+ binbook = gdbm_open(BOOKDIR "zbook.bin", 16384, GDBM_WRITER, 0, NULL);
+ } else if (Variant == Bughouse) {
return;
+ }
if (binbook == NULL)
{
+36
View File
@@ -0,0 +1,36 @@
$NetBSD: patch-ad,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
--- rcfile.c.orig Fri Jun 15 06:47:10 2001
+++ rcfile.c
@@ -47,12 +47,30 @@
int cfg_attackeval;
float cfg_scalefac;
+static
+FILE *get_rcfile (void)
+{
+ FILE *rc;
+ char buf[STR_BUFF];
+
+ sprintf (buf, "%s/.sjengrc", getenv ("HOME"));
+ if ((rc = fopen ("sjeng.rc", "r")) != NULL) {
+ return rc;
+ } else if ((rc = fopen (".sjengrc", "r")) != NULL) {
+ return rc;
+ } else if ((rc = fopen (buf, "r")) != NULL) {
+ return rc;
+ } else {
+ return NULL;
+ }
+}
+
void read_rcfile (void)
{
int i;
unsigned int setc;
- if ((rcfile = fopen ("sjeng.rc", "r")) == NULL)
+ if ((rcfile = get_rcfile ()) == NULL)
{
printf("No configuration file!\n");
+22
View File
@@ -0,0 +1,22 @@
$NetBSD: patch-segtb.c,v 1.1 2013/01/11 23:26:36 joerg Exp $
--- segtb.c.orig 2013-01-11 14:40:04.000000000 +0000
+++ segtb.c
@@ -703,7 +703,7 @@ void free_egtb()
}
-int init_segtb()
+void init_segtb(void)
{
int i;
@@ -733,8 +733,6 @@ int init_segtb()
(21 * TWO_PIECE_SIZE) / 1024);
printf("Three-piece suicide endgame table cache %d kB\n",
(CACHE_SIZE * THREE_PIECE_SIZE) / 1024);
-
- return 1;
}
+11
View File
@@ -0,0 +1,11 @@
$NetBSD: patch-sjeng.h,v 1.1 2013/01/11 23:26:36 joerg Exp $
--- sjeng.h.orig 2013-01-11 14:40:45.000000000 +0000
+++ sjeng.h
@@ -153,4 +153,6 @@ typedef time_t rtime_t;
#define max(x, y) ((x) > (y) ? (x) : (y))
#define mix(x, y) ((x) < (y) ? (x) : (y))
+void init_segtb(void);
+
#endif