Merge fort-nix/nix-bitcoin#648: bitcoin: add shell completions

26cc9e4b60 bitcoin: add shell completions (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  0xB10C:
    Code Review ACK 26cc9e4b60

Tree-SHA512: 78e38c1045d445553d2a84bd51521e17ee216bc98d93b4786658b770b5df464d744e99f0b9af110fb909e31dd7e8bde9ef2f0f33b1cf4d3465710849a9572be8
This commit is contained in:
Jonas Nick 2023-10-02 09:09:09 +00:00
commit 29a32ac53b
No known key found for this signature in database
GPG Key ID: 4861DBF262123605

View File

@ -4,6 +4,7 @@
, fetchurl , fetchurl
, autoreconfHook , autoreconfHook
, pkg-config , pkg-config
, installShellFiles
, util-linux , util-linux
, hexdump , hexdump
, autoSignDarwinBinariesHook , autoSignDarwinBinariesHook
@ -44,7 +45,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = nativeBuildInputs =
[ autoreconfHook pkg-config ] [ autoreconfHook pkg-config installShellFiles ]
++ lib.optionals stdenv.isLinux [ util-linux ] ++ lib.optionals stdenv.isLinux [ util-linux ]
++ lib.optionals stdenv.isDarwin [ hexdump ] ++ lib.optionals stdenv.isDarwin [ hexdump ]
++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
@ -54,7 +55,11 @@ stdenv.mkDerivation rec {
++ lib.optionals withWallet [ db48 sqlite ] ++ lib.optionals withWallet [ db48 sqlite ]
++ lib.optionals withGui [ qrencode qtbase qttools ]; ++ 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 install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin" substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin"
install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png