Merge branch 'abuild-elvish-completion' into 'master'

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

See merge request alpine/abuild!268
This commit is contained in:
Biswapriyo Nath 2024-04-30 03:32:21 +00:00
commit f8f5863c81
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() {
@ -1404,6 +1410,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
@ -2212,6 +2223,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"