# Contributor: Alex McGrath # Maintainer: Alex McGrath pkgname=gotosocial pkgver=0.10.0 pkgrel=1 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=" fc647e6fb35ef8a9969014d4e785f868e5c85fb2305f7ac204ba830d0774cf4fa7cbb25b7a47fed0b8f592e45299cb2bdbbf5f4a6ae45915a540e9c3ab92f3c4 gotosocial-0.10.0-source-code.tar.gz f9e4aa4177d727c5a2822e292a54b1d488c60c1f2f62fc64d193e3de6c1168ae74c6273eaed86f148cf0390505903bcf19b97f375d7f2838a892275abd79d9d6 gotosocial.initd e1030586395c7bcca2bf348f764bb51de75e503a29c163e95f155b2192e213db61376f0b15e957813be917ba7f5d28abc8c4e944971ea6db64088424add97874 10-config.patch "