summaryrefslogtreecommitdiffstats
path: root/games/zoom/patches
diff options
context:
space:
mode:
Diffstat (limited to 'games/zoom/patches')
-rw-r--r--games/zoom/patches/acinclude.patch9
-rw-r--r--games/zoom/patches/avoid-v6-set-colours-crash.patch18
-rw-r--r--games/zoom/patches/config_xft.diff27
-rw-r--r--games/zoom/patches/enable-antialiasing.patch15
-rw-r--r--games/zoom/patches/remove_rice.diff91
-rw-r--r--games/zoom/patches/restore-return.patch33
-rw-r--r--games/zoom/patches/series8
-rw-r--r--games/zoom/patches/static-inline.patch45
-rw-r--r--games/zoom/patches/zoomrc_in_etc.diff12
9 files changed, 258 insertions, 0 deletions
diff --git a/games/zoom/patches/acinclude.patch b/games/zoom/patches/acinclude.patch
new file mode 100644
index 0000000000..f605e40ac1
--- /dev/null
+++ b/games/zoom/patches/acinclude.patch
@@ -0,0 +1,9 @@
+Description: add the included m4 files
+Author: Stephen Kitt <skitt@debian.org>
+
+--- /dev/null
++++ b/acinclude.m4
+@@ -0,0 +1,3 @@
++m4_include([m4/carbon.m4])
++m4_include([m4/display.m4])
++m4_include([m4/util.m4])
diff --git a/games/zoom/patches/avoid-v6-set-colours-crash.patch b/games/zoom/patches/avoid-v6-set-colours-crash.patch
new file mode 100644
index 0000000000..75215cc706
--- /dev/null
+++ b/games/zoom/patches/avoid-v6-set-colours-crash.patch
@@ -0,0 +1,18 @@
+Description: Avoid crashing with invalid coordinates
+Author: Alexandre Detiste <alexandre.detiste@gmail.com>
+Bug-Debian: https://bugs.debian.org/813674
+
+--- a/src/v6display.c
++++ b/src/v6display.c
+@@ -498,9 +498,9 @@
+ fg = ACTWIN.fore;
+ if (bg == -2)
+ bg = ACTWIN.back;
+- if (fg == -1)
++ if (fg == -1 || ACTWIN.curx < 0 || ACTWIN.cury < 0)
+ fg = DEFAULT_FORE;
+- if (bg == -1)
++ if (bg == -1 || ACTWIN.curx < 0 || ACTWIN.cury < 0)
+ bg = DEFAULT_BACK;
+
+ if (bg == -3)
diff --git a/games/zoom/patches/config_xft.diff b/games/zoom/patches/config_xft.diff
new file mode 100644
index 0000000000..8b1d7100e9
--- /dev/null
+++ b/games/zoom/patches/config_xft.diff
@@ -0,0 +1,27 @@
+diff -Naur zoom-1.1.5/configure zoom-1.1.5.patched/configure
+--- zoom-1.1.5/configure 2011-11-05 10:29:03.000000000 -0400
++++ zoom-1.1.5.patched/configure 2012-11-28 02:34:45.000000000 -0500
+@@ -7349,21 +7349,8 @@
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+- # If Xft is installed, then there will be a xft-config file on the current path
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xft-config" >&5
+-$as_echo_n "checking for xft-config... " >&6; }
+- XFTCONFIG=`which xft-config`
+- XFT_CFLAGS=""
+- XFT_LIBS=""
+- if test -x ${XFTCONFIG}; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XFTCONFIG" >&5
+-$as_echo "$XFTCONFIG" >&6; }
+- XFT_CFLAGS=`${XFTCONFIG} --cflags`
+- XFT_LIBS=`${XFTCONFIG} --libs`
+- else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- fi
++ XFT_CFLAGS=`pkg-config xft --cflags`
++ XFT_LIBS=`pkg-config xft --libs`
+
+ # Had to move this, Xft 2 again
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderQueryExtension in -lXrender" >&5
diff --git a/games/zoom/patches/enable-antialiasing.patch b/games/zoom/patches/enable-antialiasing.patch
new file mode 100644
index 0000000000..f75c600604
--- /dev/null
+++ b/games/zoom/patches/enable-antialiasing.patch
@@ -0,0 +1,15 @@
+Description: Enable anti-aliasing by default
+Author: Stephen Kitt <skitt@debian.org>
+Bug-Debian: https://bugs.debian.org/813715
+
+--- a/src/zoomrc
++++ b/src/zoomrc
+@@ -25,7 +25,7 @@
+ font 9 "font3" symbolic
+
+ size 80,30
+- antialias no
++ antialias yes
+
+ colours (0,0,0), (255,0,0), (0,255,0), (255,255,0), (0,0,255), (255,0,255),
+ (0,255,255), (255,255,204),
diff --git a/games/zoom/patches/remove_rice.diff b/games/zoom/patches/remove_rice.diff
new file mode 100644
index 0000000000..1a9e3b7f2f
--- /dev/null
+++ b/games/zoom/patches/remove_rice.diff
@@ -0,0 +1,91 @@
+diff -Naur zoom-1.1.5/configure zoom-1.1.5.patched/configure
+--- zoom-1.1.5/configure 2011-11-05 10:29:03.000000000 -0400
++++ zoom-1.1.5.patched/configure 2017-06-21 03:19:11.223593935 -0400
+@@ -4630,87 +4630,6 @@
+ conftest$ac_exeext conftest.$ac_ext
+
+
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler ($CC) supports -finline-functions" >&5
+-$as_echo_n "checking if the C compiler ($CC) supports -finline-functions... " >&6; }
+- ac_OLD_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -finline-functions"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-
+-int
+-main ()
+-{
+- { int x; x = 1; }
+- ;
+- return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- CFLAGS="$ac_OLD_CFLAGS"
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-
+-
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler ($CC) supports -funroll-loops" >&5
+-$as_echo_n "checking if the C compiler ($CC) supports -funroll-loops... " >&6; }
+- ac_OLD_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -funroll-loops"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-
+-int
+-main ()
+-{
+- { int x; x = 1; }
+- ;
+- return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- CFLAGS="$ac_OLD_CFLAGS"
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-
+-
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler ($CC) supports -fomit-frame-pointer" >&5
+-$as_echo_n "checking if the C compiler ($CC) supports -fomit-frame-pointer... " >&6; }
+- ac_OLD_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -fomit-frame-pointer"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h. */
+-
+-int
+-main ()
+-{
+- { int x; x = 1; }
+- ;
+- return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+-else
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- CFLAGS="$ac_OLD_CFLAGS"
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-
+-
+ # Check whether --enable-new-terp was given.
+ if test "${enable_new_terp+set}" = set; then :
+ enableval=$enable_new_terp;
diff --git a/games/zoom/patches/restore-return.patch b/games/zoom/patches/restore-return.patch
new file mode 100644
index 0000000000..9412980e91
--- /dev/null
+++ b/games/zoom/patches/restore-return.patch
@@ -0,0 +1,33 @@
+commit 5ef19e08bbeff74096a1944ec8ba591cdab8cc55
+Author: Andrew Hunter <andrew@logicalshift.co.uk>
+Date: Sun Nov 13 21:20:23 2011 +0000
+
+ Restored a return statement that got deleted way back in changeset 1cd73ed without anybody (well, me) noticing.
+
+ The effect of this missing return statement was to make aread callbacks that return true continue as if they had returned false and randomly crash after they try to write to the (now freed) buffer.
+
+ Amazingly, this hasn't been reported up until now. I suspect that there are few or no cases where aread callbacks return a value other than zero.
+
+ Also added a paranoid buffer check, which is probably unnecessary but looks like good practice in any case.
+
+diff --git a/src/interp.c b/src/interp.c
+index 60b3e13..a5fa8fe 100644
+--- a/src/interp.c
++++ b/src/interp.c
+@@ -1057,6 +1057,7 @@ static void zcode_op_aread_5678(ZDWord* pc,
+ {
+ mem[1] = 0;
+ free(buf);
++ return;
+ }
+ }
+
+@@ -1151,7 +1152,7 @@ static void zcode_op_aread_5678(ZDWord* pc,
+ int x;
+
+ mem[1] = 0;
+- for (x=0; buf[x] != 0; x++)
++ for (x=0; buf[x] != 0 && x < bufLen; x++)
+ {
+ mem[1]++;
+ buf[x] = unicode_to_lower(buf[x]);
diff --git a/games/zoom/patches/series b/games/zoom/patches/series
new file mode 100644
index 0000000000..636b59b5a3
--- /dev/null
+++ b/games/zoom/patches/series
@@ -0,0 +1,8 @@
+config_xft.diff
+remove_rice.diff
+avoid-v6-set-colours-crash.patch
+acinclude.patch
+restore-return.patch
+enable-antialiasing.patch
+static-inline.patch
+zoomrc_in_etc.diff
diff --git a/games/zoom/patches/static-inline.patch b/games/zoom/patches/static-inline.patch
new file mode 100644
index 0000000000..4e5190ef4c
--- /dev/null
+++ b/games/zoom/patches/static-inline.patch
@@ -0,0 +1,45 @@
+commit 6b0ad57dd2c125c9126e9b7913560ad25709a36f
+Author: Andrew Hunter <andrew@logicalshift.co.uk>
+Date: Sat Mar 3 16:31:35 2012 +0000
+
+ Inline functions need to be marked as static in order to compile with LLVM
+
+diff --git a/src/interp.c b/src/interp.c
+index a5fa8fe..3d446fa 100644
+--- a/src/interp.c
++++ b/src/interp.c
+@@ -232,7 +232,7 @@ ZFrame* call_routine(ZDWord* pc, ZStack* stack, ZDWord start)
+ return newframe;
+ }
+
+-inline void store(ZStack* stack, int var, ZWord value)
++static inline void store(ZStack* stack, int var, ZWord value)
+ {
+ #ifdef DEBUG
+ printf_debug("Storing %i in Variable #%x\n", value, var);
+@@ -253,7 +253,7 @@ inline void store(ZStack* stack, int var, ZWord value)
+ }
+ }
+
+-inline void store_nopush(ZStack* stack, int var, ZWord value)
++static inline void store_nopush(ZStack* stack, int var, ZWord value)
+ {
+ #ifdef DEBUG
+ printf_debug("Storing %i in Variable #%x\n", value, var);
+diff --git a/src/tokenise.c b/src/tokenise.c
+index 5925169..fb442d0 100644
+--- a/src/tokenise.c
++++ b/src/tokenise.c
+@@ -154,9 +154,9 @@ ZDictionary* dictionary_cache(const ZUWord dict_pos)
+
+ int cache = 1;
+
+-inline ZUWord lookup_word(unsigned int* word,
+- int wordlen,
+- ZUWord dct)
++static inline ZUWord lookup_word(unsigned int* word,
++ int wordlen,
++ ZUWord dct)
+ {
+ ZByte packed[12];
+ int zscii_len;
diff --git a/games/zoom/patches/zoomrc_in_etc.diff b/games/zoom/patches/zoomrc_in_etc.diff
new file mode 100644
index 0000000000..760fb294a3
--- /dev/null
+++ b/games/zoom/patches/zoomrc_in_etc.diff
@@ -0,0 +1,12 @@
+diff -Naur zoom-1.1.5/src/rc.c zoom-1.1.5.patched/src/rc.c
+--- zoom-1.1.5/src/rc.c 2011-11-05 07:40:53.000000000 -0400
++++ zoom-1.1.5.patched/src/rc.c 2021-10-11 19:43:39.814078341 -0400
+@@ -41,7 +41,7 @@
+ rc_game* rc_defgame = NULL;
+
+ #ifdef DATADIR
+-# define ZOOMRC DATADIR "/zoomrc"
++# define ZOOMRC "/etc/zoom/zoomrc"
+ # define GAMEDIR DATADIR "/games"
+ #else
+ # define ZOOMRC "zoomrc"