www-apps/gotosocial: add 0.8.0

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2023-04-10 19:17:50 +05:00
parent 892ce9e2b8
commit e7d39cb14f
2 changed files with 104 additions and 0 deletions

View File

@@ -1,2 +1,4 @@
DIST gotosocial-0.7.1-source-code.tar.gz 50913308 BLAKE2B 90daac4c7250313965b01504e806559c98b1785b81b44b5254f8ad54da16d56c1174ac0b4be52a3a4b4ff68d2e19e340e8fb67490ca9093d7c452030eb1e3d69 SHA512 0c3c71eb66126f8b4e3c617e9ca27cb824d181d4dd22ab0aeb2851a6a6754d736a8a8245db4da9c3f51341b73fcc863b7a482da3dfbd54f0387f9842f84e70a0
DIST gotosocial-0.8.0-source-code.tar.gz 52503432 BLAKE2B 34f12afc5d1e51bbc2bb6e7b66aed79dd5a659357d711cf5c0432d11351d986c7ac33635be75ca8be20dbaaf1c570c9a00ca5603e0257d3b3dc2238b0f1ac462 SHA512 b3bbb160e039ddc8e36165bd39e6d633d719d6bed49a9c8a3e0a2bd8d272c42940132126b076a8dd8998cf2497c888f033baf6f23b44901c3f270efa87db6ba4
DIST gotosocial_0.7.1_web-assets.tar.gz 1314903 BLAKE2B 9f27eadff51615d44d3cae3ce58302b2e0a2b56706429b2696df08d8385b0d8049f2a1caa9da5f169dcef5b61b2798bc863d3d780514df703a6bda99ba758df7 SHA512 6709aa5cbfe2a7077d2ea3291fbe2f246153d7a6ebfb49d8d369cb39c7620f47a9ec857d82581243ad59970c48854a944741e697d915fb1d9deb45ed8fed333d
DIST gotosocial_0.8.0_web-assets.tar.gz 1306945 BLAKE2B eaf9286865c76fc73b9c471551264b1009fb3a6f6fa0d93a51a62092d3249259e5aa488eedf2c959b4c5e035b54f713577022ea299635d1ffa94f5670dc75a7f SHA512 d2d54627adf2e28f5cd8e85322db7279f280ef34e83b8118b608851ffe55801e39679d63273a6f997262b3352f499299b19e2698d5c6ebb28b63bfb0dbbf326c

View File

@@ -0,0 +1,102 @@
# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
DOCS_BUILDER="mkdocs"
DOCS_DEPEND=(
dev-python/mkdocs-material
dev-python/mkdocs-swagger-ui-tag
dev-python/pillow
dev-python/regex
media-gfx/cairosvg
)
inherit python-any-r1 docs go-module systemd tmpfiles
DESCRIPTION="Fast, fun, ActivityPub server, powered by Go"
HOMEPAGE="
https://gotosocial.org/
https://github.com/superseriousbusiness/gotosocial
"
GH_RELEASE="https://github.com/superseriousbusiness/${PN}/releases/download/v${PV}"
SRC_URI="
${GH_RELEASE}/${P}-source-code.tar.gz
${GH_RELEASE}/${PN}_${PV}_web-assets.tar.gz
"
S="${WORKDIR}"
LICENSE="|| ( WTFPL-2 CC0-1.0 ) AGPL-3 Apache-2.0 BSD BSD-2 CC0-1.0 GPL-3 MIT MPL-2.0"
SLOT="0"
KEYWORDS="~amd64"
# Flaky tests
RESTRICT="test"
RDEPEND="acct-user/gotosocial"
DOCS=( archive {CONTRIBUTING,README,ROADMAP}.md )
src_unpack() {
# source code
unpack ${P}-source-code.tar.gz
rm -r web || die
# prebuilt web assets
unpack ${PN}_${PV}_web-assets.tar.gz
}
src_prepare() {
default
sed -i example/config.yaml \
-e "s|./web/template/|${EPREFIX}/usr/share/gotosocial/web/template/|g" \
-e "s|./web/assets/|${EPREFIX}/usr/share/gotosocial/web/assets/|g" \
-e "s|/gotosocial/storage|${EPREFIX}/var/lib/gotosocial/storage|g" \
|| die
}
src_configure() {
GOFLAGS+=" -tags=netgo,osusergo,static_build,kvformat"
}
src_compile() {
local myargs=(
-trimpath
-ldflags "-X main.Version=${PV}"
)
ego build "${myargs[@]}" ./cmd/gotosocial
use doc && docs_compile
}
src_test() {
local -x GTS_DB_TYPE="sqlite"
local -x GTS_DB_ADDRESS=":memory:"
local -x GOFLAGS
GOFLAGS="${GOFLAGS//-v/}"
GOFLAGS="${GOFLAGS//-x/}"
ego test -vet off ./...
}
src_install() {
dobin gotosocial
newinitd "${FILESDIR}"/gotosocial.initd ${PN}
newconfd "${FILESDIR}"/gotosocial.confd ${PN}
systemd_dounit "${FILESDIR}"/gotosocial.service
newtmpfiles "${FILESDIR}"/gotosocial.tmpfiles ${PN}.conf
insinto /usr/share/gotosocial
doins -r web
insinto /etc/gotosocial
doins example/config.yaml
}
pkg_postinst() {
tmpfiles_process ${PN}.conf
}