qm-vamp-plugins.SlackBuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #!/bin/bash
  2. # Slackware build script for qm-vamp-plugins
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. PRGNAM=qm-vamp-plugins
  5. VERSION=${VERSION:-1.7}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. if [ -z "$ARCH" ]; then
  9. case "$( uname -m )" in
  10. i?86) ARCH=i486 ;;
  11. arm*) ARCH=arm ;;
  12. *) ARCH=$( uname -m ) ;;
  13. esac
  14. fi
  15. CWD=$(pwd)
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. # No CFLAGS support (releases are tested with their own opts)
  20. if [ "$ARCH" = "i486" ]; then
  21. LIBDIRSUFFIX=""
  22. elif [ "$ARCH" = "i686" ]; then
  23. LIBDIRSUFFIX=""
  24. elif [ "$ARCH" = "x86_64" ]; then
  25. LIBDIRSUFFIX="64"
  26. else
  27. LIBDIRSUFFIX=""
  28. fi
  29. set -e
  30. # Remove SSE/SSE2 flags as needed from the CFLAGS
  31. fix_sse_flags() {
  32. local makefile="$1"
  33. if [ "$USE_SSE2" != "yes" ]; then
  34. sed -i \
  35. -e 's/-msse2//g' \
  36. $makefile
  37. fi
  38. if [ "$USE_SSE" != "yes" ]; then
  39. sed -i \
  40. -e 's/-msse//g' \
  41. -e 's/-mfpmath=sse//g' \
  42. $makefile
  43. fi
  44. }
  45. # Private static lib that's distributed as a separate tarball. Main
  46. # program links to it, but it doesn't need to be installed system-wide
  47. # as nothing else uses it. It's assumed that qm-dsp's version number
  48. # will always match the main one.
  49. LIBNAM=qm-dsp
  50. rm -rf $PKG
  51. mkdir -p $TMP $PKG $OUTPUT
  52. cd $TMP
  53. rm -rf $PRGNAM-$VERSION $LIBNAM-$VERSION
  54. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  55. tar xvf $CWD/$LIBNAM-$VERSION.tar.gz
  56. cd $LIBNAM-$VERSION
  57. chown -R root:root .
  58. find . \
  59. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  60. -exec chmod 755 {} \; -o \
  61. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  62. -exec chmod 644 {} \;
  63. # Why doesn't the include path include the project's own include/ dir?
  64. # (without this, it can't find its own headers)
  65. sed -i 's,-I\.,-I. -Iinclude,' build/general/Makefile.inc
  66. # SSE/SSE2 support:
  67. case "$SSE" in
  68. "yes") USE_SSE=yes ;;
  69. "no") USE_SSE=no ;;
  70. *) if grep -q '\<sse\>' /proc/cpuinfo; then
  71. USE_SSE=yes
  72. else
  73. USE_SSE=no
  74. fi
  75. ;;
  76. esac
  77. if [ "$USE_SSE" = "yes" ]; then
  78. case "$SSE2" in
  79. "yes") USE_SSE2=yes ;;
  80. "no") USE_SSE2=no ;;
  81. *) if grep -q '\<sse2\>' /proc/cpuinfo; then
  82. USE_SSE2=yes
  83. else
  84. USE_SSE2=no
  85. fi
  86. ;;
  87. esac
  88. else
  89. USE_SSE2=no
  90. fi
  91. echo "USE_SSE=$USE_SSE and USE_SSE2=$USE_SSE2"
  92. # Note about the Makefiles: Makefile.linux64 works fine on 32-bit. The difference
  93. # between the .linux and .linux64 Makefiles is that the .linux64 one uses atlas
  94. # instead of plain unoptimized lapack and blas. There's nothing magically 64-bit
  95. # about atlas...
  96. fix_sse_flags build/linux/Makefile.linux64
  97. make -f build/linux/Makefile.linux64
  98. cd -
  99. # main makefile looks for ../qm-dsp (no version suffix), so:
  100. ln -s $LIBNAM-$VERSION $LIBNAM
  101. cd $PRGNAM-$VERSION
  102. chown -R root:root .
  103. find . \
  104. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  105. -exec chmod 755 {} \; -o \
  106. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  107. -exec chmod 644 {} \;
  108. fix_sse_flags build/linux/Makefile.linux64
  109. make -f build/linux/Makefile.linux64
  110. # no 'make install' target, just cp it.
  111. mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/vamp
  112. cp $PRGNAM.so $PRGNAM.cat $PRGNAM.n3 $PKG/usr/lib$LIBDIRSUFFIX/vamp
  113. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  114. cp -a \
  115. README.txt COPYING \
  116. $PKG/usr/doc/$PRGNAM-$VERSION
  117. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  118. mkdir -p $PKG/install
  119. cat $CWD/slack-desc > $PKG/install/slack-desc
  120. cd $PKG
  121. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}