1 |
commit: dfffb12847f492c5e489ae5457890b8fc7c45d79 |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 9 13:39:02 2021 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 10 11:51:42 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfffb128 |
7 |
|
8 |
games-kids/tuxmath: EAPI-7, -fno-common, and crash fix |
9 |
|
10 |
Two causes of crashes, mismatch with t4k-common is exposed by |
11 |
gcc10+ (blits-to-tmblits patch), and bug #763591 is fixed in |
12 |
>=t4k-common-0.1.1-r1 which now depend on. |
13 |
|
14 |
Thanks to Samuel Bauer for pointing out -fno-common fix |
15 |
|
16 |
Closes: https://bugs.gentoo.org/763591 |
17 |
Closes: https://bugs.gentoo.org/795069 |
18 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
19 |
|
20 |
.../files/tuxmath-2.0.3-blits-to-tmblits.patch | 36 +++++++++++++ |
21 |
.../tuxmath/files/tuxmath-2.0.3-fno-common.patch | 8 +++ |
22 |
games-kids/tuxmath/tuxmath-2.0.3-r2.ebuild | 62 ++++++++++++++++++++++ |
23 |
3 files changed, 106 insertions(+) |
24 |
|
25 |
diff --git a/games-kids/tuxmath/files/tuxmath-2.0.3-blits-to-tmblits.patch b/games-kids/tuxmath/files/tuxmath-2.0.3-blits-to-tmblits.patch |
26 |
new file mode 100644 |
27 |
index 00000000000..ff6e875d62f |
28 |
--- /dev/null |
29 |
+++ b/games-kids/tuxmath/files/tuxmath-2.0.3-blits-to-tmblits.patch |
30 |
@@ -0,0 +1,36 @@ |
31 |
+Fixes immediate crash on titlescreen with gcc10+ |
32 |
+Patch from debian: |
33 |
+https://bugs.debian.org/986623 |
34 |
+--- a/src/titlescreen.c |
35 |
++++ b/src/titlescreen.c |
36 |
+@@ -57,3 +57,3 @@ |
37 |
+ unsigned char type; |
38 |
+-} blits[MAX_UPDATES]; |
39 |
++} tmblits[MAX_UPDATES]; |
40 |
+ |
41 |
+@@ -1021,4 +1021,4 @@ |
42 |
+ for (i = 0; i < MAX_UPDATES; ++i) { |
43 |
+- blits[i].srcrect = &srcupdate[i]; |
44 |
+- blits[i].dstrect = &dstupdate[i]; |
45 |
++ tmblits[i].srcrect = &srcupdate[i]; |
46 |
++ tmblits[i].dstrect = &dstupdate[i]; |
47 |
+ } |
48 |
+@@ -1034,4 +1034,4 @@ |
49 |
+ for (i = 0; i < numupdates; i++) |
50 |
+- if (blits[i].type == 'E') |
51 |
+- SDL_LowerBlit(blits[i].src, blits[i].srcrect, screen, blits[i].dstrect); |
52 |
++ if (tmblits[i].type == 'E') |
53 |
++ SDL_LowerBlit(tmblits[i].src, tmblits[i].srcrect, screen, tmblits[i].dstrect); |
54 |
+ // SNOW_erase(); |
55 |
+@@ -1040,4 +1040,4 @@ |
56 |
+ for (i = 0; i < numupdates; i++) |
57 |
+- if (blits[i].type == 'D') |
58 |
+- SDL_BlitSurface(blits[i].src, blits[i].srcrect, screen, blits[i].dstrect); |
59 |
++ if (tmblits[i].type == 'D') |
60 |
++ SDL_BlitSurface(tmblits[i].src, tmblits[i].srcrect, screen, tmblits[i].dstrect); |
61 |
+ // SNOW_draw(); |
62 |
+@@ -1069,3 +1069,3 @@ |
63 |
+ |
64 |
+- update = &blits[numupdates++]; |
65 |
++ update = &tmblits[numupdates++]; |
66 |
+ |
67 |
|
68 |
diff --git a/games-kids/tuxmath/files/tuxmath-2.0.3-fno-common.patch b/games-kids/tuxmath/files/tuxmath-2.0.3-fno-common.patch |
69 |
new file mode 100644 |
70 |
index 00000000000..ffd711f21ce |
71 |
--- /dev/null |
72 |
+++ b/games-kids/tuxmath/files/tuxmath-2.0.3-fno-common.patch |
73 |
@@ -0,0 +1,8 @@ |
74 |
+https://bugs.gentoo.org/795069 |
75 |
+https://github.com/tux4kids/tuxmath/pull/15 |
76 |
+--- a/src/menu_lan.c |
77 |
++++ b/src/menu_lan.c |
78 |
+@@ -39,3 +39,2 @@ |
79 |
+ /* lan_player_type now defined in network.h */ |
80 |
+-lan_player_type lan_player_info[MAX_CLIENTS]; |
81 |
+ |
82 |
|
83 |
diff --git a/games-kids/tuxmath/tuxmath-2.0.3-r2.ebuild b/games-kids/tuxmath/tuxmath-2.0.3-r2.ebuild |
84 |
new file mode 100644 |
85 |
index 00000000000..fb3e676b0cf |
86 |
--- /dev/null |
87 |
+++ b/games-kids/tuxmath/tuxmath-2.0.3-r2.ebuild |
88 |
@@ -0,0 +1,62 @@ |
89 |
+# Copyright 1999-2021 Gentoo Authors |
90 |
+# Distributed under the terms of the GNU General Public License v2 |
91 |
+ |
92 |
+EAPI=7 |
93 |
+ |
94 |
+inherit desktop optfeature |
95 |
+ |
96 |
+DESCRIPTION="Educational arcade game where you have to solve maths problems" |
97 |
+HOMEPAGE="https://www.tux4kids.com/" |
98 |
+SRC_URI="mirror://debian/pool/main/t/${PN}/${PN}_${PV}.orig.tar.gz" |
99 |
+S="${WORKDIR}/${PN}_w_fonts-${PV}" |
100 |
+ |
101 |
+LICENSE="CC-BY-SA-3.0 CC-PD GPL-3+ public-domain" |
102 |
+SLOT="0" |
103 |
+KEYWORDS="~amd64 ~x86" |
104 |
+IUSE="nls svg" |
105 |
+ |
106 |
+RDEPEND=" |
107 |
+ >=dev-games/t4k-common-0.1.1-r1[svg?] |
108 |
+ dev-libs/libxml2:2 |
109 |
+ media-libs/libsdl[video] |
110 |
+ media-libs/sdl-image[jpeg,png] |
111 |
+ media-libs/sdl-mixer |
112 |
+ media-libs/sdl-net |
113 |
+ nls? ( virtual/libintl )" |
114 |
+DEPEND=" |
115 |
+ ${RDEPEND} |
116 |
+ svg? ( |
117 |
+ gnome-base/librsvg:2 |
118 |
+ x11-libs/cairo |
119 |
+ )" |
120 |
+BDEPEND=" |
121 |
+ virtual/pkgconfig |
122 |
+ nls? ( sys-devel/gettext )" |
123 |
+ |
124 |
+PATCHES=( |
125 |
+ "${FILESDIR}"/${P}-blits-to-tmblits.patch |
126 |
+ "${FILESDIR}"/${P}-fno-common.patch |
127 |
+) |
128 |
+ |
129 |
+src_configure() { |
130 |
+ local econfargs=( |
131 |
+ $(use_enable nls) |
132 |
+ $(usex svg '' --without-rsvg) |
133 |
+ ) |
134 |
+ econf "${econfargs[@]}" |
135 |
+} |
136 |
+ |
137 |
+src_install() { |
138 |
+ default |
139 |
+ |
140 |
+ doicon data/images/icons/${PN}.svg |
141 |
+ domenu ${PN}.desktop |
142 |
+ |
143 |
+ # bundled fonts are unused if t4k-common uses pango |
144 |
+ rm -r "${ED}"/usr/share/${PN}/fonts || die |
145 |
+ rm "${ED}"/usr/share/doc/${PF}/{COPYING_GPL3,GPL_VERSIONS,INSTALL,OFL,README_DATA_LICENSES} || die |
146 |
+} |
147 |
+ |
148 |
+pkg_postinst() { |
149 |
+ optfeature "music support" "media-libs/sdl-mixer[mod,vorbis]" |
150 |
+} |