mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 15:27:20 +03:00
Merge pull request #98350 from 9999years/spotify-device-scale-factor
spotify: support --force-device-scale-factor for high-DPI displays
This commit is contained in:
commit
2e98177bd7
@ -64,7 +64,7 @@ let
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "spotify";
|
||||
pname = "spotify-unwrapped";
|
||||
inherit version;
|
||||
|
||||
# fetch from snapcraft instead of the debian repository most repos fetch from.
|
||||
|
31
pkgs/applications/audio/spotify/wrapper.nix
Normal file
31
pkgs/applications/audio/spotify/wrapper.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{ 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;
|
||||
};
|
||||
}
|
@ -23330,7 +23330,7 @@ in
|
||||
|
||||
spek = callPackage ../applications/audio/spek { };
|
||||
|
||||
spotify = callPackage ../applications/audio/spotify {
|
||||
spotify-unwrapped = callPackage ../applications/audio/spotify {
|
||||
libgcrypt = libgcrypt_1_5;
|
||||
libpng = libpng12;
|
||||
curl = curl.override {
|
||||
@ -23338,6 +23338,8 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
spotify = callPackage ../applications/audio/spotify/wrapper.nix { };
|
||||
|
||||
libspotify = callPackage ../development/libraries/libspotify (config.libspotify or {});
|
||||
|
||||
sourcetrail = callPackage ../development/tools/sourcetrail { };
|
||||
|
Loading…
Reference in New Issue
Block a user