diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2023-08-03 19:32:37 +0000 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2023-08-19 15:51:08 +0300 |
commit | 6373daa40e8a7bbd5a6325b90ca23bce70db99c9 (patch) | |
tree | 033147f869f056252b58d661e86a93eaee533106 /app-misc | |
parent | app-emulation/libvirt-snmp: update HOMEPAGE, SRC_URI (diff) | |
download | gentoo-6373daa40e8a7bbd5a6325b90ca23bce70db99c9.tar.gz gentoo-6373daa40e8a7bbd5a6325b90ca23bce70db99c9.tar.bz2 gentoo-6373daa40e8a7bbd5a6325b90ca23bce70db99c9.zip |
app-misc/dvorak7min: Fix call to undeclared library function index
Closes: https://bugs.gentoo.org/894546
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/32160
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r-- | app-misc/dvorak7min/dvorak7min-1.6.1-r2.ebuild | 38 | ||||
-rw-r--r-- | app-misc/dvorak7min/files/dvorak7min-1.6.1-clang16-build-fix.patch | 29 |
2 files changed, 67 insertions, 0 deletions
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)); |