jalv.SlackBuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # Slackware build script for jalv
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211202 bkw:
  6. # - update for v1.6.6.
  7. # - fix man pages.
  8. # - add source tarball for waflib (no longer included in jalv src).
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=jalv
  11. VERSION=${VERSION:-1.6.6}
  12. BUILD=${BUILD:-1}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i586 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  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 [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "i686" ]; then
  33. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "x86_64" ]; then
  36. SLKCFLAGS="-O2 -fPIC"
  37. LIBDIRSUFFIX="64"
  38. else
  39. SLKCFLAGS="-O2"
  40. LIBDIRSUFFIX=""
  41. fi
  42. set -e
  43. # waflib got broken out into its own submodule, which isn't included
  44. # in github's generated tarball. my waflib tarball was made by
  45. # $ git clone https://github.com/drobilla/jalv/
  46. # $ cd jalv
  47. # $ git submodule update --init
  48. # $ tar cvfJ ../waflib-b600c92.tar.xz waflib/
  49. # (the commit hash came from 'cd waflib; git log')
  50. WAFLIBVER=${WAFLIBVER:-b600c92}
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $PRGNAM-$VERSION
  55. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  56. cd $PRGNAM-$VERSION
  57. tar xvf $CWD/waflib-$WAFLIBVER.tar.xz
  58. chown -R root:root .
  59. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  60. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  61. # Fix references to 'jalv.qt(2)', mention jalv.gtk3 and jalv.qt5 in
  62. # jalv.gtk.1 and jalv.qt.1.
  63. patch -p1 < $CWD/manpages.diff
  64. CFLAGS="$SLKCFLAGS" \
  65. CXXFLAGS="$SLKCFLAGS" \
  66. ./waf configure \
  67. --libdir=/usr/lib$LIBDIRSUFFIX \
  68. --prefix=/usr \
  69. --mandir=/usr/man
  70. ./waf build
  71. ./waf install --destdir=$PKG
  72. # the one in /usr/lib*/jack/ seems to be a jack plugin. not documented,
  73. # but jack won't load it by default so leaving it there is OK.
  74. strip $PKG/usr/bin/* $PKG/usr/lib*/jack/*.so
  75. gzip -9 $PKG/usr/man/man1/*.1
  76. ln -s $PRGNAM.qt.1.gz $PKG/usr/man/man1/$PRGNAM.qt5.1.gz
  77. ln -s $PRGNAM.gtk.1.gz $PKG/usr/man/man1/$PRGNAM.gtk3.1.gz
  78. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  79. cp -a AUTHORS* COPYING* NEWS* README* $PKG/usr/doc/$PRGNAM-$VERSION
  80. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  81. mkdir -p $PKG/install
  82. cat $CWD/slack-desc > $PKG/install/slack-desc
  83. # Only add capability stuff if not disabled:
  84. if [ "${SETCAP:-yes}" = "yes" ]; then
  85. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  86. # Only allow execution by audio group
  87. chown root:audio $PKG/usr/bin/*
  88. chmod 0750 $PKG/usr/bin/*
  89. fi
  90. cd $PKG
  91. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE