Install shell completions with cmake #34714

issue kpcyrd openend this issue on March 2, 2026
  1. kpcyrd commented at 6:05 pm on March 2, 2026: none

    Please describe the feature you’d like to see added.

    When building a package, I currently have the following code to include shell completions for the relevant components:

     0for tool in bitcoin bitcoin-tx bitcoin-util bitcoin-wallet bitcoin-chainstate libbitcoinkernel
     1do
     2  DESTDIR="$pkgdir" cmake --install build --component "$tool"
     3
     4  # shell completions
     5  if [ -f "contrib/completions/bash/$tool.bash" ]; then
     6    install -Dm644 "contrib/completions/bash/$tool.bash" \
     7      "$pkgdir/usr/share/bash-completion/completions/$tool"
     8  fi
     9  if [ -f "contrib/completions/fish/$tool.fish" ]; then
    10    install -Dm644 contrib/completions/fish/$tool.fish \
    11      -t "$pkgdir/usr/share/fish/vendor_completions.d/"
    12  fi
    13done
    

    No response

    Describe the solution you’d like

    I’m wondering if there could be a way to include the shell completions in cmake --install, so running DESTDIR="$pkgdir" cmake --install build --component bitcoin-tx would copy shell completions to DESTDIR, if any are available.

    Describe any alternatives you’ve considered

    Keeping the current code as-is. :)

    Please leave any additional context

    No response

  2. kpcyrd added the label Feature on Mar 2, 2026
  3. maflcko added the label Build system on Mar 3, 2026
  4. hebasto commented at 11:13 am on March 3, 2026: member
  5. willcl-ark commented at 11:20 am on March 3, 2026: member

    Thank you for your work packaging bitcoind on Arch @kpcyrd :)

    IMO this seems like a perfectly reasonable request. I’d be happy to fix it.

    I’ll wait to see what @purpleKarrot thinks first, but the change itself is simple.

  6. purpleKarrot commented at 11:46 am on March 3, 2026: contributor

    Go for it @willcl-ark! I agree that shell completions should be installed together with each tool.

    We may want to rethink the 1:1 relationship of tool and component. Usually, you have components like “runtime”, “development”, and “data” where “runtime” contains binaries and .so files, “development” contains headers and soname links, “data” contains documentation, config files, shell completions, etc (all architecture independent files).

    Packagers may then decide how to organize components into sub-packages. Arch usually packages everything together, other distros provide packages on a finer granularity.

    We should make sure that @kpcyrd can execute:

    0cmake --install build --prefix $pkgdir
    

    And that should install all files to their expected location.

    I use Arch btw

  7. willcl-ark commented at 2:33 pm on March 3, 2026: member
    Opened #34721 to address this.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-23 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me