# Maintainer (arch): Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Cristian Maureira <saint@archlinux.cl>
# Contributor: Dr.Egg <rwhite@archlinux.us>
# Maintainer: bill-auger <bill-auger@programmer.net>

# parabola changes and rationale:
#   - remove qt5-webengine support (redmine #2136)


pkgname=musescore
pkgver=3.2.3
pkgrel=1
pkgrel+=.parabola1
pkgdesc='Create, play and print beautiful sheet music'
arch=(x86_64)
arch+=('armv7h' 'i686')
url=https://musescore.org/
license=(GPL)
depends=(           \
  alsa-lib          \
  freetype2         \
  libpulse          \
  libsndfile        \
  libvorbisfile.so  \
  portaudio         \
  portmidi          \
  qt5-base          \
  qt5-declarative   \
  qt5-quickcontrols \
  qt5-svg           \
  qt5-tools         \
  qt5-xmlpatterns   \
  zlib              \
)
makedepends=(  \
  cmake        \
  doxygen      \
  git          \
  lame         \
  qt5-script   \
  texlive-core \
)
optdepends=('lame: MP3 export')
source=(git+https://github.com/musescore/MuseScore.git#tag=v${pkgver})
sha256sums=('SKIP')

prepare() {
  sed 's/BUILD_WEBENGINE="ON"/BUILD_WEBENGINE="OFF"/'                                                                               -i MuseScore/Makefile
  sed 's/option(BUILD_WEBENGINE "Built in webengine support" ON)/option(BUILD_WEBENGINE "Built in webengine support" OFF)/'         -i MuseScore/CMakeLists.txt
  sed 's/option(BUILD_CRASH_REPORTER "Build with crash reporter" ON)/option(BUILD_CRASH_REPORTER "Build with crash reporter" OFF)/' -i MuseScore/CMakeLists.txt
}

build() {
  make PREFIX=/usr NO_RPATH=TRUE USE_SYSTEM_FREETYPE=ON -C MuseScore revision release
}

package() {
  make DESTDIR="${pkgdir}" UPDATE_CACHE=FALSE -C MuseScore/build.release install
}
