Merge pull request #248753 from huantianad/musescore-freetype

musescore: re-add USE_SYSTEM_FREETYPE functionality
This commit is contained in:
Doron Behar 2023-08-16 06:18:23 +00:00 committed by GitHub
commit 0e22f9be54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,18 @@ in stdenv'.mkDerivation rec {
url = "https://github.com/doronbehar/MuseScore/commit/f48448a3ede46f5a7ef470940072fbfb6742487c.patch";
hash = "sha256-UEc7auscnW0KMfWkLKQtm+UstuTNsuFeoNJYIidIlwM=";
})
# Upstream removed the option to use system freetype library in v4.1.0,
# causing the app to crash on systems when the outdated bundled freetype
# tries to load the Noto Sans font. For more info on the crash itself,
# see #244409 and https://github.com/musescore/MuseScore/issues/18795.
# For now, re-add the option ourselves. The fix has been merged upstream,
# so we can remove this patch with the next version. In the future, we
# may replace the other bundled thirdparty libs with system libs, see
# https://github.com/musescore/MuseScore/issues/11572.
(fetchpatch {
url = "https://github.com/musescore/MuseScore/commit/9ab6b32b1c3b990cfa7bb172ee8112521dc2269c.patch";
hash = "sha256-5GA29Z+o3I/uDTTDbkauZ8/xSdCE6yY93phMSY0ea7s=";
})
];
cmakeFlags = [
@ -73,7 +85,7 @@ in stdenv'.mkDerivation rec {
# https://github.com/musescore/MuseScore/issues/15571
"-DMUE_BUILD_CRASHPAD_CLIENT=OFF"
# Use our freetype
"-DUSE_SYSTEM_FREETYPE=ON"
"-DMUE_COMPILE_USE_SYSTEM_FREETYPE=ON"
# From some reason, in $src/build/cmake/SetupBuildEnvironment.cmake,
# upstream defaults to compiling to x86_64 only, unless this cmake flag is
# set
@ -141,6 +153,9 @@ in stdenv'.mkDerivation rec {
ln -s $out/Applications/mscore.app/Contents/MacOS/mscore $out/bin/mscore.
'';
# Don't run bundled upstreams tests, as they require a running X window system.
doCheck = false;
passthru.tests = nixosTests.musescore;
meta = with lib; {