diff options
author | B. Watson <yalhcru@gmail.com> | 2021-11-26 11:25:45 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-12-04 10:09:00 +0700 |
commit | 1c00df53fae0ac63d25b90d3d7e1a07465edf176 (patch) | |
tree | 8f36df09d010d9a45776285cf5633df82a0b7b23 /audio/rubberband/rubberband.SlackBuild | |
parent | 87225a2c089f7073d90c35b1e4bed386e3eb32d5 (diff) |
audio/rubberband: Updated for version 2.0.0.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'audio/rubberband/rubberband.SlackBuild')
-rw-r--r-- | audio/rubberband/rubberband.SlackBuild | 101 |
1 files changed, 66 insertions, 35 deletions
diff --git a/audio/rubberband/rubberband.SlackBuild b/audio/rubberband/rubberband.SlackBuild index 25607a6cad0eb..349b10f5ce453 100644 --- a/audio/rubberband/rubberband.SlackBuild +++ b/audio/rubberband/rubberband.SlackBuild @@ -8,6 +8,7 @@ # Modified version licensed under the WTFPL. See # http://www.wtfpl.net/txt/copying/ for details. +# 20211125 bkw: update for v2.0.0 # 20201103 bkw: update for v1.9.0 # 20180702 bkw: # - update for v1.8.2 @@ -24,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=rubberband -VERSION=${VERSION:-1.9.0} +VERSION=${VERSION:-2.0.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -37,9 +38,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 @@ -75,40 +73,73 @@ 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 +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 -make install DESTDIR=$PKG - -# We don't need the static lib -rm -f $PKG/usr/lib$LIBDIRSUFFIX/*.a +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 -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +WITHJAVA=WITHOUT +[ -e $JNILIB ] && WITHJAVA=WITH # man page borrowed from Debian mkdir -p $PKG/usr/man/man1 |