aboutsummaryrefslogtreecommitdiffstats
path: root/main/fish/APKBUILD
blob: 2824b76eef1f3966001b10474b906a6af58c2f10 (plain) (blame)
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
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=fish
pkgver=3.3.1
pkgrel=1
pkgdesc="Modern interactive commandline shell"
url="https://fishshell.com/"
arch="all"
license="GPL-2.0-only"
depends="bc"
depends_doc="util-linux" # Requires 'ul' program
depends_dev="$pkgname-tools"
makedepends="cmake doxygen ncurses-dev ncurses pcre2-dev py3-sphinx"
checkdepends="py3-pexpect bash"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools::noarch"
source="https://github.com/fish-shell/fish-shell/releases/download/$pkgver/fish-$pkgver.tar.xz
	README.alpine
	"

# temp allow textrels on riscv64
[ "$CARCH" = "riscv64" ] && options="$options textrels"

build() {
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DBUILD_DOCS=TRUE
	cmake --build build
	cmake --build build --target fish_tests
}

check() {
	cd build
	./fish_tests
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	rm -fr "$pkgdir"/usr/share/$pkgname/groff

	# Install our README
	install -Dm 644 "$srcdir"/README.alpine -t "$pkgdir"/usr/share/doc/fish

	mkdir -p "$pkgdir"/usr/lib
	mv "$pkgdir"/usr/share/pkgconfig "$pkgdir"/usr/lib

	# https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/10159#note_101679
	rm "$pkgdir"/usr/share/fish/completions/rustup.fish

	# https://github.com/fish-shell/fish-shell/issues/2436
	rm "$pkgdir"/usr/share/fish/completions/docker.fish

	# provided by minikube-fish-completion
	rm "$pkgdir"/usr/share/fish/completions/minikube.fish

	# provided by flatpak-fish-completion
	rm "$pkgdir"/usr/share/fish/completions/flatpak.fish

	# provided by helm-fish-completion
	rm "$pkgdir"/usr/share/fish/completions/helm.fish
}

doc() {
	default_doc

	amove usr/share/$pkgname/man
}

tools() {
	pkgdesc="$pkgdesc (tools)"
	depends="$pkgname python3 cmd:man"

	amove usr/share/$pkgname/tools
}

sha512sums="
fc50ca44fab3f2d942284d4f714150f7ccf1e49c73da36f8d4ae4a33a9b3280f98bed15848839f5d443b4274fd0ff90174bafa6a8e9a4da226dda63d7766a660  fish-3.3.1.tar.xz
c28cef48e3d9cde4956d36192dc221e63eca89282a937e2683578ac0958d98a9c54420aea4f1d91d516f5ee2c74589a75865a973305421e1ad0a9e70854dff4f  README.alpine
"