aboutsummaryrefslogtreecommitdiffstats
path: root/main/fish/APKBUILD
blob: b8c167cbe6f778e7b372b2253310476fce5a77c2 (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
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=fish
pkgver=3.1.2
pkgrel=1
pkgdesc="Modern interactive commandline shell"
url="http://www.fishshell.com"
arch="all"
license="GPL-2.0-only"
depends="bc"
depends_dev="$pkgname-tools"
makedepends="cmake doxygen ncurses-dev ncurses pcre2-dev"
checkdepends="expect 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.gz"

prepare() {
	default_prepare
	for f in $(find share/tools -type f -name '*.py'); do
		sed -i -e '1{s@^#!.*@#!%{__python3}@}' "$f"
	done
}

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B builddir \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make -C builddir
}

check() {
	cd builddir
	ctest
}

package() {
	make -C builddir install DESTDIR="$pkgdir"
	rm -fr "$pkgdir"/usr/share/$pkgname/groff

	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
}

doc() {
	default_doc

	mkdir -p "$subpkgdir"/usr/share/$pkgname
	mv "$pkgdir"/usr/share/$pkgname/man "$subpkgdir"/usr/share/$pkgname
}

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

	mkdir -p "$subpkgdir"/usr/share/$pkgname
	mv "$pkgdir"/usr/share/$pkgname/tools "$subpkgdir"/usr/share/$pkgname
}

sha512sums="b6ae2c928774a2eaccf35312d3a9446bfa3e1335182c8f2b2d6198161d0916904f4964fb20ed13a5bf850c1c819e003905d13db3bc8b1faa5b401a60b47dc563  fish-3.1.2.tar.gz"