mda-lv2.SlackBuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. # Slackware build script for mda-lv2
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=mda-lv2
  7. VERSION=${VERSION:-1.2.6}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. if [ "$ARCH" = "i586" ]; then
  26. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  27. LIBDIRSUFFIX=""
  28. elif [ "$ARCH" = "i686" ]; then
  29. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "x86_64" ]; then
  32. SLKCFLAGS="-O2 -fPIC"
  33. LIBDIRSUFFIX="64"
  34. else
  35. SLKCFLAGS="-O2"
  36. LIBDIRSUFFIX=""
  37. fi
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM-$VERSION
  43. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  44. cd $PRGNAM-$VERSION
  45. chown -R root:root .
  46. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  47. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  48. # The include structure for lv2 has changed drastically. Recreating
  49. # the old structure is easier than patching all the includes in all
  50. # the source files.
  51. mkdir -p lv2includes/lv2/core
  52. ln -s /usr/include/lv2/lv2plug.in/ns/ext/* lv2includes/lv2
  53. ln -s /usr/include/lv2.h lv2includes/lv2/core
  54. SLKCFLAGS="$SLKCFLAGS -I$(pwd)/lv2includes"
  55. CFLAGS="$SLKCFLAGS" \
  56. CXXFLAGS="$SLKCFLAGS -std=c++11" \
  57. ./waf configure build install \
  58. --prefix=/usr \
  59. --lv2dir=/usr/lib$LIBDIRSUFFIX/lv2 \
  60. --destdir=$PKG
  61. strip $PKG/usr/lib*/lv2/mda.lv2/*.so
  62. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  63. cp -a COPYING README* NEWS $PKG/usr/doc/$PRGNAM-$VERSION
  64. # All the documentation on the individual plugins is buried in the .ttl
  65. # files as comments, which none of my LV2 hosts will display. It's useful
  66. # info, so let's put it in /usr/doc.
  67. cd $PKG/usr/lib$LIBDIRSUFFIX/lv2/mda.lv2
  68. perl $CWD/extract_docs.pl > $PKG/usr/doc/$PRGNAM-$VERSION/plugins.txt
  69. cd -
  70. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  71. mkdir -p $PKG/install
  72. cat $CWD/slack-desc > $PKG/install/slack-desc
  73. cd $PKG
  74. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE