aports/community/gotosocial/APKBUILD
2023-05-05 08:58:01 +00:00

64 lines
2.1 KiB
Plaintext

# Contributor: Alex McGrath <amk@amk.ie>
# Maintainer: Alex McGrath <amk@amk.ie>
pkgname=gotosocial
pkgver=0.8.1
pkgrel=2
pkgdesc="An ActivityPub social network server"
url="https://github.com/superseriousbusiness/gotosocial"
arch="all"
license="AGPL-3.0-only"
install="$pkgname.pre-install"
pkgusers="gotosocial"
pkggroups="gotosocial"
makedepends="go yarn nodejs"
subpackages="$pkgname-openrc"
source="https://github.com/superseriousbusiness/gotosocial/releases/download/v$pkgver/gotosocial-$pkgver-source-code.tar.gz
gotosocial.initd
10-config.patch
"
builddir="$srcdir"
case "$CARCH" in
# flaky test
s390x) options="!check";;
esac
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
build() {
yarn install --cwd web/source
BUDO_BUILD=1 node web/source
go build -o gotosocial ./cmd/gotosocial
}
check() {
# skip tests in internal/media as they're failing
local pkgs="$(go list ./... | grep -v 'internal/media')"
CGO_ENABLED=0 GTS_DB_TYPE="sqlite" GTS_DB_ADDRESS=":memory:" \
go test $pkgs
}
package() {
install -Dm755 "$srcdir"/gotosocial.initd \
"$pkgdir"/etc/init.d/gotosocial
install -Dm755 "$builddir"/gotosocial \
-t "$pkgdir"/usr/bin/
install -d -o gotosocial -g gotosocial "$pkgdir"/etc/gotosocial
install -Dm640 "$builddir"/example/config.yaml "$pkgdir"/etc/gotosocial/gotosocial.yml
mkdir -p "$pkgdir"/usr/share/webapps/gotosocial
cp -r "$builddir"/web/assets "$pkgdir"/usr/share/webapps/gotosocial
cp -r "$builddir"/web/template "$pkgdir"/usr/share/webapps/gotosocial
install -d -o gotosocial -g gotosocial "$pkgdir"/var/lib/gotosocial
}
sha512sums="
d0bb785ec7617edbd5409b48138d5b3bcd201533e951bfff228ca7ddfa620970bf5a648e8e0fc9aeb654536974ddcda4556ee440f38d01a3c53900df7abd44ed gotosocial-0.8.1-source-code.tar.gz
f9e4aa4177d727c5a2822e292a54b1d488c60c1f2f62fc64d193e3de6c1168ae74c6273eaed86f148cf0390505903bcf19b97f375d7f2838a892275abd79d9d6 gotosocial.initd
e1030586395c7bcca2bf348f764bb51de75e503a29c163e95f155b2192e213db61376f0b15e957813be917ba7f5d28abc8c4e944971ea6db64088424add97874 10-config.patch
"