Merge pull request #256091 from erikarvstedt/bitcoin-shell-completions

bitcoin: add shell completions
This commit is contained in:
Pavol Rusnak 2023-09-19 14:08:26 +02:00 committed by GitHub
commit fa6cdce1d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
, fetchurl
, autoreconfHook
, pkg-config
, installShellFiles
, util-linux
, hexdump
, autoSignDarwinBinariesHook
@ -43,7 +44,7 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs =
[ autoreconfHook pkg-config ]
[ autoreconfHook pkg-config installShellFiles ]
++ lib.optionals stdenv.isLinux [ util-linux ]
++ lib.optionals stdenv.isDarwin [ hexdump ]
++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
@ -53,7 +54,19 @@ stdenv.mkDerivation rec {
++ lib.optionals withWallet [ db48 sqlite ]
++ lib.optionals withGui [ qrencode qtbase qttools ];
postInstall = lib.optionalString withGui ''
postInstall = ''
installShellCompletion --cmd bitcoin-cli --bash contrib/completions/bash/bitcoin-cli.bash-completion
installShellCompletion --cmd bitcoind --bash contrib/completions/bash/bitcoind.bash-completion
installShellCompletion --cmd bitcoin-tx --bash contrib/completions/bash/bitcoin-tx.bash-completion
installShellCompletion --fish contrib/completions/fish/bitcoin-cli.fish
installShellCompletion --fish contrib/completions/fish/bitcoind.fish
installShellCompletion --fish contrib/completions/fish/bitcoin-tx.fish
installShellCompletion --fish contrib/completions/fish/bitcoin-util.fish
installShellCompletion --fish contrib/completions/fish/bitcoin-wallet.fish
'' + lib.optionalString withGui ''
installShellCompletion --fish contrib/completions/fish/bitcoin-qt.fish
install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin"
install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png