diff options
Diffstat (limited to 'pkgs/applications/audio/spotify/linux.nix')
-rw-r--r-- | pkgs/applications/audio/spotify/linux.nix | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/pkgs/applications/audio/spotify/linux.nix b/pkgs/applications/audio/spotify/linux.nix index 88e4e8658a8bd..8886e851c3c95 100644 --- a/pkgs/applications/audio/spotify/linux.nix +++ b/pkgs/applications/audio/spotify/linux.nix @@ -14,14 +14,14 @@ let # If an update breaks things, one of those might have valuable info: # https://aur.archlinux.org/packages/spotify/ # https://community.spotify.com/t5/Desktop-Linux - version = "1.2.31.1205.g4d59ad7c"; + version = "1.2.37.701.ge66eb7bc"; # To get the latest stable revision: # curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=stable' | jq '.download_url,.version,.last_updated' # To get general information: # curl -H 'Snap-Device-Series: 16' 'https://api.snapcraft.io/v2/snaps/info/spotify' | jq '.' # More examples of api usage: # https://github.com/canonical-websites/snapcraft.io/blob/master/webapp/publisher/snaps/views.py - rev = "75"; + rev = "76"; deps = [ alsa-lib @@ -86,8 +86,9 @@ stdenv.mkDerivation { # spotify ourselves: # https://community.spotify.com/t5/Desktop-Linux/Redistribute-Spotify-on-Linux-Distributions/td-p/1695334 src = fetchurl { + name = "spotify-${version}-${rev}.snap"; url = "https://api.snapcraft.io/api/v1/snaps/download/pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7_${rev}.snap"; - hash = "sha512-o4iLcbNqbsxo9YJMy0SXO7Udv4CMhhBcsf53UuqWKFFWY/jKVN+Lb+dB7Jf9+UowpmbrP44w97Oi+dnbfFXYjQ=="; + hash = "sha512-k7aw1QM3NCFkm0tXcHgYyeEBagGFpCL6JdWlFruJszPloiCy5vopOsD4PdqyiSEs0rSUP0rLxX2UBs3XuI5cUA=="; }; nativeBuildInputs = [ wrapGAppsHook3 makeShellWrapper squashfsTools ]; @@ -120,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/ @@ -147,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" @@ -175,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 ]; }; |