xmms-ladspa.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Slackware build script for xmms-ladspa
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # Notes:
  6. # - The source includes its own ladspa.h, which is why ladspa_sdk isn't
  7. # listed in REQUIRES.
  8. # - Certain ladspa plugins will make xmms segfault when the xmms
  9. # plugin tries to enumerate all the plugins available. guitarix's
  10. # plugins are the only ones on my system that do this. All the
  11. # other SBo packages that install ladspa plugins seem OK, so the
  12. # "fix" for this is (for now anyway) just to have xmms-ladspa skip
  13. # any plugin with "guitarix" in its name.
  14. # - The source is called xmms_ladspa. I chose to use xmms-ladspa for
  15. # PRGNAM so it'll match all the other xmms-* builds on SBo.
  16. cd $(dirname $0) ; CWD=$(pwd)
  17. PRGNAM=xmms-ladspa
  18. VERSION=${VERSION:-1.1}
  19. BUILD=${BUILD:-1}
  20. TAG=${TAG:-_SBo}
  21. PKGTYPE=${PKGTYPE:-tgz}
  22. if [ -z "$ARCH" ]; then
  23. case "$( uname -m )" in
  24. i?86) ARCH=i586 ;;
  25. arm*) ARCH=arm ;;
  26. *) ARCH=$( uname -m ) ;;
  27. esac
  28. fi
  29. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  30. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  31. exit 0
  32. fi
  33. TMP=${TMP:-/tmp/SBo}
  34. PKG=$TMP/package-$PRGNAM
  35. OUTPUT=${OUTPUT:-/tmp}
  36. if [ "$ARCH" = "i586" ]; then
  37. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "i686" ]; then
  40. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  41. LIBDIRSUFFIX=""
  42. elif [ "$ARCH" = "x86_64" ]; then
  43. SLKCFLAGS="-O2 -fPIC"
  44. LIBDIRSUFFIX="64"
  45. else
  46. SLKCFLAGS="-O2"
  47. LIBDIRSUFFIX=""
  48. fi
  49. set -e
  50. SRCNAM=${PRGNAM/-/_}
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $SRCNAM-$VERSION
  55. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  56. cd $SRCNAM-$VERSION
  57. chown -R root:root .
  58. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  59. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  60. # Dirty hack alert: guitarix's plugins cause xmms to segfault when trying
  61. # to configure the ladspa plugins.
  62. patch -p1 < $CWD/skip_guitarix.diff
  63. sed -i "s,-fPIC,& $SLKCFLAGS," Makefile
  64. make
  65. mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/xmms/Effect
  66. install -m0755 -s ladspa.so $PKG/usr/lib$LIBDIRSUFFIX/xmms/Effect
  67. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  68. cp -a README PLUGINS COPYING ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
  69. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  70. mkdir -p $PKG/install
  71. cat $CWD/slack-desc > $PKG/install/slack-desc
  72. cd $PKG
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE