New comment by meator on void-packages repository https://github.com/void-linux/void-packages/pull/38149#issuecomment-1190414781 Comment: > Also, please generate and install shell completions This won't look pretty when you take cross compiling into consideration. I know, I have dealt with these issues before. There are four ways this can be solved (sorted by their usefulness): 1. Ask upstream to distribute completion scripts in their own files in the repo instead of embedding them into the program (it seems that they're using some automatic system that generates the completions but distributing the files separately is way more practical in my opinion). You could then simply `vcompletion` these files in `post_install()`. 2. Add `xremap` to `hostmakedepends` when `$CROSS_BUILD`ing. I know, this seems strange. `xremap` depending on `xremap`? This won't create an infinite loop because this dependency is active only if `$CROSS_BUILD` is defined. This dependency means that the cross compiled version (the version that's in `$XBPS_TARGET_MACHINE` and that `xbps-src` can't directly execute) depends on the natively compiled version (the `$XBPS_MACHINE` architecture which can be executed) of `xremap`. There are two things you can do with the native version of `xremap`: 1. Steal the completion from the native version. You could generate the completions normally when you aren't cross compiling and then "steal" these completions from the native package when you are cross compiling (copy them from `/usr/share/` which was populated by the native package into `$DESTDIR`). I do not know how would the Void maintainers think of this but this seems like the simplest solution. This would normally be unacceptable, but since shell completions aren't architecture dependent, this shouldn't matter. 2. Generate the completions with the native version. You could run `xremap --completions ` with the **native** version and put the completions in the appropriate locations in `$DESTDIR` (this would probably require some temporary files if you would want to use `vcompletion`). This is a bit similar to 3a9aeacde03485588f78984c4baf040ab003dd32. This solution is good because the completions would be automatically retrieved when an update changes them (which isn't true for the third solution). 3. Make a `srcpkgs/xremap/files` (i.e. `$FILESDIR`) directory, manually generate the files and put them there (and add them to this PR). Then `post_install()` would `vcompletion` these files. I don't really like this solution because every time the completions would change, the files in `$FILESDIR` would have to be updated. 4. Do not include the completions in the package. You might not call this a "solution" but it is the simplest thing to do. If you have any questions than please comment on this. What do you think @tranzystorek-io?