jack.SlackBuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #!/bin/bash
  2. # Slackware build script for jack (formerly jack2).
  3. # Copyright 2014 Yanes Checcacci Balod <email removed>, Brazil
  4. # Copyright 2014-2015 Marcel Saegebarth <email removed>
  5. # Copyright 2018 B. Watson <urchlay@slackware.uk>
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. # 20220614 bkw: update for v1.9.21 and 15.0.
  25. # 20210802 bkw: update for v1.9.19 and -current.
  26. # 20210304 bkw: update for v1.9.17.
  27. # 20201104 bkw: update for v1.9.16.
  28. # 20200118 bkw: renamed from 'jack2' to 'jack'. If you want to see
  29. # the old log: "git log -- audio/jack2"
  30. # 20200112 bkw: get rid of --profile (thanks, dive!), BUILD=2.
  31. # 20191201 bkw: update for v1.9.14 (including new python3 dep).
  32. # 20180714 bkw:
  33. # - Take over maintenance.
  34. # - Update for v1.9.12.
  35. # - Move HTML docs to proper Slackware doc dir.
  36. # - i486 => i586.
  37. cd $(dirname $0) ; CWD=$(pwd)
  38. PRGNAM=jack
  39. VERSION=${VERSION:-1.9.21}
  40. BUILD=${BUILD:-1}
  41. TAG=${TAG:-_SBo}
  42. PKGTYPE=${PKGTYPE:-tgz}
  43. SRCNAM=jack2
  44. if [ -z "$ARCH" ]; then
  45. case "$( uname -m )" in
  46. i?86) ARCH=i586 ;;
  47. arm*) ARCH=arm ;;
  48. *) ARCH=$( uname -m ) ;;
  49. esac
  50. fi
  51. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  52. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  53. exit 0
  54. fi
  55. TMP=${TMP:-/tmp/SBo}
  56. PKG=$TMP/package-$PRGNAM
  57. OUTPUT=${OUTPUT:-/tmp}
  58. if [ "$ARCH" = "i586" ]; then
  59. SLKCFLAGS="-O2 -march=i586 -mtune=i586"
  60. LIBDIRSUFFIX=""
  61. elif [ "$ARCH" = "i686" ]; then
  62. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  63. LIBDIRSUFFIX=""
  64. elif [ "$ARCH" = "x86_64" ]; then
  65. SLKCFLAGS="-O2 -fPIC"
  66. LIBDIRSUFFIX="64"
  67. else
  68. SLKCFLAGS="-O2"
  69. LIBDIRSUFFIX=""
  70. fi
  71. set -e
  72. rm -rf $PKG
  73. mkdir -p $TMP $PKG $OUTPUT
  74. cd $TMP
  75. rm -rf $SRCNAM-$VERSION
  76. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  77. cd $SRCNAM-$VERSION
  78. chown -R root:root .
  79. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  80. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  81. # Minor source of incompatibility between jack 1.x and 2.x: some jack
  82. # apps don't add -lpthread to their CFLAGS because they assume jack.pc
  83. # will already include it (it does, in 1.x). So make 2 act like 1:
  84. sed -i '/^Libs:/s,$, -lpthread,' jack.pc.in
  85. # 20220614 bkw: upstream disabled the tools by default in 1.9.21, way
  86. # to handle a point release... --example-tools turns it back on.
  87. CFLAGS="$SLKCFLAGS" \
  88. CXXFLAGS="$SLKCFLAGS" \
  89. LDFLAGS="-Wl,-s" \
  90. ./waf configure \
  91. --prefix=/usr \
  92. --libdir=/usr/lib${LIBDIRSUFFIX} \
  93. --mandir=/usr/man/man1 \
  94. --htmldir=/usr/doc/$PRGNAM-$VERSION/html \
  95. --classic \
  96. --dbus \
  97. --readline \
  98. --example-tools \
  99. --alsa
  100. ./waf build
  101. ./waf install --destdir=$PKG
  102. gzip $PKG/usr/man/man?/*
  103. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  104. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  105. mkdir -p $PKG/install
  106. cat $CWD/slack-desc > $PKG/install/slack-desc
  107. # Only add capability stuff if not disabled:
  108. if [ "${SETCAP:-yes}" = "yes" ]; then
  109. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  110. # Only allow execution by audio group
  111. chown root:audio $PKG/usr/bin/*
  112. chmod 0750 $PKG/usr/bin/*
  113. fi
  114. cd $PKG
  115. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE