summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson2021-10-12 09:43:44 +0200
committer Willy Sudiarto Raharjo2021-10-12 19:52:46 +0200
commit30bcea97fcf0f7a1857f55ea3c256abf510c390e (patch)
tree01dc5ac8ff164b2610cf6e24d70b011ba3310129
parent650bc309dc9066a03a4e7c7d84ab470d76cd0aab (diff)
downloadslackbuilds-30bcea97fcf0f7a1857f55ea3c256abf510c390e.tar.gz
games/xu4: New-style icons, disable alt-x.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--games/xu4/disable_alt_x.diff24
-rw-r--r--games/xu4/doinst.sh6
-rw-r--r--games/xu4/icons/128.pngbin0 -> 11436 bytes
-rw-r--r--games/xu4/icons/16.pngbin0 -> 1513 bytes
-rw-r--r--games/xu4/icons/32.pngbin0 -> 2649 bytes
-rw-r--r--games/xu4/icons/48.pngbin0 -> 4643 bytes
-rw-r--r--games/xu4/icons/64.pngbin0 -> 6928 bytes
-rw-r--r--games/xu4/u4.6 (renamed from games/xu4/u4.1)2
-rw-r--r--games/xu4/u4.desktop2
-rw-r--r--games/xu4/xu4.SlackBuild38
10 files changed, 64 insertions, 8 deletions
diff --git a/games/xu4/disable_alt_x.diff b/games/xu4/disable_alt_x.diff
new file mode 100644
index 0000000000..62f18c3f76
--- /dev/null
+++ b/games/xu4/disable_alt_x.diff
@@ -0,0 +1,24 @@
+diff -Naur xu4-20130612_svn/src/event_sdl.cpp xu4-20130612_svn.patched/src/event_sdl.cpp
+--- xu4-20130612_svn/src/event_sdl.cpp 2013-06-12 19:34:25.000000000 -0400
++++ xu4-20130612_svn.patched/src/event_sdl.cpp 2021-10-12 03:38:36.048487922 -0400
+@@ -43,7 +43,7 @@
+ case U4_META + 'q': /* Cmd+q */
+ case U4_META + 'x': /* Cmd+x */
+ #endif
+- case U4_ALT + 'x': /* Alt+x */
++ // case U4_ALT + 'x': /* Alt+x */
+ #if defined(WIN32)
+ case U4_ALT + U4_FKEY + 3:
+ #endif
+diff -Naur xu4-20130612_svn/src/game.cpp xu4-20130612_svn.patched/src/game.cpp
+--- xu4-20130612_svn/src/game.cpp 2013-06-12 19:34:24.000000000 -0400
++++ xu4-20130612_svn.patched/src/game.cpp 2021-10-12 03:33:55.794513398 -0400
+@@ -1205,7 +1205,7 @@
+ screenMessage("Quit & Save...\n%d moves\n", c->saveGame->moves);
+ if (c->location->context & CTX_CAN_SAVE_GAME) {
+ gameSave();
+- screenMessage("Press Alt-x to quit\n");
++ screenMessage("Close window to quit\n");
+ }
+ else screenMessage("%cNot here!%c\n", FG_GREY, FG_WHITE);
+
diff --git a/games/xu4/doinst.sh b/games/xu4/doinst.sh
index 5fb28930db..3e5691a052 100644
--- a/games/xu4/doinst.sh
+++ b/games/xu4/doinst.sh
@@ -1,3 +1,9 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/games/xu4/icons/128.png b/games/xu4/icons/128.png
new file mode 100644
index 0000000000..40d12d1bb7
--- /dev/null
+++ b/games/xu4/icons/128.png
Binary files differ
diff --git a/games/xu4/icons/16.png b/games/xu4/icons/16.png
new file mode 100644
index 0000000000..d96bf37a3f
--- /dev/null
+++ b/games/xu4/icons/16.png
Binary files differ
diff --git a/games/xu4/icons/32.png b/games/xu4/icons/32.png
new file mode 100644
index 0000000000..bc594186b6
--- /dev/null
+++ b/games/xu4/icons/32.png
Binary files differ
diff --git a/games/xu4/icons/48.png b/games/xu4/icons/48.png
new file mode 100644
index 0000000000..43b3509bbe
--- /dev/null
+++ b/games/xu4/icons/48.png
Binary files differ
diff --git a/games/xu4/icons/64.png b/games/xu4/icons/64.png
new file mode 100644
index 0000000000..8f5f6b38b6
--- /dev/null
+++ b/games/xu4/icons/64.png
Binary files differ
diff --git a/games/xu4/u4.1 b/games/xu4/u4.6
index 0fc8fe2376..5ccf1d4bd6 100644
--- a/games/xu4/u4.1
+++ b/games/xu4/u4.6
@@ -1,4 +1,4 @@
-.TH u4 1 "26 Oct 2011" "Version 1.1+svn" "XU4 Manual"
+.TH u4 6 "12 Oct 2021" "Version 1.1+svn" "XU4 Manual"
.SH NAME
\fBu4\fR \- A modern reimplementation of the classic Ultima IV role\-playing game.
diff --git a/games/xu4/u4.desktop b/games/xu4/u4.desktop
index 6674892a97..cbe5634486 100644
--- a/games/xu4/u4.desktop
+++ b/games/xu4/u4.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Ultima 4
Comment=Ultima 4 (xu4)
-Exec=u4
+Exec=/usr/games/u4
Icon=u4
Terminal=false
Type=Application
diff --git a/games/xu4/xu4.SlackBuild b/games/xu4/xu4.SlackBuild
index 32f7cf5b57..443875df22 100644
--- a/games/xu4/xu4.SlackBuild
+++ b/games/xu4/xu4.SlackBuild
@@ -6,11 +6,21 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211012 bkw: BUILD=3,
+# - new-style icon.
+# - binary in /usr/games.
+# - man page in section 6.
+# - disable Alt-x keystroke (it crashes the game).
+# - "Press Alt-x to quit" => "Close window to quit".
+
+# TODO: make Alt-x stop crashing the game. It seems to work correctly
+# only at the main menu, not while playing. Disabled it for now.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=xu4
VERSION=${VERSION:-20130612_svn}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -80,9 +90,13 @@ sed -i '/#define *DEFAULT_VALIDATE_XML/s,1,0,' src/settings.h
# Patch for GCC 7
patch -p1 < $CWD/gcc7.patch
+# 20211012 bkw: work around a bug. Disable Alt-X as it crashes the
+# game. Tell the user to close the window to quit, instead.
+patch -p1 < $CWD/disable_alt_x.diff
+
# The -DNPERF stops u4 from creating a debug/ in the current dir.
make -C src DEBUGCXXFLAGS="-DNPERF $SLKCFLAGS" prefix=/usr libdir=$PKGLIBDIR
-make -C src install prefix=$PKG/usr libdir=$PKGLIBDIR
+make -C src install prefix=$PKG/usr bindir=$PKG/usr/games libdir=$PKGLIBDIR
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -114,6 +128,18 @@ find $PKGLIBDIR \
-name \*.xml -o -name \*.dtd -o -name \*.ogg \) \
-print0 | xargs -0 chmod 644
+# 20211012 bkw: new-style icon...
+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/u4.png
+done
+
+rm -f $PKG/usr/share/pixmaps/u4.png
+ln -s ../icons/hicolor/64x64/apps/u4.png $PKG/usr/share/pixmaps/u4.png
+
# Docs. N.B. we don't need border.png.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/developers
cp -a *.html AUTHORS COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
@@ -161,13 +187,13 @@ sed -i 's/\r//' *.txt
cd -
# I hate packages called "xfoo" whose binaries are called "foo".
-ln -s u4 $PKG/usr/bin/$PRGNAM
+ln -s u4 $PKG/usr/games/$PRGNAM
# I also hate binaries that take options but have no man pages, so here's
# the one I made. Enjoy.
-mkdir -p $PKG/usr/man/man1
-sed "s/@VERSION@/$VERSION/" $CWD/u4.1 | gzip -9c - > $PKG/usr/man/man1/u4.1.gz
-ln -s u4.1.gz $PKG/usr/man/man1/$PRGNAM.1.gz
+mkdir -p $PKG/usr/man/man6
+sed "s/@VERSION@/$VERSION/" $CWD/u4.6 | gzip -9c - > $PKG/usr/man/man6/u4.6.gz
+ln -s u4.6.gz $PKG/usr/man/man6/$PRGNAM.6.gz
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc