Merge pull request #206559 from doronbehar/pkg/musescore

musescore: 3.6.2 -> 4.0.1
This commit is contained in:
Doron Behar 2023-02-05 12:00:06 +02:00 committed by GitHub
commit 42b3a6354f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 66 deletions

View File

@ -414,7 +414,9 @@ in {
mtp = handleTest ./mtp.nix {};
multipass = handleTest ./multipass.nix {};
mumble = handleTest ./mumble.nix {};
musescore = handleTest ./musescore.nix {};
# Fails on aarch64-linux at the PDF creation step - need to debug this on an
# aarch64 machine..
musescore = handleTestOn ["x86_64-linux"] ./musescore.nix {};
munin = handleTest ./munin.nix {};
mutableUsers = handleTest ./mutable-users.nix {};
mxisd = handleTest ./mxisd.nix {};

View File

@ -2,13 +2,12 @@ import ./make-test-python.nix ({ pkgs, ...} :
let
# Make sure we don't have to go through the startup tutorial
customMuseScoreConfig = pkgs.writeText "MuseScore3.ini" ''
customMuseScoreConfig = pkgs.writeText "MuseScore4.ini" ''
[application]
startup\firstStart=false
hasCompletedFirstLaunchSetup=true
[ui]
application\startup\showTours=false
application\startup\showStartCenter=false
[project]
preferredScoreCreationMode=1
'';
in
{
@ -40,51 +39,68 @@ in
# Inject custom settings
machine.succeed("mkdir -p /root/.config/MuseScore/")
machine.succeed(
"cp ${customMuseScoreConfig} /root/.config/MuseScore/MuseScore3.ini"
"cp ${customMuseScoreConfig} /root/.config/MuseScore/MuseScore4.ini"
)
# Start MuseScore window
machine.execute("DISPLAY=:0.0 mscore >&2 &")
# Wait until MuseScore has launched
machine.wait_for_window("MuseScore")
machine.wait_for_window("MuseScore 4")
# Wait until the window has completely initialised
machine.wait_for_text("MuseScore")
# Start entering notes
machine.send_key("n")
# Type the beginning of https://de.wikipedia.org/wiki/Alle_meine_Entchen
machine.send_chars("cdef6gg5aaaa7g")
# Make sure the VM catches up with all the keys
machine.sleep(1)
machine.wait_for_text("MuseScore 4")
machine.screenshot("MuseScore0")
# Create a new score
machine.send_key("ctrl-n")
# Wait until the creation wizard appears
machine.wait_for_window("New score")
machine.screenshot("MuseScore1")
machine.send_key("tab")
machine.send_key("tab")
machine.send_key("tab")
machine.send_key("tab")
machine.send_key("right")
machine.send_key("right")
machine.send_key("ret")
machine.sleep(1)
# Type the beginning of https://de.wikipedia.org/wiki/Alle_meine_Entchen
machine.send_chars("cdef6gg5aaaa7g")
machine.sleep(1)
machine.screenshot("MuseScore2")
# Go to the export dialogue and create a PDF
machine.send_key("alt-f")
machine.sleep(1)
machine.send_key("e")
# Wait until the export dialogue appears.
machine.wait_for_window("Export")
machine.screenshot("MuseScore1")
machine.send_key("shift-tab")
machine.sleep(1)
machine.send_key("shift-tab")
machine.sleep(1)
machine.send_key("ret")
machine.sleep(1)
machine.send_key("ret")
machine.screenshot("MuseScore2")
# Wait until PDF is exported
machine.wait_for_file("/root/Documents/MuseScore3/Scores/Untitled.pdf")
# Check that it contains the title of the score
machine.succeed("pdfgrep Title /root/Documents/MuseScore3/Scores/Untitled.pdf")
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")
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.screenshot("MuseScore5")
'';
})

View File

@ -1,8 +1,9 @@
{ stdenv, lib, fetchurl, undmg }:
let
versionComponents = [ "3" "6" "2" "548020600" ];
versionComponents = [ "4" "0" "1" ];
appName = "MuseScore ${builtins.head versionComponents}";
ref = "230121751";
in
stdenv.mkDerivation rec {
@ -13,8 +14,8 @@ stdenv.mkDerivation rec {
sourceRoot = "${appName}.app";
src = fetchurl {
url = "https://github.com/musescore/MuseScore/releases/download/v${lib.concatStringsSep "." (lib.take 3 versionComponents)}/MuseScore-${version}.dmg";
sha256 = "sha256-lHckfhTTrDzaGwlbnZ5w0O1gMPbRmrmgATIGMY517l0=";
url = "https://github.com/musescore/MuseScore/releases/download/v${version}/MuseScore-${version}.${ref}.dmg";
hash = "sha256-tkIEV+tCS0SYh2TlC70/zEBUEOSg//EaSKDGA7kH/vo=";
};
buildInputs = [ undmg ];

View File

@ -1,28 +1,35 @@
{ mkDerivation, lib, fetchFromGitHub, cmake, pkg-config
{ mkDerivation, lib, fetchFromGitHub, fetchpatch, cmake, pkg-config, ninja
, alsa-lib, freetype, libjack2, lame, libogg, libpulseaudio, libsndfile, libvorbis
, portaudio, portmidi, qtbase, qtdeclarative, qtgraphicaleffects
, portaudio, portmidi, qtbase, qtdeclarative, qtgraphicaleffects, flac
, qtquickcontrols2, qtscript, qtsvg, qttools
, qtwebengine, qtxmlpatterns
, qtwebengine, qtxmlpatterns, qtnetworkauth, qtx11extras
, nixosTests
}:
mkDerivation rec {
pname = "musescore";
version = "3.6.2";
version = "4.0.1";
src = fetchFromGitHub {
owner = "musescore";
repo = "MuseScore";
rev = "v${version}";
sha256 = "sha256-GBGAD/qdOhoNfDzI+O0EiKgeb86GFJxpci35T6tZ+2s=";
sha256 = "sha256-Xhjjm/pYcjfZE632eP2jujqUAmzdYNa81EPrvS5UKnQ=";
};
patches = [
./remove_qtwebengine_install_hack.patch
# See https://github.com/musescore/MuseScore/issues/15571
(fetchpatch {
url = "https://github.com/musescore/MuseScore/commit/365be5dfb7296ebee4677cb74b67c1721bc2cf7b.patch";
hash = "sha256-tJ2M21i3geO9OsjUQKNatSXTkJ5U9qMT4RLNdJnyoKw=";
})
];
cmakeFlags = [
"-DMUSESCORE_BUILD_CONFIG=release"
# Disable the _usage_ of the `/bin/crashpad_handler` utility. See:
# https://github.com/musescore/MuseScore/pull/15577
"-DBUILD_CRASHPAD_CLIENT=OFF"
# Use our freetype
"-DUSE_SYSTEM_FREETYPE=ON"
];
@ -34,13 +41,13 @@ mkDerivation rec {
"--set-default QT_QPA_PLATFORM xcb"
];
nativeBuildInputs = [ cmake pkg-config ];
nativeBuildInputs = [ cmake pkg-config ninja ];
buildInputs = [
alsa-lib libjack2 freetype lame libogg libpulseaudio libsndfile libvorbis
portaudio portmidi # tesseract
portaudio portmidi flac # tesseract
qtbase qtdeclarative qtgraphicaleffects qtquickcontrols2
qtscript qtsvg qttools qtwebengine qtxmlpatterns
qtscript qtsvg qttools qtwebengine qtxmlpatterns qtnetworkauth qtx11extras
];
passthru.tests = nixosTests.musescore;
@ -48,8 +55,10 @@ mkDerivation rec {
meta = with lib; {
description = "Music notation and composition software";
homepage = "https://musescore.org/";
license = licenses.gpl2;
license = licenses.gpl3Only;
maintainers = with maintainers; [ vandenoever turion doronbehar ];
# Darwin requires CoreMIDI from SDK 11.3, we use the upstream built .dmg
# file in ./darwin.nix in the meantime.
platforms = platforms.linux;
};
}

View File

@ -1,19 +0,0 @@
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -220,16 +219,0 @@ else (MINGW)
- ## install qwebengine core
- if (NOT APPLE AND USE_WEBENGINE)
- install(PROGRAMS
- ${QT_INSTALL_LIBEXECS}/QtWebEngineProcess
- DESTINATION bin
- )
- install(DIRECTORY
- ${QT_INSTALL_DATA}/resources
- DESTINATION lib/qt5
- )
- install(DIRECTORY
- ${QT_INSTALL_TRANSLATIONS}/qtwebengine_locales
- DESTINATION lib/qt5/translations
- )
- endif(NOT APPLE AND USE_WEBENGINE)
-