vamp-plugin-sdk.SlackBuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #!/bin/bash
  2. # Slackware build script for vamp-plugin-sdk
  3. # Written by Luis Henrique <lmello.009@gmail.com>
  4. # Now maintained by B. Watson <yalhcru@gmail.com>, please don't bother
  5. # Luis with questions as he no longer uses Slackware.
  6. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  7. # 20211126 bkw: Parallel build broken on -current, add -j1.
  8. # 20191202 bkw: Update for v2.9.0
  9. # 20170712 bkw: Update for v2.7.1
  10. # 20160803 bkw: Update for v2.6, BUILD=1
  11. # 20140915 bkw:
  12. # - Update for v2.5
  13. # - Get rid of static libs
  14. # - Use sed instead of a diff for lib64 on x86_64
  15. # - Fix the x86_64 lib path in the .pc files, too
  16. # 20150403 bkw:
  17. # - Bump BUILD, get rid of *.la files
  18. cd $(dirname $0) ; CWD=$(pwd)
  19. PRGNAM=vamp-plugin-sdk
  20. VERSION=${VERSION:-2.9.0}
  21. BUILD=${BUILD:-1}
  22. TAG=${TAG:-_SBo}
  23. PKGTYPE=${PKGTYPE:-tgz}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i586 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  32. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  33. exit 0
  34. fi
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "i586" ]; then
  39. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "i686" ]; then
  42. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "x86_64" ]; then
  45. SLKCFLAGS="-O2 -fPIC"
  46. LIBDIRSUFFIX="64"
  47. else
  48. SLKCFLAGS="-O2"
  49. LIBDIRSUFFIX=""
  50. fi
  51. set -e
  52. rm -rf $PKG
  53. mkdir -p $TMP $PKG $OUTPUT
  54. cd $TMP
  55. rm -rf $PRGNAM-$VERSION
  56. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  57. cd $PRGNAM-$VERSION
  58. chown -R root:root .
  59. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  60. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  61. # Fix libdir on x86_64
  62. sed -i "s,\<lib\>,&$LIBDIRSUFFIX,g" Makefile.in pkgconfig/*.pc.in
  63. CFLAGS="$SLKCFLAGS" \
  64. CXXFLAGS="$SLKCFLAGS" \
  65. ./configure \
  66. --prefix=/usr \
  67. --libdir=/usr/lib${LIBDIRSUFFIX} \
  68. --enable-programs \
  69. --build=$ARCH-slackware-linux
  70. make -j1
  71. make install DESTDIR=$PKG
  72. strip $PKG/usr/bin/* $PKG/usr/lib*/{lib*.so.*.*.*,vamp/*.so}
  73. # we don't want the static libs, and the configure script ignores
  74. # --disable-static --enable-shared.
  75. rm -f $PKG/usr/lib$LIBDIRSUFFIX/*.a
  76. # Ryan P.C. McQuen <ryanpcmcquen@member.fsf.org> reports that the .la
  77. # files break building audacity with VAMP=yes. In general I think
  78. # .la files break more than they fix.
  79. rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
  80. mkdir -p $PKG/etc/profile.d/
  81. cat << EOF > $PKG/etc/profile.d/vamp.csh
  82. #!/bin/csh
  83. setenv VAMP_PATH /usr/lib${LIBDIRSUFFIX}/vamp
  84. EOF
  85. cat << EOF > $PKG/etc/profile.d/vamp.sh
  86. #!/bin/sh
  87. export VAMP_PATH=/usr/lib${LIBDIRSUFFIX}/vamp
  88. EOF
  89. chmod 0755 $PKG/etc/profile.d/*
  90. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  91. cp -a CHANGELOG COPYING INSTALL README* $PKG/usr/doc/$PRGNAM-$VERSION
  92. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  93. mkdir -p $PKG/install
  94. cat $CWD/slack-desc > $PKG/install/slack-desc
  95. cd $PKG
  96. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE