1 |
commit: a70ccb1e002ff4becc0ba79cd3390d73a73d1027 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 13 07:42:32 2020 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 13 07:45:06 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a70ccb1e |
7 |
|
8 |
app-misc/dvorak7min: bump to EAPI 7, fix build |
9 |
|
10 |
* Port to EAPI 7 |
11 |
* Adopt Debian's patches for some little bug fixes (inc. glibc-2.32) |
12 |
* Fix linking with ncurses by using pkgconfig |
13 |
|
14 |
Closes: https://bugs.gentoo.org/742080 |
15 |
Closes: https://bugs.gentoo.org/722336 |
16 |
Closes: https://bugs.gentoo.org/715848 |
17 |
Closes: https://bugs.gentoo.org/689986 |
18 |
Closes: https://bugs.gentoo.org/698082 |
19 |
Closes: https://bugs.gentoo.org/702372 |
20 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
21 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
22 |
|
23 |
...min-1.6.1.ebuild => dvorak7min-1.6.1-r1.ebuild} | 17 +- |
24 |
.../files/dvorak7min-1.6.1-debian-changes.patch | 194 +++++++++++++++++++++ |
25 |
.../files/dvorak7min-1.6.1-makefile-flags.patch | 26 +++ |
26 |
.../dvorak7min-1.6.1-ncurses-pkg-config.patch | 24 +++ |
27 |
4 files changed, 255 insertions(+), 6 deletions(-) |
28 |
|
29 |
diff --git a/app-misc/dvorak7min/dvorak7min-1.6.1.ebuild b/app-misc/dvorak7min/dvorak7min-1.6.1-r1.ebuild |
30 |
similarity index 64% |
31 |
rename from app-misc/dvorak7min/dvorak7min-1.6.1.ebuild |
32 |
rename to app-misc/dvorak7min/dvorak7min-1.6.1-r1.ebuild |
33 |
index 64c73178040..38f74d2fc07 100644 |
34 |
--- a/app-misc/dvorak7min/dvorak7min-1.6.1.ebuild |
35 |
+++ b/app-misc/dvorak7min/dvorak7min-1.6.1-r1.ebuild |
36 |
@@ -1,7 +1,7 @@ |
37 |
-# Copyright 1999-2012 Gentoo Foundation |
38 |
+# Copyright 1999-2020 Gentoo Authors |
39 |
# Distributed under the terms of the GNU General Public License v2 |
40 |
|
41 |
-EAPI=4 |
42 |
+EAPI=7 |
43 |
|
44 |
inherit toolchain-funcs |
45 |
|
46 |
@@ -12,11 +12,16 @@ SRC_URI="http://www.linalco.com/ragnar/${P}.tar.gz" |
47 |
LICENSE="GPL-2" |
48 |
SLOT="0" |
49 |
KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos" |
50 |
-IUSE="" |
51 |
|
52 |
-src_prepare() { |
53 |
- emake clean |
54 |
-} |
55 |
+BDEPEND="virtual/pkgconfig" |
56 |
+DEPEND="sys-libs/ncurses:=" |
57 |
+RDEPEND="${DEPEND}" |
58 |
+ |
59 |
+PATCHES=( |
60 |
+ "${FILESDIR}/${PN}-1.6.1-debian-changes.patch" |
61 |
+ "${FILESDIR}/${PN}-1.6.1-makefile-flags.patch" |
62 |
+ "${FILESDIR}/${PN}-1.6.1-ncurses-pkg-config.patch" |
63 |
+) |
64 |
|
65 |
src_compile() { |
66 |
emake \ |
67 |
|
68 |
diff --git a/app-misc/dvorak7min/files/dvorak7min-1.6.1-debian-changes.patch b/app-misc/dvorak7min/files/dvorak7min-1.6.1-debian-changes.patch |
69 |
new file mode 100644 |
70 |
index 00000000000..1257ee8eeaa |
71 |
--- /dev/null |
72 |
+++ b/app-misc/dvorak7min/files/dvorak7min-1.6.1-debian-changes.patch |
73 |
@@ -0,0 +1,194 @@ |
74 |
+"These are the combined Debian changes from upstream. They have been made only to the Debian packaging because the source is no longer maintained upstream." |
75 |
+https://sources.debian.org/patches/dvorak7min/1.6.1+repack-4/debian-changes.patch/ |
76 |
+---- |
77 |
+--- a/README |
78 |
++++ b/README |
79 |
+@@ -2,28 +2,16 @@ First of all, please read COPYING. Note |
80 |
+ courtesy of Dan Wood <danwood@×××××××.com>, and that they are available in |
81 |
+ the original html format at http://www.karelia.com/abcd/ |
82 |
+ |
83 |
+-After that, just type |
84 |
+- |
85 |
+- make |
86 |
+- |
87 |
+-and when it's done, try running ``./dvorak7min''. |
88 |
++Once the program is installed, try running ``./dvorak7min''. |
89 |
+ |
90 |
+ If you get screwed up chars on the keyboard layout, you might want to try: |
91 |
+ |
92 |
+ rm ~/.terminfo -R |
93 |
+ |
94 |
+-and, if that doesn't work, try uncommenting the COLORS and/or the |
95 |
+-NOT_SO_PRETTY lines in the Makefile, and doing a ``make clean all''. You |
96 |
+-have a few other options in the Makefile, have a look to them. |
97 |
+- |
98 |
+ In addition of the built-in lessons, you can use any ascii file (as Smoke |
99 |
+ suggests, Gutenberg books are good idea). Just specify the filename as an |
100 |
+ argument to the program, and you are done. |
101 |
+ |
102 |
+-If you are satisfied with the program, simply |
103 |
+- |
104 |
+- make install |
105 |
+- |
106 |
+ Remember that you can set your keyboard map with |
107 |
+ |
108 |
+ loadkeys dvorak.map |
109 |
+--- dvorak7min-1.6.1.orig/lessons.c |
110 |
++++ dvorak7min-1.6.1/lessons.c |
111 |
+@@ -166,6 +166,7 @@ char *lessons[] = |
112 |
+ "gggg pppp gggg pppp gggg pppp gggg pppp gggg pppp gggg pppp gggg ppp\n" |
113 |
+ "pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg\n" |
114 |
+ "gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp\n" |
115 |
++"\x1" |
116 |
+ "gggg hhhh pppp uuuu gggg hhhh pppp uuuu gggg hhhh pppp uuuu\n" |
117 |
+ "up up up up hug hug hug hug pug pug pug pug pup pup pup pup\n" |
118 |
+ "ugh ugh ugh ugh Hugh Hugh Hugh Hugh Pugh Pugh Pugh Pugh", |
119 |
+@@ -263,7 +264,7 @@ char *lessons[] = |
120 |
+ "The catchup accident at the picnic depicted Dutch as an apathetic nuisance.\n" |
121 |
+ "It is no coincidence that this idiotic sentence has eight concise Cs in it.\n" |
122 |
+ "The enthusiastic duchess noticed the Pontiac coupe...and decided to chase it." |
123 |
+-"\1" |
124 |
++"\x1" |
125 |
+ "I detect a headache...I hope it is not the\n" |
126 |
+ "Schnapps and Cocoa I had as a nightcap.\n" |
127 |
+ "\n" |
128 |
+@@ -362,11 +363,12 @@ char *lessons[] = |
129 |
+ "Allegra, an unparalleled intellectual, calculated the celestial latitudes and\n" |
130 |
+ "longitudes in her sleep.", |
131 |
+ |
132 |
+- "YF: index fingers streching up", |
133 |
++ "YF: index fingers stretching up", |
134 |
+ "\x2" |
135 |
+ "ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy\n" |
136 |
+ "ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy\n" |
137 |
+ "fy fy fy fy fy fy fy yf yf yf yf yf yf yf ffff gggg hhhh yyyy pppp uuuu\n" |
138 |
++"\x1" |
139 |
+ "guy guy guy guy guy guy guy guy guy gyp gyp gyp gyp gyp gyp gyp gyp gyp\n" |
140 |
+ "UHF UHF UHF UHF UHF UHF UHF UHF UHF yuh yuh yuh yuh yuh yuh yuh yuh yuh\n" |
141 |
+ "huff huff huff huff huff huff huff puff puff puff puff puff puff puff\n" |
142 |
+@@ -406,6 +408,7 @@ char *lessons[] = |
143 |
+ "kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm\n" |
144 |
+ "kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm\n" |
145 |
+ "km km km km km km km km km km mk mk mk mk mk mk mk mk mk mk\n" |
146 |
++"\x1" |
147 |
+ "hhhh kkkk mmmm uuuu hhhh kkkk mmmm uuuu hhhh kkkk mmmm uuuu\n" |
148 |
+ "ku ku ku ku ku ku ku ku ku ku mu mu mu mu mu mu mu mu mu mu\n" |
149 |
+ "UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK\n" |
150 |
+@@ -442,6 +445,7 @@ char *lessons[] = |
151 |
+ "jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww\n" |
152 |
+ "jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww\n" |
153 |
+ "jw jw jw jw jw jw jw jw jw jw jw wj wj wj wj wj wj wj wj wj\n" |
154 |
++"\x1" |
155 |
+ "eeee jjjj tttt wwww eeee jjjj tttt wwww eeee jjjj tttt wwww\n" |
156 |
+ "ewe ewe ewe ewe ewe jet jet jet jet jet Jew Jew Jew Jew Jew\n" |
157 |
+ "wee wee wee wee wee wee wee wet wet wet wet wet wet wet wet\n" |
158 |
+@@ -500,6 +504,7 @@ char *lessons[] = |
159 |
+ "An acquisitive mind helped Pavlov evolve his theories.\n" |
160 |
+ "QVC's involvement with Paramount may give it new verve.\n" |
161 |
+ "Vivian's new Volvo unequivocally vanquished her fears of driving.\n" |
162 |
++"\x1" |
163 |
+ "According to Pravda, Vladivostok was a quiet village in its Soviet days.\n" |
164 |
+ "This unique, opaque liquor does not quench your thirst, it makes you queasy.\n" |
165 |
+ "David's vivid imagination and his inquisitive and inventive mind suggest a high IQ." |
166 |
+@@ -548,7 +553,7 @@ char *lessons[] = |
167 |
+ "activity; several lizards hazarded the freezing waters and capsized the fish\n" |
168 |
+ "tanks; a dozen grizzlies were waltzing in the plaza.", |
169 |
+ |
170 |
+- "XB: index fingers streching down", |
171 |
++ "XB: index fingers stretching down", |
172 |
+ "\x2" |
173 |
+ "bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx\n" |
174 |
+ "bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx\n" |
175 |
+--- dvorak7min-1.6.1.orig/Makefile |
176 |
++++ dvorak7min-1.6.1/Makefile |
177 |
+@@ -6,7 +6,7 @@ INSTALL = /usr/local/games/bin |
178 |
+ #NASTINESS = -DNASTY_AS_USUAL |
179 |
+ #BEEPS = -DBEEPS_ARENT_IRRITATING |
180 |
+ #FLASHES = -DFLASHES_ARENT_IRRITATING |
181 |
+-#COLORS = -DNO_COLORS_PLEASE |
182 |
++COLORS = -DNO_COLORS_PLEASE |
183 |
+ |
184 |
+ # Max length of imported texts. Set it to 0 or comment it if you don't want |
185 |
+ # a limit |
186 |
+@@ -14,7 +14,7 @@ LIMIT_LENGTH = -DLIMIT_LENGTH=1024 |
187 |
+ |
188 |
+ ### That's all ### |
189 |
+ |
190 |
+-#CC = gcc |
191 |
++CC = gcc |
192 |
+ PROF = -g0 -O2 |
193 |
+ CFLAGS = $(PROF) -Wall \ |
194 |
+ $(PRETTINESS) $(NASTINESS) $(BEEPS) $(FLASHES) $(COLORS) \ |
195 |
+--- dvorak7min-1.6.1.orig/dvorak7min.c |
196 |
++++ dvorak7min-1.6.1/dvorak7min.c |
197 |
+@@ -173,7 +173,8 @@ int myGetch(char shouldBe) |
198 |
+ /* calculate typing speed in a given interval */ |
199 |
+ inline float calcSpeed (time_t timeStart, time_t timeFinish, int hits) |
200 |
+ { |
201 |
+- return (float) hits / (timeFinish - timeStart); |
202 |
++ // Use WPS/WPM as better standard, so also divide by 5 |
203 |
++ return (float) hits / 5 / (timeFinish - timeStart); |
204 |
+ } |
205 |
+ |
206 |
+ |
207 |
+@@ -193,7 +194,7 @@ int importText (char const * const fileN |
208 |
+ |
209 |
+ file = fopen (fileName, "r"); |
210 |
+ if (!file) { |
211 |
+- postmortem = sys_errlist[errno]; |
212 |
++ postmortem = strerror(errno); |
213 |
+ return -1; |
214 |
+ } |
215 |
+ |
216 |
+@@ -220,7 +221,7 @@ int importText (char const * const fileN |
217 |
+ while (1) { |
218 |
+ c = fgetc (file); |
219 |
+ if (errno) { |
220 |
+- postmortem = sys_errlist[errno]; |
221 |
++ postmortem = strerror(errno); |
222 |
+ fclose (file); |
223 |
+ return -1; |
224 |
+ } |
225 |
+@@ -418,6 +419,7 @@ void do_text (char * const text) |
226 |
+ ++p; |
227 |
+ if (!timeStart) { |
228 |
+ timeStart = time(0); |
229 |
++ hits = 0; |
230 |
+ } |
231 |
+ } |
232 |
+ |
233 |
+@@ -431,8 +433,9 @@ void do_text (char * const text) |
234 |
+ float ratio = hits - misses; |
235 |
+ ratio = (ratio < 0) ? 0 : (100.0 * ratio / hits); |
236 |
+ timeCurrent = time(0); |
237 |
+- speed = calcSpeed (timeStart, timeCurrent, hits); |
238 |
+- mvprintw (LINES - 1, 0, "CPS %.2f CPM %.2f Hits: %d Misses: %d Seconds: %d Ratio: %.2f%%", speed, speed * 60, hits, misses, time(0) - timeStart, ratio); |
239 |
++ speed = calcSpeed (timeStart, timeCurrent, hits + misses); |
240 |
++ // Use WPS/WPM as better standards |
241 |
++ mvprintw (LINES - 1, 0, "WPS %.2f WPM %.2f Hits: %d Misses: %d Seconds: %d Ratio: %.2f%%", speed, speed * 60, hits, misses, time(0) - timeStart, ratio); |
242 |
+ clrtoeol(); |
243 |
+ } |
244 |
+ } while (ch == ERR); |
245 |
+@@ -510,7 +513,7 @@ void do_text (char * const text) |
246 |
+ } |
247 |
+ |
248 |
+ timeFinish = time(0); |
249 |
+- speed = calcSpeed(timeStart, timeFinish, hits); |
250 |
++ speed = calcSpeed(timeStart, timeFinish, hits + misses); |
251 |
+ clear(); |
252 |
+ cbreak(); |
253 |
+ if (!timeStart) { |
254 |
+@@ -519,8 +522,11 @@ void do_text (char * const text) |
255 |
+ float ratio = hits - misses; |
256 |
+ ratio = (ratio < 0) ? 0 : (100.0 * ratio / hits); |
257 |
+ mvprintw (0, 0, "Elapsed time: %d seconds", timeFinish - timeStart); |
258 |
+- mvprintw (1, 0, "Total: %d Misses: %d Ratio: %.2f%%", hits, misses, ratio); |
259 |
+- mvprintw (2, 0, "CPS: %.2f CPM: %.2f", speed, speed * 60); |
260 |
++ mvprintw (1, 0, "Total: %d Misses: %d Ratio: %.2f%%", |
261 |
++ hits + misses, misses, |
262 |
++ (float)100*(hits) / (hits + misses)); |
263 |
++ // Use WPM/WPS as better standard |
264 |
++ mvprintw (2, 0, "WPS: %.2f WPM: %.2f", speed, speed * 60); |
265 |
+ } |
266 |
+ |
267 |
+ mvprintw (4, 0, "[ ] Press ESCAPE to continue."); |
268 |
|
269 |
diff --git a/app-misc/dvorak7min/files/dvorak7min-1.6.1-makefile-flags.patch b/app-misc/dvorak7min/files/dvorak7min-1.6.1-makefile-flags.patch |
270 |
new file mode 100644 |
271 |
index 00000000000..83981050daf |
272 |
--- /dev/null |
273 |
+++ b/app-misc/dvorak7min/files/dvorak7min-1.6.1-makefile-flags.patch |
274 |
@@ -0,0 +1,26 @@ |
275 |
+https://sources.debian.org/patches/dvorak7min/1.6.1+repack-4/makefile-flags.patch/ |
276 |
+--- a/Makefile |
277 |
++++ b/Makefile |
278 |
+@@ -6,6 +6,7 @@ |
279 |
+ #NASTINESS = -DNASTY_AS_USUAL |
280 |
+ #BEEPS = -DBEEPS_ARENT_IRRITATING |
281 |
+ #FLASHES = -DFLASHES_ARENT_IRRITATING |
282 |
++#PROF = -g0 -O2 |
283 |
+ COLORS = -DNO_COLORS_PLEASE |
284 |
+ |
285 |
+ # Max length of imported texts. Set it to 0 or comment it if you don't want |
286 |
+@@ -15,11 +16,10 @@ |
287 |
+ ### That's all ### |
288 |
+ |
289 |
+ CC = gcc |
290 |
+-PROF = -g0 -O2 |
291 |
+-CFLAGS = $(PROF) -Wall \ |
292 |
++CFLAGS += -Wall \ |
293 |
+ $(PRETTINESS) $(NASTINESS) $(BEEPS) $(FLASHES) $(COLORS) \ |
294 |
+- $(LIMIT_LENGTH) |
295 |
+-LDFLAGS = $(PROF) |
296 |
++ $(LIMIT_LENGTH) $(PROF) |
297 |
++LDFLAGS += $(PROF) |
298 |
+ LIBS = -lncurses |
299 |
+ |
300 |
+ OBJECTS = dvorak7min.o lessons.o |
301 |
|
302 |
diff --git a/app-misc/dvorak7min/files/dvorak7min-1.6.1-ncurses-pkg-config.patch b/app-misc/dvorak7min/files/dvorak7min-1.6.1-ncurses-pkg-config.patch |
303 |
new file mode 100644 |
304 |
index 00000000000..2f62112ceb4 |
305 |
--- /dev/null |
306 |
+++ b/app-misc/dvorak7min/files/dvorak7min-1.6.1-ncurses-pkg-config.patch |
307 |
@@ -0,0 +1,24 @@ |
308 |
+https://bugs.gentoo.org/show_bug.cgi?id=722336 |
309 |
+https://bugs.gentoo.org/show_bug.cgi?id=689986 |
310 |
+https://bugs.gentoo.org/show_bug.cgi?id=698082 |
311 |
+https://bugs.gentoo.org/show_bug.cgi?id=702372 |
312 |
+diff --git a/Makefile b/Makefile |
313 |
+index e0e7645..6aee6ab 100644 |
314 |
+--- a/Makefile |
315 |
++++ b/Makefile |
316 |
+@@ -15,12 +15,13 @@ LIMIT_LENGTH = -DLIMIT_LENGTH=1024 |
317 |
+ |
318 |
+ ### That's all ### |
319 |
+ |
320 |
+-CC = gcc |
321 |
++PKG_CONFIG ?= pkg-config |
322 |
++CC ?= gcc |
323 |
+ CFLAGS += -Wall \ |
324 |
+ $(PRETTINESS) $(NASTINESS) $(BEEPS) $(FLASHES) $(COLORS) \ |
325 |
+ $(LIMIT_LENGTH) $(PROF) |
326 |
+ LDFLAGS += $(PROF) |
327 |
+-LIBS = -lncurses |
328 |
++LIBS = $(shell pkg-config --libs ncurses) |
329 |
+ |
330 |
+ OBJECTS = dvorak7min.o lessons.o |
331 |
+ HEADERS = lessons.h |