summaryrefslogtreecommitdiffstats
path: root/development/inform/inform.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/inform/inform.SlackBuild')
-rw-r--r--development/inform/inform.SlackBuild149
1 files changed, 114 insertions, 35 deletions
diff --git a/development/inform/inform.SlackBuild b/development/inform/inform.SlackBuild
index 7879eddc00..0e5e1a7083 100644
--- a/development/inform/inform.SlackBuild
+++ b/development/inform/inform.SlackBuild
@@ -1,11 +1,26 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for inform
-# 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.
+# 20230118 bkw: updated for v6.41_r2.
+# - add the Inform 6 Addendum to the package.
+# - destdir.diff had to change, can't build previous version any more.
+# - symlink library demos and tutorial to doc dir.
+
+# 20210831 bkw:
+# - updated for v6.35_r2 (upstream changed their version numbering
+# scheme again). script had to change a lot, so can't build old
+# versions any more.
+
+# 20201104 bkw: updated for 6.34_6.12.4. In case anyone's wondering
+# why I use a self-hosted URL for the source, it's because upstream
+# moves the old source immediately when a new release is made. Also
+# moved the binary to /usr/games and the man page to section 6.
+
# 20191216 bkw: updated for 6.34_6.12.2. The secondary version number
# is the inform6 library version. This script can no longer build the
# old 6.32.1 version, but it should be fine for future releases.
@@ -16,10 +31,13 @@
# needs any of these old includes, please let me know. If there's enough
# demand, I'll dig up the old includes and re-add them to the package.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=inform
-VERSION=${VERSION:-6.34_6.12.2}
+VERSION=${VERSION:-6.41_r2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -29,7 +47,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}
@@ -52,8 +74,9 @@ set -e
MANVER="${MANVER:-4}"
MANUAL=designers_manual_${MANVER}.zip
-TARVER="${VERSION/_/-}"
-DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION
+TARVER="${VERSION//_/-}"
+DOCDIR=/usr/doc/$PRGNAM-$VERSION
+PKGDOC=$PKG/$DOCDIR
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
@@ -65,37 +88,77 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
-# Upstream got rid of autotools, which I consider a step in the right
-# direction... but they also got rid of DESTDIR support.
+# 20201104 bkw: Since inform is for game purposes, install the binary
+# to /usr/games, and its man page to section 6. Also change the
+# "see also" to a man page that actually might exist.
+sed -e '1s/"1"/"6"/' -e "s,zcode-interpreter,frotz," $PRGNAM.1 > $PRGNAM.6
-make OPTS="$SLKCFLAGS" \
- PREFIX=/usr \
+# 20201104 bkw: upstream now supports DESTDIR again.
+# 20210831 bkw: upstream *broke* DESTDIR again. Sigh.
+patch -p1 < $CWD/destdir.diff
-make install-strip \
- PREFIX=$PKG/usr \
+# 20210831 bkw: install-strip failed with "text file busy" on -current,
+# use -Wl,-s to build the binary stripped in the first place.
+
+make install \
+ OPTS="$SLKCFLAGS" \
+ LDFLAGS="-Wl,-s" \
+ BINDIR=/usr/games \
+ MANDIR=/usr/man/man6 \
+ MANPAGE=$PRGNAM.6 \
+ PREFIX=/usr \
TUTORDIR=$DOCDIR/tutor \
- DEMODIR=$DOCDIR/demos
-
-gzip $PKG/usr/man/man1/*.1
-
-# Inform started life (and is still used primarily) on OSes with
-# case-insensitive filenames. The library include files are
-# duplicated here, with e.g. 3 identical files called verblib.h,
-# Verblib.h, VerbLib.h. Clean up the mess.
-( cd $PKG/usr/share/$PRGNAM/lib
- for upper in [A-Z]*.h; do
- lower="$( echo $upper | tr A-Z a-z )"
- if [ -e "$lower" ]; then
- rm -f "$upper"
- ln -s "$lower" "$upper"
- fi
+ DEMODIR=$DOCDIR/demos \
+ DESTDIR=$PKG
+
+gzip $PKG/usr/man/man?/*.?
+
+# 20201104 bkw: the binary got moved, be kind and provide a symlink
+mkdir -p $PKG/usr/bin
+ln -s ../games/$PRGNAM $PKG/usr/bin/$PRGNAM
+
+# Inform started life (and is still used primarily) on OSes
+# with case-insensitive filenames, meaning that a lot of inform
+# source refers to e.g. VerbLib or even VERBLIB (with or without
+# the .h at the end, which could also be capitalized as .H). The
+# Makefile can create a few symlinks to support this, but let's
+# be more all-inclusive. We got 8 .h files, and end up with 70+
+# symlinks. There's no kill like overkill!
+( cd $PKG/usr/share/$PRGNAM/std/lib
+ for file in *.h; do
+ name=${file%%.*}
+ # Name.h NAME.h
+ for link in ${name^}.h ${name^^}.h; do
+ ln -sf $file $link
+ done
+ done
+
+ # MixedCase isn't standardized, these are guesses. Some are pretty
+ # unlikely, but they don't cost much. Better to have and not need,
+ # than to need and not have.
+ for link in VerbLib VerbLIB verbLib verbLIB \
+ InFix InFIX inFix inFIX \
+ InfGlk InfGLK infGlk infGLK \
+ LinkLpa LinkLPA linkLpa linkLPA
+ do
+ ln -sf ${link,,}.h $link.h
+ done
+
+ # Any of the above might appear with .H. Use readlink so all the
+ # variant names link to the real file (no symlinks to symlinks).
+ # This might be overcautious: the example code all just says
+ # e.g. 'Include "Parser"', without the .h.
+ for file in *.h; do
+ dest="${file%%.*}.H"
+ [ -L "$file" ] && file="$( readlink $file )"
+ ln -sf $file $dest
done
)
# Upstream removed the manual for licensing reasons. It belongs in the
# binary package IMO.
-mkdir -p $DOCDIR/manual
-( cd $DOCDIR/manual
+mkdir -p $PKGDOC/manual
+( cd $PKGDOC/manual
unzip $CWD/$MANUAL
# manual has no subdirs
chmod 644 *
@@ -103,20 +166,36 @@ mkdir -p $DOCDIR/manual
)
# Inform Beginners' Guide, required reading.
-cat $CWD/IBG.pdf > $DOCDIR/inform_beginners_guide.pdf
+cat $CWD/IBG.pdf > $PKGDOC/inform_beginners_guide.pdf
+ln -s inform_beginners_guide.pdf $PKGDOC/IBG.pdf
-mkdir -p $DOCDIR/lib
+# Also the addendum to the manual, because the manual's a bit dated.
+cat $CWD/I6-Addendum.html > $PKGDOC/inform_6_addendum.html
+ln -s inform_6_addendum.html $PKGDOC/I6-Addendum.html
+
+# Library documentation should be visibile in /usr/doc.
+mkdir -p $PKGDOC/lib
for i in ChangeLog README.txt voices_and_tenses.txt; do
- ln -s ../../../share/$PRGNAM/lib/$i $DOCDIR/lib
+ ln -s ../../../share/$PRGNAM/std/lib/$i $PKGDOC/lib
+done
+
+# 20230118 bkw: Demos and tutorial will be easier to find if they're
+# visible from the doc dir.
+ln -s ../../share/inform/std/{demos,tutor} $PKGDOC
+
+# Same for punyinform docs.
+mkdir -p $PKGDOC/punyinform
+for i in README.md LICENSE documentation; do
+ ln -s ../../../share/$PRGNAM/punyinform/$i $PKGDOC/punyinform
done
# ARTISTIC and COPYING are redundant: src/licence.txt includes the
# full text of both.
-cp -a AUTHORS NEWS README* src/*.txt src/*.html docs/* $DOCDIR
-cat $CWD/$PRGNAM.SlackBuild > $DOCDIR/$PRGNAM.SlackBuild
+cp -a AUTHORS NEWS README* src/*.txt src/*.html docs/* $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
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