[gentoo-commits] repo/gentoo:master commit in: games-misc/typespeed/, games-misc/typespeed/files/

2024-03-03 Thread Sam James
commit: 205386500401a626968efb6b5e5dba531e752fe8
Author: Sam James  gentoo  org>
AuthorDate: Mon Mar  4 05:12:27 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Mar  4 05:16:30 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20538650

games-misc/typespeed: update EAPI 7 -> 8, fix build with LTO, fix group for 
leaderboard

* EAPI 8
* Fix build with LTO (-Wlto-type-mismatch)
* Fix group for leaderboard (tried to use 'games', move to 'gamestat')
* Wire up tests

Closes: https://bugs.gentoo.org/858785
Signed-off-by: Sam James  gentoo.org>

 .../typespeed/files/typespeed-0.6.5-gamestat.patch | 15 +
 .../typespeed/files/typespeed-0.6.5-lto.patch  | 54 ++
 games-misc/typespeed/typespeed-0.6.5-r3.ebuild | 64 ++
 3 files changed, 133 insertions(+)

diff --git a/games-misc/typespeed/files/typespeed-0.6.5-gamestat.patch 
b/games-misc/typespeed/files/typespeed-0.6.5-gamestat.patch
new file mode 100644
index ..7159b1950ecc
--- /dev/null
+++ b/games-misc/typespeed/files/typespeed-0.6.5-gamestat.patch
@@ -0,0 +1,15 @@
+--- a/src/Makefile.am
 b/src/Makefile.am
+@@ -23,10 +23,10 @@ typespeed.score:
+   @touch typespeed.score
+ 
+ install-data-hook:
+-  -chgrp games $(DESTDIR)$(highscoredir)/$(HIGHFILE) && \
++  -chgrp gamestat $(DESTDIR)$(highscoredir)/$(HIGHFILE) && \
+   chmod g+w $(DESTDIR)$(highscoredir)/$(HIGHFILE) && \
+   chmod o-rwx $(DESTDIR)$(highscoredir)/$(HIGHFILE)
+ 
+ install-exec-hook:
+-  -chgrp games $(DESTDIR)$(bindir)/typespeed && \
++  -chgrp gamestat $(DESTDIR)$(bindir)/typespeed && \
+   chmod g+s $(DESTDIR)$(bindir)/typespeed

diff --git a/games-misc/typespeed/files/typespeed-0.6.5-lto.patch 
b/games-misc/typespeed/files/typespeed-0.6.5-lto.patch
new file mode 100644
index ..c734e196e683
--- /dev/null
+++ b/games-misc/typespeed/files/typespeed-0.6.5-lto.patch
@@ -0,0 +1,54 @@
+https://bugs.gentoo.org/858785
+--- a/src/file.c
 b/src/file.c
+@@ -97,7 +97,7 @@ extern unsigned long  cstrl(char *);
+ extern voiddefrule(void);
+ extern voiddrawscreen(void);
+ extern int fileselmenu(int, struct finfo *, const char *);
+-extern unsigned short  level(int);
++extern int level(int);
+ extern voidliima_mvgetnstr(int, int, char *, int);
+ extern int netrecv(int, int, int, int, char *, size_t);
+ extern int netsend(char *);
+--- a/src/menu.c
 b/src/menu.c
+@@ -54,7 +54,7 @@ extern void  closenetwork(void);
+ extern unsigned long  cstrl(char *);
+ extern void   xerrx(int, const char *, ...);
+ extern intinitnetwork(char *, int);
+-extern unsigned short level(int);
++extern intlevel(int);
+ extern void   liima_mvgetnstr(int, int, char *, int);
+ extern void   multipmenu(void);
+ extern void   xcolor_set(short);
+--- a/src/misc.c
 b/src/misc.c
+@@ -61,7 +61,7 @@
+ unsigned long  cstrl(char *);
+ void   endcursestuff(void);
+ void   initcursestuff(void);
+-unsigned short level(int);
++intlevel(int);
+ void   liima_mvgetnstr(int, int, char *, int);
+ intr(int);
+ clock_ttimenow(void);
+@@ -151,7 +151,7 @@ initcursestuff(void)
+ }
+ 
+ /* Returns (0 - 10) and sets color according to "pointsit". */
+-unsigned short
++int
+ level(int pointsit)
+ {
+   int leveli;
+--- a/src/typespeed.c
 b/src/typespeed.c
+@@ -96,7 +96,7 @@ extern void  freewords(void);
+ extern void   initcursestuff(void);
+ extern intinitnetwork(char *, int);
+ extern void   initstatus(char *);
+-extern unsigned short level(int);
++extern intlevel(int);
+ extern intloadscores(char *);
+ extern void   makescorefiles(char *);
+ extern void   multipmenu(void);

diff --git a/games-misc/typespeed/typespeed-0.6.5-r3.ebuild 
b/games-misc/typespeed/typespeed-0.6.5-r3.ebuild
new file mode 100644
index ..a8cbef568bc7
--- /dev/null
+++ b/games-misc/typespeed/typespeed-0.6.5-r3.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo
+
+DESCRIPTION="Test your typing speed, and get your fingers CPS"
+HOMEPAGE="https://typespeed.sourceforge.net/;
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="nls"
+
+RDEPEND="
+   acct-group/gamestat
+   sys-libs/ncurses:=
+   nls? ( virtual/libintl )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+   virtual/pkgconfig
+   nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+   "${FILESDIR}"/${P}-musl.patch
+   "${FILESDIR}"/${P}-use-extern.patch
+   "${FILESDIR}"/${P}-link-tinfo.patch
+   "${FILESDIR}"/${P}-lto.patch
+   "${FILESDIR}"/${P}-gamestat.patch
+)
+

[gentoo-commits] repo/gentoo:master commit in: games-misc/typespeed/, games-misc/typespeed/files/

2020-11-15 Thread David Seifert
commit: 0fc243064474c8e4d688e7d59e5423fe0a931840
Author: Alexey Sokolov  google  com>
AuthorDate: Sun Nov 15 20:02:50 2020 +
Commit: David Seifert  gentoo  org>
CommitDate: Sun Nov 15 20:02:50 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fc24306

games-misc/typespeed: fix build

Closes: https://bugs.gentoo.org/694840
Closes: https://bugs.gentoo.org/691256
Closes: https://bugs.gentoo.org/706518
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Alexey Sokolov  asokolov.org>
Signed-off-by: David Seifert  gentoo.org>

 .../files/typespeed-0.6.5-link-tinfo.patch |  35 +++
 .../files/typespeed-0.6.5-use-extern.patch | 116 +
 games-misc/typespeed/typespeed-0.6.5-r2.ebuild |  47 +
 3 files changed, 198 insertions(+)

diff --git a/games-misc/typespeed/files/typespeed-0.6.5-link-tinfo.patch 
b/games-misc/typespeed/files/typespeed-0.6.5-link-tinfo.patch
new file mode 100644
index 000..9ffb9cfcc56
--- /dev/null
+++ b/games-misc/typespeed/files/typespeed-0.6.5-link-tinfo.patch
@@ -0,0 +1,35 @@
+diff -r 8cf704f4cffa configure.ac
+--- a/configure.ac Thu Oct 15 23:52:32 2020 +
 b/configure.ac Thu Oct 15 23:52:58 2020 +
+@@ -16,6 +16,6 @@
+ 
+ # Checks for libraries.
+-AC_CHECK_LIB([ncurses], [initscr])
++PKG_CHECK_MODULES([NCURSES], [ncurses], [], [exit 1])
+ 
+ # I18N
+ AM_GNU_GETTEXT_VERSION([0.14.5])
+diff -r e64ba00e0147 src/Makefile.am
+--- a/src/Makefile.am  Fri Oct 16 00:08:17 2020 +
 b/src/Makefile.am  Fri Oct 16 00:08:39 2020 +
+@@ -15,7 +15,7 @@
+   -DCONFIGFILE=\"$(sysconfdir)/typespeedrc\" \
+ -DHIGHFILE=\"$(highscoredir)/$(HIGHFILE)\" \
+   -DWORDDIR=\"$(WORDDIR)\" -DRULEDIR=\"$(RULEDIR)\"
+-typespeed_LDADD = @LIBINTL@
++typespeed_LDADD = @LIBINTL@ @NCURSES_LIBS@
+ typespeed_SOURCES = file.c gettext.h menu.c misc.c network.c pathnames.h \
+   typespeed.c typespeed.h
+ 
+diff -r 987ceebc438f testsuite/Makefile.am
+--- a/testsuite/Makefile.amFri Oct 16 00:14:34 2020 +
 b/testsuite/Makefile.amFri Oct 16 00:15:37 2020 +
+@@ -2,7 +2,7 @@
+ 
+ localedir = $(datadir)/locale
+ AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -DTVERSION=\"v$(VERSION)\" -DTEST
+-LDADD = @LIBINTL@
++LDADD = @LIBINTL@ @NCURSES_LIBS@
+ 
+ EXTRA_DIST = t_unescstr.sh t_loadwords_data/3_empty
+ 

diff --git a/games-misc/typespeed/files/typespeed-0.6.5-use-extern.patch 
b/games-misc/typespeed/files/typespeed-0.6.5-use-extern.patch
new file mode 100644
index 000..cd5e4ea54c0
--- /dev/null
+++ b/games-misc/typespeed/files/typespeed-0.6.5-use-extern.patch
@@ -0,0 +1,116 @@
+Description: Fix FTBFS with gcc-10
+
+Author: Sudip Mukherjee 
+Bug-Debian: https://bugs.debian.org/957887
+
+---
+
+--- typespeed-0.6.5.orig/src/file.c
 typespeed-0.6.5/src/file.c
+@@ -142,6 +142,9 @@ extern int  hfd;
+ extern char   *rankki[11];
+ extern char   *typorank[12];
+ extern char   *usedwordfile;
++extern struct rules   rules;
++struct rawdatawords;
++struct optopt;
+ 
+ char ruledir[MAXPATHLEN];
+ char worddir[MAXPATHLEN];
+--- typespeed-0.6.5.orig/src/menu.c
 typespeed-0.6.5/src/menu.c
+@@ -76,6 +76,9 @@ void  tellstory(void);
+ 
+ extern int misses;
+ extern char   *rankki[11];
++extern struct stats   now;
++extern struct rules   rules;
++extern struct opt opt;
+ 
+ struct positions {
+   int rank;
+--- typespeed-0.6.5.orig/src/misc.c
 typespeed-0.6.5/src/misc.c
+@@ -75,6 +75,7 @@ char *xstrdup(char *);
+ void   xstrncpy(char *, char *, size_t);
+ 
+ extern char   *progname;
++extern struct opt opt;
+ 
+ static int graph = 0;
+ 
+--- typespeed-0.6.5.orig/src/network.c
 typespeed-0.6.5/src/network.c
+@@ -116,6 +116,7 @@ void   setnoblock(void);
+ void  writenum(char *, uint32_t);
+ 
+ extern FILE   *netlogfile;
++extern struct opt opt;
+ 
+ static int ds = -1;
+ static int ss = -1;
+--- typespeed-0.6.5.orig/src/typespeed.c
 typespeed-0.6.5/src/typespeed.c
+@@ -146,6 +146,7 @@ char *typorank[12] =
+ 
+ FILE  *netlogfile;
+ struct stats   best;
++struct stats   now;
+ inthfd;
+ intmisses;
+ struct stats   other;
+@@ -155,6 +156,9 @@ char   *usedwordfile;
+ intwordcount = 0;
+ intwordpos[22];
+ char   wordstring[22][20];
++struct rules   rules;
++extern struct rawdata words;
++extern struct opt opt;
+ 
+ struct option options[] = {
+   {"cheat", no_argument, , 1},
+--- typespeed-0.6.5.orig/src/typespeed.h
 typespeed-0.6.5/src/typespeed.h
+@@ -56,7 +56,7 @@ struct stats {
+   clock_t duration;
+   unsigned int sinit;
+   char name[21];
+-} now;
++};
+ 
+ struct opt {
+   int cheat;
+@@ -66,7 +66,7 @@ struct opt {
+   int usecolors;
+   char name[21];
+   char order[3];
+-} opt;
++};
+ 
+ struct rules {
+   int misses;
+@@ -85,12 +85,12 @@ struct rules {
+  

[gentoo-commits] repo/gentoo:master commit in: games-misc/typespeed/, games-misc/typespeed/files/

2016-01-01 Thread Michael Sterrett
commit: cfb29fb00e056aa3b599c34172f7f2ca6bea8a71
Author: Michael Sterrett  gentoo  org>
AuthorDate: Sat Jan  2 01:47:09 2016 +
Commit: Michael Sterrett  gentoo  org>
CommitDate: Sat Jan  2 01:47:25 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cfb29fb0

games-misc/typespeed: add patch from Felix Janda to build on the musl profiles 
(bug #570452)

Package-Manager: portage-2.2.24

 games-misc/typespeed/files/typespeed-0.6.5-musl.patch | 15 +++
 games-misc/typespeed/typespeed-0.6.5.ebuild   |  7 +++
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/games-misc/typespeed/files/typespeed-0.6.5-musl.patch 
b/games-misc/typespeed/files/typespeed-0.6.5-musl.patch
new file mode 100644
index 000..3fd53b3
--- /dev/null
+++ b/games-misc/typespeed/files/typespeed-0.6.5-musl.patch
@@ -0,0 +1,15 @@
+diff -ur a/typespeed-0.6.5/src/typespeed.h b/typespeed-0.6.5/src/typespeed.h
+--- a/typespeed-0.6.5/src/typespeed.h  2008-08-13 15:36:51.0 +0100
 b/typespeed-0.6.5/src/typespeed.h  2016-01-01 10:41:54.919998820 +0100
+@@ -27,10 +27,10 @@
+ 
+ #include 
+ #include 
++#include 
+ 
+ #ifdef WIN32
+   #include 
+-  #include 
+ 
+   #ifndef MAXHOSTNAMELEN
+   #define MAXHOSTNAMELEN  256

diff --git a/games-misc/typespeed/typespeed-0.6.5.ebuild 
b/games-misc/typespeed/typespeed-0.6.5.ebuild
index 88c9474..cca2de7 100644
--- a/games-misc/typespeed/typespeed-0.6.5.ebuild
+++ b/games-misc/typespeed/typespeed-0.6.5.ebuild
@@ -3,7 +3,7 @@
 # $Id$
 
 EAPI=5
-inherit autotools games
+inherit autotools eutils games
 
 DESCRIPTION="Test your typing speed, and get your fingers CPS"
 HOMEPAGE="http://typespeed.sourceforge.net/;
@@ -24,9 +24,8 @@ src_prepare() {
-e 's/testsuite//' \
-e 's/doc//' \
Makefile.am || die
-   sed -i \
-   -e '/^CC =/d' \
-   src/Makefile.am || die
+   sed -i -e '/^CC =/d' src/Makefile.am || die
+   epatch "${FILESDIR}"/${P}-musl.patch
rm -rf m4 #417265
eautoreconf
 }