zynjacku.SlackBuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # Slackware build script for zynjacku
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211210 bkw: BUILD=2
  6. # - Fix lockups that occur when guitarix is installed.
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=zynjacku
  9. VERSION=${VERSION:-6}
  10. BUILD=${BUILD:-2}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. if [ -z "$ARCH" ]; then
  14. case "$( uname -m )" in
  15. i?86) ARCH=i586 ;;
  16. arm*) ARCH=arm ;;
  17. *) ARCH=$( uname -m ) ;;
  18. esac
  19. fi
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. if [ "$ARCH" = "i586" ]; then
  28. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "i686" ]; then
  31. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. LIBDIRSUFFIX="64"
  36. else
  37. SLKCFLAGS="-O2"
  38. LIBDIRSUFFIX=""
  39. fi
  40. set -e
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  46. cd $PRGNAM-$VERSION
  47. chown -R root:root .
  48. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  49. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  50. # In the newer lv2 the pkgconfig file is named differently...
  51. sed -i "s|lv2core|lv2|" configure
  52. # If LV2_PATH not set, a hard-coded path including /usr/lib/lv2 is used.
  53. # On x86_64, this is wrong.
  54. if [ "$LIBDIRSUFFIX" != "" ]; then
  55. sed -i "s,/usr/lib/lv2,/usr/lib$LIBDIRSUFFIX/lv2,g" zynworld/lv2.py
  56. fi
  57. # Stops zynjacku and lv2rack from freezing when they're scanning the
  58. # lv2 plugin dir(s) and hit the Guitarix tuner (and maybe others).
  59. # The tuner plugin still won't load ("Failed to construct") if
  60. # you select it, but at least the application doesn't crash and is
  61. # otherwise useful.
  62. patch -p1 < $CWD/fix_scan_lockup.diff
  63. CFLAGS="$SLKCFLAGS" \
  64. CXXFLAGS="$SLKCFLAGS" \
  65. ./configure \
  66. --prefix=/usr \
  67. --libdir=/usr/lib${LIBDIRSUFFIX} \
  68. --sysconfdir=/etc \
  69. --localstatedir=/var \
  70. --mandir=/usr/man \
  71. --docdir=/usr/doc/$PRGNAM-$VERSION \
  72. --build=$ARCH-slackware-linux
  73. make
  74. make install-strip DESTDIR=$PKG
  75. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  76. cp -a AUTHORS NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
  77. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  78. mkdir -p $PKG/install
  79. cat $CWD/slack-desc > $PKG/install/slack-desc
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE