blob: 3ce56243813122347b57622aa662fb7519a7bb96 (
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
|
# Maintainer: tarball <bootctl@gmail.com>
# Contributor: Philip Goto <philip.goto@gmail.com>
# Contributor: fortea
pkgname=apx
pkgver=2.4.4
pkgrel=1
pkgdesc='Package manager with support for multiple sources'
arch=(x86_64 aarch64)
url='https://github.com/Vanilla-OS/apx'
license=(GPL-3.0-only)
depends=(
distrobox
glibc
)
makedepends=(go)
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
b2sums=('f81d3f0715c6ed358ab3056eff537611b8f2ace286785905e27da2f558c945fabe0bb022a268f57909dcdf2e05fb649ba508ef514cbe0b3df42f9b32c0181a65')
prepare() {
cd "${pkgname}-${pkgver}"
mkdir -p build/
sed -i 's|share/apx|bin|' config/apx.json
sed -i 's|bin/distrobox|bin|' config/apx.json
}
build() {
cd "${pkgname}-${pkgver}"
go build -o build \
-ldflags "-s -w -linkmode=external -X main.Version=v$pkgver -extldflags \"$LDFLAGS\""
for shell in bash fish zsh; do
./build/apx completion $shell >build/$pkgname.$shell
done
}
check() {
cd "${pkgname}-${pkgver}"
[[ "$(./build/apx --version)" == "apx version v$pkgver" ]]
}
package() {
cd "${pkgname}-${pkgver}"
# binary
install -Dm755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
# config
install -Dm644 "config/apx.json" "$pkgdir/etc/apx/apx.json"
# man pages
install -Dm644 man/man1/apx.1 "$pkgdir/usr/share/man/man1/apx.1"
# completions
install -Dm644 build/$pkgname.bash "$pkgdir/usr/share/bash-completion/completions/$pkgname"
install -Dm644 build/$pkgname.fish "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
install -Dm644 build/$pkgname.zsh "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
}
|