diff options
Diffstat (limited to 'games/planetblupi/planetblupi.SlackBuild')
-rw-r--r-- | games/planetblupi/planetblupi.SlackBuild | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/games/planetblupi/planetblupi.SlackBuild b/games/planetblupi/planetblupi.SlackBuild index bf83e009df..50fba689fc 100644 --- a/games/planetblupi/planetblupi.SlackBuild +++ b/games/planetblupi/planetblupi.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for planetblupi # # Yth | Pont-en-Royans, France | yth@ythogtha.org @@ -20,10 +20,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=planetblupi -VERSION=${VERSION:-1.14.1} +VERSION=${VERSION:-1.15.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} +BINDIR=/usr/games if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -33,7 +37,14 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +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} @@ -49,6 +60,9 @@ elif [ "$ARCH" = "i686" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" @@ -69,12 +83,51 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +## slackware's SDL2_ttf is outdated, using more recent one +tar xvf $CWD/SDL_ttf-release-2.20.2.tar.gz +pushd SDL_ttf-release-2.20.2 +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 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_BUILD_TYPE=Release .. + make + mkdir -p $PKG/usr/share/planetblupi + cp -a libSDL2_ttf*.so* $PKG/usr/share/planetblupi +cd .. +cp -a SDL_ttf.h ../src/ +export CMAKE_LIBRARY_PATH=$PKG/usr/share/planetblupi +popd +sed -i 's/<SDL_ttf.h>/"SDL_ttf.h"/' src/text.cxx +# planetblupi expects to find its files in (binary path)/../share/planetblupi +# Hence we are installing planetblupi binary in /usr/libexec +# and a shell wrapper in /usr/games. +BINDIR=/usr/libexec +mkdir -p $PKG/usr/games +cat <<EOF > $PKG/usr/games/planetblupi +#!/bin/bash +export LD_LIBRARY_PATH=/usr/share/planetblupi:\$LD_LIBRARY_PATH +exec "$BINDIR/planetblupi" "$@" +EOF +chmod 755 $PKG/usr/games/planetblupi +## End of SDL2_ttf block + mkdir -p build cd build cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \ + -DCMAKE_INSTALL_BINDIR:PATH=$BINDIR \ + -Wno-dev \ -DCMAKE_BUILD_TYPE=Release .. make make install DESTDIR=$PKG @@ -94,4 +147,4 @@ 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} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |