Add www-apps/yarnd
Signed-off-by: Shin'ya Minazuki <shinyoukai@laidback.moe>
This commit is contained in:
18
www-apps/yarnd/files/yarnd.confd-r1
Normal file
18
www-apps/yarnd/files/yarnd.confd-r1
Normal file
@@ -0,0 +1,18 @@
|
||||
# Arguments to pass to the Yarn.social server
|
||||
# Some common options are:
|
||||
# -R to enable open registrations (this is required for admin account creation)
|
||||
# -d path to data directory
|
||||
# -O to enable open profiles
|
||||
|
||||
# Environment variables
|
||||
# These will be exported by OpenRC for use with the daemon
|
||||
|
||||
# ADMIN_USER=""
|
||||
# ADMIN_EMAIL=""
|
||||
|
||||
# These values are required for a production instance
|
||||
# cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1
|
||||
#
|
||||
# API_SIGNING_KEY=""
|
||||
# COOKIE_SECRET=""
|
||||
# MAGICLINK_SECRET=""
|
||||
12
www-apps/yarnd/files/yarnd.initd-r1
Normal file
12
www-apps/yarnd/files/yarnd.initd-r1
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2026 Shin'ya Minazuki
|
||||
supervisor="supervise-daemon"
|
||||
|
||||
command="/usr/sbin/${RC_SVCNAME}"
|
||||
command_args="${yarnd_args}"
|
||||
command_background="true"
|
||||
command_user="yarnd:yarnd"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
8
www-apps/yarnd/metadata.xml
Normal file
8
www-apps/yarnd/metadata.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>shinyoukai@laidback.moe</email>
|
||||
<name>Shin'ya Minazuki</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
53
www-apps/yarnd/yarnd-9999.ebuild
Normal file
53
www-apps/yarnd/yarnd-9999.ebuild
Normal file
@@ -0,0 +1,53 @@
|
||||
# Copyright 2026 Shin'ya Minazuki
|
||||
EAPI=8
|
||||
|
||||
inherit git-r3 go-module
|
||||
|
||||
DESCRIPTION="Self-hosted non-social social media (daemon)"
|
||||
HOMEPAGE="https://yarn.social"
|
||||
EGIT_REPO_URI="https://git.mills.io/yarnsocial/yarn.git"
|
||||
|
||||
LICENSE="AGPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm64 ~x86"
|
||||
|
||||
# There's also other two build dependencies,
|
||||
# but they are not required for building, and no user
|
||||
# I know gives a crap.
|
||||
BDEPEND="dev-util/minify"
|
||||
|
||||
DOCS=( AUTHORS README.md )
|
||||
|
||||
src_unpack() {
|
||||
git-r3_src_unpack
|
||||
go-module_live_vendor
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
einfo "Bundling CSS files..."
|
||||
minify -b -o ./internal/theme/static/css/yarn.min.css ./internal/theme/static/css/[0-9]*-*.css
|
||||
minify -b -o ./internal/theme/static/css/noscript.min.css ./internal/theme/static/css/noscript.css
|
||||
einfo "Bundiling JS files..."
|
||||
minify -b -o ./internal/theme/static/js/yarn.min.js ./internal/theme/static/js/[0-9]*-*.js
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
export VERSION="0.15.1-${EGIT_COMMIT}"
|
||||
export COMMIT="${EGIT_COMMIT}"
|
||||
export BUILD="$(date +%Y-%m-%d)"
|
||||
export CGO_ENABLED="0"
|
||||
|
||||
ego build \
|
||||
-tags "netgo static_build" \
|
||||
-installsuffix netgo \
|
||||
-ldflags="-w -X git.mills.io/yarnsocial/yarn.Version=${VERSION} -X git.mills.io/yarnsocial/yarn.Commit=${COMMIT} -X git.mills.io/yarnsocial/yarn.Build=${BUILD}" \
|
||||
./cmd/yarnd/...
|
||||
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dosbin yarnd
|
||||
newinitd "${FILESDIR}/yarnd.initd-r1" "${PN}"
|
||||
newconfd "${FILESDIR}/yarnd.confd-r1" "${PN}"
|
||||
einstalldocs
|
||||
}
|
||||
Reference in New Issue
Block a user