diff options
Diffstat (limited to 'system/xtrs/xtrs.SlackBuild')
-rw-r--r-- | system/xtrs/xtrs.SlackBuild | 120 |
1 files changed, 74 insertions, 46 deletions
diff --git a/system/xtrs/xtrs.SlackBuild b/system/xtrs/xtrs.SlackBuild index 6d0f41246d..c0d9fb78d0 100644 --- a/system/xtrs/xtrs.SlackBuild +++ b/system/xtrs/xtrs.SlackBuild @@ -1,14 +1,33 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for xtrs - the X Windows TRS-80 emulator -# Written by Niels Horn <niels.horn@gmail.com> -# revision date 2010/07/17 +# Originally written by Niels Horn <email removed>. +# Highly modified and now maintained by B. Watson <urchlay@slackware.uk>. +# There was no license on the original version. Modified version is +# licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20230517 bkw: BUILD=4 +# - include patch from Jens Guenther (sdltrs upstream maintainer) to +# make the window close button work. + +# 20230418 bkw: BUILD=3 +# - new maintainer. +# - use ROMs from trs80-roms package by default. +# - binaries in /usr/games; man pages in section 6. +# - replace old 32x21 icon. +# - remove ROMs from package (they live in trs80-roms now). +# - include all the trs-80 native stuff in the doc dir, like +# sdltrs does. basically it's the same stuff, too. +# - link with libaoss, to get audio working. + +cd $(dirname $0) ; CWD=$(pwd) PRGNAM=xtrs VERSION=${VERSION:-4.9d} -BUILD=${BUILD:-2} +BUILD=${BUILD:-4} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -18,23 +37,23 @@ 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} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" - LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" - LIBDIRSUFFIX="" fi set -e @@ -46,48 +65,57 @@ cd $TMP tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION 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 {} \; - -# Make /usr/share/xtrs the default rom directory -patch -p1 < $CWD/default_rom_dir.patch - -# xtrs does not have a ./configure -make \ - DEBUG="$SLKCFLAGS" \ - PREFIX=/usr \ - MANDIR=/usr/man \ - APPDEFAULTS='-DAPPDEFAULTS=\"/etc/X11/app-defaults\"' - -mkdir -p $PKG/usr/bin $PKG/usr/man/man1 -make BINDIR=$PKG/usr/bin MANDIR=$PKG/usr/man install - -# Make a directory for the ROMs (not included), include fakerom.hex & xtrsrom4p.hex -mkdir -p $PKG/usr/share/xtrs -cp -a fakerom.hex xtrsrom4p.hex $PKG/usr/share/xtrs - -# Copy icon & desktop file to package -mkdir -p $PKG/usr/share/{applications,pixmaps} +# upstream permissions are wonky, do not revert to template. +find . -type f -a -exec chmod 644 {} + -o \ + -type d -a -exec chmod 755 {} + + +# 20230418 bkw: patch does all this: +# - use system-wide ROMs from trs80-roms package. +# - install binaries to /usr/games and man pages to section 6. +# - strip binaries. +# - use correct app-defaults dir. +patch -p1 < $CWD/sbo.diff + +# 20230517 bkw: Jens Guenther's "quick and dirty" patch to make the +# windowmanager's close button work. Many thanks! +patch -p1 < $CWD/window_close.diff + +# 20230418 bkw: the -laoss here allows xtrs to make sound via ALSA +# or PulseAudio (via /etc/asound.conf). +make DEBUG="$SLKCFLAGS" EXTRALIBS="-laoss" +mkdir -p $PKG/usr/games $PKG/usr/man/man6 +make BINDIR=$PKG/usr/games MANDIR=$PKG/usr/man install + +gzip -9 $PKG/usr/man/man*/* + +# 20230418 bkw: made this icon by combining the sdltrs icon +# and the X logo (tinted red). not beautiful, but distinctive. +for i in $CWD/icons/*.png; do + px="$( basename $i .png )" + size="${px}x${px}" + dir=$PKG/usr/share/icons/hicolor/$size/apps + mkdir -p $dir + cat $i > $dir/$PRGNAM.png +done + +mkdir -p $PKG/usr/share/pixmaps +ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png + +mkdir -p $PKG/usr/share/applications cat $CWD/xtrs.desktop > $PKG/usr/share/applications/xtrs.desktop -cp $CWD/xtrs-ico.png $PKG/usr/share/pixmaps - -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a ChangeLog README xtrsrom4p.README $PKG/usr/doc/$PRGNAM-$VERSION -find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \; -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +# 20230418 bkw: the .txt files are just rendered versions of the man +# pages (with ddoouubblleedd characters), do not package. +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC/utilities +cp -a ChangeLog README *.html $PKGDOC +cp -a *.ccc *.cmd *.tgz *.jcl *.bas *.z80 *.lst xtrsemt.h *.hex *.README \ + $PKGDOC/utilities +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install 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 |