summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Dave Woodfall <dave@slackbuilds.org>2022-03-04 09:46:12 +0000
committer Dave Woodfall <dave@slackbuilds.org>2022-03-04 09:46:12 +0000
commitfbfee76567e710a4ebe2e585c476c9d2f64830e3 (patch)
treeebe70d1bce5540848313c3e893e300b5a756f62c
parent78eae1b73a44735070ff3b55f85063d47970ee33 (diff)
downloadslackbuilds-fbfee76567e710a4ebe2e585c476c9d2f64830e3.tar.gz
slackbuilds-fbfee76567e710a4ebe2e585c476c9d2f64830e3.tar.xz
academic/tuxmath: Rename blits. Remove dupe lan player.
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
-rw-r--r--academic/tuxmath/0001-src-menu_lan.c-Remove-unused-duplicate-lan_player_in.patch26
-rw-r--r--academic/tuxmath/0002-rename-blits-to-tmblits.patch54
-rw-r--r--academic/tuxmath/tuxmath.SlackBuild3
3 files changed, 83 insertions, 0 deletions
diff --git a/academic/tuxmath/0001-src-menu_lan.c-Remove-unused-duplicate-lan_player_in.patch b/academic/tuxmath/0001-src-menu_lan.c-Remove-unused-duplicate-lan_player_in.patch
new file mode 100644
index 0000000000..ee192e9470
--- /dev/null
+++ b/academic/tuxmath/0001-src-menu_lan.c-Remove-unused-duplicate-lan_player_in.patch
@@ -0,0 +1,26 @@
+From c471e2a94798787afbad4e547a1e2485ef9835db Mon Sep 17 00:00:00 2001
+From: Adrian Bunk <bunk@debian.org>
+Date: Sun, 3 Jan 2021 14:22:29 +0200
+Subject: src/menu_lan.c: Remove unused duplicate lan_player_info definition
+
+This broke the build with gcc 10:
+https://bugs.debian.org/976513
+---
+ src/menu_lan.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/menu_lan.c b/src/menu_lan.c
+index 4512eb1..d85f2c6 100644
+--- a/src/menu_lan.c
++++ b/src/menu_lan.c
+@@ -37,7 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+ /* lan_player_type now defined in network.h */
+-lan_player_type lan_player_info[MAX_CLIENTS];
+
+ /* Local function prototypes: ------------------- */
+ void draw_player_table(void);
+--
+2.20.1
+
diff --git a/academic/tuxmath/0002-rename-blits-to-tmblits.patch b/academic/tuxmath/0002-rename-blits-to-tmblits.patch
new file mode 100644
index 0000000000..c5b5108acf
--- /dev/null
+++ b/academic/tuxmath/0002-rename-blits-to-tmblits.patch
@@ -0,0 +1,54 @@
+Bug-Debian: https://bugs.debian.org/986623
+Forwarded: no
+Last-Update: 2021-04-20
+
+--- tuxmath-2.0.3.orig/src/titlescreen.c
++++ tuxmath-2.0.3/src/titlescreen.c
+@@ -55,7 +55,7 @@ struct blit {
+ SDL_Rect *srcrect;
+ SDL_Rect *dstrect;
+ unsigned char type;
+-} blits[MAX_UPDATES];
++} tmblits[MAX_UPDATES];
+
+ // Lessons available for play
+ char **lesson_list_titles = NULL;
+@@ -1019,8 +1019,8 @@ void init_blits(void) {
+ int i;
+
+ for (i = 0; i < MAX_UPDATES; ++i) {
+- blits[i].srcrect = &srcupdate[i];
+- blits[i].dstrect = &dstupdate[i];
++ tmblits[i].srcrect = &srcupdate[i];
++ tmblits[i].dstrect = &dstupdate[i];
+ }
+ }
+
+@@ -1032,14 +1032,14 @@ void update_screen(int *frame) {
+
+ /* -- First erase everything we need to -- */
+ for (i = 0; i < numupdates; i++)
+- if (blits[i].type == 'E')
+- SDL_LowerBlit(blits[i].src, blits[i].srcrect, screen, blits[i].dstrect);
++ if (tmblits[i].type == 'E')
++ SDL_LowerBlit(tmblits[i].src, tmblits[i].srcrect, screen, tmblits[i].dstrect);
+ // SNOW_erase();
+
+ /* -- then draw -- */
+ for (i = 0; i < numupdates; i++)
+- if (blits[i].type == 'D')
+- SDL_BlitSurface(blits[i].src, blits[i].srcrect, screen, blits[i].dstrect);
++ if (tmblits[i].type == 'D')
++ SDL_BlitSurface(tmblits[i].src, tmblits[i].srcrect, screen, tmblits[i].dstrect);
+ // SNOW_draw();
+
+ /* -- update the screen only where we need to! -- */
+@@ -1067,7 +1067,7 @@ void add_rect(SDL_Rect* src, SDL_Rect* d
+ return;
+ }
+
+- update = &blits[numupdates++];
++ update = &tmblits[numupdates++];
+
+ update->srcrect->x = src->x;
+ update->srcrect->y = src->y;
diff --git a/academic/tuxmath/tuxmath.SlackBuild b/academic/tuxmath/tuxmath.SlackBuild
index ebed9cec3f..8128007c5e 100644
--- a/academic/tuxmath/tuxmath.SlackBuild
+++ b/academic/tuxmath/tuxmath.SlackBuild
@@ -58,6 +58,9 @@ find -L . \
# Fix .desktop.
sed -i -e '/^##/d' -e '/^X/d' -e 's|Math;||' $PRGNAM.desktop
+patch -p1 < $CWD/0001-src-menu_lan.c-Remove-unused-duplicate-lan_player_in.patch
+patch -p1 < $CWD/0002-rename-blits-to-tmblits.patch
+
LDFLAGS="-std=gnu11" \
CFLAGS="$SLKCFLAGS -std=gnu11 -fcommon" \
CXXFLAGS="$SLKCFLAGS" \