abuild.in: Add split package functions for elvish shell completion

This commit is contained in:
Biswapriyo Nath 2024-04-10 05:11:17 +00:00
parent 0e325a2354
commit d6c3a953d2
1 changed files with 23 additions and 0 deletions

View File

@ -596,6 +596,8 @@ subpkg_set() {
subpkgsplit=zshcomp
elif is_fishcomp_pkg "$subpkgname"; then
subpkgsplit=fishcomp
elif is_elvishcomp_pkg "$subpkgname"; then
subpkgsplit=elvishcomp
else
subpkgsplit="${subpkgname##*-}"
fi
@ -959,6 +961,10 @@ prepare_subpackages() {
warning "Found /usr/share/fish/completions"
warning2 "Add \$pkgname-fish-completion to subpackages"
fi
if [ -d "$pkgdir"/usr/share/elvish/lib ]; then
warning "Found /usr/share/elvish/lib"
warning2 "Add \$pkgname-elvish-completion to subpackages"
fi
}
default_lang() {
@ -1397,6 +1403,11 @@ is_fishcomp_pkg() {
test "${1%-fish-completion}" != "$1"
}
# returns true if this is the -elvish-completion package
is_elvishcomp_pkg() {
test "${1%-elvish-completion}" != "$1"
}
# check that noarch is set if needed
archcheck() {
options_has "!archcheck" && return 0
@ -2213,6 +2224,18 @@ fishcomp() {
default_fishcomp
}
default_elvishcomp() {
depends=""
pkgdesc="Elvish completions for $pkgname"
install_if="$pkgname=$pkgver-r$pkgrel elvish"
amove usr/share/elvish/lib
}
elvishcomp() {
default_elvishcomp
}
default_pyc() {
pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"