diff options
author | William Hubbs <williamh@gentoo.org> | 2020-12-15 22:18:11 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2020-12-15 22:19:50 -0600 |
commit | 95c12de526a02edbada6b57dd17225480fa1575d (patch) | |
tree | 6096471577fea85c1611fcddffb5c8ea444a754c /net-vpn/tailscale/tailscale-1.2.10-r1.ebuild | |
parent | net-p2p/transmission-remote-gtk: amd64 stable (bug #706980) (diff) | |
download | gentoo-95c12de526a02edbada6b57dd17225480fa1575d.tar.gz gentoo-95c12de526a02edbada6b57dd17225480fa1575d.tar.bz2 gentoo-95c12de526a02edbada6b57dd17225480fa1575d.zip |
net-vpn/tailscale: adjust build with upstream recommendations
This ports upstream's build-dist.sh script into an ebuild equivalent.
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'net-vpn/tailscale/tailscale-1.2.10-r1.ebuild')
-rw-r--r-- | net-vpn/tailscale/tailscale-1.2.10-r1.ebuild | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/net-vpn/tailscale/tailscale-1.2.10-r1.ebuild b/net-vpn/tailscale/tailscale-1.2.10-r1.ebuild index c675afd06350..4b3d61ed3d1e 100644 --- a/net-vpn/tailscale/tailscale-1.2.10-r1.ebuild +++ b/net-vpn/tailscale/tailscale-1.2.10-r1.ebuild @@ -3,6 +3,11 @@ EAPI=7 inherit go-module systemd tmpfiles +# This is obtained using ./version/version.sh in the upstream repo and +# substituting ${PV} appropriately. +VERSION_SHORT="${PV}" +VERSION_LONG="${PV}-te480f8ddf" +VERSION_GIT_HASH="e480f8ddf6f7334fda1b3d0dd1b500f2f01f961b" DESCRIPTION="Tailscale vpn client" HOMEPAGE="https://tailscale.com" @@ -219,15 +224,18 @@ KEYWORDS="~amd64" RDEPEND="net-firewall/iptables" +# This translates the build command from upstream's build_dist.sh to an +# ebuild equivalent. +build_dist() { + go build -tags xversion -ldflags " + -X tailscale.com/version.Long=${VERSION_LONG} + -X tailscale.com/version.Short=${VERSION_SHORT} + -X tailscale.com/version.GitCommit=${VERSION_GIT_HASH}" "$@" +} + src_compile() { - go build -tags xversion \ - -ldflags "-X tailscale.com/version.Long=${PV} - -X tailscale.com/version.Short=${PV}" \ - ./cmd/tailscale || die - go build -tags xversion \ - -ldflags "-X tailscale.com/version.Long=${PV} - -X tailscale.com/version.Short=${PV}" \ - ./cmd/tailscaled || die + build_dist ./cmd/tailscale || die + build_dist ./cmd/tailscaled || die } src_install() { |