mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-03 06:04:38 +00:00
musescore: fix qtdeclarative crash (#558368)
This commit is contained in:
@@ -2,45 +2,78 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
|
||||
# nativeBuildInputs
|
||||
cmake,
|
||||
wrapGAppsHook3,
|
||||
pkg-config,
|
||||
ninja,
|
||||
pkg-config,
|
||||
wrapGAppsHook3,
|
||||
|
||||
# buildInputs
|
||||
alsa-lib,
|
||||
alsa-plugins,
|
||||
ffmpeg,
|
||||
flac,
|
||||
freetype,
|
||||
qt6,
|
||||
lame,
|
||||
libjack2,
|
||||
libogg,
|
||||
libopus,
|
||||
libopusenc,
|
||||
libpulseaudio,
|
||||
libsndfile,
|
||||
libvorbis,
|
||||
mnxdom,
|
||||
portaudio,
|
||||
portmidi,
|
||||
flac,
|
||||
libopusenc,
|
||||
libopus,
|
||||
mnxdom,
|
||||
kdePackages,
|
||||
pugixml,
|
||||
utf8cpp,
|
||||
|
||||
# passthru tests
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
let
|
||||
qt6' = qt6.overrideScope (
|
||||
self: super: {
|
||||
# Fix for: https://github.com/NixOS/nixpkgs/issues/526825
|
||||
# reported upstream at: https://github.com/musescore/MuseScore/issues/33015
|
||||
qtdeclarative = super.qtdeclarative.overrideAttrs (
|
||||
new: old: {
|
||||
patches = old.patches ++ [
|
||||
(fetchpatch {
|
||||
url = "https://github.com/qt/qtdeclarative/commit/9d4d376726a6ce15c429128dc65b927e411e40da.patch";
|
||||
hash = "sha256-XhfliF5wZuN4/E55f8hfipIRjxBe9V7vL1cgn5p4xqA=";
|
||||
})
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "musescore";
|
||||
version = "4.7.0";
|
||||
version = "4.7.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "musescore";
|
||||
repo = "MuseScore";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-AEYZWkcjqB2pW+oBow2oMX1HQn4kRaTBBxhyxIbG0a4=";
|
||||
hash = "sha256-ny6s5hQUxopb6c45KJugYEZULkC8fLP+Au5ghic0KvI=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix for https://github.com/musescore/MuseScore/issues/34091 also reported
|
||||
# downstream at: https://github.com/NixOS/nixpkgs/issues/540783. PR to
|
||||
# track: https://github.com/musescore/MuseScore/pull/34204
|
||||
(fetchpatch {
|
||||
url = "https://github.com/musescore/MuseScore/commit/f273501e418842351c4bda10cce32b0e329eaff1.patch";
|
||||
hash = "sha256-zrZRzeAHSFGtCuw/o4A3b1Blbo3FxKGxw1UDu9IggzY=";
|
||||
})
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeFeature "MUSE_APP_BUILD_MODE" "release")
|
||||
# Disable the build and usage of the `/bin/crashpad_handler` utility - it's
|
||||
@@ -59,6 +92,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# Implies also OPUS
|
||||
"OPUSENC"
|
||||
"FLAC"
|
||||
"PUGIXML"
|
||||
"LAME"
|
||||
"UTF8CPP"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
# https://github.com/musescore/MuseScore/issues/33467
|
||||
@@ -87,11 +123,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
dontWrapGApps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
kdePackages.wrapQtAppsHook
|
||||
cmake
|
||||
kdePackages.qttools
|
||||
pkg-config
|
||||
qt6'.qttools
|
||||
qt6'.wrapQtAppsHook
|
||||
ninja
|
||||
pkg-config
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
# Since https://github.com/musescore/MuseScore/pull/13847/commits/685ac998
|
||||
@@ -100,30 +136,42 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libjack2
|
||||
flac
|
||||
freetype
|
||||
qt6'.qt5compat
|
||||
qt6'.qtbase
|
||||
qt6'.qtdeclarative
|
||||
qt6'.qtnetworkauth
|
||||
qt6'.qtscxml
|
||||
qt6'.qtsvg
|
||||
lame
|
||||
libjack2
|
||||
libogg
|
||||
libopus
|
||||
libopusenc
|
||||
libpulseaudio
|
||||
libsndfile
|
||||
libvorbis
|
||||
mnxdom
|
||||
portaudio
|
||||
portmidi
|
||||
flac
|
||||
libopusenc
|
||||
libopus
|
||||
mnxdom
|
||||
kdePackages.qtbase
|
||||
kdePackages.qtdeclarative
|
||||
kdePackages.qt5compat
|
||||
kdePackages.qtsvg
|
||||
kdePackages.qtscxml
|
||||
kdePackages.qtnetworkauth
|
||||
pugixml
|
||||
utf8cpp
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
alsa-lib
|
||||
kdePackages.qtwayland
|
||||
qt6'.qtwayland
|
||||
];
|
||||
|
||||
# Put the default, `$prefix/lib` directory to look for ffmpeg shared objects,
|
||||
# Nixpkgs' provided ffmpeg, for both MacOS & Linux. Note that upstream uses
|
||||
# the /usr/lib/x86_64-linux-gnu location for any Linux (e.g aarch64 too).
|
||||
preConfigure = ''
|
||||
substituteInPlace src/framework/media/internal/ffmpegutils.cpp \
|
||||
--replace-fail "/usr/lib/x86_64-linux-gnu" "${lib.getLib ffmpeg}/lib" \
|
||||
--replace-fail "/opt/homebrew/lib" "${lib.getLib ffmpeg}/lib" \
|
||||
'';
|
||||
|
||||
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
mkdir -p "$out/Applications"
|
||||
mv "$out/mscore.app" "$out/Applications/mscore.app"
|
||||
@@ -157,7 +205,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# Don't run bundled upstreams tests, as they require a running X window system.
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests = nixosTests.musescore;
|
||||
passthru.tests.nixos = nixosTests.musescore;
|
||||
|
||||
meta = {
|
||||
description = "Music notation and composition software";
|
||||
|
||||
Reference in New Issue
Block a user