Skip to content

Commit

Permalink
Merge pull request #206559 from doronbehar/pkg/musescore
Browse files Browse the repository at this point in the history
musescore: 3.6.2 -> 4.0.1
  • Loading branch information
doronbehar authored Feb 5, 2023
2 parents ecf7340 + 3917d02 commit 42b3a63
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 54 deletions.
4 changes: 3 additions & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down
56 changes: 36 additions & 20 deletions nixos/tests/musescore.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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")
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)
# 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.screenshot("MuseScore0")
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.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("MuseScore2")
machine.screenshot("MuseScore4")
# Wait until PDF is exported
machine.wait_for_file("/root/Documents/MuseScore3/Scores/Untitled.pdf")
machine.wait_for_file('"/root/Documents/MuseScore4/Scores/Untitled score.pdf"')
# Check that it contains the title of the score
machine.succeed("pdfgrep Title /root/Documents/MuseScore3/Scores/Untitled.pdf")
machine.succeed('pdfgrep "Untitled score" "/root/Documents/MuseScore4/Scores/Untitled score.pdf"')
machine.screenshot("MuseScore3")
machine.screenshot("MuseScore5")
'';
})
7 changes: 4 additions & 3 deletions pkgs/applications/audio/musescore/darwin.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 ];
Expand Down
31 changes: 20 additions & 11 deletions pkgs/applications/audio/musescore/default.nix
Original file line number Diff line number Diff line change
@@ -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"
];

Expand All @@ -34,22 +41,24 @@ 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;

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;
};
}

This file was deleted.

0 comments on commit 42b3a63

Please sign in to comment.