commit:     bd96a72124416cab741cdd56c8a244a3463a91ae
Author:     Eric Joldasov <bratishkaerik <AT> landless-city <DOT> net>
AuthorDate: Thu Nov 28 18:31:48 2024 +0000
Commit:     Julien Roy <julien <AT> jroy <DOT> ca>
CommitDate: Thu Nov 28 18:31:48 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=bd96a721

net-p2p/yggdrasil-go: add 0.5.10

Signed-off-by: Eric Joldasov <bratishkaerik <AT> landless-city.net>

 net-p2p/yggdrasil-go/Manifest                   |  2 +
 net-p2p/yggdrasil-go/yggdrasil-go-0.5.10.ebuild | 79 +++++++++++++++++++++++++
 2 files changed, 81 insertions(+)

diff --git a/net-p2p/yggdrasil-go/Manifest b/net-p2p/yggdrasil-go/Manifest
index 2fae92444..ecf1bd272 100644
--- a/net-p2p/yggdrasil-go/Manifest
+++ b/net-p2p/yggdrasil-go/Manifest
@@ -1,2 +1,4 @@
+DIST yggdrasil-go-0.5.10-vendor.tar.xz 1389288 BLAKE2B 
69006e8e7440abbd84e5e5ebf9469f6dfce96474420f6975eb085771da5b2096044adcdc87726dbae301890a7a50a363057022b17b2d9881cba592d6b0a12a80
 SHA512 
720e22338d9b47fbcd36e0bc3a79ab6fb4d869404b52e93b40c49440ccd30b20ae66135df3715f7a9c06a491752244eaac95cd5944452e0d27caad89a9d310bf
+DIST yggdrasil-go-0.5.10.tar.gz 110477 BLAKE2B 
267579ec0f97dd2bce99590e006dc95ff8e2f542dcc7df06bd6854501fb2f58880b2f7af26e8747ead577ee9146c0c5b895d7cdd23ab0b68c3b0d6e874e3f39f
 SHA512 
402704bf61414cf13248941ee0a5d38db9a86838d8dfd19d5032ab0408862f484d999d69c2cab124c1e5da4ba352dadd2958e6a4ad70a88167421cfca7a179f4
 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

diff --git a/net-p2p/yggdrasil-go/yggdrasil-go-0.5.10.ebuild 
b/net-p2p/yggdrasil-go/yggdrasil-go-0.5.10.ebuild
new file mode 100644
index 000000000..285b8c048
--- /dev/null
+++ b/net-p2p/yggdrasil-go/yggdrasil-go-0.5.10.ebuild
@@ -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"
+}

Reply via email to