File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
pkgs/applications/audio/musescore Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments