slackbuilds_ponce/multimedia/MuseScore/MuseScore.SlackBuild
klaatu 05ff58168c
multimedia/MuseScore: Updated for version 3.6.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2021-01-30 09:38:43 +07:00

95 lines
2.5 KiB
Bash

#!/bin/sh
# Slackware build script for MuseScore
# Maintained by Klaatu at member.fsf dot org
PRGNAM=MuseScore
VERSION=${VERSION:-3.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Copy over sound files for installation.
cp $CWD/MuseScore_General_License.md share/sound
cp $CWD/MuseScore_General.sf3 share/sound
# Turn off Qt crash reporter. Option isn't available in Makefile,
# so turn it off in CMakeLists.txt
sed -i '/(BUILD_CRASH_REPORTER/s|ON)|OFF)|' CMakeLists.txt
sed -i 's|share/man|man|' CMakeLists.txt
#musescore doesn't like to build with webengine with qt4 installed
#because the qmake finder finds the qt4 version. lets patch this
sed -i 's/qmake)/qmake-qt5)/g' build/FindQt5.cmake
make revision
make release \
PREFIX=/usr \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
LDFLAGS="-pthread" \
MUSESCORE_BUILD_CONFIG=release \
DOWNLOAD_SOUNDFONT=OFF \
USE_SYSTEM_FREETYPE=ON \
BUILD_WEBENGINE=ON \
VERBOSE=1
make install \
-C build.release \
DESTDIR=$PKG \
UPDATE_CACHE=FALSE
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/man -type f -exec gzip -9 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE.* README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}