2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2014-02-25 03:09:49 +01:00
|
|
|
|
|
|
|
# Slackware build script for jalv
|
|
|
|
|
2022-06-08 18:26:10 +02:00
|
|
|
# Written by B. Watson (urchlay@slackware.uk)
|
2014-02-25 03:09:49 +01:00
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2023-07-23 09:27:49 +02:00
|
|
|
# 20230723 bkw: fix 32-bit build (needs -fPIC).
|
2023-01-10 06:59:13 +01:00
|
|
|
# 20230110 bkw: update for v1.6.8. no more waf; it uses meson now.
|
2021-12-02 21:41:54 +01:00
|
|
|
# 20211202 bkw:
|
|
|
|
# - update for v1.6.6.
|
|
|
|
# - fix man pages.
|
|
|
|
# - add source tarball for waflib (no longer included in jalv src).
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2014-02-25 03:09:49 +01:00
|
|
|
PRGNAM=jalv
|
2023-01-10 06:59:13 +01:00
|
|
|
VERSION=${VERSION:-1.6.8}
|
2014-02-25 03:09:49 +01:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2014-02-25 03:09:49 +01:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-19 10:59:10 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2014-02-25 03:09:49 +01:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2014-02-25 03:09:49 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-19 10:59:10 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
2023-07-23 09:27:49 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686 -fPIC"
|
2014-02-25 03:09:49 +01:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2023-07-23 09:27:49 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686 -fPIC"
|
2014-02-25 03:09:49 +01:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
2023-07-23 09:27:49 +02:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2014-02-25 03:09:49 +01:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2021-12-02 21:41:54 +01:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2014-02-25 03:09:49 +01:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2021-12-02 21:41:54 +01:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
|
|
|
|
2023-01-10 06:59:13 +01:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
meson .. \
|
|
|
|
--buildtype=release \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
-Dstrip=true
|
|
|
|
"${NINJA:=ninja}"
|
|
|
|
DESTDIR=$PKG $NINJA install
|
|
|
|
cd ..
|
2014-02-25 03:09:49 +01:00
|
|
|
|
2021-12-02 21:41:54 +01:00
|
|
|
# the one in /usr/lib*/jack/ seems to be a jack plugin. not documented,
|
|
|
|
# but jack won't load it by default so leaving it there is OK.
|
2023-01-10 06:59:13 +01:00
|
|
|
#strip $PKG/usr/bin/* $PKG/usr/lib*/jack/*.so
|
2014-02-25 03:09:49 +01:00
|
|
|
gzip -9 $PKG/usr/man/man1/*.1
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2021-12-02 21:41:54 +01:00
|
|
|
cp -a AUTHORS* COPYING* NEWS* README* $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-02-25 03:09:49 +01:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
2023-01-10 06:59:13 +01:00
|
|
|
# there's a .desktop file but no icon. *shrug*.
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
2014-02-25 03:09:49 +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/*
|
|
|
|
chmod 0750 $PKG/usr/bin/*
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|