games/rejoystick: Patched for init SDL.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Klaatu 2014-12-20 06:59:36 +07:00 committed by Willy Sudiarto Raharjo
parent ab30fdd2da
commit b4242367ee
2 changed files with 28 additions and 9 deletions

View file

@ -6,7 +6,7 @@
PRGNAM=rejoystick
VERSION=${VERSION:-0.8.1}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -46,14 +46,16 @@ tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -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
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@ -67,14 +69,12 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# AUTHORS, ChangeLog, and NEWS are empty files
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
COPYING INSTALL README \
$PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install

View file

@ -0,0 +1,19 @@
--- rejoystick-0.8.1/src/main.c.orig 2014-12-20 06:55:37.951753670 +0700
+++ rejoystick-0.8.1/src/main.c 2014-12-20 06:56:23.666092712 +0700
@@ -137,13 +137,9 @@
pthread_t sdl_thread;
- char* home;
- char* keyfile;
-
- home = (char*)getenv("HOME");
- keyfile = KEYFILE;
- filename = strcat(home, keyfile);
-
+ const char * home = getenv("HOME");
+ filename = malloc(strlen(home) + strlen(KEYFILE) + 1);
+ sprintf(filename, "%s%s", home, KEYFILE);
global_argv = argv;