From b9a6d30880cf8e84067c09a8d3b88c6408f010af Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 8 Jan 2023 00:11:33 -0500 Subject: [PATCH] games/koules: Make joysticks work again. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- games/koules/koules.SlackBuild | 12 ++++++++++-- games/koules/patches/joystickdevs.diff | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 games/koules/patches/joystickdevs.diff diff --git a/games/koules/koules.SlackBuild b/games/koules/koules.SlackBuild index 84d2b6d753..e02b060475 100644 --- a/games/koules/koules.SlackBuild +++ b/games/koules/koules.SlackBuild @@ -10,13 +10,17 @@ # This script doesn't share any code with whatever build script # existed back then (partly because I couldn't find a copy) +# TODO: make -E the default size. It's 2023, nobody wants to play a game +# in a window the size of a postcard (or a playing card, on 4K). + +# 20230107 bkw: BUILD=4, fix paths to joystick devices (/dev/jsX => /dev/input/jsX) # 20211020 bkw: BUILD=3, fix -current build. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=koules VERSION=${VERSION:-1.4} -BUILD=${BUILD:-3} +BUILD=${BUILD:-4} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -81,7 +85,7 @@ patch -p1 < $CWD/patches/slackware.diff patch -p1 < $CWD/patches/compile_fix.diff # Modern gcc seems to hate the inline assembly. Anyway I bet gcc's code -# with -O2 is the same or faster... +# with -O2 is the same or faster... and we need this for x86_64 too. patch -p1 < $CWD/patches/no_inline_asm.diff # The author forgot to mention the -E option in the help and man page @@ -90,6 +94,10 @@ patch -p1 < $CWD/patches/document_E_option.diff # Some people might like the launcher... patch -p1 < $CWD/patches/tcl_launcher_paths.diff +# 20230107 bkw: this has been broken for ages, I just now decided to play +# this game with a joystick... +patch -p1 < $CWD/patches/joystickdevs.diff + # I hate Imake even worse than autoconf... if [ "$MITSHM" = "no" ]; then sed -i -e '/#define MITSHM/d' Iconfig diff --git a/games/koules/patches/joystickdevs.diff b/games/koules/patches/joystickdevs.diff new file mode 100644 index 0000000000..be9d7b6934 --- /dev/null +++ b/games/koules/patches/joystickdevs.diff @@ -0,0 +1,21 @@ +diff -Naur koules1.4/xlib/init.c koules1.4.patched/xlib/init.c +--- koules1.4/xlib/init.c 1998-03-05 12:03:01.000000000 -0500 ++++ koules1.4.patched/xlib/init.c 2023-01-07 23:23:21.963726308 -0500 +@@ -334,7 +334,7 @@ + printf ("Autoprobing hardware\n"); + printf ("Initializing joystick driver\n"); + #ifdef JOYSTICK +- joystickdevice[0] = open ("/dev/js0", O_RDONLY); ++ joystickdevice[0] = open ("/dev/input/js0", O_RDONLY); + if (joystickdevice[0] < 0) + { + perror ("Joystick driver"); +@@ -343,7 +343,7 @@ + } + else + printf ("Joystick 1 initialized\n"); +- joystickdevice[1] = open ("/dev/js1", O_RDONLY); ++ joystickdevice[1] = open ("/dev/input/js1", O_RDONLY); + if (joystickdevice[1] < 0) + { + perror ("Joystick driver");