summaryrefslogtreecommitdiff
path: root/system/atari800/atari800.SlackBuild
blob: 0ef81eebc0cb8969427663792b3a9cdc2bed57c2 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/sh

# Slackware build script for atari800

# Written by B. Watson (yalhcru@gmail.com)
# Modified by the SlackBuilds.org project.

PRGNAM=atari800
VERSION=${VERSION:-2.1.0}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

# Do you want the emulated serial port to listen on a TCP port?
# This is enabled by default, build with RIO_DEVICE=no to disable.
RIO_DEVICE=${RIO_DEVICE:-yes}

# Do you want the package to automatically associate itself with
# the various Atari 8-bit file formats (disk/cart/tape images)?
# Build with MIME_TYPES=no to disable
MIME_TYPES=${MIME_TYPES:-yes}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .

if [ "$RIO_DEVICE" = "yes" ]; then
	RIO="--enable-riodevice";
else
	RIO="--disable-riodevice";
fi

cd src
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
	./configure \
	--target=sdl \
	--prefix=/usr \
	--enable-monitorprofile \
	--enable-seriosound \
	--enable-clipsound \
	--enable-readline \
	$RIO \
	--enable-monitorbreakpoints \
	--enable-monitortrace

make

# The Makefile ignores --datarootdir, --mandir, --docdir, so force it:
make install DESTDIR=$PKG \
	DOC_DIR=/usr/doc/$PRGNAM-$VERSION MAN_DIR=/usr/man/man1

chmod 755 $PKG/usr/bin/*
strip $PKG/usr/bin/$PRGNAM

gzip -9 $PKG/usr/man/man1/$PRGNAM.1

# Package-specific docs
for i in README_rom_images.txt $PRGNAM.SlackBuild; do
	cat $CWD/$i > $PKG/usr/doc/$PRGNAM-$VERSION/$i
done

cat $CWD/README_SBo.txt > $PKG/usr/doc/$PRGNAM-$VERSION/README_SBo.txt

# Sample code and contrib stuff, throw it in the doc dir
cp -r ../act ../util $PKG/usr/doc/$PRGNAM-$VERSION

# Link a copy of the ROM doc to the ROM dir (we really want them to read this)
mkdir -p $PKG/usr/share/$PRGNAM
( cd $PKG/usr/share/$PRGNAM && \
  ln -s ../../doc/$PRGNAM-$VERSION/README_rom_images.txt . )

mkdir -p $PKG/usr/share/{applications,pixmaps}
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
cp $CWD/pixmaps/* $PKG/usr/share/pixmaps/

# All these .desktop, XML, and icon files are extras, not part of the
# atari800 release. They've been submitted to the atari800 mailing list,
# but have not yet been imported into the tree.
if [ "$MIME_TYPES" = "yes" ]; then

	mkdir -p $PKG/usr/share/{mime/packages,mimelnk/application}
	cat $CWD/mime/$PRGNAM.xml > $PKG/usr/share/mime/packages/$PRGNAM.xml
	cp $CWD/mime/*.desktop $PKG/usr/share/mimelnk/application/

	# Add the MimeType stuff to the .desktop file
	cat $CWD/mime/atari800_desktop_mime >> $PKG/usr/share/applications/$PRGNAM.desktop

fi

# Optional binfmt_misc support script (admin must enable by hand)
mkdir -p $PKG/etc/rc.d
cat $CWD/rc.atari800_binfmt_misc.new \
	> $PKG/etc/rc.d/rc.atari800_binfmt_misc.new

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 y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz