aboutsummaryrefslogtreecommitdiff
path: root/games/xroar-roms/xroar-roms.SlackBuild
blob: 7bc0d9aac942a8c47da828a3bbe260d2eaaec834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash

# Slackware build script for xroar-roms

# Written by B. Watson (urchlay@slackware.uk)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# The list of ROMS is the intersection of the set of ROMs xroar loads
# by default, and the example commands in Readme.txt. Adding a ROM is
# as simple as adding it to the .info file, just make sure the download
# links line up with the md5sums.

# 20220315 bkw: BUILD=2, use symlinks for duplicate ROMs.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=xroar-roms
VERSION=${VERSION:-20180901}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
ARCH=noarch

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}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG/usr/share/xroar/roms $OUTPUT
cd $PKG/usr/share/xroar/roms

# DRY principle: I already listed all the files in the .info file, not
# duplicating the list here.
. $CWD/$PRGNAM.info

# These ROMs aren't zipped or anything, just stick them where they go.
for romfile in $DOWNLOAD; do
  romfile="$( basename $romfile )"
  cat "$CWD/$romfile" > "$romfile"
done

# 20220315 bkw: some of the ROMs were dupes. Instead of installing
# duplicate files, symlink them.
ln -s d200rom1.rom d64tano.rom
ln -s d200rom2.rom d64rom2.rom
ln -s d200rom2.rom d64tano2.rom

# Get rid of "-vo sdl" from example commands, as it no longer works in
# modern xroar.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
sed 's/-vo *sdl *//g' Readme.txt > $PKG/usr/doc/$PRGNAM-$VERSION/Readme.txt
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README_SBo.txt
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$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