/[gentoo-x86]/games-board/crafty/crafty-23.4.ebuild
Gentoo

Contents of /games-board/crafty/crafty-23.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Fri Jan 25 06:29:31 2013 UTC (19 months ago) by mr_bones_
Branch: MAIN
Changes since 1.4: +3 -3 lines
point HOMEPAGE at an actual web page

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/games-board/crafty/crafty-23.4.ebuild,v 1.4 2012/01/10 20:31:52 ranger Exp $
4
5 EAPI=2
6 inherit flag-o-matic toolchain-funcs games
7
8 DESCRIPTION="Bob Hyatt's strong chess engine"
9 HOMEPAGE="http://www.craftychess.com/"
10 SRC_URI="http://www.craftychess.com/${P}.zip
11 ftp://ftp.cis.uab.edu/pub/hyatt/source/${P}.zip
12 ftp://ftp.cis.uab.edu/pub/hyatt/documentation/${PN}.doc.ascii"
13
14 LICENSE="crafty"
15 SLOT="0"
16 KEYWORDS="amd64 ppc x86"
17 IUSE="no-opts"
18 RESTRICT="test"
19
20 RDEPEND=""
21 DEPEND="${RDEPEND}
22 app-arch/unzip"
23
24 src_prepare() {
25 sed -i \
26 -e '/-o crafty/s/CC/CXX/' \
27 -e 's:CXFLAGS:CXXFLAGS:g' \
28 Makefile \
29 || die "sed failed"
30 sed -i \
31 -e "s:\"crafty.hlp\":\"${GAMES_DATADIR}/${PN}/crafty.hlp\":" option.c \
32 || die "sed failed"
33 }
34
35 src_compile() {
36 local makeopts="target=LINUX"
37
38 if ! use no-opts ; then
39 if [[ $(tc-getCC) = icc ]] ; then
40 makeopts="${makeopts} asm=X86.o"
41 append-flags -D_REENTRANT -tpp6 \
42 -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
43 -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B -DFAST \
44 -DSMP -DCPUS=4 -DCLONE -DDGT
45 append-flags -O2 -fno-alias -fforce-mem \
46 -fomit-frame-pointer -fno-gcse -mpreferred-stack-boundary=2
47 else
48 if [[ "${CHOST}" == "i686-pc-linux-gnu" ]] \
49 || [[ "${CHOST}" == "i586-pc-linux-gnu" ]] ; then
50 append-flags -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
51 -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B \
52 -DFAST -DSMP -DCPUS=4 -DCLONE -DDGT
53 append-flags -fno-gcse \
54 -fomit-frame-pointer -mpreferred-stack-boundary=2
55 elif [[ "${CHOST}" == "x86_64-pc-linux-gnu" ]] ; then
56 append-flags -DCOMPACT_ATTACKS -DUSE_ATTACK_FUNCTIONS \
57 -DUSE_ASSEMBLY_A -DUSE_ASSEMBLY_B \
58 -DFAST -DSMP -DCPUS=4 -DCLONE -DDGT
59 append-flags -fomit-frame-pointer
60 else
61 : # everything else :)
62 fi
63 fi
64 fi
65 append-flags -DPOSIX -DSKILL
66 emake ${makeopts} crafty-make LDFLAGS="${LDFLAGS} -pthread" || die "build failed"
67 }
68
69 src_install() {
70 dogamesbin crafty || die "dogamesbin failed"
71 insinto "${GAMES_DATADIR}/${PN}"
72 doins crafty.hlp || die "doins failed"
73 dodoc "${DISTDIR}"/crafty.doc.ascii
74 prepgamesdirs
75 }
76
77 pkg_postinst() {
78 games_pkg_postinst
79 elog
80 elog "Note: No books or tablebases have been installed. If you want them, just"
81 elog " download them from ${HOMEPAGE}."
82 elog " You will find documentation there too. In most cases you take now "
83 elog " your xboard compatible application, (xboard, eboard, knights) and "
84 elog " just play chess against computer opponent. Have fun."
85 elog
86 }

  ViewVC Help
Powered by ViewVC 1.1.20