Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-board/stockfish/
Date: Thu, 07 Jul 2016 19:48:44
Message-Id: 1467920820.135e2a15cf45b98afaf3f10dbdc02335458a5b98.wizardedit@gentoo
1 commit: 135e2a15cf45b98afaf3f10dbdc02335458a5b98
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 7 19:40:42 2016 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 7 19:47:00 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=135e2a15
7
8 games-board/stockfish: bump to EAPI 6, add maintainer-needed
9
10 Package-Manager: portage-2.2.28
11
12 games-board/stockfish/metadata.xml | 1 +
13 games-board/stockfish/stockfish-6-r2.ebuild | 62 +++++++++++++++++++++++++++++
14 2 files changed, 63 insertions(+)
15
16 diff --git a/games-board/stockfish/metadata.xml b/games-board/stockfish/metadata.xml
17 index cae5816..831231b 100644
18 --- a/games-board/stockfish/metadata.xml
19 +++ b/games-board/stockfish/metadata.xml
20 @@ -1,6 +1,7 @@
21 <?xml version="1.0" encoding="UTF-8"?>
22 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
23 <pkgmetadata>
24 + <!-- maintainer-needed -->
25 <use>
26 <flag name="armv7">Build for armv7; enables PIE</flag>
27 <flag name="general-32">Generic unoptimized 32-bits build</flag>
28
29 diff --git a/games-board/stockfish/stockfish-6-r2.ebuild b/games-board/stockfish/stockfish-6-r2.ebuild
30 new file mode 100644
31 index 0000000..c38f33f
32 --- /dev/null
33 +++ b/games-board/stockfish/stockfish-6-r2.ebuild
34 @@ -0,0 +1,62 @@
35 +# Copyright 1999-2016 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +# $Id$
38 +
39 +EAPI=6
40 +if [[ ${PV} == *9999* ]]; then
41 + inherit git-r3
42 + EGIT_REPO_URI="git://github.com/official-stockfish/Stockfish.git"
43 + KEYWORDS=""
44 + S=${WORKDIR}/${P}/src
45 +else
46 + SRC_URI="https://stockfish.s3.amazonaws.com/${P}-src.zip"
47 + KEYWORDS="~amd64 ~x86"
48 + S=${WORKDIR}/${P}-src/src
49 +fi
50 +
51 +DESCRIPTION="Free UCI chess engine, claimed to be the strongest in the world"
52 +HOMEPAGE="http://stockfishchess.org/"
53 +
54 +LICENSE="GPL-3"
55 +SLOT="0"
56 +IUSE="armv7 cpu_flags_x86_avx2 cpu_flags_x86_popcnt cpu_flags_x86_sse debug
57 + general-32 general-64 +optimize"
58 +
59 +DEPEND="|| ( app-arch/unzip
60 + app-arch/zip )"
61 +RDEPEND=""
62 +
63 +src_prepare() {
64 + default
65 +
66 + # prevent pre-stripping
67 + sed -e 's:-strip $(BINDIR)/$(EXE)::' -i Makefile || die
68 +}
69 +
70 +src_compile() {
71 + local my_arch
72 + # generic unoptimized first
73 + use general-32 && my_arch=general-32
74 + use general-64 && my_arch=general-64
75 + # x86
76 + use x86 && my_arch=x86-32-old
77 + use cpu_flags_x86_sse && my_arch=x86-32
78 + # amd64
79 + use amd64 && my_arch=x86-64
80 + use cpu_flags_x86_popcnt && my_arch=x86-64-modern
81 + # both bmi2 and avx2 are part of hni (haswell new instructions)
82 + use cpu_flags_x86_avx2 && my_arch=x86-64-bmi2
83 + # other architectures
84 + use armv7 && my_arch=armv7
85 + use ppc && my_arch=ppc
86 + use ppc64 && my_arch=ppc64
87 +
88 + emake build ARCH=${my_arch} \
89 + debug=$(usex debug "yes" "no") \
90 + optimize=$(usex optimize "yes" "no")
91 +}
92 +
93 +src_install() {
94 + emake PREFIX="${D}/usr" install
95 + dodoc ../AUTHORS ../Readme.md
96 +}