aboutsummaryrefslogtreecommitdiffstats
path: root/community/yash/APKBUILD
blob: 9aaadf671e9625e742a88246113beb0545e4cae1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=yash
pkgver=2.50
pkgrel=0
pkgdesc="Yet another shell"
url="http://yash.osdn.jp"
arch="all"
license="GPL-2.0-or-later"
depends="$pkgname-completion"
makedepends="ncurses-dev"
install="$pkgname.post-install $pkgname.pre-deinstall"
subpackages="$pkgname-doc"
source="https://github.com/magicant/yash/releases/download/$pkgver/yash-$pkgver.tar.xz"

_compdir="usr/share/yash/completion"

# Move some bigger completion files to separate subpackages.
_comps="git:git:git[gkx]:git-*
	openssh-client:ssh:ssh-*
	subversion:svn
	valgrind:valgrind
	"
for _i in $_comps; do
	subpackages="$subpackages ${_i%%:*}-yash-completion:_completion:noarch"
done
subpackages="$subpackages $pkgname-completion::noarch"

prepare() {
	default_prepare

	# XXX: Disable hanging tests.
	sed -i -e 's/\bkill[24]-p.tst\b//g' \
		-e 's/\bsignal[12]-y.tst\b//g' \
		tests/Makefile.in

	# Remove completions for programs that are not available on Alpine
	# (just to decrease size of the package).
	cd share/completion
	rm carthage dnf pgawk useradd who
}

build() {
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--disable-nls
	make
}

check() {
	# FIXME: Fix broken tests.
	make tests LANG=en_US.UTF-8 || true
}

package() {
	make DESTDIR="$pkgdir" install
	rm -Rf "$pkgdir"/usr/share/man/ja
}

_completion() {
	local name="${subpkgname%-yash-completion}"
	pkgdesc="Yash completions for $name"
	depends="$pkgname-completion"
	install_if="$pkgname-completion=$pkgver-r$pkgrel $name"

	local files=$(printf '%s\n' $_comps \
		| sed -En "s|^$name:(.*)|\1|p" \
		| tr : ' ')
	[ "$files" ] || die "$name not found in \$_comps"

	local f; for f in $files; do
		amove usr/share/yash/completion/$f
	done
}

completion() {
	pkgdesc="$pkgdesc (command-line completion)"
	depends=""

	amove usr/share/yash/completion
}

sha512sums="fc78d61b09f7c81d1d7bd3f4feefa7d4c0de910524759ebcba2b53322abc3f1e0a937007b36a5060af0ee759df210ec06d5eed2c71cf3f7ccd0825521b50edb7  yash-2.50.tar.xz"