mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-06 20:48:32 +03:00
gitoxide: Install shell completions.
This commit is contained in:
parent
1fe7393b79
commit
9c9de33ff2
@ -9,9 +9,14 @@
|
||||
, SystemConfiguration
|
||||
, curl
|
||||
, openssl
|
||||
, buildPackages
|
||||
, installShellFiles
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
let
|
||||
canRunCmd = stdenv.hostPlatform.emulatorAvailable buildPackages;
|
||||
gix = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/gix";
|
||||
in rustPlatform.buildRustPackage rec {
|
||||
pname = "gitoxide";
|
||||
version = "0.33.0";
|
||||
|
||||
@ -26,10 +31,17 @@ rustPlatform.buildRustPackage rec {
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
|
||||
buildInputs = [ curl ] ++ (if stdenv.isDarwin
|
||||
buildInputs = [ curl installShellFiles ] ++ (if stdenv.isDarwin
|
||||
then [ libiconv Security SystemConfiguration ]
|
||||
else [ openssl ]);
|
||||
|
||||
preFixup = lib.optionalString canRunCmd ''
|
||||
installShellCompletion --cmd gix \
|
||||
--bash <(${gix} completions --shell bash) \
|
||||
--fish <(${gix} completions --shell fish) \
|
||||
--zsh <(${gix} completions --shell zsh)
|
||||
'';
|
||||
|
||||
# Needed to get openssl-sys to use pkg-config.
|
||||
env.OPENSSL_NO_VENDOR = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user