1 |
commit: 8d1381e95c7c4a122a3f41d7ff3c39a41b4a4031 |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 3 14:22:30 2021 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 3 15:04:26 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d1381e9 |
7 |
|
8 |
games-board/scid: add 4.7.0 |
9 |
|
10 |
- migrated to cmake, EAPI 6->7, and added tests |
11 |
- add USE=scripts to make python targets and other scripts optional |
12 |
- install missing photo files but behind USE=photos due to being large |
13 |
- give incompatibility warning regarding ~/.scid -> ~/.scid4.7 |
14 |
|
15 |
Fetching the binary tarball for additional assets due to upstream's |
16 |
.zip for other files being an unstable "latest" type. |
17 |
|
18 |
Closes: https://bugs.gentoo.org/710464 |
19 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
20 |
|
21 |
games-board/scid/Manifest | 2 + |
22 |
.../scid/files/scid-4.6.2-pgnfix-python3.patch | 1 + |
23 |
.../scid/files/scid-4.7.0-system-gtest.patch | 16 ++++ |
24 |
.../scid/files/scid-4.7.0-tcl-start-path.patch | 7 ++ |
25 |
games-board/scid/metadata.xml | 4 + |
26 |
games-board/scid/scid-4.7.0.ebuild | 106 +++++++++++++++++++++ |
27 |
6 files changed, 136 insertions(+) |
28 |
|
29 |
diff --git a/games-board/scid/Manifest b/games-board/scid/Manifest |
30 |
index a3af0578eb8..9fe9859e527 100644 |
31 |
--- a/games-board/scid/Manifest |
32 |
+++ b/games-board/scid/Manifest |
33 |
@@ -1,5 +1,7 @@ |
34 |
DIST photos.zip 1007488 BLAKE2B 8b0f9b0402d9102bda4cfe1333cafdf048592004b2b8cb7f8f085eacc10b6b89811afd39c3d849a4f6288ad63145fc760e60bcd70867ae339459a451c537cbf3 SHA512 c04fc810b457d4dbd9a9cfaac90feaa8c32a2abee05e28a79042ae81cb01e8580e2a1cf0abeff230ec2928da883f862b8901d679cb1448fd9ca0923323fbddd6 |
35 |
DIST ratings.zip 969347 BLAKE2B 47d050f7c0e00e96aa0371db7f328e699cd0e34eafa3652664f00df7fe08b98adc4197c5235303d6df2c5bcf7ea568c753d23ac5fffe3616de6db9dae21a31a3 SHA512 9b2a7280a7e72e2b464cc3da6be82ec9825b11d3c7e2219ab03a711c69f185f7d954eb3acdd441bff210e9296613df79a7e147a2ccbb4ed37b50af762abbd243 |
36 |
DIST scid-4.6.2.zip 9768139 BLAKE2B 8e9baf2fe67c3566111f23ead005cba34d32f986afbaaed2117dc46aab65190dd8675df721c6fff3e7c5f338a07d7b787265dee63480141258625f6b6f54ec6d SHA512 d33f730857362dfefe55aaf395b0fc42087e190743ed63072128509fc6ac33791a4c2f67f89f03ec39170660fc6b7a6804fea084b383cf97cbb21661ce0569b2 |
37 |
+DIST scid-4.7.0_x64_linux.tar.gz 129771457 BLAKE2B 65ad7b58685a498954ebcf5216287216e2d2805bf0379784195b096c9eb04b333a8bbfb6c020c321b66c63d7bad2cfba724750b4d26f8172f620047219f98a73 SHA512 c9fb6f19741d60fe4952c643240f7e2eaa476eab35379c0a053b35217fe7a4b9ecfbc68edc45df4c9a2354babe8e0ddd2211db014d5396ce9bbb59db531c1179 |
38 |
+DIST scid-code-4.7.0.zip 15782104 BLAKE2B f1b927a1b23478d2e27a098e2ec99acb9a2061c373686cfcfa14ac219a1dce47468c3e46b3fe786655792177c86180bbe8e1dc91927b3ad2a80ea9b0bdb17fd3 SHA512 3c43fb8877da4a8dda9c99b1b856fe3f3840c7013041d53c31c8411ecf2e9ccbaf3b7c098e35cb23f5d0d7cac6b7514ca3bfb719fcbc111f5e1ef07f765f2708 |
39 |
DIST scidlet40k.zip 242632 BLAKE2B a16c5a3c04f721a40221db33f9ff7192dba724203ff81a61286903c2f4ab8a33b442503882550a7a59ab0a0e6d735a74b3f34bf9dd89f9677f2b7a8b8082d398 SHA512 e8cb4ca276ca94378f224fad972b0659f3e8159668fa395dcae4be1de6cdd9d29082fdddba393bbea6c909bab4f388042ea05c7dff41edf850d731bc7479850d |
40 |
DIST spelling.zip 3147998 BLAKE2B 40b33e0c5fab487247af13b0e3fa22d91b17cfb1dbc7d3fafd080db306700e684b30bf46a7222dd7ae16dc1407239973be8de1ee619b31cbcb373684a7f1487c SHA512 394a8835f23336b6f4bebe4e33ab9f64ffa505e9d9bb984de82396e671df0b57b088aab28c5cf648c1a11bc28370b431cb6db54765ac4ab6056a707276ba8f42 |
41 |
|
42 |
diff --git a/games-board/scid/files/scid-4.6.2-pgnfix-python3.patch b/games-board/scid/files/scid-4.6.2-pgnfix-python3.patch |
43 |
index 79b64e5ef6f..264849c0eb3 100644 |
44 |
--- a/games-board/scid/files/scid-4.6.2-pgnfix-python3.patch |
45 |
+++ b/games-board/scid/files/scid-4.6.2-pgnfix-python3.patch |
46 |
@@ -1,3 +1,4 @@ |
47 |
+https://sourceforge.net/p/scid/patches/8/ |
48 |
--- a/scripts/pgnfix.py |
49 |
+++ b/scripts/pgnfix.py |
50 |
@@ -12,7 +12,6 @@ |
51 |
|
52 |
diff --git a/games-board/scid/files/scid-4.7.0-system-gtest.patch b/games-board/scid/files/scid-4.7.0-system-gtest.patch |
53 |
new file mode 100644 |
54 |
index 00000000000..4e4a38cdc93 |
55 |
--- /dev/null |
56 |
+++ b/games-board/scid/files/scid-4.7.0-system-gtest.patch |
57 |
@@ -0,0 +1,16 @@ |
58 |
+--- a/gtest/CMakeLists.txt |
59 |
++++ b/gtest/CMakeLists.txt |
60 |
+@@ -19,8 +19,3 @@ |
61 |
+ # googletest |
62 |
+-if(NOT IS_DIRECTORY "${CMAKE_BINARY_DIR}/googletest") |
63 |
+- find_package(Git) |
64 |
+- execute_process(COMMAND ${GIT_EXECUTABLE} clone https://github.com/google/googletest.git) |
65 |
+-endif() |
66 |
+-set(gtest_force_shared_crt ON CACHE BOOL "Always use msvcrt.dll") |
67 |
+-add_subdirectory(${CMAKE_BINARY_DIR}/googletest ${CMAKE_BINARY_DIR}/googletest/Build EXCLUDE_FROM_ALL) |
68 |
++find_package(GTest REQUIRED) |
69 |
+ |
70 |
+@@ -48,2 +43,2 @@ |
71 |
+ target_compile_definitions(scid_tests PRIVATE -DSCID_TESTDIR=\"${CMAKE_CURRENT_LIST_DIR}/\") |
72 |
+-target_link_libraries(scid_tests PRIVATE scid_base gtest_main) |
73 |
++target_link_libraries(scid_tests PRIVATE scid_base ${GTEST_BOTH_LIBRARIES}) |
74 |
|
75 |
diff --git a/games-board/scid/files/scid-4.7.0-tcl-start-path.patch b/games-board/scid/files/scid-4.7.0-tcl-start-path.patch |
76 |
new file mode 100644 |
77 |
index 00000000000..361700d7bc8 |
78 |
--- /dev/null |
79 |
+++ b/games-board/scid/files/scid-4.7.0-tcl-start-path.patch |
80 |
@@ -0,0 +1,7 @@ |
81 |
+--- a/src/ui_tcltk.h |
82 |
++++ b/src/ui_tcltk.h |
83 |
+@@ -59,3 +59,3 @@ |
84 |
+ else dirname += 1; |
85 |
+- strcpy (dirname, "tcl/start.tcl"); |
86 |
++ strcpy (dirname, "../share/scid/tcl/start.tcl"); |
87 |
+ if (0 != Tcl_Access(sourceFileName, 4)) { |
88 |
|
89 |
diff --git a/games-board/scid/metadata.xml b/games-board/scid/metadata.xml |
90 |
index 2e8ed33ebd1..2d032ffeb5e 100644 |
91 |
--- a/games-board/scid/metadata.xml |
92 |
+++ b/games-board/scid/metadata.xml |
93 |
@@ -5,6 +5,10 @@ |
94 |
<email>games@g.o</email> |
95 |
<name>Gentoo Games Project</name> |
96 |
</maintainer> |
97 |
+ <use> |
98 |
+ <flag name="photos">Install collection of player photos (large)</flag> |
99 |
+ <flag name="scripts">Install additional python and tcl utility scripts</flag> |
100 |
+ </use> |
101 |
<upstream> |
102 |
<remote-id type="sourceforge">scid</remote-id> |
103 |
</upstream> |
104 |
|
105 |
diff --git a/games-board/scid/scid-4.7.0.ebuild b/games-board/scid/scid-4.7.0.ebuild |
106 |
new file mode 100644 |
107 |
index 00000000000..ab2ebaf3830 |
108 |
--- /dev/null |
109 |
+++ b/games-board/scid/scid-4.7.0.ebuild |
110 |
@@ -0,0 +1,106 @@ |
111 |
+# Copyright 1999-2021 Gentoo Authors |
112 |
+# Distributed under the terms of the GNU General Public License v2 |
113 |
+ |
114 |
+EAPI=7 |
115 |
+ |
116 |
+PYTHON_COMPAT=( python3_{8..10} ) |
117 |
+inherit cmake desktop optfeature python-single-r1 |
118 |
+ |
119 |
+DESCRIPTION="Shane's Chess Information Database" |
120 |
+HOMEPAGE="http://scid.sourceforge.net/" |
121 |
+SRC_URI=" |
122 |
+ mirror://sourceforge/scid/${PN}-code-${PV}.zip |
123 |
+ mirror://sourceforge/scid/${P}_x64_linux.tar.gz" |
124 |
+S="${WORKDIR}/${PN}" |
125 |
+ |
126 |
+LICENSE="GPL-2" |
127 |
+SLOT="0" |
128 |
+KEYWORDS="~amd64 ~x86" |
129 |
+IUSE="photos scripts test" |
130 |
+REQUIRED_USE="scripts? ( ${PYTHON_REQUIRED_USE} )" |
131 |
+RESTRICT="!test? ( test )" |
132 |
+ |
133 |
+COMMON_DEPEND=" |
134 |
+ dev-lang/tcl:= |
135 |
+ dev-lang/tk" |
136 |
+RDEPEND=" |
137 |
+ ${COMMON_DEPEND} |
138 |
+ dev-tcltk/tkimg |
139 |
+ scripts? ( ${PYTHON_DEPS} )" |
140 |
+DEPEND=" |
141 |
+ ${COMMON_DEPEND} |
142 |
+ test? ( dev-cpp/gtest )" |
143 |
+BDEPEND=" |
144 |
+ app-arch/unzip |
145 |
+ scripts? ( ${PYTHON_DEPS} )" |
146 |
+ |
147 |
+PATCHES=( |
148 |
+ "${FILESDIR}"/${PN}-4.6.2-pgnfix-python3.patch |
149 |
+ "${FILESDIR}"/${P}-system-gtest.patch |
150 |
+ "${FILESDIR}"/${P}-tcl-start-path.patch |
151 |
+) |
152 |
+ |
153 |
+HTML_DOCS=( help/. ) |
154 |
+ |
155 |
+pkg_setup() { |
156 |
+ use scripts && python-single-r1_pkg_setup |
157 |
+} |
158 |
+ |
159 |
+src_prepare() { |
160 |
+ cmake_src_prepare |
161 |
+ |
162 |
+ if use scripts; then |
163 |
+ python_fix_shebang scripts/pgnfix.py |
164 |
+ |
165 |
+ # cmake build doesn't use "tkscid" anymore but scripts still do |
166 |
+ sed -i s/tkscid/scid/ scripts/*.tcl || die |
167 |
+ fi |
168 |
+} |
169 |
+ |
170 |
+src_configure() { |
171 |
+ local mycmakeargs=( |
172 |
+ -DBUILD_SHARED_LIBS=off |
173 |
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}"/usr/share |
174 |
+ -DGTEST=$(usex test) |
175 |
+ ) |
176 |
+ |
177 |
+ cmake_src_configure |
178 |
+} |
179 |
+ |
180 |
+src_test() { |
181 |
+ "${BUILD_DIR}"/gtest/scid_tests || die |
182 |
+} |
183 |
+ |
184 |
+src_install() { |
185 |
+ cmake_src_install |
186 |
+ |
187 |
+ dobin "${BUILD_DIR}"/{phalanx-scid,scid,scidlet} |
188 |
+ |
189 |
+ if use scripts; then |
190 |
+ local script |
191 |
+ # install same set of scripts as pre-cmake |
192 |
+ for script in pgnfix.py {sc_{epgn,spell,eco,import},scidpgn,spliteco,spf2spi}.tcl sc_remote.tk; do |
193 |
+ newbin scripts/${script} ${script%.*} |
194 |
+ done |
195 |
+ fi |
196 |
+ |
197 |
+ insinto /usr/share/scid |
198 |
+ doins scid{,_es,_fr}.eco "${WORKDIR}"/${P}/spelling.ssp |
199 |
+ use photos && doins -r "${WORKDIR}"/${P}/photos |
200 |
+ |
201 |
+ newicon resources/svg/scid_app.svg scid.svg |
202 |
+ make_desktop_entry scid Scid |
203 |
+ |
204 |
+ # delete re-located files |
205 |
+ rm -r "${ED}"/usr/share/{bin,scid/{scid,scripts}} || die |
206 |
+} |
207 |
+ |
208 |
+pkg_postinst() { |
209 |
+ optfeature "speech support" dev-tcltk/snack |
210 |
+ |
211 |
+ if [[ ${REPLACING_VERSIONS} ]] && ver_test ${REPLACING_VERSIONS} -lt 4.7; then |
212 |
+ elog |
213 |
+ elog "Warning: this version uses ~/.scid4.7 and is incompatible with older ~/.scid" |
214 |
+ elog |
215 |
+ fi |
216 |
+} |