mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-29 19:30:11 +00:00
musescore: 4.4.1 -> 4.4.3 (#353370)
This commit is contained in:
@@ -43,13 +43,10 @@ in
|
||||
)
|
||||
|
||||
# Start MuseScore window
|
||||
machine.execute("DISPLAY=:0.0 mscore >&2 &")
|
||||
machine.execute("env XDG_RUNTIME_DIR=$PWD DISPLAY=:0.0 mscore >&2 &")
|
||||
|
||||
# Wait until MuseScore has launched
|
||||
machine.wait_for_window("MuseScore 4")
|
||||
|
||||
# Wait until the window has completely initialised
|
||||
machine.wait_for_text("MuseScore 4")
|
||||
machine.wait_for_window("MuseScore Studio")
|
||||
|
||||
machine.screenshot("MuseScore0")
|
||||
|
||||
@@ -75,29 +72,22 @@ in
|
||||
machine.screenshot("MuseScore2")
|
||||
|
||||
# Go to the export dialogue and create a PDF
|
||||
machine.send_key("alt-f")
|
||||
machine.sleep(1)
|
||||
machine.send_key("e")
|
||||
machine.send_key("ctrl-p")
|
||||
|
||||
# Wait until the export dialogue appears.
|
||||
machine.wait_for_text("Export")
|
||||
|
||||
machine.screenshot("MuseScore3")
|
||||
|
||||
machine.send_key("shift-tab")
|
||||
machine.sleep(1)
|
||||
machine.send_key("ret")
|
||||
machine.sleep(1)
|
||||
machine.send_key("ret")
|
||||
# Wait until the Print dialogue appears.
|
||||
machine.wait_for_window("Print")
|
||||
|
||||
machine.screenshot("MuseScore4")
|
||||
|
||||
# Wait until PDF is exported
|
||||
machine.wait_for_file('"/root/Documents/MuseScore4/Scores/Untitled score.pdf"')
|
||||
|
||||
# Check that it contains the title of the score
|
||||
machine.succeed('pdfgrep "Untitled score" "/root/Documents/MuseScore4/Scores/Untitled score.pdf"')
|
||||
machine.send_key("alt-p")
|
||||
machine.sleep(1)
|
||||
|
||||
machine.screenshot("MuseScore5")
|
||||
|
||||
# Wait until PDF is exported
|
||||
machine.wait_for_file('"/root/Untitled score.pdf"')
|
||||
|
||||
## Check that it contains the title of the score
|
||||
machine.succeed('pdfgrep "Untitled score" "/root/Untitled score.pdf"')
|
||||
machine.copy_from_vm("/root/Untitled score.pdf")
|
||||
'';
|
||||
})
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, cmake
|
||||
, wrapGAppsHook3
|
||||
, wrapQtAppsHook
|
||||
, pkg-config
|
||||
, ninja
|
||||
@@ -34,10 +34,10 @@
|
||||
}:
|
||||
|
||||
let
|
||||
stdenv' = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
|
||||
stdenv' = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
|
||||
# portaudio propagates Darwin frameworks. Rebuild it using the 11.0 stdenv
|
||||
# from Qt and the 11.0 SDK frameworks.
|
||||
portaudio' = if stdenv.isDarwin then portaudio.override {
|
||||
portaudio' = if stdenv.hostPlatform.isDarwin then portaudio.override {
|
||||
stdenv = stdenv';
|
||||
inherit (darwin.apple_sdk_11_0.frameworks)
|
||||
AudioUnit
|
||||
@@ -49,22 +49,14 @@ let
|
||||
} else portaudio;
|
||||
in stdenv'.mkDerivation (finalAttrs: {
|
||||
pname = "musescore";
|
||||
version = "4.4.1";
|
||||
version = "4.4.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "musescore";
|
||||
repo = "MuseScore";
|
||||
rev = "v${finalAttrs.version}";
|
||||
sha256 = "sha256-eLtpLgXSc8L5y1Mg3s1wrxr09+/vBxNqJEtl9IoKYSM=";
|
||||
sha256 = "sha256-bHpPhav9JBPkwJA9o+IFHRWbvxWnGkD1wHBHS4XJ/YE=";
|
||||
};
|
||||
patches = [
|
||||
# https://github.com/musescore/MuseScore/pull/24326
|
||||
(fetchpatch {
|
||||
name = "fix-menubar-with-qt6.5+.patch";
|
||||
url = "https://github.com/musescore/MuseScore/pull/24326/commits/b274f13311ad0b2bce339634a006ba22fbd3379e.patch";
|
||||
hash = "sha256-ZGmjRa01CBEIxJdJYQMhdg4A9yjWdlgn0pCPmENBTq0=";
|
||||
})
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DMUSE_APP_BUILD_MODE=release"
|
||||
@@ -82,25 +74,37 @@ in stdenv'.mkDerivation (finalAttrs: {
|
||||
# Don't bundle qt qml files, relevant really only for darwin, but we set
|
||||
# this for all platforms anyway.
|
||||
"-DMUE_COMPILE_INSTALL_QTQML_FILES=OFF"
|
||||
# Don't build unit tests unless we are going to run them.
|
||||
(lib.cmakeBool "MUSE_ENABLE_UNIT_TESTS" finalAttrs.finalPackage.doCheck)
|
||||
];
|
||||
|
||||
qtWrapperArgs = [
|
||||
# MuseScore JACK backend loads libjack at runtime.
|
||||
"--prefix ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}"
|
||||
] ++ lib.optionals (stdenv.isLinux) [
|
||||
"--prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}"
|
||||
] ++ lib.optionals (stdenv.hostPlatform.isLinux) [
|
||||
"--set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib"
|
||||
] ++ lib.optionals (!stdenv.isDarwin) [
|
||||
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
||||
# There are some issues with using the wayland backend, see:
|
||||
# https://musescore.org/en/node/321936
|
||||
"--set-default QT_QPA_PLATFORM xcb"
|
||||
];
|
||||
|
||||
preFixup = ''
|
||||
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
||||
'';
|
||||
|
||||
dontWrapGApps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
wrapQtAppsHook
|
||||
cmake
|
||||
qttools
|
||||
pkg-config
|
||||
ninja
|
||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
# Since https://github.com/musescore/MuseScore/pull/13847/commits/685ac998
|
||||
# GTK3 is needed for file dialogs. Fixes crash with No GSettings schemas error.
|
||||
wrapGAppsHook3
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@@ -123,23 +127,46 @@ in stdenv'.mkDerivation (finalAttrs: {
|
||||
qtsvg
|
||||
qtscxml
|
||||
qtnetworkauth
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
alsa-lib
|
||||
qtwayland
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
darwin.apple_sdk_11_0.frameworks.Cocoa
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
# Remove unneeded bundled libraries and headers
|
||||
rm -r $out/{include,lib}
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
mkdir -p "$out/Applications"
|
||||
mv "$out/mscore.app" "$out/Applications/mscore.app"
|
||||
mkdir -p $out/bin
|
||||
ln -s $out/Applications/mscore.app/Contents/MacOS/mscore $out/bin/mscore
|
||||
'';
|
||||
|
||||
# muse-sounds-manager installs Muse Sounds sampler libMuseSamplerCoreLib.so.
|
||||
# It requires that argv0 of the calling process ends with "/mscore" or "/MuseScore-4".
|
||||
# We need to ensure this in two cases:
|
||||
#
|
||||
# 1) when the user invokes MuseScore as "mscore" on the command line or from
|
||||
# the .desktop file, and the normal argv0 is "mscore" (no "/");
|
||||
# 2) when MuseScore invokes itself via File -> New, and the normal argv0 is
|
||||
# the target of /proc/self/exe, which in Nixpkgs was "{...}/.mscore-wrapped"
|
||||
#
|
||||
# In order to achieve (2) we install the final binary as $out/libexec/mscore, and
|
||||
# in order to achieve (1) we use makeWrapper without --inherit-argv0.
|
||||
#
|
||||
# wrapQtAppsHook uses wrapQtApp -> wrapProgram -> makeBinaryWrapper --inherit-argv0
|
||||
# so we disable it and explicitly use makeQtWrapper.
|
||||
#
|
||||
# TODO: check if something like this is also needed for macOS.
|
||||
dontWrapQtApps = stdenv.hostPlatform.isLinux;
|
||||
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
mkdir -p $out/libexec
|
||||
mv $out/bin/mscore $out/libexec
|
||||
makeQtWrapper $out/libexec/mscore $out/bin/mscore
|
||||
'';
|
||||
|
||||
# Don't run bundled upstreams tests, as they require a running X window system.
|
||||
doCheck = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user