From 54722c829a074c78444bdb66ca863bae6534df68 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Mon, 16 Sep 2024 08:42:28 +0000 Subject: [PATCH 1/2] musescore: support Muse Sounds After this change Muse Sounds are always active in MuseScore, even if it is launched from PATH or via File -> New Fixes #318210 --- pkgs/applications/audio/musescore/default.nix | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkgs/applications/audio/musescore/default.nix b/pkgs/applications/audio/musescore/default.nix index fbfc50a1a684..577aac4a6ae5 100644 --- a/pkgs/applications/audio/musescore/default.nix +++ b/pkgs/applications/audio/musescore/default.nix @@ -140,6 +140,29 @@ in stdenv'.mkDerivation (finalAttrs: { 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.isLinux; + postFixup = lib.optionalString stdenv.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; From 3fc425d7fcc50b7edb57b28c6401174516405013 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Mon, 16 Sep 2024 14:50:53 +0000 Subject: [PATCH 2/2] musescore: add orivej to maintainers --- pkgs/applications/audio/musescore/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/musescore/default.nix b/pkgs/applications/audio/musescore/default.nix index 577aac4a6ae5..58abcb4ffb99 100644 --- a/pkgs/applications/audio/musescore/default.nix +++ b/pkgs/applications/audio/musescore/default.nix @@ -172,7 +172,7 @@ in stdenv'.mkDerivation (finalAttrs: { description = "Music notation and composition software"; homepage = "https://musescore.org/"; license = licenses.gpl3Only; - maintainers = with maintainers; [ vandenoever doronbehar ]; + maintainers = with maintainers; [ vandenoever doronbehar orivej ]; mainProgram = "mscore"; platforms = platforms.unix; };