318.3. musescore-4.7.5
MuseScore Studio — music notation: write, play back, print and export scores, with the MS Basic soundfont
| Version | 4.7.5, release 2 |
| Shelf | studio — Music production: DAWs, audio editors, trackers, drum machines and notation |
| Phase | 44_apps (Applications), 373 of 422 in build order |
| Licence | GPL-3.0-only AND MIT |
| Homepage | https://musescore.org/ |
| Build time | 46.5 SBU |
| Installed size | 207.4 MiB in 771 files |
| Recipe | ports/core/studio/musescore/kpkgbuild |
About
MuseScore Studio is a music notation program: scores are written on the staff, played back with a built-in synthesiser, and printed or exported as PDF, MusicXML, MIDI and audio. The interface is Qt 6 and QML on upstream’s “muse” framework, which Audacity 4 also uses. The package installs the program as mscore with a musescore link beside it, and ships the MS Basic soundfont that playback uses.
Sources
musescore-4.7.5.tar.gz(159.4 MiB)
sha256b9db52e139e925adfc56e3ab59244f44da4db7e5e133d5084c5da5dfc3dfb9d1
upstream: https://github.com/musescore/MuseScore/archive/refs/tags/v4.7.5.tar.gz
archive copy: sources-4/studio--musescore-4.7.5.tar.gzmnxdom-488aa8757ec602c20ff8cf599a2c6857339d8e93.tar.gz(197.2 KiB)
sha256308b413cf8288e872715fcdede0ec8504693f7bbadcc50bd5969ed7ea1d35baa
upstream: https://github.com/rpatters1/mnxdom/archive/488aa8757ec602c20ff8cf599a2c6857339d8e93.tar.gz
archive copy: sources-4/studio--mnxdom-488aa8757ec602c20ff8cf599a2c6857339d8e93.tar.gzjson-schema-validator-40af3ec39670e768fc3f01f935140af311d71024.tar.gz(81.2 KiB)
sha25636d7e99a73aa6076834736f0fb108fa8e232c4739aa4b3e2089fe96efb21fa8d
upstream: https://github.com/pboettch/json-schema-validator/archive/40af3ec39670e768fc3f01f935140af311d71024.tar.gz
archive copy: sources-4/studio--json-schema-validator-40af3ec39670e768fc3f01f935140af311d71024.tar.gz
Dependencies
Depends on: cmake, ninja, pkgconf, gzip, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, qt6-qtshadertools, qt6-qt5compat, qt6-qtnetworkauth, qt6-qttools, qt6-qtwayland, alsa-lib, pipewire, flac, opus, libopusenc, lame, harfbuzz, freetype2, pugixml, utfcpp, nlohmann-json.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
fix-destdir-symlinks.patch— Upstream’s pull request 33819. The install rules insrc/app/CMakeLists.txt(Linux and FreeBSD) andbuildscripts/packaging/Linux+BSD/SetupAppImagePackaging.cmakecreate themusescorelink tomscoreand themusescoremanual page’s link tomscore’s withcmake -E create_symlinkat a path built fromCMAKE_INSTALL_PREFIXalone. The patch puts$ENV{DESTDIR}in front of the link’s own path (the target stays/usr/...), so the links land in the package instead of in the build root’s/usr.wayland-platform.patch— Removes the block ofsrc/app/main.cppthat, on Linux, setsQT_QPA_PLATFORMTHEME=gtk3(unlessMU_QT_QPA_PLATFORMisoffscreen) and, unlessMU_QT_QPA_PLATFORMis set,QT_QPA_PLATFORM=xcb. Unpatched, MuseScore is always an Xwayland window with the GTK 3 platform theme; patched, Qt follows the session’sQT_QPA_PLATFORMandQT_QPA_PLATFORMTHEME(see a graphical application).
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install musescore'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/studio/musescore.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/studio/musescore
echo 'b9db52e139e925adfc56e3ab59244f44da4db7e5e133d5084c5da5dfc3dfb9d1 musescore-4.7.5.tar.gz' | sha256sum -c -
echo '308b413cf8288e872715fcdede0ec8504693f7bbadcc50bd5969ed7ea1d35baa mnxdom-488aa8757ec602c20ff8cf599a2c6857339d8e93.tar.gz' | sha256sum -c -
echo '36d7e99a73aa6076834736f0fb108fa8e232c4739aa4b3e2089fe96efb21fa8d json-schema-validator-40af3ec39670e768fc3f01f935140af311d71024.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/musescore
SRC=$SRC_ROOT/musescore-4.7.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf musescore-4.7.5.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf mnxdom-488aa8757ec602c20ff8cf599a2c6857339d8e93.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf json-schema-validator-40af3ec39670e768fc3f01f935140af311d71024.tar.gz -C "$SRC_ROOT"
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _mnxdom, _jsv and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/fix-destdir-symlinks.patch"
patch -p1 -i "$PORT_SRC/wayland-platform.patch"
export CXXFLAGS="$CXXFLAGS -D_LARGEFILE64_SOURCE"
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_SKIP_RPATH=ON \
-D FETCHCONTENT_FULLY_DISCONNECTED=ON \
-D FETCHCONTENT_SOURCE_DIR_MNXDOM="$SRC_ROOT/mnxdom-$_mnxdom" \
-D FETCHCONTENT_SOURCE_DIR_JSON_SCHEMA_VALIDATOR="$SRC_ROOT/json-schema-validator-$_jsv" \
-D USE_SYSTEM_NLOHMANN_JSON=ON \
-D USE_SYSTEM_JSON_SCHEMA_VALIDATOR=OFF \
-D mnxdom_BUILD_TESTING=OFF \
-D JSON_VALIDATOR_BUILD_TESTS=OFF \
-D JSON_VALIDATOR_BUILD_EXAMPLES=OFF \
-D JSON_VALIDATOR_INSTALL=OFF \
-D MUSESCORE_BUILD_CONFIGURATION=app \
-D MUSE_APP_BUILD_MODE=release \
-D MUSE_ENABLE_UNIT_TESTS=OFF \
-D MUSE_COMPILE_USE_COMPILER_CACHE=OFF \
-D MUSE_COMPILE_USE_UNITY=OFF \
-D MUSE_MODULE_UPDATE=OFF \
-D MUSE_MODULE_CLOUD=OFF \
-D MUSE_MODULE_LEARN=OFF \
-D MUSE_MODULE_MUSESAMPLER=OFF \
-D MUE_BUILD_MUSESOUNDS_MODULE=OFF \
-D MUE_BUILD_MUSESOUNDS_QML=ON \
-D MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT=OFF \
-D MUSE_MODULE_VST=OFF \
-D MUSE_MODULE_AUDIO_JACK=OFF \
-D MUSE_MODULE_AUDIO_PIPEWIRE=ON \
-D MUE_DOWNLOAD_SOUNDFONT=OFF \
-D MUE_INSTALL_SOUNDFONT=ON \
-D MUE_RUN_LRELEASE=OFF \
-D MUE_COMPILE_USE_SYSTEM_FLAC=ON \
-D MUE_COMPILE_USE_SYSTEM_OPUS=ON \
-D MUE_COMPILE_USE_SYSTEM_OPUSENC=ON \
-D MUE_COMPILE_USE_SYSTEM_LAME=ON \
-D MUE_COMPILE_USE_SYSTEM_HARFBUZZ=ON \
-D MUE_COMPILE_USE_SYSTEM_FREETYPE=ON \
-D MUE_COMPILE_USE_SYSTEM_PUGIXML=ON \
-D MUE_COMPILE_USE_SYSTEM_UTF8CPP=ON \
-D MUE_COMPILE_USE_SYSTEM_MNXDOM=OFF \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
rm -rf "$PKG/usr/include" "$PKG/usr/lib/pkgconfig"
find "$PKG/usr/lib" -name '*.a' -delete
find "$PKG/usr/share" -path '*/locale/*.qm' -delete
cat > "$PKG/usr/share/applications/org.musescore.MuseScore.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=MuseScore Studio
GenericName=Music Notation
Comment=Create, play and print sheet music
TryExec=mscore
Exec=mscore %U
Icon=mscore
Terminal=false
StartupNotify=true
StartupWMClass=org.musescore.MuseScore
MimeType=application/x-musescore;application/x-musescore+xml;application/vnd.recordare.musicxml;application/vnd.recordare.musicxml+xml;application/x-mei+xml;application/x-bww;application/x-biab;application/x-capella;audio/x-gtp;application/x-musedata;application/x-overture;audio/x-ptb;application/x-tef;
Categories=AudioVideo;Audio;Midi;Sequencer;Music;Publishing;Qt;
Keywords=music;notation;composition;composing;arranging;sheet music;score;scorewriter;midi;musicxml;musescore;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.musescore.MuseScore.desktop"
The switches, and why each is set:
-D CMAKE_SKIP_RPATH=ON— write noRPATHinto any binary, at build or at install; the libraries are all in/usr/lib(see what the package lint refuses).-D FETCHCONTENT_FULLY_DISCONNECTED=ON— FetchContent performs no download or update step at all. The MNX importer (src/importexport/mnx) declares two git dependencies for FetchContent: the mnxdom DOM library and, inside it, pboettch’s JSON Schema validator. They are the recipe’s second and third sources, pinned to the commits upstream names (_mnxdomand_jsvinkpkgbuild).-D FETCHCONTENT_SOURCE_DIR_MNXDOM="$SRC_ROOT/mnxdom-$_mnxdom"— andFETCHCONTENT_SOURCE_DIR_JSON_SCHEMA_VALIDATOR: point each declaration at its unpacked tarball, so FetchContent uses that tree and clones nothing.-D USE_SYSTEM_NLOHMANN_JSON=ON— mnxdom’s switch: take the JSON library from the nlohmann-json port instead of downloading it.-D USE_SYSTEM_JSON_SCHEMA_VALIDATOR=OFFbuilds the validator from its own source, which is not a port.-D mnxdom_BUILD_TESTING=OFF— andJSON_VALIDATOR_BUILD_TESTS,JSON_VALIDATOR_BUILD_EXAMPLES: no tests or examples of the two fetched libraries.-D JSON_VALIDATOR_INSTALL=OFF— the validator installs nothing. It and mnxdom are built as static libraries inside the program.-D MUSESCORE_BUILD_CONFIGURATION=app— the desktop application, upstream’s default configuration.-D MUSE_APP_BUILD_MODE=release— a stable release; upstream’s default isdev, the development and nightly mode.-D MUSE_ENABLE_UNIT_TESTS=OFF— no unit tests.-D MUSE_COMPILE_USE_COMPILER_CACHE=OFF— upstream’s default tries ccache, sccache and buildcache in turn and puts the first it finds in front of the compiler; off, the tree’s compiler is called directly.-D MUSE_COMPILE_USE_UNITY=OFF— compile every source file as its own translation unit. Upstream’s default is a unity build, which merges each module’s sources, twelve at a time, into one.-D MUSE_MODULE_UPDATE=OFF— andMUSE_MODULE_CLOUD,MUSE_MODULE_LEARN,MUSE_MODULE_MUSESAMPLER,MUE_BUILD_MUSESOUNDS_MODULE: the update checker, the MuseScore.com account and cloud scores, the Learn page, and the Muse Sounds and Muse Sampler integration (proprietary instruments delivered online). Upstream’s stubs take their place.-D MUE_BUILD_MUSESOUNDS_QML=ON— the MuseSounds QML target, whose default followsMUE_BUILD_MUSESOUNDS_MODULE. The app shell’s QML module names that target as a dependency, so with it off the configure stops withArgument musesounds_qml is not a target!; on, the stub builds its placeholder page under the same target (see a stub whose QML target is off with its module).-D MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT=OFF— no Crashpad crash-reporting client.-D MUSE_MODULE_VST=OFF— no VST3 hosting, which needs Steinberg’s SDK.-D MUSE_MODULE_AUDIO_JACK=OFF— no JACK driver.-D MUSE_MODULE_AUDIO_PIPEWIRE=ONbuilds the native PipeWire driver, off by default upstream; the ALSA driver is built beside it. Alibpipewire-0.3the configure cannot find only prints a warning and drops the PipeWire driver, so pipewire is independs.-D MUE_DOWNLOAD_SOUNDFONT=OFF— no download of the latest soundfont during the build.-D MUE_INSTALL_SOUNDFONT=ONinstalls theMS Basic.sf3that the release tree carries undershare/sound.-D MUE_RUN_LRELEASE=OFF— compile no interface translations; the package is English only under the size and language policy, andbuild.shdeletes any.qmcatalogue the install puts under alocaledirectory.-D MUE_COMPILE_USE_SYSTEM_FLAC=ON— and theOPUS,OPUSENC,LAME,HARFBUZZ,FREETYPE,PUGIXMLandUTF8CPPswitches: link each of these libraries from its port instead of compiling upstream’s bundled copy. HarfBuzz must be found: when it is not,SetupHarfBuzz.cmakedownloads a build recipe for it from upstream’smuse_depsrepository, which the offline build cannot do, so harfbuzz is independs.-D MUE_COMPILE_USE_SYSTEM_MNXDOM=OFF— build mnxdom through FetchContent from the recipe’s source; mnxdom is not a port.-D_LARGEFILE64_SOURCE— added toCXXFLAGS: musl declares the 64-bit file-offset names (stat64,off64_t,lseek64) only under this macro, which_GNU_SOURCEdoes not imply (see a glibc-only call on musl).
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/musescore, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf musescore-4.7.5-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/musescore, and runs the triggers its paths call for.
Contents
Installed programs: mscore, musescore.
Installed directories: /usr/share/licenses/musescore, /usr/share/mscore-4.7.
Short descriptions
mscore |
MuseScore 4 sheet music editor |
Notes
After the install, build.sh deletes /usr/include, /usr/lib/pkgconfig and every static archive under /usr/lib: they come from mnxdom’s own install rules, a static library, its headers and a mnxdom.pc that nothing on the system links against.
The recipe writes its own org.musescore.MuseScore.desktop. MuseScore sets its desktop file name to org.musescore.MuseScore, which is its Wayland app id and the entry’s StartupWMClass. The entry claims MuseScore’s score formats and the notation formats it imports, and leaves MIDI files and soundfonts to the players and synthesisers.