Install shell completions with cmake #34714

issue kpcyrd opened 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:

    for tool in bitcoin bitcoin-tx bitcoin-util bitcoin-wallet bitcoin-chainstate libbitcoinkernel
    do
      DESTDIR="$pkgdir" cmake --install build --component "$tool"
    
      # shell completions
      if [ -f "contrib/completions/bash/$tool.bash" ]; then
        install -Dm644 "contrib/completions/bash/$tool.bash" \
          "$pkgdir/usr/share/bash-completion/completions/$tool"
      fi
      if [ -f "contrib/completions/fish/$tool.fish" ]; then
        install -Dm644 contrib/completions/fish/$tool.fish \
          -t "$pkgdir/usr/share/fish/vendor_completions.d/"
      fi
    done
    

    Is your feature related to a problem, if so please describe it.

    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:

    cmake --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-05-02 12:12 UTC

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