jalv.SlackBuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # Slackware build script for jalv
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20230110 bkw: update for v1.6.8. no more waf; it uses meson now.
  6. # 20211202 bkw:
  7. # - update for v1.6.6.
  8. # - fix man pages.
  9. # - add source tarball for waflib (no longer included in jalv src).
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=jalv
  12. VERSION=${VERSION:-1.6.8}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) ARCH=i586 ;;
  19. arm*) ARCH=arm ;;
  20. *) ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  24. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  25. exit 0
  26. fi
  27. TMP=${TMP:-/tmp/SBo}
  28. PKG=$TMP/package-$PRGNAM
  29. OUTPUT=${OUTPUT:-/tmp}
  30. if [ "$ARCH" = "i586" ]; then
  31. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "i686" ]; then
  34. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "x86_64" ]; then
  37. SLKCFLAGS="-O2 -fPIC"
  38. LIBDIRSUFFIX="64"
  39. else
  40. SLKCFLAGS="-O2"
  41. LIBDIRSUFFIX=""
  42. fi
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $PRGNAM-$VERSION
  48. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  52. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  53. mkdir build
  54. cd build
  55. CFLAGS="$SLKCFLAGS" \
  56. CXXFLAGS="$SLKCFLAGS" \
  57. meson .. \
  58. --buildtype=release \
  59. --infodir=/usr/info \
  60. --libdir=/usr/lib${LIBDIRSUFFIX} \
  61. --localstatedir=/var \
  62. --mandir=/usr/man \
  63. --prefix=/usr \
  64. --sysconfdir=/etc \
  65. -Dstrip=true
  66. "${NINJA:=ninja}"
  67. DESTDIR=$PKG $NINJA install
  68. cd ..
  69. # the one in /usr/lib*/jack/ seems to be a jack plugin. not documented,
  70. # but jack won't load it by default so leaving it there is OK.
  71. #strip $PKG/usr/bin/* $PKG/usr/lib*/jack/*.so
  72. gzip -9 $PKG/usr/man/man1/*.1
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a AUTHORS* COPYING* NEWS* README* $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. # there's a .desktop file but no icon. *shrug*.
  79. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  80. # Only add capability stuff if not disabled:
  81. if [ "${SETCAP:-yes}" = "yes" ]; then
  82. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  83. # Only allow execution by audio group
  84. chown root:audio $PKG/usr/bin/*
  85. chmod 0750 $PKG/usr/bin/*
  86. fi
  87. cd $PKG
  88. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE