summaryrefslogtreecommitdiffstats
path: root/games/xroar/xroar.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/xroar/xroar.SlackBuild')
-rw-r--r--games/xroar/xroar.SlackBuild90
1 files changed, 53 insertions, 37 deletions
diff --git a/games/xroar/xroar.SlackBuild b/games/xroar/xroar.SlackBuild
index 9a38359102..422b078b3d 100644
--- a/games/xroar/xroar.SlackBuild
+++ b/games/xroar/xroar.SlackBuild
@@ -1,11 +1,27 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for xroar
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20240314 bkw: update for 1.5.4
+# 20240216 bkw: update for 1.5.3
+# 20230907 bkw: update for 1.4.2
+# - add 22x22 and 64x64 icons.
+# - reword README and slack-desc (use text from the man page).
+
+# 20230308 bkw: BUILD=2, de-uglify douninst.sh.
+# 20230214 bkw: update for 1.3.1
+# 20230109 bkw: update for 1.3
+
+# 20211015 bkw:
+# - update for 0.37.1
+# - new-style icons
+# - doinst.sh installs info file in info dir
+# - douninst.sh removes info file from info dir
+
# 20201025 bkw:
# - update for 0.36.2
# - the SDL 1.x UI is gone. One or the other of SDL2, gtkglext is
@@ -13,34 +29,13 @@
# in which case you get an xroar that has no display at all! Added
# code to the script to prevent this from happening.
-# 20191130 bkw:
-# - update for 0.35.4
-# - restore the SDL1 build, now that it builds again
-# - remove the possibility of including ROMs in the package, because:
-# - make xroar-roms a required dependency
-
-# 20181201 bkw: update for 0.35.2
-
-# 20180828 bkw:
-# - update for 0.35
-# - build with --without-oss by default, add OSS=yes option
-# - get rid of alsa_first.diff (doesn't apply any more anyway)
-# - add PULSE=no option
-# - move cruft out of here & into ChangeLog.old
-# - SDL 1.x build broke in 0.35, so remove SDL2=no and add SDL2
-# to REQUIRES.
-
-# 20170822 bkw:
-# - update for 0.34.8
-# - add SDL2=no and GTKGLEXT=no options, mostly for my own testing
-# - record build options in slack-desc
-
-# 20170122 bkw: update for 0.34.7
+cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=xroar
-VERSION=${VERSION:-0.36.2}
+VERSION=${VERSION:-1.5.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -50,7 +45,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+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}
@@ -127,6 +126,7 @@ CXXFLAGS="$SLKCFLAGS" \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
+ --infodir=/usr/info \
--build=$ARCH-slackware-linux
make
@@ -136,7 +136,10 @@ strip $PKG/usr/games/$PRGNAM
# reset these for use in the slack-desc
SDL2=no; JACK=no; GTKGLEXT=no; PULSE=no; OSS=no
-# actually examine the binary to figure out build options.
+# actually examine the binary to figure out build options. this may
+# seem like overkill, but it's very handy when updating to new xroar
+# versions (if the slack-desc doesn't match the environment, something
+# has changed in xroar and this script needs fixing).
ldd $PKG/usr/games/$PRGNAM > ldd.tmp
grep -q libSDL2 ldd.tmp && SDL2=yes
grep -q libjack ldd.tmp && JACK=yes
@@ -151,21 +154,29 @@ sed '1s,\<1\>,6,' \
| gzip -9c > $PKG/usr/man/man6/$PRGNAM.6.gz
rm -rf $PKG/usr/man/man1
-mv $PKG/usr/share/info $PKG/usr/info
-rm -rf $PKG/usr/share
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*.info*
# include empty ROM dir
mkdir -p $PKG/usr/share/xroar/roms
-# Icon taken from Fedora package here:
-# ftp://mirror.switch.ch/pool/3/mirror/rpmfusion/free/fedora/updates/8/i386/xroar-0.21-2.fc8.i386.rpm
-# Current versions of xroar include windows and mac icons that are larger,
-# but they don't include the word 'xroar' (just the X-shaped graphic), so
-# I'm sticking with the old Fedora icon.
+# 20211015 bkw: Icons converted from src/macosx/xroar.icns with
+# icns2png from the libicns package. I really liked the old Fedora
+# icon, with the colorful XROAR at the bottom, but it only existed
+# as a 32x32 PNG, which is smaller than a postage stamp on most
+# modern displays and doesn't scale up nicely. Besides which, these
+# are upstream's official icons.
+# 20230907 bkw: added 22x22 and 64x64 icons.
+for i in $CWD/icons/*.png; do
+ px=$( basename $i | cut -d. -f1 )
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ cat $i > $dir/$PRGNAM.png
+done
+
mkdir $PKG/usr/share/pixmaps
-cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
mkdir $PKG/usr/share/applications
cp $CWD/*.desktop $PKG/usr/share/applications
@@ -190,5 +201,10 @@ sed -e "s,@JACK@,$JACK," \
$CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
+# 20211015 bkw: douninst.sh removes the XRoar entry from the info
+# directory, and the Emulators section if XRoar was the only entry
+# there.
+cat $CWD/douninst.sh > $PKG/install/douninst.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