2010-05-12 23:29:22 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for hatari
|
2012-12-21 22:16:35 +01:00
|
|
|
|
2010-05-12 23:29:22 +02:00
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
2012-12-21 22:16:35 +01:00
|
|
|
# Licensed under the WTFPL. See http://sam.zoy.org/wtfpl/ for details.
|
|
|
|
|
2016-07-31 00:06:51 +02:00
|
|
|
# 20160730 bkw:
|
|
|
|
# - updated for v1.9.0.
|
|
|
|
# - install some missing docs, including the French man page.
|
|
|
|
# - get rid of empty & useless /etc/hatari/ in package. strace
|
|
|
|
# shows that hatari never even looks there for a conf file,
|
|
|
|
# it looks for /etc/hatari.cfg (which we don't ship).
|
|
|
|
|
2014-10-30 15:01:37 +01:00
|
|
|
# 20141029 bkw: add missing : in VERSION BUILD TAG assignments
|
|
|
|
|
2014-08-26 12:19:19 +02:00
|
|
|
# 20140825 bkw:
|
|
|
|
# - updated for v1.8.0
|
|
|
|
# - install docs/manpages to right places, instead of moving after the fact
|
|
|
|
# - get rid of the need for a symlink /usr/doc/hatari
|
|
|
|
# - only symlink emutos.img -> tos.img if no link already exists, so
|
|
|
|
# reinstalling the package won't reset the default ROM.
|
|
|
|
# - add mime type and auto-associate ST disk images and executables.
|
|
|
|
|
2010-05-12 23:29:22 +02:00
|
|
|
PRGNAM=hatari
|
2016-07-31 00:06:51 +02:00
|
|
|
VERSION=${VERSION:-1.9.0}
|
2014-10-30 15:01:37 +01:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-12 23:29:22 +02:00
|
|
|
|
2012-09-29 23:29:26 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-07-31 00:06:51 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2012-09-29 23:29:26 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-12 23:29:22 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-07-31 00:06:51 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-12 23:29:22 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2012-12-21 22:16:35 +01:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
2010-05-12 23:29:22 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG $TMP/$PRGNAM-$VERSION
|
|
|
|
|
|
|
|
cd $TMP
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
|
|
|
|
cd $PRGNAM-$VERSION
|
2014-08-26 12:19:19 +02:00
|
|
|
|
|
|
|
# configure script is really a wrapper for cmake, doesn't support
|
|
|
|
# --libdir, --mandir, --docdir. cheat a little.
|
|
|
|
sed -i \
|
|
|
|
-e 's,share/man/man1,man/man1,' \
|
|
|
|
-e "s,share/doc/$PRGNAM,doc/$PRGNAM-$VERSION," \
|
|
|
|
CMakeLists.txt
|
|
|
|
|
2016-07-31 00:06:51 +02:00
|
|
|
# Hard-code the doc path in the UI (we don't use /usr/share/doc/hatari)
|
2014-08-26 12:19:19 +02:00
|
|
|
sed -i \
|
|
|
|
-e "/path *= *path *+/s,=.*,= \"/usr/doc/$PRGNAM-$VERSION/\"," \
|
|
|
|
python-ui/uihelpers.py
|
|
|
|
|
2011-06-18 07:08:40 +02:00
|
|
|
./configure --prefix=/usr
|
2010-05-13 00:26:28 +02:00
|
|
|
|
2010-05-12 23:29:22 +02:00
|
|
|
make
|
2011-06-18 07:08:40 +02:00
|
|
|
make install/strip DESTDIR=$PKG
|
|
|
|
|
2012-12-21 22:16:35 +01:00
|
|
|
DOCDIR=$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $DOCDIR/$PRGNAM.SlackBuild
|
2010-05-12 23:29:22 +02:00
|
|
|
|
2016-07-31 00:06:51 +02:00
|
|
|
# These docs don't get installed for some reason:
|
|
|
|
cp tools/hmsa/readme-hmsa.txt readme.txt gpl.txt \
|
|
|
|
doc/changelog.txt doc/coding.txt doc/toc.js doc/video-recording.txt \
|
|
|
|
$DOCDIR
|
|
|
|
|
|
|
|
# The UI has its own docs:
|
|
|
|
UIDOCDIR=$DOCDIR/${PRGNAM}ui
|
|
|
|
mkdir -p $UIDOCDIR
|
|
|
|
for i in README TODO release-notes.txt; do
|
|
|
|
ln -s ../../../share/$PRGNAM/${PRGNAM}ui/$i $UIDOCDIR/$i
|
|
|
|
done
|
|
|
|
|
|
|
|
# Someone might find the French man page useful:
|
|
|
|
mkdir -p $PKG/usr/man/fr/man1
|
|
|
|
gzip -9c < doc/fr/$PRGNAM.1 > $PKG/usr/man/fr/man1/$PRGNAM.1.gz
|
2012-12-21 22:16:35 +01:00
|
|
|
|
2014-08-26 12:19:19 +02:00
|
|
|
# Replace .desktop with modified one, auto-associates ST disks/executables.
|
|
|
|
cat $CWD/${PRGNAM}ui.desktop > $PKG/usr/share/applications/${PRGNAM}ui.desktop
|
|
|
|
|
|
|
|
# Custom MIME types for ST disk images and executables, by script author.
|
|
|
|
mkdir -p $PKG/usr/share/mime/packages
|
|
|
|
cat $CWD/$PRGNAM.xml > $PKG/usr/share/mime/packages/$PRGNAM.xml
|
2010-05-12 23:29:22 +02:00
|
|
|
|
2014-08-26 12:19:19 +02:00
|
|
|
# Don't symlink emutos to tos here, do it conditionally in doinst.sh.
|
|
|
|
( cd $PKG/usr/share/$PRGNAM && mv tos.img emutos.img )
|
2010-05-12 23:29:22 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2012-09-29 23:29:26 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-12 23:29:22 +02:00
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:26:28 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|