Skip to content

Commit

Permalink
Merge pull request NixOS#321963 from NixOS/backport-321902-to-release…
Browse files Browse the repository at this point in the history
…-24.05

[Backport release-24.05] spotify: fix wrapping
  • Loading branch information
Artturin authored Jul 24, 2024
2 parents e43257d + 7123ed1 commit 8c4026b
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions pkgs/applications/audio/spotify/linux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@ stdenv.mkDerivation {
# Prevent double wrapping
dontWrapGApps = true;

env = rec {
libdir = "${placeholder "out"}/lib/spotify";
librarypath = "${lib.makeLibraryPath deps}:${libdir}";
};

installPhase =
''
runHook preInstall
libdir=$out/lib/spotify
mkdir -p $libdir
mv ./usr/* $out/
Expand All @@ -148,16 +152,6 @@ stdenv.mkDerivation {
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $rpath $out/share/spotify/spotify
librarypath="${lib.makeLibraryPath deps}:$libdir"
wrapProgramShell $out/share/spotify/spotify \
''${gappsWrapperArgs[@]} \
${lib.optionalString (deviceScaleFactor != null) ''
--add-flags "--force-device-scale-factor=${toString deviceScaleFactor}" \
''} \
--prefix LD_LIBRARY_PATH : "$librarypath" \
--prefix PATH : "${gnome.zenity}/bin" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
# fix Icon line in the desktop file (#48062)
sed -i "s:^Icon=.*:Icon=spotify-client:" "$out/share/spotify/spotify.desktop"
Expand All @@ -176,6 +170,21 @@ stdenv.mkDerivation {
runHook postInstall
'';

fixupPhase = ''
runHook preFixup
wrapProgramShell $out/share/spotify/spotify \
''${gappsWrapperArgs[@]} \
${lib.optionalString (deviceScaleFactor != null) ''
--add-flags "--force-device-scale-factor=${toString deviceScaleFactor}" \
''} \
--prefix LD_LIBRARY_PATH : "$librarypath" \
--prefix PATH : "${gnome.zenity}/bin" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
runHook postFixup
'';

meta = meta // {
maintainers = with lib.maintainers; [ eelco ftrvxmtrx sheenobu timokau ma27 ];
};
Expand Down

0 comments on commit 8c4026b

Please sign in to comment.