summaryrefslogtreecommitdiff
path: root/games-board/crafty
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-board/crafty
reinit the tree, so we can have metadata
Diffstat (limited to 'games-board/crafty')
-rw-r--r--games-board/crafty/Manifest7
-rw-r--r--games-board/crafty/crafty-24.1.ebuild85
-rw-r--r--games-board/crafty/files/crafty-24.1-numcpus.patch44
-rw-r--r--games-board/crafty/metadata.xml11
4 files changed, 147 insertions, 0 deletions
diff --git a/games-board/crafty/Manifest b/games-board/crafty/Manifest
new file mode 100644
index 000000000000..870b93bddfc2
--- /dev/null
+++ b/games-board/crafty/Manifest
@@ -0,0 +1,7 @@
+AUX crafty-24.1-numcpus.patch 1564 SHA256 ef6451bf80d98e74eb4ce76fc91b3afbde7b41d28033b4c3c1d6926ede7c65c2 SHA512 303942f906b0ddedd1f2d2ab2c6808877c793dbc58d5f866c1af9823509fe08085d81cb3ed44f9663fa56aadc6b96a0fa4fbfde0b5ff9f53f1a235185faa2cbf WHIRLPOOL c171ffd383cf9621761b9985dfe3e31795335ef81a8ca7a1cf9c503b230f4ce6ce71ba8c20d8746ebb47d858dd1d8fc154745490e71f570944518ce8447d54cd
+DIST crafty-24.1.zip 442680 SHA256 a29d25d9a26a5a958f07a075d1f76f52c12d287ad16ee7aadb224a0dfee40659 SHA512 4d8088aeb683d69e3ea5e01194eb0dc9b957049823c7f8a1f28686e601f9f270b829319083a8b8170016bfda36a42c592a94b4429d7c4f35a6351fd469f16124 WHIRLPOOL c98726bfd1cb042273105525b13c8bd85e99ce9591292be6e63981bb1b08d8447a53eaf5bb476135cc1221516d18005517e7c6096096f35fbd1e32d1735f1a85
+DIST crafty.doc.ascii 79678 SHA256 be291c0f4c7e7d64404ec58b9e92c2455c4342d3c96c721ba21a80fce8332e83 SHA512 562698c3954e53f05c009025291bdb748baaa08616437796a08b42198057cff9f9efa7a8caf41574e71dafe60f4c132dc9497ad5ed9a83b8f071d1c31c8583b8 WHIRLPOOL 8786cafa5afd98b6878467701ff19206f220b20fd3f575f51f17a052de709d7f5572632dd56876d34a412d4628a6c4eb984ec6e6f148a3418ff16617d7670845
+EBUILD crafty-24.1.ebuild 2477 SHA256 995c6471ae428de664a34fc0ac11fd255498c9451e1cb1d670d0d4eb3736fe4b SHA512 e5161a4e00face949c77420f8a9fb4e9bf952da18ca597c33eb0d0993f0bed9d479fcd7cf2b9b6f7302a5a35dfb38f9665444c036fcce03da36ab75e8746d5b6 WHIRLPOOL 856ff94ee71de99b297b88d58936adc287c2e211c395ffad3e58606216c3084f4b8d73cc91e2458f07e62d9381dbb2869018c533dca98b2d30aa404b0b4aba26
+MISC ChangeLog 2459 SHA256 c7ff64c7e8b397448b926d97a419675585c573410f4985ce3e993e1164acde94 SHA512 05be8ec7b48084781306e4252eb07be12b5e391524c6a016f192e261ac16b0c40847c243c85ebbe7de4afbd5b9ada8556278dd0747ff85c8b206826fb3c7c7a0 WHIRLPOOL dabadd3e7a54d8c5268fb199909016e1845844541fb5226d722e26386b5218580d1eaa2cecd25433c63bbd5ccc5d6d2524acd8cc525315da8de795ee4e6d633a
+MISC ChangeLog-2015 8236 SHA256 1b931f85790ece8302635b510bd44b715971d695a2629526cd570e5eb50e01ca SHA512 d27f40dc73f43303e3196db4d483a9ef721cba918c5a34a364acfe71ae1a03c71dc81ebd519c8b5d869a7d038acef9fdb6fe4ae4512147e9ae9ae5ee8b6dfce9 WHIRLPOOL 920eec73c10dc5c699e0de7ebba4e411adc53022d2f1901170770161f83c2dc7e9cc87f47925bdc5f5e4d2c4302509511d06dd2b86d6fcf826509cf97e9b288b
+MISC metadata.xml 348 SHA256 518243ec22e4432dd9c04c4453f1975c02d8df1d600cbb73b73a2c4914838103 SHA512 dac102e7447ff6f41ab290b7e59dfc9a97b2614e8f977f97a54ef1d5d616e8f22cc83607d3f9803693b59b98ecb175dcd527dcc78519451770e80f0a9cf6ed27 WHIRLPOOL 8f7b993736ba893359537ec5e7d416be0206d809f6c91b26b85837bdf4a03cffe8758ea8b9c77e0da1665c9a1e93a8572e7c2a55d4a4963160ae06de64f01fb8
diff --git a/games-board/crafty/crafty-24.1.ebuild b/games-board/crafty/crafty-24.1.ebuild
new file mode 100644
index 000000000000..f3805181aae9
--- /dev/null
+++ b/games-board/crafty/crafty-24.1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit flag-o-matic toolchain-funcs eutils games
+
+DESCRIPTION="Bob Hyatt's strong chess engine"
+HOMEPAGE="http://www.craftychess.com/"
+SRC_URI="http://www.craftychess.com/${P}.zip
+ http://www.cis.uab.edu/hyatt/crafty/source/${P}.zip
+ ftp://ftp.cis.uab.edu/pub/hyatt/documentation/${PN}.doc.ascii"
+
+LICENSE="crafty"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="no-opts"
+RESTRICT="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+src_prepare() {
+ sed -i \
+ -e '/-o crafty/s/CC/CXX/' \
+ -e 's:CXFLAGS:CXXFLAGS:g' \
+ -e 's:-j ::g' \
+ Makefile || die
+ sed -i \
+ -e "s:\"crafty.hlp\":\"${GAMES_DATADIR}/${PN}/crafty.hlp\":" option.c || die
+ epatch "${FILESDIR}"/${P}-numcpus.patch
+}
+
+src_compile() {
+ local makeopts="target=UNIX"
+
+ if ! use no-opts ; then
+ if [[ $(tc-getCC) = icc ]] ; then
+ makeopts="${makeopts} asm=X86.o"
+ append-flags -D_REENTRANT -tpp6 \
+ -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST \
+ -DSMP -DCPUS=4 -DCLONE -DDGT
+ append-flags -O2 -fno-alias -fforce-mem \
+ -fomit-frame-pointer -fno-gcse -mpreferred-stack-boundary=2
+ else
+ if [[ "${CHOST}" == "i686-pc-linux-gnu" ]] \
+ || [[ "${CHOST}" == "i586-pc-linux-gnu" ]] ; then
+ append-flags -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B \
+ -DFAST -DSMP -DCPUS=4 -DCLONE -DDGT
+ append-flags -fno-gcse \
+ -fomit-frame-pointer -mpreferred-stack-boundary=2
+ elif [[ "${CHOST}" == "x86_64-pc-linux-gnu" ]] ; then
+ append-flags -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
+ -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B \
+ -DFAST -DSMP -DCPUS=4 -DCLONE -DDGT
+ append-flags -fomit-frame-pointer
+ else
+ : # everything else :)
+ fi
+ fi
+ fi
+ append-flags -DPOSIX -DSKILL
+ emake ${makeopts} crafty-make LDFLAGS="${LDFLAGS} -pthread"
+}
+
+src_install() {
+ dogamesbin crafty
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins crafty.hlp
+ dodoc "${DISTDIR}"/crafty.doc.ascii
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ elog
+ elog "Note: No books or tablebases have been installed. If you want them, just"
+ elog " download them from ${HOMEPAGE}."
+ elog " You will find documentation there too. In most cases you take now "
+ elog " your xboard compatible application, (xboard, eboard, knights) and "
+ elog " just play chess against computer opponent. Have fun."
+ elog
+}
diff --git a/games-board/crafty/files/crafty-24.1-numcpus.patch b/games-board/crafty/files/crafty-24.1-numcpus.patch
new file mode 100644
index 000000000000..14365cede2a0
--- /dev/null
+++ b/games-board/crafty/files/crafty-24.1-numcpus.patch
@@ -0,0 +1,44 @@
+diff -ru crafty-24.1.org/lock.h crafty-24.1/lock.h
+--- crafty-24.1.org/lock.h 2015-03-10 16:24:09.064539177 +0100
++++ crafty-24.1/lock.h 2015-03-10 17:45:37.675995497 +0100
+@@ -42,6 +42,7 @@
+ * *
+ *******************************************************************************
+ */
++# if defined(__i386__) || defined(__amd64__)
+ static void __inline__ LockX86(volatile int *lock) {
+ int dummy;
+ asm __volatile__(
+@@ -71,17 +72,26 @@
+ :"memory");
+ }
+
+-# define LockInit(p) (p=0)
+-# define LockFree(p) (p=0)
+-# define Unlock(p) (UnlockX86(&p))
+-# define Lock(p) (LockX86(&p))
+-# define lock_t volatile int
+-# endif
++# define LockInit(p) (p=0)
++# define LockFree(p) (p=0)
++# define Unlock(p) (UnlockX86(&p))
++# define Lock(p) (LockX86(&p))
++# define lock_t volatile int
++# else /* Not building for x86 or amd64 platforms */
++# define LockInit(p)
++# define LockFree(p)
++# define Lock(p)
++# define Unlock(p)
++# define Pause()
++# define lock_t volatile int
++# endif /* x86 && amd64 platforms or rest of the world. */
++# endif /* SMP code */
+ #else
+ # define LockInit(p)
+ # define LockFree(p)
+ # define Lock(p)
+ # define Unlock(p)
++# define Pause()
+ # define lock_t volatile int
+ #endif /* SMP code */
+ /* *INDENT-ON* */
diff --git a/games-board/crafty/metadata.xml b/games-board/crafty/metadata.xml
new file mode 100644
index 000000000000..a8ab91531634
--- /dev/null
+++ b/games-board/crafty/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="no-opts">Don't try to enable crazy CFLAG options</flag>
+ </use>
+</pkgmetadata>