calf-ladspa.SlackBuild 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #!/bin/bash
  2. # Slackware build script for calf-ladspa
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # 20211127 bkw: BUILD=2
  5. # - rework README and slack-desc, remove mentions of JACK and DSSI.
  6. # - move html docs to subdir.
  7. # 20170706 bkw:
  8. # - Patch source so it doesn't check for jack-audio-connection-kit or
  9. # fluidsynth. Previously they were required for the build to complete,
  10. # but the stuff that got built with support for them was being rm'ed
  11. # after make install (because the package only contains LADSPA plugins).
  12. # - Remove jack-audio-connection-kit and fluidsynth from REQUIRES.
  13. # - Add patch to support -current's gcc7. For now, it's commented out
  14. # in the SlackBuild, since 14.2 doesn't need it.
  15. # 20151105 bkw:
  16. # - Renamed to calf-ladspa. The main calf build is now for calf-0.0.60,
  17. # which lacks LADSPA support. Removed LV2 and standalone support, use
  18. # calf for that instead. Removed DSSI support, because I don't
  19. # think anyone's using it, and because it's non-trivial to install
  20. # the gui support files anywhere other than /usr/share/calf, which
  21. # would step on the main calf package.
  22. # 20141030 bkw:
  23. # Finally getting around to submitting this, there have been no code
  24. # changes upstream since 20140308.
  25. # 20140308 bkw:
  26. # - Switched to falkTX's KXStudio fork of CALF. falkTX doesn't do release
  27. # tarballs, so this is a git checkout from 20140308.
  28. # - Added capability stuff.
  29. cd $(dirname $0) ; CWD=$(pwd)
  30. PRGNAM=calf-ladspa
  31. VERSION=${VERSION:-0.0.19kx}
  32. BUILD=${BUILD:-2}
  33. TAG=${TAG:-_SBo}
  34. PKGTYPE=${PKGTYPE:-tgz}
  35. if [ -z "$ARCH" ]; then
  36. case "$( uname -m )" in
  37. i?86) ARCH=i586 ;;
  38. arm*) ARCH=arm ;;
  39. *) ARCH=$( uname -m ) ;;
  40. esac
  41. fi
  42. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  43. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  44. exit 0
  45. fi
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49. if [ "$ARCH" = "i586" ]; then
  50. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  51. LIBDIRSUFFIX=""
  52. elif [ "$ARCH" = "i686" ]; then
  53. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "x86_64" ]; then
  56. SLKCFLAGS="-O2 -fPIC"
  57. LIBDIRSUFFIX="64"
  58. else
  59. SLKCFLAGS="-O2"
  60. LIBDIRSUFFIX=""
  61. fi
  62. # 20151106 bkw: --enable-experimental only enables the fluidsynth
  63. # module, which doesn't work as LADSPA (needs to be DSSI or LV2), so
  64. # leave it disabled here.
  65. EXPOPT=disable
  66. # We'll disable what we can, and rm -rf what we don't need after install.
  67. LADSPA_OPT="--with-ladspa-dir=/usr/lib${LIBDIRSUFFIX}/ladspa"
  68. DSSI_OPT="--without-dssi"
  69. LV2_OPT="--without-lv2"
  70. set -e
  71. SRCNAM=calf
  72. rm -rf $PKG
  73. mkdir -p $TMP $PKG $OUTPUT
  74. cd $TMP
  75. rm -rf $SRCNAM-$VERSION
  76. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  77. cd $SRCNAM-$VERSION
  78. chown -R root:root .
  79. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  80. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  81. # There are no --without or --disable options for jack and fluidsynth,
  82. # so patch the autoconf to skip them (they're not needed for the LADSPA
  83. # plugins).
  84. patch -p1 < $CWD/disable-jack-and-fluidsynth.diff
  85. # gcc 7 is very picky about the argument types of std::min() and std::max().
  86. # This patch replaces them with C-style MIN and MAX macros.
  87. patch -p1 < $CWD/minmax.diff
  88. autoreconf -if
  89. # Note: The build ignores the provided -O2 in the flags (but the
  90. # -march/-mtune -fPIC stuff is used). If you really want to force
  91. # it to use -O2 (Slackware default), set FORCE_SLACK_CFLAGS=yes
  92. # in the environment.
  93. if [ "${FORCE_SLACK_CFLAGS:-no}" = "yes" ]; then
  94. sed -i -e 's/ -O3[^"]*//' configure
  95. fi
  96. CFLAGS="$SLKCFLAGS" \
  97. CXXFLAGS="$SLKCFLAGS" \
  98. ./configure \
  99. --${EXPOPT}-experimental \
  100. --prefix=/usr \
  101. --libdir=/usr/lib${LIBDIRSUFFIX} \
  102. --sysconfdir=/etc \
  103. --localstatedir=/var \
  104. --mandir=/usr/man \
  105. --docdir=/usr/doc/$PRGNAM-$VERSION \
  106. --htmldir=/usr/doc/$PRGNAM-$VERSION \
  107. --enable-shared \
  108. --disable-static \
  109. $LADSPA_OPT \
  110. $DSSI_OPT \
  111. $LV2_OPT \
  112. --build=$ARCH-slackware-linux
  113. make
  114. make install DESTDIR=$PKG docdir=/usr/doc/$PRGNAM-$VERSION/html
  115. # install-strip is supported, but doesn't work:
  116. strip $PKG/usr/lib*/ladspa/*.so
  117. # This build is only for the ladspa plugins, so none of this
  118. # other stuff should be in the package:
  119. rm -rf $PKG/usr/share $PKG/usr/bin $PKG/usr/man $PKG/usr/lib64/calf
  120. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  121. cp -a AUTHORS COPYING* ChangeLog README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  122. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  123. mkdir -p $PKG/install
  124. cat $CWD/slack-desc > $PKG/install/slack-desc
  125. cd $PKG
  126. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE