mhwaveedit.SlackBuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #!/bin/bash
  2. # Slackware build script for mhwaveedit
  3. # Originally written by Felix Krueger
  4. # Now maintained by B. Watson <yalhcru@gmail.com>. Original script
  5. # had no license. Modified version licensed under the WTFPL. See
  6. # http://www.wtfpl.net/txt/copying/ for details.
  7. # 20211127 bkw: BUILD=2
  8. # - portaudio support was broken, explicitly disable it and remove
  9. # from README.
  10. # - add JACK=no in case someone needs it.
  11. # - dynamic slack-desc.
  12. # 20181022 bkw:
  13. # - Take over maintenance.
  14. # - Update for v1.4.24. Incompatible changes, can't build old version.
  15. # - Add PULSE and OSS env vars.
  16. # - If JACK support is built-in, do the realtime stuff.
  17. # - Minor script cleanups.
  18. # - Don't install the install directions in docdir.
  19. cd $(dirname $0) ; CWD=$(pwd)
  20. PRGNAM=mhwaveedit
  21. VERSION=${VERSION:-1.4.24}
  22. BUILD=${BUILD:-2}
  23. TAG=${TAG:-_SBo}
  24. PKGTYPE=${PKGTYPE:-tgz}
  25. if [ -z "$ARCH" ]; then
  26. case "$( uname -m )" in
  27. i?86) ARCH=i586 ;;
  28. arm*) ARCH=arm ;;
  29. *) ARCH=$( uname -m ) ;;
  30. esac
  31. fi
  32. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  33. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  34. exit 0
  35. fi
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. if [ "$ARCH" = "i486" ]; then
  40. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  41. LIBDIRSUFFIX=""
  42. elif [ "$ARCH" = "i686" ]; then
  43. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  44. LIBDIRSUFFIX=""
  45. elif [ "$ARCH" = "x86_64" ]; then
  46. SLKCFLAGS="-O2 -fPIC"
  47. LIBDIRSUFFIX="64"
  48. else
  49. SLKCFLAGS="-O2"
  50. LIBDIRSUFFIX=""
  51. fi
  52. set -e
  53. rm -rf $PKG
  54. mkdir -p $TMP $PKG $OUTPUT
  55. cd $TMP
  56. rm -rf $PRGNAM-$VERSION
  57. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  58. cd $PRGNAM-$VERSION
  59. chown -R root:root .
  60. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  61. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  62. # Fix "unknown type name 'Intbox'"
  63. patch -p0 < $CWD/intbox.diff
  64. # 20181023 bkw: environment variables to control the build options.
  65. PULSE="${PULSE:-yes}"
  66. OSS="${OSS:-no}"
  67. JACK="${JACK:-yes}"
  68. [ "$PULSE" = "no" ] && EXTRAOPTS+=" --without-pulse"
  69. [ "$OSS" = "no" ] && EXTRAOPTS+=" --without-oss"
  70. [ "$JACK" = "no" ] && EXTRAOPTS+=" --without-jack"
  71. # 20211127 bkw: this just sets the default; it can be changed in the
  72. # preferences.
  73. MIXER="${MIXER:-xterm -e alsamixer}"
  74. # 20211127 bkw: add --without-portaudio. Our portaudio lacks the
  75. # Pa_Timestamp type, so the configure script would disable it anyway.
  76. # Not sure if that means our portaudio is too new or too old, not
  77. # all that interested anyway.
  78. CFLAGS="$SLKCFLAGS" \
  79. ./configure \
  80. --with-default-mixerapp="$MIXER" \
  81. $EXTRAOPTS \
  82. --without-portaudio \
  83. --with-default-ladspa-path=/usr/lib$LIBDIRSUFFIX/ladspa \
  84. --prefix=/usr \
  85. --libdir=/usr/lib${LIBDIRSUFFIX} \
  86. --sysconfdir=/etc \
  87. --localstatedir=/var \
  88. --docdir=/usr/doc/$PRGNAM-$VERSION \
  89. --mandir=/usr/man \
  90. --with-double-samples \
  91. --without-arts \
  92. --without-esound \
  93. --build=$ARCH-slackware-linux
  94. make
  95. make install DESTDIR=$PKG
  96. strip $PKG/usr/bin/$PRGNAM
  97. gzip $PKG/usr/man/man1/$PRGNAM.1
  98. mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps
  99. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  100. ln -s ../icons/hicolor/64x64/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  101. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  102. cp -a AUTHORS COPYING ChangeLog NEWS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  103. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  104. mkdir -p $PKG/install
  105. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  106. J=no; P=no; O=no
  107. objdump -p $PKG/usr/bin/$PRGNAM | grep -q 'NEEDED.*libpulse' && P=yes
  108. strings $PKG/usr/bin/$PRGNAM | grep -q /dev/dsp && O=yes
  109. # realtime audio stuff only if JACK support included.
  110. if objdump -p $PKG/usr/bin/$PRGNAM | grep -q 'NEEDED.*libjack'; then
  111. J=yes
  112. if [ "${SETCAP:-yes}" = "yes" ]; then
  113. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  114. chown root:audio $PKG/usr/bin/$PRGNAM
  115. chmod 0750 $PKG/usr/bin/$PRGNAM
  116. fi
  117. fi
  118. sed -e "s,@J@,$J," \
  119. -e "s,@P@,$P," \
  120. -e "s,@O@,$O," \
  121. $CWD/slack-desc > $PKG/install/slack-desc
  122. cd $PKG
  123. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE