summaryrefslogtreecommitdiffstats
path: root/audio/rubberband/rubberband.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'audio/rubberband/rubberband.SlackBuild')
-rw-r--r--audio/rubberband/rubberband.SlackBuild130
1 files changed, 91 insertions, 39 deletions
diff --git a/audio/rubberband/rubberband.SlackBuild b/audio/rubberband/rubberband.SlackBuild
index 25607a6cad..5bd8202709 100644
--- a/audio/rubberband/rubberband.SlackBuild
+++ b/audio/rubberband/rubberband.SlackBuild
@@ -4,10 +4,19 @@
# Written by Luis Henrique <email removed>
-# Modified by B. Watson <yalhcru@gmail.com>. Original had no license.
+# Modified by B. Watson <urchlay@slackware.uk>. Original had no license.
# Modified version licensed under the WTFPL. See
# http://www.wtfpl.net/txt/copying/ for details.
+# 20240321 bkw: update for v3.3.0.
+# 20230112 bkw: update for v3.1.2.
+# In 3.1.2, ladspa_sdk and vamp-plugin-sdk are not required. I'm
+# leaving them in REQUIRES for now, because other builds that
+# depend on rubberband might also depend on ladspa_sdk and/or
+# vamp-plugin-sdk, but not list them in REQUIRES because rubberband
+# "pulls them in". This will change in the future!
+
+# 20211125 bkw: update for v2.0.0
# 20201103 bkw: update for v1.9.0
# 20180702 bkw:
# - update for v1.8.2
@@ -24,7 +33,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=rubberband
-VERSION=${VERSION:-1.9.0}
+VERSION=${VERSION:-3.3.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -37,9 +46,6 @@ if [ -z "$ARCH" ]; then
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
@@ -72,54 +78,100 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
-find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
- \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
-
-# Fixup libdir on x86_64
-sed -i "s,\<lib\>,lib$LIBDIRSUFFIX,g" Makefile.in *.pc.in
-
-# For 1.8.2, the Makefile tries to install the JNI stuff even if
-# we don't build it.
-sed -i '/cp *-f .*JNI_TARGET/s,$, || true,' Makefile.in
-
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --build=$ARCH-slackware-linux
-
-make
-
-# 20180703 bkw: build java JNI stuff if we have javac in $PATH and
-# the user says JAVA=yes. Disabled by default because we have too many
-# choices for java compilers, and I can't be bothered to test them all
-# (jdk, openjdk 6 through 8, zulu-openjdk 6 thru 8). Plain "make"
-# doesn't build this...
-WITHJAVA=without
-if [ "${JAVA:-no}" = "yes" ] && which javac &>/dev/null; then
- make lib$LIBDIRSUFFIX/librubberband-jni.so
- WITHJAVA=with
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
+
+JAVA="${JAVA:-no}"
+
+if [ "$JAVA" = "yes" ]; then
+ if [ -z "$JAVA_HOME" ]; then
+ # if JAVA_HOME isn't set, try to set it by sourcing the profile script
+ for i in /etc/profile.d/*jdk*.sh; do
+ if [ -x $i ]; then
+ source $i
+ break
+ fi
+ done
+ fi
+
+ if [ -z "$JAVA_HOME" ]; then
+ cat <<EOF
+!!! Java support requested, but JAVA_HOME is unset and I can't find
+!!! a /etc/profile.d script that sets it. Are you sure you have a JDK
+!!! package installed?
+EOF
+ exit 1
+ fi
+
+ echo "=== JAVA_HOME='$JAVA_HOME'"
+ if [ -z "$JAVA_HOME" -o ! -e $JAVA_HOME/include/jni.h ]; then
+ cat <<EOF
+!!! Java support requested, but JAVA_HOME doesn't have the jni.h header.
+EOF
+ exit 1
+ fi
+
+ EXTRA="-Dextra_include_dirs=$JAVA_HOME/include,$JAVA_HOME/include/linux"
+ echo "=== EXTRA='$EXTRA'"
+fi
+
+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 \
+ $EXTRA \
+ -Dstrip=true
+ "${NINJA:=ninja}"
+ DESTDIR=$PKG $NINJA install
+cd ..
+
+# I don't see a way to disable the static lib at build time, so:
+rm -f $PKG/usr/lib*/lib$PRGNAM.a
+
+JNILIB=$PKG/usr/lib$LIBDIRSUFFIX/lib$PRGNAM-jni.so
+
+if [ "$JAVA" = "yes" -a ! -e $JNILIB ]; then
+ cat <<EOF
+!!! Java support requested, but failed to build. Check the above output
+!!! from Meson and Ninja, and adjust JAVA_HOME if needed.
+EOF
+ exit 1
fi
-make install DESTDIR=$PKG
+WITHJAVA=WITHOUT
+[ -e $JNILIB ] && WITHJAVA=WITH
-# We don't need the static lib
-rm -f $PKG/usr/lib$LIBDIRSUFFIX/*.a
+WITHLV2=WITHOUT
+[ -e $PKG/usr/lib$LIBDIRSUFFIX/lv2/$PRGNAM.lv2/lv2-$PRGNAM.so ] && \
+ WITHLV2=WITH
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+# 20230112 bkw: in 3.1.2, we get two identical binaries...
+# 20240321 bkw: still true of 3.3.0.
+rm $PKG/usr/bin/$PRGNAM-r3
+ln -s $PRGNAM $PKG/usr/bin/$PRGNAM-r3
# man page borrowed from Debian
mkdir -p $PKG/usr/man/man1
gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+ln -s $PRGNAM.1.gz $PKG/usr/man/man1/$PRGNAM-r3.1.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a CHANGELOG COPYING README* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
-sed "s,@WITHJAVA@,$WITHJAVA," $CWD/slack-desc > $PKG/install/slack-desc
+sed -e "s,@WITHJAVA@,$WITHJAVA," \
+ -e "s,@WITHLV2@,$WITHLV2," \
+ $CWD/slack-desc \
+ > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE