mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 20:55:31 +03:00
spotify_player: Install shell completions
This commit is contained in:
parent
79d027f5d6
commit
c7ef20e66c
1 changed files with 21 additions and 10 deletions
|
@ -5,6 +5,9 @@
|
||||||
pkg-config,
|
pkg-config,
|
||||||
openssl,
|
openssl,
|
||||||
cmake,
|
cmake,
|
||||||
|
installShellFiles,
|
||||||
|
writableTmpDirAsHomeHook,
|
||||||
|
|
||||||
# deps for audio backends
|
# deps for audio backends
|
||||||
alsa-lib,
|
alsa-lib,
|
||||||
libpulseaudio,
|
libpulseaudio,
|
||||||
|
@ -63,6 +66,9 @@ rustPlatform.buildRustPackage rec {
|
||||||
pkg-config
|
pkg-config
|
||||||
cmake
|
cmake
|
||||||
rustPlatform.bindgenHook
|
rustPlatform.bindgenHook
|
||||||
|
installShellFiles
|
||||||
|
# Tries to access $HOME when installing shell files, and on Darwin
|
||||||
|
writableTmpDirAsHomeHook
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||||
makeBinaryWrapper
|
makeBinaryWrapper
|
||||||
|
@ -105,16 +111,21 @@ rustPlatform.buildRustPackage rec {
|
||||||
++ lib.optionals withSixel [ "sixel" ]
|
++ lib.optionals withSixel [ "sixel" ]
|
||||||
++ lib.optionals withFuzzy [ "fzf" ];
|
++ lib.optionals withFuzzy [ "fzf" ];
|
||||||
|
|
||||||
# tries to access HOME only in aarch64-darwin environment when building mac-notification-sys
|
postInstall =
|
||||||
preBuild = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
|
let
|
||||||
export HOME=$TMPDIR
|
inherit (lib.strings) optionalString;
|
||||||
'';
|
in
|
||||||
|
# sixel-sys is dynamically linked to libsixel
|
||||||
# sixel-sys is dynamically linked to libsixel
|
optionalString (stdenv.hostPlatform.isDarwin && withSixel) ''
|
||||||
postInstall = lib.optionals (stdenv.hostPlatform.isDarwin && withSixel) ''
|
wrapProgram $out/bin/spotify_player \
|
||||||
wrapProgram $out/bin/spotify_player \
|
--prefix DYLD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsixel ]}"
|
||||||
--prefix DYLD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsixel ]}"
|
''
|
||||||
'';
|
+ optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
|
installShellCompletion --cmd spotify_player \
|
||||||
|
--bash <($out/bin/spotify_player generate bash) \
|
||||||
|
--fish <($out/bin/spotify_player generate fish) \
|
||||||
|
--zsh <($out/bin/spotify_player generate zsh)
|
||||||
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
updateScript = nix-update-script { };
|
updateScript = nix-update-script { };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue