slackbuilds_ponce/games/bsnes/bsnes.SlackBuild

106 lines
2.4 KiB
Text
Raw Normal View History

2010-05-13 00:58:07 +02:00
#!/bin/sh
# Slackware build script for bsnes
# Written by Larry Hajali <larryhaja[at]gmail[dot]com>
PRGNAM=bsnes
VERSION=${VERSION:-0.068}
2010-05-13 00:58:07 +02:00
SRCVER=${VERSION:2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) export ARCH=i486 ;;
arm*) export ARCH=arm ;;
*) export ARCH=$( uname -m ) ;;
esac
fi
2010-05-13 00:58:07 +02:00
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
2010-05-13 00:58:07 +02:00
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
2010-05-13 00:58:07 +02:00
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
2010-05-13 00:58:07 +02:00
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
tar xvf $CWD/${PRGNAM}_v${SRCVER}.tar.bz2
find . -type d -exec chmod -R 0755 {} \;
2010-05-13 00:58:07 +02:00
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -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 {} \;
cd $PRGNAM
2010-05-13 00:58:07 +02:00
# Patch makefile so SLKCFLAGS and LIBDIRSUFFIX are recognized.
cat $CWD/bsnes-0.068-makefile.patch \
| sed -e "/^\+/s|/lib/|/lib${LIBDIRSUFFIX}/|g" \
| patch -p1
2010-05-13 00:58:07 +02:00
# Remove pulseaudio as there is no package for it at SBo.
# Comment out or delete the following 4 lines to enable pulseaudio.
sed -i \
-e 's|audio.pulseaudio ||' \
-e 's|audio.pulseaudiosimple ||' \
-e '/pulse/d' qt/Makefile
2010-05-13 00:58:07 +02:00
CXXFLAGS="$SLKCFLAGS" \
2010-05-13 00:58:07 +02:00
make \
platform=x \
compiler=gcc \
prefix=/usr
make install DESTDIR=$PKG prefix=/usr
# Install plugins.
for i in snesfilter snesreader supergameboy; do
cd ../${i}
CXXFLAGS="$SLKCFLAGS" \
make \
platform=x \
compiler=gcc \
prefix=/usr
make install DESTDIR=$PKG prefix=/usr
cd -
done
2010-05-19 08:34:21 +02:00
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
2010-05-13 00:58:07 +02:00
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a qt/data/*.html $PKG/usr/doc/$PRGNAM-$VERSION
2010-05-13 00:58:07 +02:00
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG/usr/doc -type f -exec chmod 0644 {} \;
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}