jack.SlackBuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 <yalhcru@gmail.com>
  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. # 20210802 bkw: update for v1.9.19 and -current.
  25. # 20210304 bkw: update for v1.9.17.
  26. # 20201104 bkw: update for v1.9.16.
  27. # 20200118 bkw: renamed from 'jack2' to 'jack'. If you want to see
  28. # the old log: "git log -- audio/jack2"
  29. # 20200112 bkw: get rid of --profile (thanks, dive!), BUILD=2.
  30. # 20191201 bkw: update for v1.9.14 (including new python3 dep).
  31. # 20180714 bkw:
  32. # - Take over maintenance.
  33. # - Update for v1.9.12.
  34. # - Move HTML docs to proper Slackware doc dir.
  35. # - i486 => i586.
  36. cd $(dirname $0) ; CWD=$(pwd)
  37. PRGNAM=jack
  38. VERSION=${VERSION:-1.9.19}
  39. BUILD=${BUILD:-1}
  40. TAG=${TAG:-_SBo}
  41. PKGTYPE=${PKGTYPE:-tgz}
  42. SRCNAM=jack2
  43. if [ -z "$ARCH" ]; then
  44. case "$( uname -m )" in
  45. i?86) ARCH=i586 ;;
  46. arm*) ARCH=arm ;;
  47. *) ARCH=$( uname -m ) ;;
  48. esac
  49. fi
  50. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  51. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  52. exit 0
  53. fi
  54. TMP=${TMP:-/tmp/SBo}
  55. PKG=$TMP/package-$PRGNAM
  56. OUTPUT=${OUTPUT:-/tmp}
  57. if [ "$ARCH" = "i586" ]; then
  58. SLKCFLAGS="-O2 -march=i586 -mtune=i586"
  59. LIBDIRSUFFIX=""
  60. elif [ "$ARCH" = "i686" ]; then
  61. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  62. LIBDIRSUFFIX=""
  63. elif [ "$ARCH" = "x86_64" ]; then
  64. SLKCFLAGS="-O2 -fPIC"
  65. LIBDIRSUFFIX="64"
  66. else
  67. SLKCFLAGS="-O2"
  68. LIBDIRSUFFIX=""
  69. fi
  70. set -e
  71. rm -rf $PKG
  72. mkdir -p $TMP $PKG $OUTPUT
  73. cd $TMP
  74. rm -rf $SRCNAM-$VERSION
  75. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  76. cd $SRCNAM-$VERSION
  77. chown -R root:root .
  78. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  79. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  80. # Minor source of incompatibility between jack 1.x and 2.x: some jack
  81. # apps don't add -lpthread to their CFLAGS because they assume jack.pc
  82. # will already include it (it does, in 1.x). So make 2 act like 1:
  83. sed -i '/^Libs:/s,$, -lpthread,' jack.pc.in
  84. CFLAGS="$SLKCFLAGS" \
  85. CXXFLAGS="$SLKCFLAGS" \
  86. LDFLAGS="-Wl,-s" \
  87. ./waf configure \
  88. --prefix=/usr \
  89. --libdir=/usr/lib${LIBDIRSUFFIX} \
  90. --mandir=/usr/man/man1 \
  91. --htmldir=/usr/doc/$PRGNAM-$VERSION/html \
  92. --classic \
  93. --dbus \
  94. --readline \
  95. --alsa
  96. ./waf build
  97. ./waf install --destdir=$PKG
  98. gzip $PKG/usr/man/man?/*
  99. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  100. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  101. mkdir -p $PKG/install
  102. cat $CWD/slack-desc > $PKG/install/slack-desc
  103. # Only add capability stuff if not disabled:
  104. if [ "${SETCAP:-yes}" = "yes" ]; then
  105. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  106. # Only allow execution by audio group
  107. chown root:audio $PKG/usr/bin/*
  108. chmod 0750 $PKG/usr/bin/*
  109. fi
  110. cd $PKG
  111. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE