MuseScore.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #!/bin/bash
  2. # Slackware build script for MuseScore
  3. # Copyright 2022 Klaatu <klaatu@member.fsf.org> | Lawrence NZ
  4. # Thanks to Tim Dickson
  5. # GNU All-Permissive License
  6. # Copying and distribution of this file, with or without modification,
  7. # are permitted in any medium without royalty provided the copyright
  8. # notice and this notice are preserved. This file is offered as-is,
  9. # without any warranty.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=MuseScore
  12. VERSION=${VERSION:-3.6.2}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) ARCH=i586 ;;
  19. arm*) ARCH=arm ;;
  20. *) ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  24. # the name of the created package would be, and then exit. This information
  25. # could be useful to other scripts.
  26. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  27. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  28. exit 0
  29. fi
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. if [ "$ARCH" = "i586" ]; then
  34. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "i686" ]; then
  37. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "x86_64" ]; then
  40. SLKCFLAGS="-O2 -fPIC"
  41. LIBDIRSUFFIX="64"
  42. else
  43. SLKCFLAGS="-O2"
  44. LIBDIRSUFFIX=""
  45. fi
  46. set -e
  47. rm -rf $PKG
  48. mkdir -p $TMP $PKG $OUTPUT
  49. cd $TMP
  50. rm -rf $PRGNAM-$VERSION
  51. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  52. cd $PRGNAM-$VERSION
  53. chown -R root:root .
  54. find -L . \
  55. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  56. -o -perm 511 \) -exec chmod 755 {} \; -o \
  57. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  58. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  59. # Copy over sound files for installation.
  60. cp $CWD/MuseScore_General_License.md share/sound
  61. cp $CWD/MuseScore_General.sf3 share/sound
  62. # Turn off Qt crash reporter. Option isn't available in Makefile,
  63. # so turn it off in CMakeLists.txt
  64. sed -i '/(BUILD_CRASH_REPORTER/s|ON)|OFF)|' CMakeLists.txt
  65. sed -i 's|share/man|man|' CMakeLists.txt
  66. mkdir b
  67. cd b
  68. cmake \
  69. -DCMAKE_INSTALL_PREFIX=/usr \
  70. -DCMAKE_C_FLAGS_RELEASE="$SLKCFLAGS" \
  71. -DCMAKE_CXX_FLAGS_RELEASE="$SLKCFLAGS" \
  72. -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="-pthread" \
  73. -DMUSESCORE_BUILD_CONFIG=release \
  74. -DDOWNLOAD_SOUNDFONT=OFF \
  75. -DUSE_SYSTEM_FREETYPE=ON \
  76. -DBUILD_WEBENGINE=OFF \
  77. -DBUILD_TELEMETRY_MODULE=OFF \
  78. -DBUILD_PORTAUDIO=ON \
  79. -DBUILD_PORTMIDI=ON \
  80. -DQMAKE=/usr/lib"${LIBDIRSUFFIX}"/qt5/bin/qmake \
  81. -DQT_QMAKE_EXECUTABLE=/usr/lib"${LIBDIRSUFFIX}"/qt5/bin/qmake \
  82. ..
  83. make install \
  84. DESTDIR=$PKG \
  85. UPDATE_CACHE=FALSE
  86. cd ..
  87. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  88. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  89. find $PKG/usr/man -type f -exec gzip -9 {} \;
  90. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  91. cp -a LICENSE.* README.md $PKG/usr/doc/$PRGNAM-$VERSION
  92. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  93. mkdir -p $PKG/install
  94. cat $CWD/slack-desc > $PKG/install/slack-desc
  95. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  96. cd $PKG
  97. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE