diff options
author | Ulrich Müller <ulm@gentoo.org> | 2017-03-09 08:57:20 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2017-03-09 08:57:20 +0100 |
commit | 955f9a4027164fe86fe438f83304632652ef8e39 (patch) | |
tree | 19057a323faf83094d397f42a48d0710b78fed95 | |
parent | games-board/tablebase-syzygy: Package move. (diff) | |
download | ulm-955f9a4027164fe86fe438f83304632652ef8e39.tar.gz ulm-955f9a4027164fe86fe438f83304632652ef8e39.tar.bz2 ulm-955f9a4027164fe86fe438f83304632652ef8e39.zip |
games-board/tablebase-syzygy: Move 6-piece tables to a separate ebuild.
Package-Manager: Portage-2.3.4, Repoman-2.3.2
3 files changed, 82 insertions, 32 deletions
diff --git a/games-board/tablebase-syzygy/ChangeLog b/games-board/tablebase-syzygy/ChangeLog index 64f1e5b..1b4152d 100644 --- a/games-board/tablebase-syzygy/ChangeLog +++ b/games-board/tablebase-syzygy/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for games-board/tablebase-syzygy # Copyright 1999-2017 Gentoo Foundation; Distributed under the GPL v2 +*tablebase-syzygy-0_pre20131213-r100 (09 Mar 2017) + + 09 Mar 2017; Ulrich Müller <ulm@gentoo.org> + tablebase-syzygy-0_pre20131213.ebuild, + +tablebase-syzygy-0_pre20131213-r100.ebuild: + Move 6-piece tables to a separate ebuild. + *tablebase-syzygy-0_pre20131213 (09 Mar 2017) 09 Mar 2017; Ulrich Müller <ulm@gentoo.org> diff --git a/games-board/tablebase-syzygy/tablebase-syzygy-0_pre20131213-r100.ebuild b/games-board/tablebase-syzygy/tablebase-syzygy-0_pre20131213-r100.ebuild new file mode 100644 index 0000000..b8e192c --- /dev/null +++ b/games-board/tablebase-syzygy/tablebase-syzygy-0_pre20131213-r100.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit check-reqs + +DESCRIPTION="Syzygy chess endgame tablebases for up to 6 pieces" +HOMEPAGE="http://tablebase.sesse.net/ + http://kirill-kryukov.com/chess/tablebases-online/" + +tb345=() +m=(P N B R Q K) +for ((i=4; i>=0; i--)); do + tb345+=(K${m[i]}vK) # 2+1 + for ((j=i; j>=0; j--)); do + tb345+=(K${m[i]}vK${m[j]} K${m[i]}${m[j]}vK) # 2+2, 3+1 + for ((k=4; k>=0; k--)); do + tb345+=(K${m[i]}${m[j]}vK${m[k]}) # 3+2 + #((k<=i)) || continue + #for ((l=k; l>=0; l--)); do + # ((k<i || l<=j)) && tb6+=(K${m[i]}${m[j]}vK${m[k]}${m[l]}) # 3+3 + #done + ((k<=j)) || continue + tb345+=(K${m[i]}${m[j]}${m[k]}vK) # 4+1 + #for ((l=4; l>=0; l--)); do + # tb6+=(K${m[i]}${m[j]}${m[k]}vK${m[l]}) # 4+2 + # ((l<=k)) && tb6+=(K${m[i]}${m[j]}${m[k]}${m[l]}vK) # 5+1 + #done + done + done +done + +SRC_URI="" +for i in "${tb345[@]}"; do + SRC_URI+="http://tablebase.sesse.net/syzygy/3-4-5/${i}.rtbw " + SRC_URI+="http://tablebase.sesse.net/syzygy/3-4-5/${i}.rtbz " +done +unset i j k m tb345 + +LICENSE="public-domain" # machine-generated tables +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="tb6" +RESTRICT="mirror" # not on Gentoo mirrors + +# there is no use-conditional fetch restriction, +# so depend on another slot of the same package instead +PDEPEND="tb6? ( ~${CATEGORY}/${P}:tb6 )" + +S="${WORKDIR}" +CHECKREQS_DISK_USR="939M" +CHECKREQS_DISK_BUILD="${CHECKREQS_DISK_USR}" + +src_unpack() { :; } + +src_install() { + local f + insinto /usr/share/${PN} + for f in ${A}; do + [[ ${f} = *.rtb[wz] ]] && echo "${DISTDIR}"/${f} + done | xargs doins +} diff --git a/games-board/tablebase-syzygy/tablebase-syzygy-0_pre20131213.ebuild b/games-board/tablebase-syzygy/tablebase-syzygy-0_pre20131213.ebuild index 379466c..8044a7d 100644 --- a/games-board/tablebase-syzygy/tablebase-syzygy-0_pre20131213.ebuild +++ b/games-board/tablebase-syzygy/tablebase-syzygy-0_pre20131213.ebuild @@ -9,21 +9,15 @@ DESCRIPTION="Syzygy chess endgame tablebases for up to 6 pieces" HOMEPAGE="http://tablebase.sesse.net/ http://kirill-kryukov.com/chess/tablebases-online/" -tb345=() tb6=() m=(P N B R Q K) for ((i=4; i>=0; i--)); do - tb345+=(K${m[i]}vK) # 2+1 for ((j=i; j>=0; j--)); do - tb345+=(K${m[i]}vK${m[j]} K${m[i]}${m[j]}vK) # 2+2, 3+1 - for ((k=4; k>=0; k--)); do - tb345+=(K${m[i]}${m[j]}vK${m[k]}) # 3+2 - ((k<=i)) || continue + for ((k=i; k>=0; k--)); do for ((l=k; l>=0; l--)); do ((k<i || l<=j)) && tb6+=(K${m[i]}${m[j]}vK${m[k]}${m[l]}) # 3+3 done ((k<=j)) || continue - tb345+=(K${m[i]}${m[j]}${m[k]}vK) # 4+1 for ((l=4; l>=0; l--)); do tb6+=(K${m[i]}${m[j]}${m[k]}vK${m[l]}) # 4+2 ((l<=k)) && tb6+=(K${m[i]}${m[j]}${m[k]}${m[l]}vK) # 5+1 @@ -31,25 +25,23 @@ for ((i=4; i>=0; i--)); do done done done -for i in "${tb345[@]}"; do - SRC_URI+=" http://tablebase.sesse.net/syzygy/3-4-5/${i}.rtbw" - SRC_URI+=" http://tablebase.sesse.net/syzygy/3-4-5/${i}.rtbz" -done -SRC_URI+=" tb6? (" + +SRC_URI="" for i in "${tb6[@]}"; do - SRC_URI+=" http://tablebase.sesse.net/syzygy/6-WDL/${i}.rtbw" - SRC_URI+=" http://tablebase.sesse.net/syzygy/6-DTZ/${i}.rtbz" + SRC_URI+="${i}.rtbw ${i}.rtbz " done -SRC_URI+=" )" -unset i j k l m tb345 tb6 +unset i j k l m tb6 -LICENSE="public-domain" -SLOT="0" +LICENSE="public-domain" # machine-generated tables +SLOT="tb6" KEYWORDS="~amd64 ~x86" -IUSE="tb6" -RESTRICT="mirror tb6? ( fetch )" # not on Gentoo mirrors +RESTRICT="fetch" + +RDEPEND="~${CATEGORY}/${P}:0" S="${WORKDIR}" +CHECKREQS_DISK_USR="150G" +CHECKREQS_DISK_BUILD="${CHECKREQS_DISK_USR}" pkg_nofetch() { local f @@ -61,18 +53,6 @@ pkg_nofetch() { done } -pkg_pretend() { - CHECKREQS_DISK_USR=$(usex tb6 "151G" "939M") - CHECKREQS_DISK_BUILD="${CHECKREQS_DISK_USR}" - check-reqs_pkg_pretend -} - -pkg_setup() { - CHECKREQS_DISK_USR=$(usex tb6 "151G" "939M") - CHECKREQS_DISK_BUILD="${CHECKREQS_DISK_USR}" - check-reqs_pkg_setup -} - src_unpack() { :; } src_install() { |