diff options
Diffstat (limited to 'system/sdltrs')
-rw-r--r-- | system/sdltrs/README | 36 | ||||
-rw-r--r-- | system/sdltrs/doinst.sh | 5 | ||||
-rw-r--r-- | system/sdltrs/git2tarxz.sh | 48 | ||||
-rw-r--r-- | system/sdltrs/sdltrs.SlackBuild | 163 | ||||
-rw-r--r-- | system/sdltrs/sdltrs.desktop | 10 | ||||
-rw-r--r-- | system/sdltrs/sdltrs.info | 14 | ||||
-rw-r--r-- | system/sdltrs/sdltrs.png | bin | 362 -> 0 bytes | |||
-rw-r--r-- | system/sdltrs/slack-desc | 6 |
8 files changed, 206 insertions, 76 deletions
diff --git a/system/sdltrs/README b/system/sdltrs/README index bab7f5bafa..f3b219e8d0 100644 --- a/system/sdltrs/README +++ b/system/sdltrs/README @@ -1,8 +1,28 @@ -sdltrs is a Radio Shack TRS-80 Model I/III/4/4P emulator for Macintosh OSX, -Windows and Linux. It has been ported from the excellent X Window Unix -emulator xtrs. Instead of using the X-Window system for graphics, it uses -the portable SDL library. - -A simple sdltrs.desktop file is included that will start sdltrs with the -default options. Read the included documentation after installation for -more information. +sdltrs (Radio Shack TRS-80 Model I/III/4/4P Emulator) + +sdltrs is a Radio Shack TRS-80 Model I/III/4/4P emulator for Macintosh +OSX, Windows and Linux. It has been ported from the excellent X +Window Unix emulator xtrs. Instead of using the X-Window system for +graphics, it uses the portable SDL library. + +This build uses SDL-1.2, which is an older library that performs +better on older and lower-spec machine. If your computer was made +in the last 10 years or so, you probably should be using the SDL-2.0 +build, which is called sdl2trs. It's possible to install both sdltrs +and sdl2trs on the same system without conflict. + +Note: When you start up sdltrs for the first time, it attempts +to boot from floppy disk. If you didn't give either the "-disk0 +/path/to/image.dsk" or "-nofloppy" options on the command line, it +will "hang" with a black screen, because it's trying to boot from a +nonexistent floppy disc. To recover from this: + +- Hold down F10 (TRS-80 Reset) and press Escape (TRS-80 Break key) to + skip the disk boot and enter the ROM BASIC. + +- Press Alt+D to enter the emulator's disk menu, and from there, + either select a bootable disk image for drive 0, or disable the + floppy disk controller. Then press Shift-F10 to reboot the TRS-80. + +See the man page and the documentation at +/usr/doc/sdltrs-$VERSION/html/index.html for further details. diff --git a/system/sdltrs/doinst.sh b/system/sdltrs/doinst.sh index 4e8ba7071d..3e5691a052 100644 --- a/system/sdltrs/doinst.sh +++ b/system/sdltrs/doinst.sh @@ -2,3 +2,8 @@ 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/system/sdltrs/git2tarxz.sh b/system/sdltrs/git2tarxz.sh new file mode 100644 index 0000000000..e7a4f38c46 --- /dev/null +++ b/system/sdltrs/git2tarxz.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version +# number. + +# Note that this script doesn't need to be run as root. It does +# need to be able to write to the current directory it's run from. + +# Takes one optional argument, which is the commit or tag to create +# a tarball of. With no arg, HEAD is used. + +PRGNAM=sdltrs-sdl2 +CLONE_URL=https://gitlab.com/jengun/sdltrs/ + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +git checkout remotes/origin/sdl2 + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +VERTAG=$( git tag --sort=version:refname | tail -1 | sed 's,^v,,' ) + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERSION=${VERTAG}+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=$VERSION" diff --git a/system/sdltrs/sdltrs.SlackBuild b/system/sdltrs/sdltrs.SlackBuild index 0ce5123722..e04e9b64b3 100644 --- a/system/sdltrs/sdltrs.SlackBuild +++ b/system/sdltrs/sdltrs.SlackBuild @@ -1,9 +1,10 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for sdltrs: # the Radio Shack TRS-80 Model I/III/4/4p emulator # Copyright 2009-2010, 2012 Niels Horn, Rio de Janeiro, Brazil +# Copyright 2023, B. Watson # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,90 +24,156 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# revision date 2012/08/09 +# 20240311 bkw, BUILD=2: having heard from upstream... the proper SDL2 +# version of sdltrs is in the sdl2 branch on his gitlab. This branch +# (master) is the SDL-1.2 branch... though, confusingly, it does +# support SDL2 (not in the modern way though, using hardware assisted +# scaling and such). So. Modified the README to explain this, added +# -DSDL1=true to the meson options, and added a completely new sdl2trs +# build. +# Also, include diskimages/*.dsk in the package (should have been there +# all along, my bad). + +# 20240213 bkw: update for v1.2.28. + +# 20230524 bkw: previous update had wrong version number. use latest +# git (with fix for .desktop file), with correct tag. + +# 20230517 bkw: update for latest git, v1.2.9a+20230517_29980234, +# the sdl2 branch. This is done at the suggestion of the upstream +# maintainer, because the master branch doesn't support SDL2's +# hardware rendering and scaling. The binary changes names to +# sdl2trs, so there's symlinks to the old name for now. + +# 20230418 bkw: +# - new maintainer. +# - update for v1.2.27 (make => meson, for one thing). +# - patch to support system-wide ROM directory (which is shared +# with xtrs). +# - remove disk images from package (they're in trs80-roms now). +# - use upstream's icon and .desktop. +# - include man page in package. +# - new version defaults to enabling the floppy drive, which causes +# it to wait for a disk boot. add a README note explaining the +# situation. + +# 20230418 bkw: Note: the default build is for SDL 2. It's still +# possible to build with SDL 1, but I haven't bothered adding an +# option for that. If you *really* need SDL 1 for some reason, let +# me know. + +cd $(dirname $0) ; CWD=$(pwd) PRGNAM=sdltrs -VERSION=${VERSION:-1.1.0} -BUILD=${BUILD:-3} +VERSION=${VERSION:-1.2.28} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi -SRCVERSION=$(echo $VERSION | tr . _) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi -CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" - ARCHQUADLET="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" - ARCHQUADLET="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" - ARCHQUADLET="" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" - ARCHQUADLET="" fi set -e -rm -rf $TMP/${PRGNAM}_$SRCVERSION $PKG +rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT +rm -rf $TMP/$PRGNAM-$VERSION cd $TMP -tar xvf $CWD/${PRGNAM}_$SRCVERSION.tar.gz -cd ${PRGNAM}_$SRCVERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 --exclude='*/bin/*' # debs/exes +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 {} \; - -# include -lX11 in the Makefile (sw-14.0) -sed "/^LIBS/s/= /= -lX11 /" -i src/linux/Makefile - -# the Makefile is in the src/linux directory -make INCS="$SLKCFLAGS" -C src/linux - -# sdltrs does not have a "make install" option, so we'll do it manually -mkdir -p $PKG/usr/bin -cp -a src/linux/sdltrs $PKG/usr/bin -strip --strip-unneeded $PKG/usr/bin/sdltrs - -# Copy icon & desktop file to package -mkdir -p $PKG/usr/share/{applications,pixmaps} -cat $CWD/sdltrs.desktop > $PKG/usr/share/applications/sdltrs.desktop -cat $CWD/sdltrs.png > $PKG/usr/share/pixmaps/sdltrs.png - -# Make a directory for the ROMs (not included) and copy included images -mkdir -p $PKG/usr/share/sdltrs -cp -a diskimages/* $PKG/usr/share/sdltrs - -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html -cp -a BUILDING README $PKG/usr/doc/$PRGNAM-$VERSION -cp -a docs/* $PKG/usr/doc/$PRGNAM-$VERSION/html/ -find $PKG/usr/doc/$PRGNAM-$VERSION/ -type f -exec chmod 644 {} \; +# upstream permissions are wonky, do not revert to template. +find . -type f -a -exec chmod 644 {} + -o \ + -type d -a -exec chmod 755 {} + + +# 20230417 bkw: Look in system-wide ROM directory by default. +sed -i '/strcpy(romfile/s, ", "/usr/share/trs80-roms/,' src/trs_sdl_interface.c + +mkdir build +cd build + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + meson .. \ + -DSDL1=true \ + --buildtype=release \ + --infodir=/usr/info \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --mandir=/usr/man \ + --prefix=/usr \ + --sysconfdir=/etc \ + -Dstrip=true + "${NINJA:=ninja}" -v + install -D -m0755 -s $PRGNAM $PKG/usr/games/$PRGNAM +cd .. + +# 20230418 bkw: use upstream's man page, but section 6. +mkdir -p $PKG/usr/man/man6 +sed -e '/^\.TH/s, 1 , 6 ,' \ + -e '/^\.TH/s,$, SlackBuilds.org,' \ + src/$PRGNAM.1 \ + | gzip -9c > $PKG/usr/man/man6/$PRGNAM.6.gz + +sed -i -e 's,^Exec=,&/usr/games/,' $PRGNAM.desktop +install -D -m0644 $PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop + +# 20230418 bkw: use upstream's icon, but pre-resized. +HICOLOR=$PKG/usr/share/icons/hicolor +SVGICON=icons/$PRGNAM.svg + +for px in 16 22 32 48 64 96 128; do + size=${px}x${px} + dir=$HICOLOR/$size/apps + mkdir -p $dir + rsvg-convert -w $px -h $px -o $dir/$PRGNAM.png $SVGICON +done + +mkdir -p $HICOLOR/scalable/apps +cp -a $SVGICON $HICOLOR/scalable/apps/$PRGNAM.svg + +mkdir -p $PKG/usr/share/pixmaps +ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png + +# Include the disk images upstream ships. +mkdir -p $PKG/usr/share/$PRGNAM +cp -a diskimages/*.dsk $PKG/usr/share/$PRGNAM + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a CHANGELOG.md README.md *LICENSE utilities html $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -chmod 755 $PKG/usr/doc/$PRGNAM-$VERSION/html/images/ 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 diff --git a/system/sdltrs/sdltrs.desktop b/system/sdltrs/sdltrs.desktop deleted file mode 100644 index cb4197b28f..0000000000 --- a/system/sdltrs/sdltrs.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=sdltrs -Comment=Emulator for TRS-80 -Categories=System; -Exec=sdltrs -Icon=sdltrs -Terminal=false -StartupNotify=false diff --git a/system/sdltrs/sdltrs.info b/system/sdltrs/sdltrs.info index 9533a9570a..7308a23dbd 100644 --- a/system/sdltrs/sdltrs.info +++ b/system/sdltrs/sdltrs.info @@ -1,10 +1,10 @@ PRGNAM="sdltrs" -VERSION="1.1.0" -HOMEPAGE="http://sdltrs.sourceforge.net" -DOWNLOAD="http://downloads.sourceforge.net/sdltrs/sdltrs_1_1_0.tar.gz" -MD5SUM="528ef3a6b491ce7858c2d24341494a40" +VERSION="1.2.28" +HOMEPAGE="https://gitlab.com/jengun/sdltrs/" +DOWNLOAD="https://gitlab.com/jengun/sdltrs/-/archive/1.2.28/sdltrs-1.2.28.tar.bz2" +MD5SUM="1ae7542c28d9b63fcb723ba95d23e443" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="" -MAINTAINER="Niels Horn" -EMAIL="niels.horn@gmail.com" +REQUIRES="trs80-roms" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/sdltrs/sdltrs.png b/system/sdltrs/sdltrs.png Binary files differdeleted file mode 100644 index 6f28450c52..0000000000 --- a/system/sdltrs/sdltrs.png +++ /dev/null diff --git a/system/sdltrs/slack-desc b/system/sdltrs/slack-desc index 51f059c873..a8cb6ad9e0 100644 --- a/system/sdltrs/slack-desc +++ b/system/sdltrs/slack-desc @@ -9,11 +9,11 @@ sdltrs: sdltrs (Radio Shack TRS-80 Model I/III/4/4P Emulator) sdltrs: sdltrs: sdltrs is a Radio Shack TRS-80 Model I/III/4/4P emulator for -sdltrs: Macintosh OSX, Windows and Linux. It has been ported from the -sdltrs: excellent X-Windows Unix emulator xtrs. Instead of using the +sdltrs: Macintosh OSX, Windows and Linux. It has been ported from the +sdltrs: excellent X-Windows Unix emulator xtrs. Instead of using the sdltrs: X-Window system for graphics, it uses the portable SDL library. sdltrs: -sdltrs: http://sdltrs.sourceforge.net/ +sdltrs: sdltrs: sdltrs: sdltrs: |