summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorozwigh2015-12-11 13:04:28 +0000
committerozwigh2015-12-11 13:04:28 +0000
commitdc4a9cb49fc3ac9e14c3c8e9893e006fbd39afe8 (patch)
tree8af4f7b1fddb603d9a3a3039f55926253c6ca3cd
downloadaur-phalanx.tar.gz
Initial import (23-3).
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD45
-rw-r--r--phalanx-23.diff118
-rw-r--r--phalanx-castling-broken.patch17
4 files changed, 203 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..496498bf6a49
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+# Generated by mksrcinfo v8
+# Fri Dec 11 13:02:55 UTC 2015
+pkgbase = phalanx
+ pkgdesc = A chess engine which understands the xboard protocol. It's suitable for beginner and intermediate players
+ pkgver = 23
+ pkgrel = 3
+ url = http://phalanx.sourceforge.net/
+ arch = i686
+ arch = x86_64
+ license = GPL
+ optdepends = xboard: to be able to use the xboard graphical frontend
+ source = http://downloads.sourceforge.net/sourceforge/phalanx/phalanx-XXIII-beta.tgz
+ source = phalanx-23.diff
+ source = phalanx-castling-broken.patch
+ md5sums = 74393533dab14b95ce8414072c913bc0
+ md5sums = 175491780d998dfb55d4315c3df0623d
+ md5sums = 9b60d4fbad709aad8ca0e9ff655b9da6
+ sha512sums = 39e09a8ddee85b60b79628e20268cafce28596ea47fdf7c61d396a7da4ef0dce6060168eb98a4794c4bc96484c0d6d82475dd1c20e8dc3546dd2ca857873af2c
+ sha512sums = 874d632efa3564f75a5534d0b2cb696e72b6a94e118e85dd590a1a79860ee1c18faa75da22df73d5774144661c3cb55ab8b9484a1a48bca76b954e484d8d3bcd
+ sha512sums = f7b007ee952fe96a26da433845e3b6babae78d1ed6a70e41d07ef213a9f008b920c715033d44f6d4d11a7771e7b5dd653877f55b918b954b68062cf166ad0d08
+
+pkgname = phalanx
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c5419bb24a6f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Eric Ozwigh <ozwigh at gmail dot com>
+# Contributor: jdarch <jda -dot- cloud -plus- archlinux -at- gmail -dot- com>
+# Contributor: Enrico Morelli <morelli@cerm.unifi.it>
+# Patches from phalanx @ openSUSE build service
+
+pkgname=phalanx
+pkgver=23
+_mypkgver=XXIII
+pkgrel=3
+pkgdesc="A chess engine which understands the xboard protocol. It's suitable for beginner and intermediate players"
+url="http://phalanx.sourceforge.net/"
+license=('GPL')
+arch=('i686' 'x86_64')
+optdepends=('xboard: to be able to use the xboard graphical frontend')
+
+source=("http://downloads.sourceforge.net/sourceforge/$pkgname/phalanx-${_mypkgver}-beta.tgz"
+ "phalanx-23.diff"
+ "phalanx-castling-broken.patch")
+md5sums=('74393533dab14b95ce8414072c913bc0'
+ '175491780d998dfb55d4315c3df0623d'
+ '9b60d4fbad709aad8ca0e9ff655b9da6')
+sha512sums=('39e09a8ddee85b60b79628e20268cafce28596ea47fdf7c61d396a7da4ef0dce6060168eb98a4794c4bc96484c0d6d82475dd1c20e8dc3546dd2ca857873af2c'
+ '874d632efa3564f75a5534d0b2cb696e72b6a94e118e85dd590a1a79860ee1c18faa75da22df73d5774144661c3cb55ab8b9484a1a48bca76b954e484d8d3bcd'
+ 'f7b007ee952fe96a26da433845e3b6babae78d1ed6a70e41d07ef213a9f008b920c715033d44f6d4d11a7771e7b5dd653877f55b918b954b68062cf166ad0d08')
+
+prepare () {
+ # Use the makepkg CFLAGS set for building phalanx
+ cd "${srcdir}"/phalanx-${_mypkgver}
+ sed -i "s/CFLAGS = -O0/# CFLAGS = -O0/g" makefile
+ # Apply patches
+ cd "${srcdir}"/phalanx-XXIII
+ patch < "${srcdir}"/phalanx-23.diff
+ patch < "${srcdir}"/phalanx-castling-broken.patch
+}
+
+build() {
+ cd "${srcdir}"/phalanx-${_mypkgver}
+ make
+}
+
+package () {
+ cd "${srcdir}"/phalanx-${_mypkgver}
+ install -t "${pkgdir}"/usr/bin -D {x,}phalanx
+ install -t "${pkgdir}"/usr/share/phalanx -D -m0644 eco.phalanx pbook.phalanx sbook.phalanx
+}
diff --git a/phalanx-23.diff b/phalanx-23.diff
new file mode 100644
index 000000000000..50512b76eb80
--- /dev/null
+++ b/phalanx-23.diff
@@ -0,0 +1,118 @@
+Index: phalanx-XXIII/makefile
+===================================================================
+--- phalanx-XXIII.orig/makefile
++++ phalanx-XXIII/makefile
+@@ -15,10 +15,8 @@ CFLAGS = -O0 -Wall -fomit-frame-pointer
+ ### -DSHOW_FORCED_MOVES
+ ### -DPBOOK_FILE=\"pbook.phalanx\"
+ ### -DSBOOK_FILE=\"sbook.phalanx\"
+-### -DLEARN_FILE=\"learn.phalanx\"
+ ### -DPBOOK_DIR=\"/usr/local/lib\"
+ ### -DSBOOK_DIR=\"/usr/local/lib\"
+-### -DLEARN_DIR=\"/var/local/lib\"
+ ### -DQCAPSONLY
+
+ DEFINES = -DGNUFUN
+Index: phalanx-XXIII/phalanx.c
+===================================================================
+--- phalanx-XXIII.orig/phalanx.c
++++ phalanx-XXIII/phalanx.c
+@@ -325,8 +325,17 @@ EcoDir = get_book_file(EcoDir,ENV_ECO,EC
+ Eco = fopen(EcoDir,"rb");
+ if( Flag.learn )
+ {
++ char learn_dir[128];
++ struct stat st;
++
++ sprintf(learn_dir, "%s/.phalanx", getenv("HOME"));
++
++ if(stat(learn_dir, &st) || !S_ISDIR(st.st_mode)) {
++ mkdir(learn_dir, 0755);
++ }
++
+ LbookDir
+- = get_book_file(LbookDir,ENV_LEARN,LEARN_DIR,LEARN_FILE,R_OK|W_OK);
++ = get_book_file(LbookDir,ENV_LEARN,learn_dir,LEARN_FILE,R_OK|W_OK);
+ Learn.f = fopen(LbookDir,"r+");
+ if( Learn.f == NULL )
+ {
+@@ -334,7 +343,7 @@ if( Flag.learn )
+ int b[LFSZ];
+ char filename[256];
+ memset( b, 0, LFSZ*sizeof(int) );
+- sprintf(filename,"./%s",LEARN_FILE);
++ sprintf(filename,"%s/%s", learn_dir, LEARN_FILE);
+ free( LbookDir );
+ LbookDir = strdup( filename );
+ Learn.f = fopen(LbookDir,"w+");
+Index: phalanx-XXIII/phalanx.h
+===================================================================
+--- phalanx-XXIII.orig/phalanx.h
++++ phalanx-XXIII/phalanx.h
+@@ -186,7 +186,7 @@ tdist;
+ #define PBOOK_FILE "pbook.phalanx"
+ #endif
+ #ifndef PBOOK_DIR
+-#define PBOOK_DIR "/usr/local/lib/phalanx"
++#define PBOOK_DIR "/usr/share/phalanx"
+ #endif
+
+ /* secondary (binary, large, generated from pgn) book */
+@@ -194,22 +194,19 @@ tdist;
+ #define SBOOK_FILE "sbook.phalanx"
+ #endif
+ #ifndef SBOOK_DIR
+-#define SBOOK_DIR "/usr/local/lib/phalanx"
++#define SBOOK_DIR "/usr/share/phalanx"
+ #endif
+
+ #ifndef ECO_FILE
+ #define ECO_FILE "eco.phalanx"
+ #endif
+ #ifndef ECO_DIR
+-#define ECO_DIR "/usr/local/lib/phalanx"
++#define ECO_DIR "/usr/share/phalanx"
+ #endif
+
+ #ifndef LEARN_FILE
+ #define LEARN_FILE "learn.phalanx"
+ #endif
+-#ifndef LEARN_DIR
+-#define LEARN_DIR "/var/local/lib/phalanx"
+-#endif
+
+ #define ENV_PBOOK "PHALANXPBOOKDIR"
+ #define ENV_SBOOK "PHALANXSBOOKDIR"
+Index: phalanx-XXIII/xphalanx
+===================================================================
+--- /dev/null
++++ phalanx-XXIII/xphalanx
+@@ -0,0 +1,27 @@
++#! /bin/sh
++#
++# Run xboard with phalanx as chess program.
++#
++# Copyright (c) 1999, 2000 SuSE GmbH Nuernberg, Germany. All rights reserved.
++#
++# Author: Steffen Winterfeldt <wfeldt@suse.de>
++#
++# Fixed for Phalanx: Pavel Janik ml. <Pavel.Janik@suse.cz>
++
++[ "$DISPLAY" ] || {
++ echo >&2 "This is not a text mode application!"
++ exit 63
++}
++
++emsg="You\'ll have to install package \'xboard\' first to run xphalanx."
++
++which xboard >/dev/null 2>&1 || {
++ if tty -s ; then
++ sh -c "echo >&2 $emsg"
++ else
++ xterm +sb -T "xphalanx error" -bg white -fg red -e sh -c "echo $emsg ; read"
++ fi
++ exit 42
++}
++
++exec xboard -fcp phalanx -scp phalanx "$@"
+
diff --git a/phalanx-castling-broken.patch b/phalanx-castling-broken.patch
new file mode 100644
index 000000000000..c4469fe9fa71
--- /dev/null
+++ b/phalanx-castling-broken.patch
@@ -0,0 +1,17 @@
+--- Phalanx-XXII/io.c
++++ phalanx-XXIII/io.c
+@@ -36,13 +36,11 @@
+ if( color(B[s]) == Color ) G[0].mtrl += Values[ B[s]>>4 ];
+ else G[0].xmtrl += Values[ B[s]>>4 ];
+
+-/* busted! S.A.
+ G[0].castling = 0;
+ if( B[E1]!=WK || B[A1]!=WR ) G[0].castling |= WLONG;
+ if( B[E1]!=WK || B[H1]!=WR ) G[0].castling |= WSHORT;
+ if( B[E8]!=BK || B[A8]!=BR ) G[0].castling |= BLONG;
+ if( B[E8]!=BK || B[H8]!=BR ) G[0].castling |= BSHORT;
+-*/
+
+ G[0].rule50 = 0;
+
+