diff options
author | B. Watson <yalhcru@gmail.com> | 2022-03-31 11:45:18 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-04-02 18:19:18 +0700 |
commit | e20fb7b2fc0e61bb98632ffe6de549e2520de8b7 (patch) | |
tree | a967b77328769774cc30e06a45bf86f22fe66c69 /games | |
parent | e27884b7eda5265f464225a5ecad0570a8f088a9 (diff) |
games/rejoystick: Added (translates joystick movement/buttons)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games')
-rw-r--r-- | games/rejoystick/README | 12 | ||||
-rw-r--r-- | games/rejoystick/rejoystick.1 | 84 | ||||
-rw-r--r-- | games/rejoystick/rejoystick.SlackBuild | 103 | ||||
-rw-r--r-- | games/rejoystick/rejoystick.info | 10 | ||||
-rw-r--r-- | games/rejoystick/rejoystick.patch | 21 | ||||
-rw-r--r-- | games/rejoystick/rejoystick.rst | 73 | ||||
-rw-r--r-- | games/rejoystick/slack-desc | 19 |
7 files changed, 322 insertions, 0 deletions
diff --git a/games/rejoystick/README b/games/rejoystick/README new file mode 100644 index 000000000000..2bcc72278761 --- /dev/null +++ b/games/rejoystick/README @@ -0,0 +1,12 @@ +rejoystick (translates joystick movement/buttons to keystrokes) + +Rejoystick is a program that maps movement and button presses on +your gamepad/joypad/joystick to keypresses on a keyboard when you +are running X. Since it uses SDL to communicate with the gamepad +device, it can work on every platform that provides SDL and an X +environment. (Though it is yet to be tested on Cygwin e.g.) + +Quickstart: run "rejoystick" with no arguments. Use the GUI to set up +button and axis key mappings. Click OK to exit. Run "rejoystick -d", +which runs in the background; moving the joystick should send the +keystrokes you configured. To exit, "killall -9 rejoystick". diff --git a/games/rejoystick/rejoystick.1 b/games/rejoystick/rejoystick.1 new file mode 100644 index 000000000000..2a2a79bf3841 --- /dev/null +++ b/games/rejoystick/rejoystick.1 @@ -0,0 +1,84 @@ +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.TH "REJOYSTICK" 1 "2022-03-26" "0.8.1" "SlackBuilds.org" +.SH NAME +rejoystick \- translates joystick movement/buttons to keystrokes +.\" RST source for rejoystick(1) man page. Convert with: +. +.\" rst2man.py rejoystick.rst > rejoystick.1 +. +.\" rst2man.py comes from the SBo development/docutils package. +. +.SH SYNOPSIS +.sp +rejoystick [\fI\-d\fP] +.SH DESCRIPTION +.sp +\fBrejoystick\fP is a daemon that converts joystick movement and/or +button presses to X keystroke events. This allows the user to use the +joystick with games that don\(aqt have joystick support. +.sp +There are two modes of operation for \fBrejoystick\fP: the GUI configuration +mode, and daemon mode. +.sp +To configure the axes/buttons \fBrejoystick\fP will map to keystrokes, +run \fBrejoystick\fP with no arguments. This will display a GUI which +you can use to set the mappings. When you\(aqre done, exit the program +(close its window). The mappings will be written to \fI~/.rejoystickrc\fP\&. +Although the configuration is graphical, it\(aqs recommended to run it +from a terminal (not a desktop launcher), so you can see its output. +.sp +To run \fBrejoystick\fP as a daemon, run it with the \fB\-d\fP option. It +will fork to the background, monitor the joystick, and generate +keystroke events according to the configuration in \fI~/.rejoystickrc\fP\&. +.sp +To exit \fBrejoystick\fP, use "\fBkillall \-9 rejoystick\fP". If you want to +change the mappings, you\(aqll have to kill the daemon and restart it, +since it won\(aqt re\-read its config file. +.SH OPTIONS +.INDENT 0.0 +.TP +.B \-d +Run as a daemon. Default is to show the config GUI. +.UNINDENT +.SH COPYRIGHT +.sp +See the file /usr/doc/rejoystick\-0.8.1/COPYING for license information. +.SH AUTHORS +.sp +rejoystick was written by Samuel <\fI\%samel_tvom@yahoo.se\fP>. +.sp +This man page written for the SlackBuilds.org project +by B. Watson, and is licensed under the WTFPL. +.SH SEE ALSO +.sp +The rejoystick homepage: \fI\%http://rejoystick.sourceforge.net/\fP +.\" Generated by docutils manpage writer. +. diff --git a/games/rejoystick/rejoystick.SlackBuild b/games/rejoystick/rejoystick.SlackBuild new file mode 100644 index 000000000000..57377c550243 --- /dev/null +++ b/games/rejoystick/rejoystick.SlackBuild @@ -0,0 +1,103 @@ +#!/bin/bash + +# Slackware build script for rejoystick + +# Written by Steven Pledger <email removed> +# Updated and now maintained by B. Watson <yalhcru@gmail.com> + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20220315 bkw: BUILD=4 +# - new maintainer. +# - resurrected. all it needed was LIBS="-lX11" to fix compilation. +# - removed useless INSTALL from doc dir. +# - add quick start guide to our README. +# - add a bit of error checking to rejoystick.patch (so it +# won't segfault if HOME isn't set in the environment). +# - i486 => i586. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=rejoystick +VERSION=${VERSION:-0.8.1} +BUILD=${BUILD:-4} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# Specify the path to the version.mk file inside of the configure script +sed -i "s|^\.\ version\.mk|. ./version.mk|" configure + +patch -p1 < $CWD/rejoystick.patch + +LIBS="-lX11" \ +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-static \ + --build=$ARCH-slackware-linux + +make +make install-strip DESTDIR=$PKG + +# man page written for this SlackBuild. since this isn't really a game +# (more of a game-related utility), it's not a section 6 page. +mkdir -p $PKG/usr/man/man1 +gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +# AUTHORS, ChangeLog, and NEWS are empty files +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYING README $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/games/rejoystick/rejoystick.info b/games/rejoystick/rejoystick.info new file mode 100644 index 000000000000..9b2c79e781f1 --- /dev/null +++ b/games/rejoystick/rejoystick.info @@ -0,0 +1,10 @@ +PRGNAM="rejoystick" +VERSION="0.8.1" +HOMEPAGE="http://rejoystick.sourceforge.net/" +DOWNLOAD="http://sourceforge.net/projects/rejoystick/files/rejoystick/rejoystick-0.8.1/rejoystick-0.8.1.tar.gz" +MD5SUM="43208b766a131e2725bfd72caf60a41d" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/games/rejoystick/rejoystick.patch b/games/rejoystick/rejoystick.patch new file mode 100644 index 000000000000..f4e955c7678c --- /dev/null +++ b/games/rejoystick/rejoystick.patch @@ -0,0 +1,21 @@ +diff -Naur rejoystick-0.8.1/src/main.c rejoystick-0.8.1.patched/src/main.c +--- rejoystick-0.8.1/src/main.c 2008-03-23 10:38:22.000000000 -0400 ++++ rejoystick-0.8.1.patched/src/main.c 2022-03-15 21:28:38.753577677 -0400 +@@ -137,12 +137,11 @@ + + pthread_t sdl_thread; + +- char* home; +- char* keyfile; +- +- home = (char*)getenv("HOME"); +- keyfile = KEYFILE; +- filename = strcat(home, keyfile); ++ const char * home = getenv("HOME"); ++ if(!home) error("HOME not set in environment"); ++ filename = malloc(strlen(home) + strlen(KEYFILE) + 1); ++ if(!filename) error("Out of memory"); ++ sprintf(filename, "%s%s", home, KEYFILE); + + global_argv = argv; + diff --git a/games/rejoystick/rejoystick.rst b/games/rejoystick/rejoystick.rst new file mode 100644 index 000000000000..54f50df69dd3 --- /dev/null +++ b/games/rejoystick/rejoystick.rst @@ -0,0 +1,73 @@ +.. RST source for rejoystick(1) man page. Convert with: +.. rst2man.py rejoystick.rst > rejoystick.1 +.. rst2man.py comes from the SBo development/docutils package. + +.. |version| replace:: 0.8.1 +.. |date| date:: + +========== +rejoystick +========== + +-------------------------------------------------- +translates joystick movement/buttons to keystrokes +-------------------------------------------------- + +:Manual section: 1 +:Manual group: SlackBuilds.org +:Date: |date| +:Version: |version| + +SYNOPSIS +======== + +rejoystick [*-d*] + +DESCRIPTION +=========== + +**rejoystick** is a daemon that converts joystick movement and/or +button presses to X keystroke events. This allows the user to use the +joystick with games that don't have joystick support. + +There are two modes of operation for **rejoystick**: the GUI configuration +mode, and daemon mode. + +To configure the axes/buttons **rejoystick** will map to keystrokes, +run **rejoystick** with no arguments. This will display a GUI which +you can use to set the mappings. When you're done, exit the program +(close its window). The mappings will be written to *~/.rejoystickrc*. +Although the configuration is graphical, it's recommended to run it +from a terminal (not a desktop launcher), so you can see its output. + +To run **rejoystick** as a daemon, run it with the **-d** option. It +will fork to the background, monitor the joystick, and generate +keystroke events according to the configuration in *~/.rejoystickrc*. + +To exit **rejoystick**, use "**killall -9 rejoystick**". If you want to +change the mappings, you'll have to kill the daemon and restart it, +since it won't re-read its config file. + +OPTIONS +======= + +-d + Run as a daemon. Default is to show the config GUI. + +COPYRIGHT +========= + +See the file /usr/doc/rejoystick-|version|/COPYING for license information. + +AUTHORS +======= + +rejoystick was written by Samuel <samel_tvom@yahoo.se>. + +This man page written for the SlackBuilds.org project +by B. Watson, and is licensed under the WTFPL. + +SEE ALSO +======== + +The rejoystick homepage: http://rejoystick.sourceforge.net/ diff --git a/games/rejoystick/slack-desc b/games/rejoystick/slack-desc new file mode 100644 index 000000000000..e97628180e37 --- /dev/null +++ b/games/rejoystick/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +rejoystick: rejoystick (translates joystick movement/buttons to keystrokes) +rejoystick: +rejoystick: Rejoystick is a program that maps movement and button presses on +rejoystick: your gamepad/joypad/joystick to keypresses on a keyboard when you +rejoystick: are running X. Since it uses SDL to communicate with the gamepad +rejoystick: device, it can work on every platform that provides SDL and an X +rejoystick: environment. (Though it is yet to be tested on Cygwin e.g.) +rejoystick: +rejoystick: +rejoystick: +rejoystick: |