aboutsummaryrefslogtreecommitdiff
path: root/games/frotz
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-10-08 14:30:35 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-10-13 00:52:39 +0700
commit5f1d15abea09e1592267780a4184e78b4aa0e892 (patch)
treee6da5af08bbfdb892f54faac9ad63cd94f7dc880 /games/frotz
parent8b91b2222bf35dfb4bc62d28d05dca7e512b813c (diff)
games/frotz: Updated for version 2.53.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/frotz')
-rw-r--r--games/frotz/README17
-rw-r--r--games/frotz/doinst.sh6
-rw-r--r--games/frotz/frotz.SlackBuild64
-rw-r--r--games/frotz/frotz.info6
-rw-r--r--games/frotz/sfrotz.memcorrupt.diff19
-rw-r--r--games/frotz/slack-desc6
-rw-r--r--games/frotz/xfrotz.desktop16
7 files changed, 78 insertions, 56 deletions
diff --git a/games/frotz/README b/games/frotz/README
index 20f3a359e66d1..c4b16bc17f8f4 100644
--- a/games/frotz/README
+++ b/games/frotz/README
@@ -4,10 +4,17 @@ Frotz is an interpreter for Infocom games and other Z-machine games. It
complies with standard 1.0 of Graham Nelson's specification. Games can
be found at: http://www.ifarchive.org/
-Optional dependencies:
+3 executables are always built:
-libmodplug - If this is installed, the curses build (frotz) will
-support sound.
+* frotz - uses curses, no images, needs libmodplug for sound.
+* sfrotz - SDL2 UI, supports images and sound, works great in X11,
+ probably also Wayland (not tested by SlackBuild author).
+* dfrotz - dumb terminal frotz, doesn't support images nor sound.
-SDL2_mixer - If this is installed, the SDL build of frotz (sfrotz) will
-be included in the package. sfrotz always supports sound.
+Optionally, you can set XFROTZ=yes to build:
+
+* xfrotz - native X11 UI, supports images, no sound. Most users won't
+ want this; sfrotz is a better choice on modern X11.
+
+Optional dependency: libmodplug. If this is installed, the curses
+build (frotz) will support sound.
diff --git a/games/frotz/doinst.sh b/games/frotz/doinst.sh
index 9424ce43ff572..3d57ee9017316 100644
--- a/games/frotz/doinst.sh
+++ b/games/frotz/doinst.sh
@@ -11,3 +11,9 @@ if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
/usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
fi
fi
+
+if [ -e usr/share/fonts/misc/Zork_r400-10.pcf ]; then
+ if [ -x /usr/bin/mkfontdir ]; then
+ /usr/bin/mkfontdir usr/share/fonts/misc >/dev/null 2>&1
+ fi
+fi
diff --git a/games/frotz/frotz.SlackBuild b/games/frotz/frotz.SlackBuild
index c18f25dc424eb..147c52fdbb6fd 100644
--- a/games/frotz/frotz.SlackBuild
+++ b/games/frotz/frotz.SlackBuild
@@ -9,6 +9,12 @@
# Original had no license. This modified version is released under the
# WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211007 bkw:
+# - updated for v2.53.
+# - add optional xfrotz.
+# - expand README.
+# - make slack-desc reflect build options (libmodplug and xfrotz).
+
# 20210215 bkw: fix building without libmodplug. BUILD=2.
# 20201212 bkw: too many changes, can't build older versions.
@@ -28,8 +34,8 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=frotz
-VERSION=${VERSION:-2.52}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-2.53}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -41,9 +47,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# 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
@@ -87,23 +90,6 @@ sed -i -e 's,invocatio$,&n.,' \
# Document location of config file:
sed -i 's,frotz\.conf,/etc/&,' doc/$PRGNAM.6
-# sfrotz aborts with a "malloc(): memory corruption" error when given
-# a long pathname on the command line. Example:
-
-# $ sfrotz "/export/home/urchlay/interactive_fiction/infocom_collection/The Hitchhikers Guide To The Galaxy (1985)/The Hitchhiker's Guide To The Galaxy R31-871119.z5"
-
-# With a somewhat shorter pathname, the program might not abort, but
-# it will end up with gibberish at the end of f_setup.script_name,
-# which would prevent it from auto-loading scripts (if present).
-
-# I don't fully understand why, but the new_basename() and
-# new_dirname() fuctions in sf_util.c are the culprits. They look OK
-# to me, but getting rid of the calls to free() causes the aborts to
-# go away. Since each function gets called only once (at startup),
-# this doesn't constitute a memory leak worth worrying about.
-
-patch -p1 < $CWD/sfrotz.memcorrupt.diff
-
run_make() {
make \
PREFIX=/usr \
@@ -111,13 +97,19 @@ run_make() {
MANDIR=/usr/man \
MAN_PREFIX=/usr \
BINDIR=/usr/games \
+ MKFONTDIR=/bin/true \
+ X11_FONTDIR=$PKG/usr/share/fonts/misc \
DESTDIR=$PKG \
$1
}
# No autodetection for libmodplug or SDL2_mixer, help it out.
-maintarg="nosound"
-pkg-config --exists libmodplug && maintarg="$PRGNAM"
+maintarg="nosound"; MP=no
+if pkg-config --exists libmodplug; then
+ maintarg="$PRGNAM"
+ MP=yes
+fi
+# on post-14.2 -current and 15.0, sdl2 is part of a full install:
pkg-config --exists sdl2 SDL2_mixer && extra="clean sdl install_sdl"
sed -i "s,-O3.*,$SLKCFLAGS," Makefile
@@ -125,6 +117,17 @@ for target in $maintarg install clean dumb install_dumb $extra; do
run_make $target
done
+# I have no idea why anyone would want this, but in case they do:
+XF=no
+if [ "${XFROTZ:-no}" = "yes" ]; then
+ XF=yes
+ run_make clean
+ run_make x11
+ run_make install_x11
+ mv $PKG/usr/bin/xfrotz $PKG/usr/games
+ rmdir $PKG/usr/bin
+fi
+
strip $PKG/usr/games/*
gzip -9 $PKG/usr/man/man?/*.*
@@ -133,7 +136,14 @@ gzip -9 $PKG/usr/man/man?/*.*
mkdir -p $PKG/usr/share/applications \
$PKG/usr/share/pixmaps \
$PKG/usr/share/icons/hicolor/32x32/apps
-install -m0644 -oroot -groot $CWD/*.desktop $PKG/usr/share/applications
+
+for i in $PKG/usr/games/*; do
+ bin="$( basename $i )"
+ if [ -e $CWD/$bin.desktop ]; then
+ install -m0644 -oroot -groot $CWD/$bin.desktop $PKG/usr/share/applications
+ fi
+done
+
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
ln -s ../../../../pixmaps/$PRGNAM.png \
$PKG/usr/share/icons/hicolor/32x32/apps/$PRGNAM.png
@@ -155,7 +165,9 @@ cp -a AUTHORS CO* ChangeLog DUMB HOW_TO_PLAY README* TODO *.lsm \
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
+sed -e "s,@MP@,$MP," \
+ -e "s,@XF@,$XF," \
+ $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
diff --git a/games/frotz/frotz.info b/games/frotz/frotz.info
index 3c08902a6b2b2..bb6a954721582 100644
--- a/games/frotz/frotz.info
+++ b/games/frotz/frotz.info
@@ -1,8 +1,8 @@
PRGNAM="frotz"
-VERSION="2.52"
+VERSION="2.53"
HOMEPAGE="https://davidgriffith.gitlab.io/frotz/"
-DOWNLOAD="https://gitlab.com/DavidGriffith/frotz/-/archive/2.52/frotz-2.52.tar.bz2"
-MD5SUM="99aeba254257d0ceb2b6bf51650b9d2a"
+DOWNLOAD="https://gitlab.com/DavidGriffith/frotz/-/archive/2.53/frotz-2.53.tar.bz2"
+MD5SUM="02c61ce6de7cd8635f99cb1bc17971e8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/games/frotz/sfrotz.memcorrupt.diff b/games/frotz/sfrotz.memcorrupt.diff
deleted file mode 100644
index a7d49a1ac70c5..0000000000000
--- a/games/frotz/sfrotz.memcorrupt.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -Naur -x '.*.swp' frotz-2.52/src/sdl/sf_util.c frotz-2.52.patched/src/sdl/sf_util.c
---- frotz-2.52/src/sdl/sf_util.c 2020-05-10 19:51:48.000000000 -0400
-+++ frotz-2.52.patched/src/sdl/sf_util.c 2020-12-16 18:33:26.144268039 -0500
-@@ -380,7 +380,6 @@
- static char *new_dirname(const char *path)
- {
- char *p = strdup(path), *p2 = strdup(dirname(p));
-- free(p);
- return p2;
- }
-
-@@ -392,7 +391,6 @@
- static char *new_basename(const char *path)
- {
- char *p = strdup(path), *p2 = strdup(basename(p));
-- free(p);
- return p2;
- }
-
diff --git a/games/frotz/slack-desc b/games/frotz/slack-desc
index 1dde07b4ecbb8..5c8781679c396 100644
--- a/games/frotz/slack-desc
+++ b/games/frotz/slack-desc
@@ -12,8 +12,8 @@ frotz: Frotz is an interpreter for Infocom games and other Z-machine games.
frotz: It complies with standard 1.0 of Graham Nelson's specification.
frotz: Games can be found at: http://www.ifarchive.org/
frotz:
-frotz:
-frotz:
-frotz:
+frotz: Build options:
+frotz: * curses frotz sound support: @MP@
+frotz: * xfrotz: @XF@
frotz:
frotz:
diff --git a/games/frotz/xfrotz.desktop b/games/frotz/xfrotz.desktop
new file mode 100644
index 0000000000000..9058d9b0ad3a6
--- /dev/null
+++ b/games/frotz/xfrotz.desktop
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Name=XFrotz
+GenericName=Z-Code Interpreter
+Comment=X11 Player for Interactive Fiction Games
+Exec=xfrotz %f
+Icon=frotz
+Terminal=false
+Type=Application
+Categories=Game;AdventureGame;
+MimeType=application/x-zmachine;
+NoDisplay=true
+Actions=Play;
+
+[Desktop Action Play]
+Name=Play
+Exec=xfrotz %f