Skip to content

Commit 54722c8

Browse files
committed
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
1 parent 12a58ef commit 54722c8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pkgs/applications/audio/musescore/default.nix

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,29 @@ in stdenv'.mkDerivation (finalAttrs: {
140140
ln -s $out/Applications/mscore.app/Contents/MacOS/mscore $out/bin/mscore
141141
'';
142142

143+
# muse-sounds-manager installs Muse Sounds sampler libMuseSamplerCoreLib.so.
144+
# It requires that argv0 of the calling process ends with "/mscore" or "/MuseScore-4".
145+
# We need to ensure this in two cases:
146+
#
147+
# 1) when the user invokes MuseScore as "mscore" on the command line or from
148+
# the .desktop file, and the normal argv0 is "mscore" (no "/");
149+
# 2) when MuseScore invokes itself via File -> New, and the normal argv0 is
150+
# the target of /proc/self/exe, which in Nixpkgs was "{...}/.mscore-wrapped"
151+
#
152+
# In order to achieve (2) we install the final binary as $out/libexec/mscore, and
153+
# in order to achieve (1) we use makeWrapper without --inherit-argv0.
154+
#
155+
# wrapQtAppsHook uses wrapQtApp -> wrapProgram -> makeBinaryWrapper --inherit-argv0
156+
# so we disable it and explicitly use makeQtWrapper.
157+
#
158+
# TODO: check if something like this is also needed for macOS.
159+
dontWrapQtApps = stdenv.isLinux;
160+
postFixup = lib.optionalString stdenv.isLinux ''
161+
mkdir -p $out/libexec
162+
mv $out/bin/mscore $out/libexec
163+
makeQtWrapper $out/libexec/mscore $out/bin/mscore
164+
'';
165+
143166
# Don't run bundled upstreams tests, as they require a running X window system.
144167
doCheck = false;
145168

0 commit comments

Comments
 (0)