SlackBuildsOrg/audio/jamulus/jamulus.SlackBuild
Willy Sudiarto Raharjo 1648752ee8
audio/jamulus: Switch to Qt5.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2021-10-24 09:56:56 +07:00

135 lines
3.5 KiB
Bash

#!/bin/bash
# Slackware build script for jamulus
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# Possible TODOs:
# - write a man page
# - have slack-desc show whether or not SERVERONLY=yes
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=jamulus
VERSION=${VERSION:-3.4.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
# I hate capitalized package names, so:
SRCNAM=Jamulus
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
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
# Check this before doing anything else.
if [ "${SERVERONLY:-no}" = "yes" ]; then
EXTRACONF="CONFIG+=nosound"
elif ! pkg-config --exists jack; then
cat <<EOF
***********************************************************************
$0: jack not found.
If you want $PRGNAM to be able to make sound, you must install
jack before running this script.
If you want to build a dedicated server, you don't have to install
jack. Instead, export SERVERONLY=yes in the environment. See SERVER.txt
for details.
***********************************************************************
EOF
sleep 5
exit 1
fi
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM$VERSION
chown -R root:root .
# permissions are gross, nonstandard find needed here:
find -L . -type d -a -exec chmod 755 {} \+ -o \
-type f -a \! -perm 644 -a -exec chmod 644 {} \+
qmake-qt5 "CONFIG+=noupcasename" $EXTRACONF \
QMAKE_CFLAGS="$SLKCFLAGS" QMAKE_CXXFLAGS="$SLKCFLAGS" \
$SRCNAM.pro
make clean
make
# No 'make install' target, so:
mkdir -p $PKG/usr/bin $PKG/usr/share/applications $PKG/usr/share/pixmaps
install -s -m0755 $PRGNAM $PKG/usr/bin/
install -m0644 src/res/$PRGNAM.desktop $PKG/usr/share/applications/
# The png icons provided are tiny, but the OSX icon is big enough
# to actually see, so I extracted the 256x256 version & include
# it with the build.
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
# NEWS is a 0-byte placeholder in 3.4.3.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# Include our own (hopefully) helpful hints for servers.
cat $CWD/SERVER.txt > $PKG/usr/doc/$PRGNAM-$VERSION/SERVER.txt
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
# Only add capability stuff if not disabled:
if [ "${SERVERONLY:-no}" != "yes" ]; then
if [ "${SETCAP:-yes}" = "yes" ]; then
cat $CWD/setcap.sh >> $PKG/install/doinst.sh
# Only allow execution by audio group
chown root:audio $PKG/usr/bin/$PRGNAM
chmod 0750 $PKG/usr/bin/$PRGNAM
fi
fi
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE