From f2eaab6e43a635a3a2bc9f3f26c254570848dcb3 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 28 Jun 2025 20:54:22 +0300 Subject: [PATCH] ports: Add tuxracer port THIS IS SUPER SLOW --- ports/tuxracer/build.sh | 34 +++++++++++ .../patches/0001-fix-macro-syntax.patch | 56 +++++++++++++++++++ .../0002-dont-assing-opague-file-handle.patch | 19 +++++++ .../0003-disable-default-fullscreen.patch | 12 ++++ .../patches/0004-exit-on-sdl-quit.patch | 15 +++++ 5 files changed, 136 insertions(+) create mode 100755 ports/tuxracer/build.sh create mode 100644 ports/tuxracer/patches/0001-fix-macro-syntax.patch create mode 100644 ports/tuxracer/patches/0002-dont-assing-opague-file-handle.patch create mode 100644 ports/tuxracer/patches/0003-disable-default-fullscreen.patch create mode 100644 ports/tuxracer/patches/0004-exit-on-sdl-quit.patch diff --git a/ports/tuxracer/build.sh b/ports/tuxracer/build.sh new file mode 100755 index 00000000..47dba4f9 --- /dev/null +++ b/ports/tuxracer/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash ../install.sh + +NAME='tuxracer' +VERSION='0.61' +DOWNLOAD_URL="http://download.sourceforge.net/tuxracer/tuxracer-$VERSION.tar.gz#a311d09080598fe556134d4b9faed7dc0c2ed956ebb10d062e5d4df022f91eff" +DEPENDENCIES=('tcl' 'mesa' 'glu' 'sdl12-compat') +CONFIGURE_OPTIONS=( + '--with-data-dir=/usr/share/tuxracer' + "--with-sdl-prefix=$BANAN_SYSROOT/usr" + '--without-gl-libs' + '--with-tcl-lib-name=tcl8.6' + '--without-x' +) + +post_install() { + pushd .. + + if [ ! -f "tuxracer-data-$VERSION.tar.gz" ]; then + wget "http://download.sourceforge.net/tuxracer/tuxracer-data-$VERSION.tar.gz" || exit 1 + fi + + if [ ! -d "tuxracer-data-$VERSION" ]; then + tar xf "tuxracer-data-$VERSION.tar.gz" || exit 1 + fi + + mkdir -p "$BANAN_SYSROOT/usr/share/tuxracer" || exit 1 + cp -r "tuxracer-data-$VERSION"/* "$BANAN_SYSROOT/usr/share/tuxracer/" || exit 1 + find "$BANAN_SYSROOT/usr/share/tuxracer" -type f -exec chmod 644 {} + + + popd +} + +export CFLAGS="-std=c99 -Wno-implicit-int -Wno-incompatible-pointer-types $CFLAGS" +export ac_cv_func_isnan=yes diff --git a/ports/tuxracer/patches/0001-fix-macro-syntax.patch b/ports/tuxracer/patches/0001-fix-macro-syntax.patch new file mode 100644 index 00000000..e0bab251 --- /dev/null +++ b/ports/tuxracer/patches/0001-fix-macro-syntax.patch @@ -0,0 +1,56 @@ +diff -ruN tuxracer-0.61/src/game_config.c tuxracer-0.61-banan_os/src/game_config.c +--- tuxracer-0.61/src/game_config.c 2001-01-30 22:04:43.000000000 +0200 ++++ tuxracer-0.61-banan_os/src/game_config.c 2025-06-26 03:13:06.859798526 +0300 +@@ -114,26 +114,26 @@ + */ + + #define INIT_PARAM( nam, val, typename, commnt ) \ +- Params. ## nam ## .loaded = False; \ +- Params. ## nam ## .name = #nam; \ +- Params. ## nam ## .deflt. ## typename ## _val = val; \ +- Params. ## nam ## .comment = commnt; ++ Params.nam.loaded = False; \ ++ Params.nam.name = #nam; \ ++ Params.nam.deflt.typename ## _val = val; \ ++ Params.nam.comment = commnt; + + #define INIT_PARAM_STRING( nam, val, commnt ) \ + INIT_PARAM( nam, val, string, commnt ); \ +- Params. ## nam ## .type = PARAM_STRING; ++ Params.nam.type = PARAM_STRING; + + #define INIT_PARAM_CHAR( nam, val, commnt ) \ + INIT_PARAM( nam, val, char, commnt ); \ +- Params. ## nam ## .type = PARAM_CHAR; ++ Params.nam.type = PARAM_CHAR; + + #define INIT_PARAM_INT( nam, val, commnt ) \ + INIT_PARAM( nam, val, int, commnt ); \ +- Params. ## nam ## .type = PARAM_INT; ++ Params.nam.type = PARAM_INT; + + #define INIT_PARAM_BOOL( nam, val, commnt ) \ + INIT_PARAM( nam, val, bool, commnt ); \ +- Params. ## nam ## .type = PARAM_BOOL; ++ Params.nam.type = PARAM_BOOL; + + + /* +@@ -310,13 +310,13 @@ + */ + #define FN_PARAM( name, typename, type ) \ + type getparam_ ## name() { \ +- if ( !Params. ## name ## .loaded ) { \ +- fetch_param_ ## typename( &( Params. ## name ) ); \ ++ if ( !Params.name.loaded ) { \ ++ fetch_param_ ## typename( &( Params.name ) ); \ + } \ +- return Params. ## name ## .val. ## typename ## _val; \ ++ return Params.name.val.typename ## _val; \ + } \ + void setparam_ ## name( type val) { \ +- set_param_ ## typename( &( Params. ## name ), val ); } ++ set_param_ ## typename( &( Params.name ), val ); } + + #define FN_PARAM_STRING( name ) \ + FN_PARAM( name, string, char* ) diff --git a/ports/tuxracer/patches/0002-dont-assing-opague-file-handle.patch b/ports/tuxracer/patches/0002-dont-assing-opague-file-handle.patch new file mode 100644 index 00000000..1e06e36a --- /dev/null +++ b/ports/tuxracer/patches/0002-dont-assing-opague-file-handle.patch @@ -0,0 +1,19 @@ +diff -ruN tuxracer-0.61/src/debug.c tuxracer-0.61-banan_os/src/debug.c +--- tuxracer-0.61/src/debug.c 2001-01-14 00:09:50.000000000 +0200 ++++ tuxracer-0.61-banan_os/src/debug.c 2025-06-26 03:18:02.090898960 +0300 +@@ -165,6 +165,7 @@ + /* Redirect stderr to file; taken from SDL_main.c, which is in the + public domain */ + newfp = freopen(BUGREPORT_FILE, "w", stderr); ++#if !defined(__banan_os__) + if ( newfp == NULL ) { /* This happens on NT */ + #if !defined(stderr) + stderr = fopen(BUGREPORT_FILE, "w"); +@@ -175,6 +176,7 @@ + } + #endif + } ++#endif + + /* Write bug report header */ + fprintf( stderr, "Tux Racer Diagnostic Log\n\n" ); diff --git a/ports/tuxracer/patches/0003-disable-default-fullscreen.patch b/ports/tuxracer/patches/0003-disable-default-fullscreen.patch new file mode 100644 index 00000000..e2b30bb3 --- /dev/null +++ b/ports/tuxracer/patches/0003-disable-default-fullscreen.patch @@ -0,0 +1,12 @@ +diff -ruN tuxracer-0.61/src/game_config.c tuxracer-0.61-banan_os/src/game_config.c +--- tuxracer-0.61/src/game_config.c 2001-01-30 22:04:43.000000000 +0200 ++++ tuxracer-0.61-banan_os/src/game_config.c 2025-06-26 04:03:28.015311092 +0300 +@@ -505,7 +505,7 @@ + "# decreasing this number, at the cost of lower image quality." ); + + INIT_PARAM_BOOL( +- fullscreen, True, ++ fullscreen, False, + "# If true then the game will run in full-screen mode." ); + + INIT_PARAM_INT( diff --git a/ports/tuxracer/patches/0004-exit-on-sdl-quit.patch b/ports/tuxracer/patches/0004-exit-on-sdl-quit.patch new file mode 100644 index 00000000..f2c7e98b --- /dev/null +++ b/ports/tuxracer/patches/0004-exit-on-sdl-quit.patch @@ -0,0 +1,15 @@ +diff -ruN tuxracer-0.61/src/winsys.c tuxracer-0.61-banan_os/src/winsys.c +--- tuxracer-0.61/src/winsys.c 2001-01-14 00:09:51.000000000 +0200 ++++ tuxracer-0.61-banan_os/src/winsys.c 2025-06-26 04:05:10.894824478 +0300 +@@ -392,6 +392,11 @@ + } + + break; ++ ++ case SDL_QUIT: ++ winsys_exit(0); ++ ++ break; + } + + SDL_LockAudio();