tap_plugins.SlackBuild 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. #!/bin/bash
  2. # Slackware build script for tap_plugins
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211201 bkw: update for v1.0.1.
  6. # - fix -current build.
  7. # - new-style icons.
  8. # - man page for reverbed.
  9. # - don't install 2 identical COPYING.* in doc dir.
  10. # 20171221 bkw: update for v1.0.0
  11. # 20151104 bkw:
  12. # update for v0.7.3, update docs to 20140526
  13. # get rid of reverbed.sh wrapper script (patch reverbed instead)
  14. # add capability stuff for reverbed
  15. # add .desktop, icon for reverbed
  16. cd $(dirname $0) ; CWD=$(pwd)
  17. PRGNAM=tap_plugins
  18. VERSION=${VERSION:-1.0.1}
  19. BUILD=${BUILD:-1}
  20. TAG=${TAG:-_SBo}
  21. PKGTYPE=${PKGTYPE:-tgz}
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ -z "$ARCH" ]; then
  30. case "$( uname -m )" in
  31. i?86) ARCH=i586 ;;
  32. arm*) ARCH=arm ;;
  33. *) ARCH=$( uname -m ) ;;
  34. esac
  35. fi
  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. fi
  46. # You almost certainly do NOT want FORCE_SLACK_CFLAGS=yes
  47. # (it's here for purists, and for troubleshooting purposes)
  48. FORCE_SLACK_CFLAGS=${FORCE_SLACK_CFLAGS:-no}
  49. # You may need FORCE_SYSTEM_LADSPA_H=yes if building against a version
  50. # of ladspa_sdk other than 1.13 (try without first)
  51. FORCE_SYSTEM_LADSPA_H=${FORCE_SYSTEM_LADSPA_H:-no}
  52. PLUGINS_SRCNAM=tap-plugins
  53. DOCS_SRCNAM=tap-plugins-doc
  54. DOCS_VERSION=20140526
  55. REVERBED_SRCNAM=tap-reverbed
  56. REVERBED_VERSION=r0
  57. set -e
  58. # First build the plugins
  59. rm -rf $PKG
  60. mkdir -p $TMP $PKG $OUTPUT
  61. cd $TMP
  62. rm -rf $PLUGINS_SRCNAM-$VERSION
  63. tar xvf $CWD/$PLUGINS_SRCNAM-$VERSION.tar.gz
  64. cd $PLUGINS_SRCNAM-$VERSION
  65. chown -R root:root .
  66. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  67. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  68. if [ "$FORCE_SLACK_CFLAGS" = "yes" ]; then
  69. sed -i '/^CFLAGS/s/\(=.*\) -O3 \(.*\)\(-c\)/\1 '"$SLKCFLAGS"' \3/' Makefile
  70. fi
  71. if [ "$FORCE_SYSTEM_LADSPA_H" = "yes" ]; then
  72. rm -f ladspa.h
  73. cp /usr/include/ladspa.h .
  74. fi
  75. make
  76. strip *.so
  77. make install \
  78. INSTALL_PLUGINS_DIR=$PKG/usr/lib$LIBDIRSUFFIX/ladspa/ \
  79. INSTALL_LRDF_DIR=$PKG/usr/share/ladspa/rdf/
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  81. cp -a COPYING $PKG/usr/doc/$PRGNAM-$VERSION
  82. for i in CREDITS README; do
  83. cp -a $i $PKG/usr/doc/$PRGNAM-$VERSION/$i.plugins
  84. done
  85. # Now build the reverb editor
  86. cd $TMP
  87. rm -rf $REVERBED_SRCNAM-$REVERBED_VERSION
  88. tar xvf $CWD/$REVERBED_SRCNAM-$REVERBED_VERSION.tar.gz
  89. cd $REVERBED_SRCNAM-$REVERBED_VERSION
  90. chown -R root:root .
  91. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  92. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  93. # patch by SlackBuild author, makes reverbed load its config from /etc
  94. # if no ~/.reverbed found (rather than aborting with an error message).
  95. patch -p1 < $CWD/reverbed-default-config.diff
  96. ./configure \
  97. --prefix=/usr \
  98. --libdir=/usr/lib${LIBDIRSUFFIX} \
  99. --sysconfdir=/etc \
  100. --localstatedir=/var \
  101. --mandir=/usr/man \
  102. --build=$ARCH-slackware-linux
  103. # 20211201 bkw: fix -current build, force this flag always.
  104. sed -i '/^CFLAGS/s/$/ -fcommon/' src/Makefile
  105. if [ "$FORCE_SLACK_CFLAGS" = "yes" ]; then
  106. # CFLAGS not supported by autoconf!
  107. sed -i '/^CFLAGS/s/=.*-fPIC/= '"$SLKCFLAGS"' -fPIC/' src/Makefile
  108. fi
  109. make LIBS=-lm
  110. # more trouble than it's worth to get 'make install' to handle DESTDIR
  111. mkdir -p $PKG/usr/bin $PKG/etc/reverbed
  112. install -s -m0755 -oroot -groot src/reverbed $PKG/usr/bin/
  113. cat src/.reverbed > $PKG/etc/reverbed/reverbed.conf
  114. # man page written by SlackBuild author
  115. mkdir -p $PKG/usr/man/man1
  116. gzip -9c < $CWD/reverbed.1 > $PKG/usr/man/man1/reverbed.1.gz
  117. # .desktop written by SlackBuild author
  118. mkdir -p $PKG/usr/share/applications
  119. cat $CWD/reverbed.desktop > $PKG/usr/share/applications/reverbed.desktop
  120. # icon came from:
  121. # https://www.hscripts.com/freeimages/icons/mechanical/spring-clipart.php
  122. # and turned into a PNG via ImageMagick's convert.
  123. for px in 16 32 48 64; do
  124. size=${px}x${px}
  125. dir=$PKG/usr/share/icons/hicolor/$size/apps
  126. mkdir -p $dir
  127. convert -resize $size $CWD/reverbed.png $dir/reverbed.png
  128. done
  129. mkdir -p $PKG/usr/share/icons/hicolor/128x128/apps
  130. cat $CWD/128.png > $PKG/usr/share/icons/hicolor/128x128/apps/reverbed.png
  131. mkdir -p $PKG/usr/share/pixmaps
  132. ln -s ../icons/hicolor/48x48/apps/reverbed.png $PKG/usr/share/pixmaps/reverbed.png
  133. # ChangeLog and NEWS are 0-length placeholders
  134. for i in AUTHORS README; do
  135. cp -a $i $PKG/usr/doc/$PRGNAM-$VERSION/$i.reverbed
  136. done
  137. # Now package up the HTML docs
  138. cd $PKG/usr/doc/$PRGNAM-$VERSION
  139. tar xvf $CWD/$DOCS_SRCNAM-$DOCS_VERSION.tar.gz
  140. chown -R root:root .
  141. find . -type d -exec chmod 755 {} \+
  142. find . -type f -exec chmod 644 {} \+
  143. cd -
  144. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  145. cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.SBo
  146. mkdir -p $PKG/install
  147. cat $CWD/slack-desc > $PKG/install/slack-desc
  148. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  149. # Only add capability stuff if not disabled:
  150. if [ "${SETCAP:-yes}" = "yes" ]; then
  151. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  152. # Only allow execution by audio group
  153. chown root:audio $PKG/usr/bin/reverbed
  154. chmod 0750 $PKG/usr/bin/reverbed
  155. fi
  156. cd $PKG
  157. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE