From 696449dedb246f42dc2c24ca42f95492e83b608a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 6 Nov 2022 00:28:41 +0100 Subject: [PATCH] spotify: consolidate wrapper --- pkgs/applications/audio/spotify/default.nix | 8 +++++- pkgs/applications/audio/spotify/wrapper.nix | 31 --------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 +-- 4 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 pkgs/applications/audio/spotify/wrapper.nix diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix index ecbdaec7f28a..2c821ec6b4c8 100644 --- a/pkgs/applications/audio/spotify/default.nix +++ b/pkgs/applications/audio/spotify/default.nix @@ -2,6 +2,9 @@ , glib, pango, cairo, atk, gdk-pixbuf, gtk3, cups, nspr, nss, libpng, libnotify , libgcrypt, systemd, fontconfig, dbus, expat, ffmpeg, curlWithGnuTls, zlib, gnome , at-spi2-atk, at-spi2-core, libpulseaudio, libdrm, mesa, libxkbcommon + # High-DPI support: Spotify's --force-device-scale-factor argument + # not added if `null`, otherwise, should be a number. +, deviceScaleFactor ? null }: let @@ -67,7 +70,7 @@ let in stdenv.mkDerivation { - pname = "spotify-unwrapped"; + pname = "spotify"; inherit version; # fetch from snapcraft instead of the debian repository most repos fetch from. @@ -143,6 +146,9 @@ stdenv.mkDerivation { librarypath="${lib.makeLibraryPath deps}:$libdir" wrapProgram $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" diff --git a/pkgs/applications/audio/spotify/wrapper.nix b/pkgs/applications/audio/spotify/wrapper.nix deleted file mode 100644 index 418ef3cbc03e..000000000000 --- a/pkgs/applications/audio/spotify/wrapper.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ symlinkJoin -, lib -, spotify-unwrapped -, makeWrapper - - # High-DPI support: Spotify's --force-device-scale-factor argument; not added - # if `null`, otherwise, should be a number. -, deviceScaleFactor ? null -}: - -symlinkJoin { - name = "spotify-${spotify-unwrapped.version}"; - - paths = [ spotify-unwrapped.out ]; - - nativeBuildInputs = [ makeWrapper ]; - preferLocalBuild = true; - passthru.unwrapped = spotify-unwrapped; - postBuild = '' - wrapProgram $out/bin/spotify \ - ${lib.optionalString (deviceScaleFactor != null) '' - --add-flags ${lib.escapeShellArg "--force-device-scale-factor=${ - builtins.toString deviceScaleFactor - }"} - ''} - ''; - - meta = spotify-unwrapped.meta // { - priority = (spotify-unwrapped.meta.priority or 0) - 1; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5813052acd69..0783e9bba8da 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1393,6 +1393,7 @@ mapAliases ({ # spidermonkey is not ABI upwards-compatible, so only allow this for nix-shell spidermonkey = spidermonkey_78; # Added 2020-10-09 split2flac = throw "split2flac has been removed. Consider using the shnsplit command from shntool package or help packaging unflac."; # added 2022-01-13 + spotify-unwrapped = spotify; # added 2022-11-06 spring-boot = spring-boot-cli; # added 2020-04-24 sqlite3_analyzer = throw "'sqlite3_analyzer' has been renamed to/replaced by 'sqlite-analyzer'"; # Converted to throw 2022-02-22 sqliteInteractive = throw "'sqliteInteractive' has been renamed to/replaced by 'sqlite-interactive'"; # Converted to throw 2022-02-22 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 11591c09582c..57a6108c969b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31936,9 +31936,7 @@ with pkgs; autoreconfHook = buildPackages.autoreconfHook269; }; - spotify-unwrapped = callPackage ../applications/audio/spotify { }; - - spotify = callPackage ../applications/audio/spotify/wrapper.nix { }; + spotify = callPackage ../applications/audio/spotify { }; spotifywm = callPackage ../applications/audio/spotifywm { };