aboutsummaryrefslogtreecommitdiffstats
path: root/community/dendrite/APKBUILD
blob: 450d9a5492d9ec7e71bf698c4466cf179bb3190a (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
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=dendrite
pkgver=0.8.9
pkgrel=2
pkgdesc="Second-generation Matrix homeserver written in Go"
url="https://github.com/matrix-org/dendrite"
license="Apache-2.0"
arch="all"
makedepends="go"
subpackages="$pkgname-openrc"
pkgusers="$pkgname"
pkggroups="$pkgname"
install="$pkgname.pre-install"
source="https://github.com/matrix-org/dendrite/archive/v$pkgver/dendrite-v$pkgver.tar.gz
	dendrite.initd
	dendrite.confd
	"
options="net" # required to download go modules

case "$CARCH" in
	arm*|x86)
		options="$options !check" # Broken, https://github.com/matrix-org/dendrite/issues/2528
		;;
esac

prepare() {
	default_prepare

	# fix build on riscv64
	go mod edit -replace golang.org/x/sys=golang.org/x/sys@1e041c57c4
	go mod tidy
}

build() {
	for cmd in dendrite-monolith-server generate-keys create-account; do
		go build -trimpath -ldflags="-s -w" -v -o bin/$cmd ./cmd/$cmd
	done
}

check() {
	DENDRITE_TEST_SKIP_NODB=1 go test ./...
}

package() {
	install -Dm755 bin/dendrite-monolith-server "$pkgdir"/usr/bin/dendrite
	install -Dm755 bin/generate-keys "$pkgdir"/usr/bin/dendrite-generate-keys
	install -Dm755 bin/create-account "$pkgdir"/usr/bin/dendrite-create-account

	install -Dm644 dendrite-sample.monolith.yaml "$pkgdir"/etc/$pkgname/dendrite.yaml
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="
6bbf616ca566c3ce24b20c86ce23e21b617ef5417e41e93d9d93ad40ea9927556d69c5dff960e7ee9004d14ed21661cc46f1dfc0dafaa199e48afc9da5f42595  dendrite-v0.8.9.tar.gz
5d228aa3970a176e10e24dc5cd8611103c944de660a65cc1e6221ae65a804b1bfbe0a6465716ccda37c4d82670d0ff27f017c44c382ab9eb25b7bc6e037d01b0  dendrite.initd
a6a088683a6aebc431d3eb289bd0d4dbaede698d1a5da25d6af2aad79e9cd36db02ce9173ab6904249f23b88bca5d1630258736feef7e8266e6c22220d74fa1f  dendrite.confd
"