bitcoin: add shell completions

Backport of https://github.com/NixOS/nixpkgs/pull/256091
This commit is contained in:
Erik Arvstedt 2023-09-19 14:16:32 +02:00
parent eaea0f120d
commit 26cc9e4b60
No known key found for this signature in database
GPG key ID: 33312B944DD97846

View file

@ -4,6 +4,7 @@
, fetchurl
, autoreconfHook
, pkg-config
, installShellFiles
, util-linux
, hexdump
, autoSignDarwinBinariesHook
@ -44,7 +45,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 ]
@ -54,7 +55,11 @@ 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/bitcoin-cli.bash-completion
installShellCompletion --cmd bitcoind --bash contrib/bitcoind.bash-completion
installShellCompletion --cmd bitcoin-tx --bash contrib/bitcoin-tx.bash-completion
'' + lib.optionalString withGui ''
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