lmms.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/bash
  2. # Slackware build script for lmms
  3. # Written by Zbigniew Baniewski, <Zbigniew [dot] Baniewski [at] gmail [dot] com>
  4. # 20200415 bkw: modified by SlackBuilds.org
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=lmms
  7. VERSION=${VERSION:-1.2.2}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i586" ]; then
  29. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf $PRGNAM
  46. tar xvf $CWD/${PRGNAM}_$VERSION.tar.?z
  47. cd $PRGNAM
  48. # Fix symlink
  49. ( cd plugins/carlabase/carla/bin/carla.lv2
  50. rm resources
  51. ln -s ../../resources . )
  52. chown -R root:root .
  53. find -L . \
  54. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  55. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  56. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  57. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  58. # 20200415 bkw: warning: if we don't set BASHCOMP_PKG_PATH, the
  59. # completions get installed to /usr (ignores DESTDIR)!
  60. mkdir build
  61. cd build
  62. cmake \
  63. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS -Wno-error" \
  64. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -Wno-error" \
  65. -DCMAKE_INSTALL_PREFIX=/usr \
  66. -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \
  67. -DBASHCOMP_PKG_PATH=$PKG/usr/share/bash-completion/completions \
  68. -DWANT_QT5=1 \
  69. ..
  70. make VERBOSE=1
  71. make install DESTDIR=$PKG
  72. cd ..
  73. # Move man pages to correct location
  74. mv $PKG/usr/share/man $PKG/usr/
  75. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  76. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  77. find $PKG/usr/man -type f -exec gzip -9 {} \;
  78. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  79. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  80. cp -a doc/AUTHORS README.md LICENSE.txt $PKG/usr/doc/$PRGNAM-$VERSION
  81. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  82. mkdir -p $PKG/install
  83. cat $CWD/slack-desc > $PKG/install/slack-desc
  84. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  85. # 20200415 bkw: if we built with jack, do the realtime thing.
  86. if ldd $PKG/usr/bin/$PRGNAM | grep -q libjack; then
  87. if [ "${SETCAP:-yes}" = "yes" ]; then
  88. echo "[ -x /sbin/setcap ] && " \
  89. "/sbin/setcap cap_ipc_lock,cap_sys_nice=ep usr/bin/$PRGNAM" \
  90. >> $PKG/install/doinst.sh
  91. # Only allow execution by audio group
  92. chown root:audio $PKG/usr/bin/$PRGNAM
  93. chmod 0750 $PKG/usr/bin/$PRGNAM
  94. fi
  95. fi
  96. cd $PKG
  97. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE