* [gentoo-commits] repo/gentoo:master commit in: app-misc/dvorak7min/files/, app-misc/dvorak7min/
@ 2020-09-13 7:45 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2020-09-13 7:45 UTC (permalink / raw
To: gentoo-commits
commit: a70ccb1e002ff4becc0ba79cd3390d73a73d1027
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 13 07:42:32 2020 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 13 07:45:06 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a70ccb1e
app-misc/dvorak7min: bump to EAPI 7, fix build
* Port to EAPI 7
* Adopt Debian's patches for some little bug fixes (inc. glibc-2.32)
* Fix linking with ncurses by using pkgconfig
Closes: https://bugs.gentoo.org/742080
Closes: https://bugs.gentoo.org/722336
Closes: https://bugs.gentoo.org/715848
Closes: https://bugs.gentoo.org/689986
Closes: https://bugs.gentoo.org/698082
Closes: https://bugs.gentoo.org/702372
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Sam James <sam <AT> gentoo.org>
...min-1.6.1.ebuild => dvorak7min-1.6.1-r1.ebuild} | 17 +-
.../files/dvorak7min-1.6.1-debian-changes.patch | 194 +++++++++++++++++++++
.../files/dvorak7min-1.6.1-makefile-flags.patch | 26 +++
.../dvorak7min-1.6.1-ncurses-pkg-config.patch | 24 +++
4 files changed, 255 insertions(+), 6 deletions(-)
diff --git a/app-misc/dvorak7min/dvorak7min-1.6.1.ebuild b/app-misc/dvorak7min/dvorak7min-1.6.1-r1.ebuild
similarity index 64%
rename from app-misc/dvorak7min/dvorak7min-1.6.1.ebuild
rename to app-misc/dvorak7min/dvorak7min-1.6.1-r1.ebuild
index 64c73178040..38f74d2fc07 100644
--- a/app-misc/dvorak7min/dvorak7min-1.6.1.ebuild
+++ b/app-misc/dvorak7min/dvorak7min-1.6.1-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=4
+EAPI=7
inherit toolchain-funcs
@@ -12,11 +12,16 @@ SRC_URI="http://www.linalco.com/ragnar/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
-IUSE=""
-src_prepare() {
- emake clean
-}
+BDEPEND="virtual/pkgconfig"
+DEPEND="sys-libs/ncurses:="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.6.1-debian-changes.patch"
+ "${FILESDIR}/${PN}-1.6.1-makefile-flags.patch"
+ "${FILESDIR}/${PN}-1.6.1-ncurses-pkg-config.patch"
+)
src_compile() {
emake \
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
new file mode 100644
index 00000000000..1257ee8eeaa
--- /dev/null
+++ b/app-misc/dvorak7min/files/dvorak7min-1.6.1-debian-changes.patch
@@ -0,0 +1,194 @@
+"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."
+https://sources.debian.org/patches/dvorak7min/1.6.1+repack-4/debian-changes.patch/
+----
+--- a/README
++++ b/README
+@@ -2,28 +2,16 @@ First of all, please read COPYING. Note
+ courtesy of Dan Wood <danwood@karelia.com>, and that they are available in
+ the original html format at http://www.karelia.com/abcd/
+
+-After that, just type
+-
+- make
+-
+-and when it's done, try running ``./dvorak7min''.
++Once the program is installed, try running ``./dvorak7min''.
+
+ If you get screwed up chars on the keyboard layout, you might want to try:
+
+ rm ~/.terminfo -R
+
+-and, if that doesn't work, try uncommenting the COLORS and/or the
+-NOT_SO_PRETTY lines in the Makefile, and doing a ``make clean all''. You
+-have a few other options in the Makefile, have a look to them.
+-
+ In addition of the built-in lessons, you can use any ascii file (as Smoke
+ suggests, Gutenberg books are good idea). Just specify the filename as an
+ argument to the program, and you are done.
+
+-If you are satisfied with the program, simply
+-
+- make install
+-
+ Remember that you can set your keyboard map with
+
+ loadkeys dvorak.map
+--- dvorak7min-1.6.1.orig/lessons.c
++++ dvorak7min-1.6.1/lessons.c
+@@ -166,6 +166,7 @@ char *lessons[] =
+ "gggg pppp gggg pppp gggg pppp gggg pppp gggg pppp gggg pppp gggg ppp\n"
+ "pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg pg\n"
+ "gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp gp\n"
++"\x1"
+ "gggg hhhh pppp uuuu gggg hhhh pppp uuuu gggg hhhh pppp uuuu\n"
+ "up up up up hug hug hug hug pug pug pug pug pup pup pup pup\n"
+ "ugh ugh ugh ugh Hugh Hugh Hugh Hugh Pugh Pugh Pugh Pugh",
+@@ -263,7 +264,7 @@ char *lessons[] =
+ "The catchup accident at the picnic depicted Dutch as an apathetic nuisance.\n"
+ "It is no coincidence that this idiotic sentence has eight concise Cs in it.\n"
+ "The enthusiastic duchess noticed the Pontiac coupe...and decided to chase it."
+-"\1"
++"\x1"
+ "I detect a headache...I hope it is not the\n"
+ "Schnapps and Cocoa I had as a nightcap.\n"
+ "\n"
+@@ -362,11 +363,12 @@ char *lessons[] =
+ "Allegra, an unparalleled intellectual, calculated the celestial latitudes and\n"
+ "longitudes in her sleep.",
+
+- "YF: index fingers streching up",
++ "YF: index fingers stretching up",
+ "\x2"
+ "ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy\n"
+ "ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy ffff yyyy\n"
+ "fy fy fy fy fy fy fy yf yf yf yf yf yf yf ffff gggg hhhh yyyy pppp uuuu\n"
++"\x1"
+ "guy guy guy guy guy guy guy guy guy gyp gyp gyp gyp gyp gyp gyp gyp gyp\n"
+ "UHF UHF UHF UHF UHF UHF UHF UHF UHF yuh yuh yuh yuh yuh yuh yuh yuh yuh\n"
+ "huff huff huff huff huff huff huff puff puff puff puff puff puff puff\n"
+@@ -406,6 +408,7 @@ char *lessons[] =
+ "kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm\n"
+ "kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm kkkk mmmm\n"
+ "km km km km km km km km km km mk mk mk mk mk mk mk mk mk mk\n"
++"\x1"
+ "hhhh kkkk mmmm uuuu hhhh kkkk mmmm uuuu hhhh kkkk mmmm uuuu\n"
+ "ku ku ku ku ku ku ku ku ku ku mu mu mu mu mu mu mu mu mu mu\n"
+ "UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK UK\n"
+@@ -442,6 +445,7 @@ char *lessons[] =
+ "jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww\n"
+ "jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww jjjj wwww\n"
+ "jw jw jw jw jw jw jw jw jw jw jw wj wj wj wj wj wj wj wj wj\n"
++"\x1"
+ "eeee jjjj tttt wwww eeee jjjj tttt wwww eeee jjjj tttt wwww\n"
+ "ewe ewe ewe ewe ewe jet jet jet jet jet Jew Jew Jew Jew Jew\n"
+ "wee wee wee wee wee wee wee wet wet wet wet wet wet wet wet\n"
+@@ -500,6 +504,7 @@ char *lessons[] =
+ "An acquisitive mind helped Pavlov evolve his theories.\n"
+ "QVC's involvement with Paramount may give it new verve.\n"
+ "Vivian's new Volvo unequivocally vanquished her fears of driving.\n"
++"\x1"
+ "According to Pravda, Vladivostok was a quiet village in its Soviet days.\n"
+ "This unique, opaque liquor does not quench your thirst, it makes you queasy.\n"
+ "David's vivid imagination and his inquisitive and inventive mind suggest a high IQ."
+@@ -548,7 +553,7 @@ char *lessons[] =
+ "activity; several lizards hazarded the freezing waters and capsized the fish\n"
+ "tanks; a dozen grizzlies were waltzing in the plaza.",
+
+- "XB: index fingers streching down",
++ "XB: index fingers stretching down",
+ "\x2"
+ "bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx\n"
+ "bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx bbbb xxxx\n"
+--- dvorak7min-1.6.1.orig/Makefile
++++ dvorak7min-1.6.1/Makefile
+@@ -6,7 +6,7 @@ INSTALL = /usr/local/games/bin
+ #NASTINESS = -DNASTY_AS_USUAL
+ #BEEPS = -DBEEPS_ARENT_IRRITATING
+ #FLASHES = -DFLASHES_ARENT_IRRITATING
+-#COLORS = -DNO_COLORS_PLEASE
++COLORS = -DNO_COLORS_PLEASE
+
+ # Max length of imported texts. Set it to 0 or comment it if you don't want
+ # a limit
+@@ -14,7 +14,7 @@ LIMIT_LENGTH = -DLIMIT_LENGTH=1024
+
+ ### That's all ###
+
+-#CC = gcc
++CC = gcc
+ PROF = -g0 -O2
+ CFLAGS = $(PROF) -Wall \
+ $(PRETTINESS) $(NASTINESS) $(BEEPS) $(FLASHES) $(COLORS) \
+--- dvorak7min-1.6.1.orig/dvorak7min.c
++++ dvorak7min-1.6.1/dvorak7min.c
+@@ -173,7 +173,8 @@ int myGetch(char shouldBe)
+ /* calculate typing speed in a given interval */
+ inline float calcSpeed (time_t timeStart, time_t timeFinish, int hits)
+ {
+- return (float) hits / (timeFinish - timeStart);
++ // Use WPS/WPM as better standard, so also divide by 5
++ return (float) hits / 5 / (timeFinish - timeStart);
+ }
+
+
+@@ -193,7 +194,7 @@ int importText (char const * const fileN
+
+ file = fopen (fileName, "r");
+ if (!file) {
+- postmortem = sys_errlist[errno];
++ postmortem = strerror(errno);
+ return -1;
+ }
+
+@@ -220,7 +221,7 @@ int importText (char const * const fileN
+ while (1) {
+ c = fgetc (file);
+ if (errno) {
+- postmortem = sys_errlist[errno];
++ postmortem = strerror(errno);
+ fclose (file);
+ return -1;
+ }
+@@ -418,6 +419,7 @@ void do_text (char * const text)
+ ++p;
+ if (!timeStart) {
+ timeStart = time(0);
++ hits = 0;
+ }
+ }
+
+@@ -431,8 +433,9 @@ void do_text (char * const text)
+ float ratio = hits - misses;
+ ratio = (ratio < 0) ? 0 : (100.0 * ratio / hits);
+ timeCurrent = time(0);
+- speed = calcSpeed (timeStart, timeCurrent, hits);
+- 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);
++ speed = calcSpeed (timeStart, timeCurrent, hits + misses);
++ // Use WPS/WPM as better standards
++ 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);
+ clrtoeol();
+ }
+ } while (ch == ERR);
+@@ -510,7 +513,7 @@ void do_text (char * const text)
+ }
+
+ timeFinish = time(0);
+- speed = calcSpeed(timeStart, timeFinish, hits);
++ speed = calcSpeed(timeStart, timeFinish, hits + misses);
+ clear();
+ cbreak();
+ if (!timeStart) {
+@@ -519,8 +522,11 @@ void do_text (char * const text)
+ float ratio = hits - misses;
+ ratio = (ratio < 0) ? 0 : (100.0 * ratio / hits);
+ mvprintw (0, 0, "Elapsed time: %d seconds", timeFinish - timeStart);
+- mvprintw (1, 0, "Total: %d Misses: %d Ratio: %.2f%%", hits, misses, ratio);
+- mvprintw (2, 0, "CPS: %.2f CPM: %.2f", speed, speed * 60);
++ mvprintw (1, 0, "Total: %d Misses: %d Ratio: %.2f%%",
++ hits + misses, misses,
++ (float)100*(hits) / (hits + misses));
++ // Use WPM/WPS as better standard
++ mvprintw (2, 0, "WPS: %.2f WPM: %.2f", speed, speed * 60);
+ }
+
+ mvprintw (4, 0, "[ ] Press ESCAPE to continue.");
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
new file mode 100644
index 00000000000..83981050daf
--- /dev/null
+++ b/app-misc/dvorak7min/files/dvorak7min-1.6.1-makefile-flags.patch
@@ -0,0 +1,26 @@
+https://sources.debian.org/patches/dvorak7min/1.6.1+repack-4/makefile-flags.patch/
+--- a/Makefile
++++ b/Makefile
+@@ -6,6 +6,7 @@
+ #NASTINESS = -DNASTY_AS_USUAL
+ #BEEPS = -DBEEPS_ARENT_IRRITATING
+ #FLASHES = -DFLASHES_ARENT_IRRITATING
++#PROF = -g0 -O2
+ COLORS = -DNO_COLORS_PLEASE
+
+ # Max length of imported texts. Set it to 0 or comment it if you don't want
+@@ -15,11 +16,10 @@
+ ### That's all ###
+
+ CC = gcc
+-PROF = -g0 -O2
+-CFLAGS = $(PROF) -Wall \
++CFLAGS += -Wall \
+ $(PRETTINESS) $(NASTINESS) $(BEEPS) $(FLASHES) $(COLORS) \
+- $(LIMIT_LENGTH)
+-LDFLAGS = $(PROF)
++ $(LIMIT_LENGTH) $(PROF)
++LDFLAGS += $(PROF)
+ LIBS = -lncurses
+
+ OBJECTS = dvorak7min.o lessons.o
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
new file mode 100644
index 00000000000..2f62112ceb4
--- /dev/null
+++ b/app-misc/dvorak7min/files/dvorak7min-1.6.1-ncurses-pkg-config.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/show_bug.cgi?id=722336
+https://bugs.gentoo.org/show_bug.cgi?id=689986
+https://bugs.gentoo.org/show_bug.cgi?id=698082
+https://bugs.gentoo.org/show_bug.cgi?id=702372
+diff --git a/Makefile b/Makefile
+index e0e7645..6aee6ab 100644
+--- a/Makefile
++++ b/Makefile
+@@ -15,12 +15,13 @@ LIMIT_LENGTH = -DLIMIT_LENGTH=1024
+
+ ### That's all ###
+
+-CC = gcc
++PKG_CONFIG ?= pkg-config
++CC ?= gcc
+ CFLAGS += -Wall \
+ $(PRETTINESS) $(NASTINESS) $(BEEPS) $(FLASHES) $(COLORS) \
+ $(LIMIT_LENGTH) $(PROF)
+ LDFLAGS += $(PROF)
+-LIBS = -lncurses
++LIBS = $(shell pkg-config --libs ncurses)
+
+ OBJECTS = dvorak7min.o lessons.o
+ HEADERS = lessons.h
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-misc/dvorak7min/files/, app-misc/dvorak7min/
@ 2023-08-19 12:51 Joonas Niilola
0 siblings, 0 replies; 2+ messages in thread
From: Joonas Niilola @ 2023-08-19 12:51 UTC (permalink / raw
To: gentoo-commits
commit: 6373daa40e8a7bbd5a6325b90ca23bce70db99c9
Author: Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Thu Aug 3 19:32:37 2023 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 12:51:08 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6373daa4
app-misc/dvorak7min: Fix call to undeclared library function index
Closes: https://bugs.gentoo.org/894546
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/32160
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
app-misc/dvorak7min/dvorak7min-1.6.1-r2.ebuild | 38 ++++++++++++++++++++++
.../files/dvorak7min-1.6.1-clang16-build-fix.patch | 29 +++++++++++++++++
2 files changed, 67 insertions(+)
diff --git a/app-misc/dvorak7min/dvorak7min-1.6.1-r2.ebuild b/app-misc/dvorak7min/dvorak7min-1.6.1-r2.ebuild
new file mode 100644
index 000000000000..9be49c11fe75
--- /dev/null
+++ b/app-misc/dvorak7min/dvorak7min-1.6.1-r2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Simple ncurses-based typing tutor for learning the Dvorak keyboard layout"
+HOMEPAGE="http://www.linalco.com/comunidad.html"
+SRC_URI="http://www.linalco.com/ragnar/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="sys-libs/ncurses:="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.6.1-debian-changes.patch
+ "${FILESDIR}"/${PN}-1.6.1-makefile-flags.patch
+ "${FILESDIR}"/${PN}-1.6.1-ncurses-pkg-config.patch
+ "${FILESDIR}"/${PN}-1.6.1-clang16-build-fix.patch
+)
+
+src_compile() {
+ tc-export PKG_CONFIG
+ emake \
+ CC="$(tc-getCC)" \
+ PROF="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dobin ${PN}
+ dodoc ChangeLog README
+}
diff --git a/app-misc/dvorak7min/files/dvorak7min-1.6.1-clang16-build-fix.patch b/app-misc/dvorak7min/files/dvorak7min-1.6.1-clang16-build-fix.patch
new file mode 100644
index 000000000000..27c54dc595b7
--- /dev/null
+++ b/app-misc/dvorak7min/files/dvorak7min-1.6.1-clang16-build-fix.patch
@@ -0,0 +1,29 @@
+Bug: https://bugs.gentoo.org/894546
+--- a/dvorak7min.c
++++ b/dvorak7min.c
+@@ -41,6 +41,7 @@
+ *
+ */
+
++#define _GNU_SOURCE
+ #include <strings.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -435,7 +436,7 @@ void do_text (char * const text)
+ timeCurrent = time(0);
+ speed = calcSpeed (timeStart, timeCurrent, hits + misses);
+ // Use WPS/WPM as better standards
+- 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);
++ mvprintw (LINES - 1, 0, "WPS %.2f WPM %.2f Hits: %d Misses: %d Seconds: %ld Ratio: %.2f%%", speed, speed * 60, hits, misses, time(0) - timeStart, ratio);
+ clrtoeol();
+ }
+ } while (ch == ERR);
+@@ -521,7 +522,7 @@ void do_text (char * const text)
+ } else {
+ float ratio = hits - misses;
+ ratio = (ratio < 0) ? 0 : (100.0 * ratio / hits);
+- mvprintw (0, 0, "Elapsed time: %d seconds", timeFinish - timeStart);
++ mvprintw (0, 0, "Elapsed time: %ld seconds", timeFinish - timeStart);
+ mvprintw (1, 0, "Total: %d Misses: %d Ratio: %.2f%%",
+ hits + misses, misses,
+ (float)100*(hits) / (hits + misses));
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-19 12:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-13 7:45 [gentoo-commits] repo/gentoo:master commit in: app-misc/dvorak7min/files/, app-misc/dvorak7min/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2023-08-19 12:51 Joonas Niilola
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox