bristol.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #!/bin/bash
  2. # Slackware build script for bristol
  3. # Written by Zbigniew Baniewski, <email removed>
  4. # Modified by B. Watson, urchlay@slackware.uk
  5. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  6. # 20211130 bkw: BUILD=2
  7. # - fix build on -current (again).
  8. # - new-style icons.
  9. # - get rid of .la files.
  10. # - add launch-bristol script, so desktop users can choose a synth
  11. # instead of only being able to use the B3.
  12. # 20170621 bkw: fix build on -current
  13. # 20141030 bkw: make VERSION respect environment
  14. cd $(dirname $0) ; CWD=$(pwd)
  15. PRGNAM=bristol
  16. VERSION=${VERSION:-0.60.11}
  17. BUILD=${BUILD:-2}
  18. TAG=${TAG:-_SBo}
  19. PKGTYPE=${PKGTYPE:-tgz}
  20. if [ -z "$ARCH" ]; then
  21. case "$( uname -m )" in
  22. i?86) ARCH=i586 ;;
  23. arm*) ARCH=arm ;;
  24. *) ARCH=$( uname -m ) ;;
  25. esac
  26. fi
  27. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  28. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  29. exit 0
  30. fi
  31. TMP=${TMP:-/tmp/SBo}
  32. PKG=$TMP/package-$PRGNAM
  33. OUTPUT=${OUTPUT:-/tmp}
  34. if [ "$ARCH" = "i586" ]; then
  35. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "i686" ]; then
  38. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "x86_64" ]; then
  41. SLKCFLAGS="-O2 -fPIC"
  42. LIBDIRSUFFIX="64"
  43. else
  44. SLKCFLAGS="-O2"
  45. LIBDIRSUFFIX=""
  46. fi
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG $OUTPUT
  50. cd $TMP
  51. rm -rf $PRGNAM-$VERSION
  52. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  53. cd $PRGNAM-$VERSION
  54. chown -R root:root .
  55. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  56. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  57. # Patch from Debian to fix alsa-lib API breakage.
  58. patch -p1 < $CWD/03-rm_alsa-iatomic.h.patch
  59. # Hard-coded /usr/lib and /usr/X11R6/lib sucks.
  60. sed -i "s,/usr/lib,/usr/lib$LIBDIRSUFFIX,g" \
  61. configure Makefile.* brighton/Makefile.* libbrightonX11/Makefile.*
  62. sed -i "s,/usr/X11R6/lib,/usr/X11R6/lib$LIBDIRSUFFIX,g" \
  63. configure Makefile.* brighton/Makefile.* libbrightonX11/Makefile.*
  64. SLKCFLAGS+=" -fcommon"
  65. CFLAGS="$SLKCFLAGS" \
  66. CXXFLAGS="$SLKCFLAGS" \
  67. ./configure \
  68. --prefix=/usr \
  69. --libdir=/usr/lib${LIBDIRSUFFIX} \
  70. --sysconfdir=/etc \
  71. --localstatedir=/var \
  72. --mandir=/usr/man \
  73. --disable-static \
  74. --enable-shared \
  75. --build=$ARCH-slackware-linux
  76. make
  77. make install-strip DESTDIR=$PKG
  78. install -m0755 -oroot -groot $CWD/launch-bristol $PKG/usr/bin
  79. rm -f $PKG/usr/lib*/*.la
  80. # "install -m0644" rather than "cp -a" so the docs aren't executable!
  81. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  82. install -m0644 AUTHORS COPYING COPYING.GPL NEWS README ChangeLog \
  83. $PKG/usr/doc/$PRGNAM-$VERSION
  84. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  85. for px in 16 32 48 64 128; do
  86. size=${px}x${px}
  87. dir=$PKG/usr/share/icons/hicolor/$size/apps
  88. mkdir -p $dir
  89. convert -background none -resize $size bitmaps/bicon.svg $dir/$PRGNAM.png
  90. done
  91. mkdir -p $PKG/usr/share/icons/hicolor/scalable/apps
  92. cat bitmaps/bicon.svg > $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg
  93. mkdir -p $PKG/usr/share/pixmaps
  94. ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  95. # .desktop written for this SlackBuild
  96. mkdir -p $PKG/usr/share/applications
  97. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  98. mkdir -p $PKG/install
  99. cat $CWD/slack-desc > $PKG/install/slack-desc
  100. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  101. # Only add capability stuff if not disabled:
  102. if [ "${SETCAP:-yes}" = "yes" ]; then
  103. PROGS="$PRGNAM brighton bristoljackstats"
  104. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  105. # Only allow execution by audio group
  106. for file in $PROGS; do
  107. chown root:audio $PKG/usr/bin/$file
  108. chmod 0750 $PKG/usr/bin/$file
  109. done
  110. fi
  111. cd $PKG
  112. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE