summaryrefslogtreecommitdiff
path: root/Ports/tuxracer
diff options
context:
space:
mode:
Diffstat (limited to 'Ports/tuxracer')
-rw-r--r--Ports/tuxracer/patches/0001-Explicitly-link-in-SDL2.patch (renamed from Ports/tuxracer/patches/configure.patch)25
-rw-r--r--Ports/tuxracer/patches/0002-Big-bag-of-random-changes-to-the-source.patch (renamed from Ports/tuxracer/patches/source.patch)82
-rw-r--r--Ports/tuxracer/patches/ReadMe.md14
3 files changed, 85 insertions, 36 deletions
diff --git a/Ports/tuxracer/patches/configure.patch b/Ports/tuxracer/patches/0001-Explicitly-link-in-SDL2.patch
index d6e803788d..bf01fd5863 100644
--- a/Ports/tuxracer/patches/configure.patch
+++ b/Ports/tuxracer/patches/0001-Explicitly-link-in-SDL2.patch
@@ -1,6 +1,18 @@
---- tuxracer-0.61-original/configure 2021-12-23 14:26:17.978567580 +0000
-+++ tuxracer-0.61/configure 2021-12-24 12:12:08.718881004 +0000
-@@ -1674,7 +1674,7 @@
+From b00365ebd72508d88bc31da63b56230ed23a5c1d Mon Sep 17 00:00:00 2001
+From: Jelle Raaijmakers <jelle@gmta.nl>
+Date: Fri, 24 Dec 2021 15:24:16 +0100
+Subject: [PATCH 1/2] Explicitly link in SDL2
+
+Also pretend that isnan() works correctly.
+---
+ configure | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure b/configure
+index 20d409b..e4de165 100755
+--- a/configure
++++ b/configure
+@@ -1674,7 +1674,7 @@ $ac_func();
; return 0; }
EOF
@@ -9,7 +21,7 @@
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
-@@ -3415,7 +3415,7 @@
+@@ -3417,7 +3417,7 @@ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
@@ -18,7 +30,7 @@
cat > conftest.$ac_ext <<EOF
#line 3423 "configure"
#include "confdefs.h"
-@@ -3452,7 +3452,7 @@
+@@ -3454,7 +3454,7 @@ fi
if test "x$have_SDL_mixer" = "xyes" ; then
TR_CPPFLAGS="$TR_CPPFLAGS -DHAVE_SDL_MIXER=1"
@@ -27,3 +39,6 @@
else
echo "*** SDL_mixer not found. Configuring without audio support."
fi
+--
+2.36.1
+
diff --git a/Ports/tuxracer/patches/source.patch b/Ports/tuxracer/patches/0002-Big-bag-of-random-changes-to-the-source.patch
index c7ceacdd89..4055e6dc21 100644
--- a/Ports/tuxracer/patches/source.patch
+++ b/Ports/tuxracer/patches/0002-Big-bag-of-random-changes-to-the-source.patch
@@ -1,7 +1,21 @@
-diff -ur tuxracer-0.61-original/src/game_config.c tuxracer-0.61/src/game_config.c
---- tuxracer-0.61-original/src/game_config.c 2001-01-30 20:04:43.000000000 +0000
-+++ tuxracer-0.61/src/game_config.c 2021-12-26 13:41:33.341076372 +0000
-@@ -114,26 +114,26 @@
+From 04c10bd91f64e3cbbcd827fc439ef8018473bcc9 Mon Sep 17 00:00:00 2001
+From: Jelle Raaijmakers <jelle@gmta.nl>
+Date: Tue, 28 Dec 2021 00:15:59 +0100
+Subject: [PATCH 2/2] Big bag of random changes to the source
+
+FIXME: Split this up sensibly
+---
+ src/game_config.c | 26 +++++++++----------
+ src/keyboard.c | 66 ++++++++++++++++++++++++++---------------------
+ src/winsys.c | 45 +++++++++++++++-----------------
+ src/winsys.h | 28 ++++++++++----------
+ 4 files changed, 85 insertions(+), 80 deletions(-)
+
+diff --git a/src/game_config.c b/src/game_config.c
+index f12bb2d..35b6036 100644
+--- a/src/game_config.c
++++ b/src/game_config.c
+@@ -114,26 +114,26 @@ struct param {
*/
#define INIT_PARAM( nam, val, typename, commnt ) \
@@ -36,7 +50,7 @@ diff -ur tuxracer-0.61-original/src/game_config.c tuxracer-0.61/src/game_config.
/*
-@@ -310,13 +310,13 @@
+@@ -310,13 +310,13 @@ void set_param_bool( struct param *p, bool_t new_val )
*/
#define FN_PARAM( name, typename, type ) \
type getparam_ ## name() { \
@@ -54,7 +68,7 @@ diff -ur tuxracer-0.61-original/src/game_config.c tuxracer-0.61/src/game_config.
#define FN_PARAM_STRING( name ) \
FN_PARAM( name, string, char* )
-@@ -505,7 +505,7 @@
+@@ -505,7 +505,7 @@ void init_game_configuration()
"# decreasing this number, at the cost of lower image quality." );
INIT_PARAM_BOOL(
@@ -63,9 +77,10 @@ diff -ur tuxracer-0.61-original/src/game_config.c tuxracer-0.61/src/game_config.
"# If true then the game will run in full-screen mode." );
INIT_PARAM_INT(
-diff -ur tuxracer-0.61-original/src/keyboard.c tuxracer-0.61/src/keyboard.c
---- tuxracer-0.61-original/src/keyboard.c 2001-01-13 22:09:51.000000000 +0000
-+++ tuxracer-0.61/src/keyboard.c 2021-12-26 13:41:33.341076372 +0000
+diff --git a/src/keyboard.c b/src/keyboard.c
+index d2b01ed..b0d38f5 100644
+--- a/src/keyboard.c
++++ b/src/keyboard.c
@@ -23,11 +23,17 @@
#include "loop.h"
@@ -88,7 +103,7 @@ diff -ur tuxracer-0.61-original/src/keyboard.c tuxracer-0.61/src/keyboard.c
static keymap_t keymap[KEYMAP_SIZE];
static int num_keymap_entries = 0;
-@@ -50,19 +56,6 @@
+@@ -50,19 +56,6 @@ int add_keymap_entry( game_mode_t mode, keymap_class_t keymap_class,
return 0; /* success */
}
@@ -108,7 +123,7 @@ diff -ur tuxracer-0.61-original/src/keyboard.c tuxracer-0.61/src/keyboard.c
static int insert_keytable_entries( char *keys, key_cb_t callback )
{
key_desc_t *key_list;
-@@ -74,9 +67,13 @@
+@@ -74,9 +67,13 @@ static int insert_keytable_entries( char *keys, key_cb_t callback )
if ( num_keys > 0 ) {
for ( i=0; i<num_keys; i++ ) {
if ( key_list[i].special ) {
@@ -124,7 +139,7 @@ diff -ur tuxracer-0.61-original/src/keyboard.c tuxracer-0.61/src/keyboard.c
}
}
-@@ -92,15 +89,14 @@
+@@ -92,15 +89,14 @@ static void init_keytable( game_mode_t mode )
{
int i;
char *keys;
@@ -142,7 +157,7 @@ diff -ur tuxracer-0.61-original/src/keyboard.c tuxracer-0.61/src/keyboard.c
}
/* Handle other classes */
-@@ -155,7 +151,9 @@
+@@ -155,7 +151,9 @@ static void keyboard_handler( unsigned int key, bool_t special,
bool_t release, int x, int y )
{
static game_mode_t last_mode = NO_MODE;
@@ -153,7 +168,7 @@ diff -ur tuxracer-0.61-original/src/keyboard.c tuxracer-0.61/src/keyboard.c
if ( is_mode_change_pending() ) {
/* Don't process keyboard events until the mode change happens */
-@@ -168,18 +166,28 @@
+@@ -168,18 +166,28 @@ static void keyboard_handler( unsigned int key, bool_t special,
}
if ( special ) {
@@ -188,9 +203,10 @@ diff -ur tuxracer-0.61-original/src/keyboard.c tuxracer-0.61/src/keyboard.c
}
void init_keyboard()
-diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
---- tuxracer-0.61-original/src/winsys.c 2001-01-13 22:09:51.000000000 +0000
-+++ tuxracer-0.61/src/winsys.c 2021-12-27 23:10:37.344295969 +0000
+diff --git a/src/winsys.c b/src/winsys.c
+index d932a1d..636d8f2 100644
+--- a/src/winsys.c
++++ b/src/winsys.c
@@ -36,7 +36,8 @@
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
@@ -201,7 +217,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
static winsys_display_func_t display_func = NULL;
static winsys_idle_func_t idle_func = NULL;
-@@ -164,7 +165,7 @@
+@@ -164,7 +165,7 @@ void winsys_set_passive_motion_func( winsys_motion_func_t func )
*/
void winsys_swap_buffers()
{
@@ -210,7 +226,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
}
-@@ -177,7 +178,7 @@
+@@ -177,7 +178,7 @@ void winsys_swap_buffers()
*/
void winsys_warp_pointer( int x, int y )
{
@@ -219,7 +235,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
}
-@@ -190,14 +191,14 @@
+@@ -190,14 +191,14 @@ void winsys_warp_pointer( int x, int y )
*/
static void setup_sdl_video_mode()
{
@@ -237,7 +253,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
}
switch ( getparam_bpp_mode() ) {
-@@ -224,12 +225,16 @@
+@@ -224,12 +225,16 @@ static void setup_sdl_video_mode()
width = getparam_x_resolution();
height = getparam_y_resolution();
@@ -255,7 +271,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
}
-@@ -266,8 +271,7 @@
+@@ -266,8 +271,7 @@ void winsys_init( int *argc, char **argv, char *window_title,
setup_sdl_video_mode();
@@ -265,7 +281,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
}
-@@ -280,6 +284,7 @@
+@@ -280,6 +284,7 @@ void winsys_init( int *argc, char **argv, char *window_title,
*/
void winsys_shutdown()
{
@@ -273,7 +289,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
SDL_Quit();
}
-@@ -293,12 +298,6 @@
+@@ -293,12 +298,6 @@ void winsys_shutdown()
*/
void winsys_enable_key_repeat( bool_t enabled )
{
@@ -286,7 +302,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
}
-@@ -330,9 +329,6 @@
+@@ -330,9 +329,6 @@ void winsys_process_events()
while (True) {
@@ -296,7 +312,7 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
while ( SDL_PollEvent( &event ) ) {
switch ( event.type ) {
-@@ -384,18 +380,19 @@
+@@ -384,18 +380,19 @@ void winsys_process_events()
}
break;
@@ -322,10 +338,11 @@ diff -ur tuxracer-0.61-original/src/winsys.c tuxracer-0.61/src/winsys.c
}
if ( redisplay && display_func ) {
-diff -ur tuxracer-0.61-original/src/winsys.h tuxracer-0.61/src/winsys.h
---- tuxracer-0.61-original/src/winsys.h 2001-01-13 22:09:51.000000000 +0000
-+++ tuxracer-0.61/src/winsys.h 2021-12-26 13:41:33.341076372 +0000
-@@ -48,16 +48,16 @@
+diff --git a/src/winsys.h b/src/winsys.h
+index 4a51f8d..1cf7ca9 100644
+--- a/src/winsys.h
++++ b/src/winsys.h
+@@ -48,16 +48,16 @@ typedef enum {
WSK_NOT_AVAIL = SDLK_UNKNOWN,
/* Numeric keypad */
@@ -352,7 +369,7 @@ diff -ur tuxracer-0.61-original/src/winsys.h tuxracer-0.61/src/winsys.h
WSK_KP_PERIOD = SDLK_KP_PERIOD,
WSK_KP_DIVIDE = SDLK_KP_DIVIDE,
WSK_KP_MULTIPLY = SDLK_KP_MULTIPLY,
-@@ -95,17 +95,17 @@
+@@ -95,17 +95,17 @@ typedef enum {
WSK_F15 = SDLK_F15,
/* Key state modifier keys */
@@ -374,3 +391,6 @@ diff -ur tuxracer-0.61-original/src/winsys.h tuxracer-0.61/src/winsys.h
WSK_LAST
+--
+2.36.1
+
diff --git a/Ports/tuxracer/patches/ReadMe.md b/Ports/tuxracer/patches/ReadMe.md
new file mode 100644
index 0000000000..86be4634d2
--- /dev/null
+++ b/Ports/tuxracer/patches/ReadMe.md
@@ -0,0 +1,14 @@
+# Patches for tuxracer on SerenityOS
+
+## `0001-Explicitly-link-in-SDL2.patch`
+
+Explicitly link in SDL2
+
+Also pretend that isnan() works correctly.
+
+## `0002-Big-bag-of-random-changes-to-the-source.patch`
+
+Big bag of random changes to the source
+
+FIXME: Split this up sensibly
+