net-p2p/yggdrasil-go: add 0.5.9

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
This commit is contained in:
Eric Joldasov 2024-10-29 03:47:44 +05:00
parent cd2f12d4dd
commit 7ffb78e153
No known key found for this signature in database
GPG Key ID: 5C9C69060686B588
2 changed files with 81 additions and 0 deletions

View File

@ -1,2 +1,4 @@
DIST yggdrasil-go-0.5.7-vendor.tar.xz 1474632 BLAKE2B c10f72f6bc94f07a51af70e55ce693ad140b4b4a1e9a7336bd80e46d6aca759f69c3d339a883732371dc4862e2da6bc4618ba046afe1a1c2efd72b2f5859482d SHA512 64ab1b29686d2c555c7f4fc8a20ea1b4bb40f05e795b010c5536cee5173647c2bcd4fff3b03ff0d8e196b33ffb814a60bdbf7d315fda7d986fdaaa6255d356cb
DIST yggdrasil-go-0.5.7.tar.gz 107794 BLAKE2B 2baf4689e1ec70362c292a62b67dc944880f6e2ece4f35725b665dc11341c9ccce93433dd085bd41351dd11562c93fd070001b1c83f6b626a5d0606c9ab8c61f SHA512 aeb6668a30043ed1ae695702d21a51faa4acd1dc4c93cbafaf5afd902fdca9a8196ed6e0e2e05b63eba4ea64906b6e43680c79a19f97be8837aa61f161fb48fa
DIST yggdrasil-go-0.5.9-vendor.tar.xz 1396864 BLAKE2B 41e6e0b2f79eca45d59f959385e32ca1059f96c292acfc97b65894b5ac304ddea99b5bf670f27c0431d079beb408ce41bc9a7bbce8591e69a202134e36b51dc0 SHA512 bcb2085845d851e47b566fb7eea77bacd315f2efc22dfc814624793404034f942e180441f42133eeceda6b9f6ba71654df47437c04aba9f25175bc3d88c72b67
DIST yggdrasil-go-0.5.9.tar.gz 109883 BLAKE2B 2a210f5b6d51703e184f7ba48d33cc301c3dc392daf79ef56a42481c46b4d45c996d2c292f685e38bac832efae44dfab4d21a789f259f6c4a4b455850df82793 SHA512 88fb5d6303b1b4a2a611131f939560d08f9d83f3516bf8d1aec041b03cca5e7711e9e989ff14d6f4588e76898b61b3ad51e9f9701837a0bd2235cdaf60e95bb8

View File

@ -0,0 +1,79 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit fcaps go-module linux-info systemd
DESCRIPTION="An experiment in scalable routing as an encrypted IPv6 overlay network"
HOMEPAGE="https://yggdrasil-network.github.io/"
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/yggdrasil-network/yggdrasil-go"
inherit git-r3
else
SRC_URI="
https://github.com/yggdrasil-network/yggdrasil-go/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
https://codeberg.org/BratishkaErik/distfiles/releases/download/yggdrasil-go-${PV}/yggdrasil-go-${PV}-vendor.tar.xz
"
KEYWORDS="~amd64 ~arm64"
fi
LICENSE="LGPL-3 MIT Apache-2.0 BSD ZLIB"
SLOT="0"
RESTRICT="mirror"
BDEPEND=">=dev-lang/go-1.23"
DEPEND="
acct-user/yggdrasil
acct-group/yggdrasil
"
DOCS=( "README.md" "CHANGELOG.md" )
FILECAPS=(
cap_net_admin,cap_net_bind_service "usr/bin/yggdrasil"
)
CONFIG_CHECK="~TUN"
ERROR_TUN="Your kernel lacks TUN support."
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
go-module_live_vendor
fi
go-module_src_unpack
}
src_compile() {
GOFLAGS+=" -mod=vendor -trimpath"
local src="github.com/yggdrasil-network/yggdrasil-go/src/version"
local name version
if [[ ${PV} == 9999 ]]; then
chmod +x ./contrib/semver/{name,version}.sh || die
name="$(./contrib/semver/name.sh || die)"
version="$(./contrib/semver/version.sh || die)"
else
name="yggdrasil"
version="v${PV}"
fi
local custom_name_version_flags="-X ${src}.buildName=${name} -X ${src}.buildVersion=${version}"
local go_ldflags="-s -linkmode external -extldflags \"${LDFLAGS}\" ${custom_name_version_flags}"
for cmd in yggdrasil{,ctl}; do
ego build ${GOFLAGS} -ldflags="${go_ldflags}" ./cmd/${cmd}
done
}
src_install() {
dobin yggdrasil{,ctl}
einstalldocs
systemd_dounit "contrib/systemd/yggdrasil.service"
systemd_dounit "contrib/systemd/yggdrasil-default-config.service"
doinitd "contrib/openrc/yggdrasil"
}