2013-11-23 15:18:36 +01:00
|
|
|
#!/bin/sh
|
2011-06-20 22:51:19 +02:00
|
|
|
|
2012-12-16 21:27:30 +01:00
|
|
|
# Slackware build script for guitarix
|
2011-06-20 22:51:19 +02:00
|
|
|
# Written by Michales Michaloudes korgie@gmail.com
|
|
|
|
|
2012-12-16 21:27:30 +01:00
|
|
|
# Modified by B. Watson <yalhcru@gmail.com>:
|
|
|
|
# - Upgraded to guitarix2
|
|
|
|
# - Added man page
|
|
|
|
# - Added realtime capabilities
|
|
|
|
# - Make .desktop file validate
|
|
|
|
# - Add guitarix's README to /usr/doc
|
|
|
|
|
2013-05-18 13:21:49 +02:00
|
|
|
# 20130430 bkw:
|
|
|
|
# - Updated for 0.27.1
|
|
|
|
# - Replaced slack-desc with updated text from guitarix site
|
|
|
|
# - Added LV2 option
|
|
|
|
|
2015-05-16 00:47:18 +02:00
|
|
|
# 20150514 bkw:
|
|
|
|
# - Updated for 0.32.3
|
|
|
|
# - Fix some issues with the shared libs: they were being installed
|
|
|
|
# to /usr/lib/ on 64-bit, and they were missing the +x bits.
|
|
|
|
# - Made LV2 option default to yes, since upstream is requiring lilv
|
|
|
|
# even if --no-lv2 is used. Also, the lv2 plugins were being
|
|
|
|
# installed to /usr/lib/ on 64-bit. Grr.
|
|
|
|
# - Upstream wants avahi by default. For now, hardcoded --no-avahi.
|
|
|
|
|
2015-11-09 03:43:33 +01:00
|
|
|
# 20151108 bkw:
|
|
|
|
# - Updated for 0.34.0
|
|
|
|
# - Added --disable-cxx11 to ./waf flags, as bluetooth.h uses the gcc
|
|
|
|
# typeof() extension. Not sure if newer versions of bluez would have
|
|
|
|
# this issue (but Slackware 14.1's bluez is pretty old by now).
|
|
|
|
# - Added patch from upstream git to allow building without webkitgtk.
|
|
|
|
# The author added support for downloading presets, but didn't make
|
|
|
|
# it optional in 0.34.0. Also added a couple of bugfix patches.
|
|
|
|
# - Support building 0.33.0 with VERSION=0.33.0 in the env.
|
|
|
|
# - Add SSE=no option.
|
|
|
|
# - Add WEBKIT=no option.
|
|
|
|
# - Remove LV2=no option from README (but not from script).
|
|
|
|
|
2013-05-18 13:21:49 +02:00
|
|
|
# Modified version released under the WTFPL, for details see
|
|
|
|
# http://www.wtfpl.net/txt/copying/
|
|
|
|
|
2011-06-20 22:51:19 +02:00
|
|
|
PRGNAM=guitarix
|
2015-11-09 03:43:33 +01:00
|
|
|
VERSION=${VERSION:-0.34.0}
|
2012-12-16 21:27:30 +01:00
|
|
|
BUILD=${BUILD:-1}
|
2011-06-20 22:51:19 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
2013-11-22 08:34:22 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2011-06-20 22:51:19 +02:00
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -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
|
|
|
|
|
2012-12-16 21:27:30 +01:00
|
|
|
# Tarballs are now named "guitarix2-$VERSION", but the dir inside the
|
|
|
|
# tarball is still "guitarix-$VERSION".
|
|
|
|
TARNAME=${PRGNAM}2
|
|
|
|
|
2011-06-20 22:51:19 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2012-12-16 21:27:30 +01:00
|
|
|
tar xvf $CWD/$TARNAME-$VERSION.tar.bz2
|
2011-06-20 22:51:19 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2011-06-20 22:51:19 +02:00
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
|
2012-12-16 21:27:30 +01:00
|
|
|
# Confusing freedesktop.org standard is confusing.
|
|
|
|
# To pass desktop-file-validate, we need both Audio and AudioVideo, even
|
|
|
|
# though the wording of the error message is 'requires another category to
|
|
|
|
# be present among', implying we should only need Audio *or* AudioVideo.
|
|
|
|
sed -i '/^Categories/s,$,Audio;,;' $PRGNAM.desktop.in
|
|
|
|
|
2015-11-09 03:43:33 +01:00
|
|
|
# this is no longer documented in README, but still here for debugging.
|
2015-05-16 00:47:18 +02:00
|
|
|
if [ "${LV2:-yes}" = "no" ]; then
|
|
|
|
LV2OPT=--no-lv2
|
2013-05-18 13:21:49 +02:00
|
|
|
fi
|
|
|
|
|
2015-11-09 03:43:33 +01:00
|
|
|
# 20151109 bkw: in case anyone needs guitarix-0.33.0:
|
|
|
|
# Starting with 0.34.0, the default is to pass -std=c++11 to gcc, which
|
|
|
|
# causes Slack 14.1's old bluetooth.h to fail (it uses gcc extensions).
|
|
|
|
# Before 0.34.0, this option's not needed... and will cause an error if
|
|
|
|
# it's present. Also, our patches are for 0.34.0 and won't apply to
|
|
|
|
# 0.33.0. So:
|
|
|
|
if ./waf --help | grep -q -- --disable-cxx11; then
|
|
|
|
EXTRAOPT="--disable-cxx11"
|
|
|
|
PATCH=${PATCH:-yes}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# patches are optional (undocumented in README, on purpose)
|
|
|
|
if [ "${PATCH:-no}" = "yes" ]; then
|
|
|
|
for patch in $CWD/patches/*.patch; do
|
|
|
|
patch -p2 < "$patch"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# allow building non-SSE package on SSE host
|
|
|
|
[ "${SSE:-yes}" = "no" ] && EXTRAOPT="$EXTRAOPT --disable-sse"
|
|
|
|
|
|
|
|
# allow disabling webkitgtk. A bit of a dirty hack.
|
|
|
|
[ "${WEBKIT:-yes}" = "no" ] && \
|
|
|
|
sed -i 's,webkit-1.0,webkit-DISABLED,' wscript
|
|
|
|
|
2015-05-16 00:47:18 +02:00
|
|
|
LIBDIR="/usr/lib${LIBDIRSUFFIX}"
|
2011-06-20 22:51:19 +02:00
|
|
|
./waf configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--cxxflags-release="$SLKCFLAGS" \
|
2015-05-16 00:47:18 +02:00
|
|
|
--ladspadir="$LIBDIR/ladspa/" \
|
|
|
|
--lv2dir="$LIBDIR/lv2/" \
|
|
|
|
--libdir="$LIBDIR" \
|
|
|
|
--no-avahi \
|
2015-11-09 03:43:33 +01:00
|
|
|
$EXTRAOPT \
|
2013-05-18 13:21:49 +02:00
|
|
|
$LV2OPT
|
2015-11-09 03:43:33 +01:00
|
|
|
./waf build # -v # verbose, shows actual commands
|
2013-11-22 08:34:22 +01:00
|
|
|
./waf install --destdir=$PKG
|
2011-06-20 22:51:19 +02:00
|
|
|
|
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
2015-05-16 00:47:18 +02:00
|
|
|
# Shared libraries are supposed to be +x.
|
|
|
|
chmod 755 $PKG/$LIBDIR/libgx*.so.?.?
|
|
|
|
|
2015-11-09 03:43:33 +01:00
|
|
|
# Man page written for this SlackBuild. It's for guitarix-0.32.3, but
|
|
|
|
# the command line options haven't changed since then.
|
2012-12-16 21:27:30 +01:00
|
|
|
mkdir -p $PKG/usr/man/man1
|
|
|
|
gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
|
|
|
|
|
2011-06-20 22:51:19 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2012-12-16 21:27:30 +01:00
|
|
|
cp -a COPYING changelog README* $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-06-20 22:51:19 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
find $PKG/usr/doc -type f -exec chmod 0644 {} \;
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2012-09-28 02:43:01 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2011-06-20 22:51:19 +02:00
|
|
|
|
2012-12-16 21:27:30 +01:00
|
|
|
# Only add capability stuff if not disabled:
|
|
|
|
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
|
|
|
|
|
2011-06-20 22:51:19 +02:00
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|