EAPI=8
inherit go-module
DESCRIPTION="An unofficial GUI wrapper for the Tailscale CLI client"
HOMEPAGE="https://github.com/DeedleFake/trayscale"

# vendor tarball needs to be updated with each release:
# https://wiki.gentoo.org/wiki/Writing_go_Ebuilds#Manual_Vendor_tarball

# use LFS for vendor tarball in the portage-deps repo:
# git add foo-vendor.tar.xz && git commit -a && git lfs migrate import --include=foo-vendor.tar.xz --everything && git push

SRC_URI="https://github.com/DeedleFake/${PN}/archive/refs/tags/v$PV.tar.gz -> ${P}.tar.gz
         https://git.alfter.us/salfter/portage-deps/media/branch/master/${P}-vendor.tar.xz"
LICENSE="Apache-2.0 BSD-2 BSD ISC MIT MPL-2.0 Unknown"
SLOT=0
KEYWORDS=~amd64
BDEPEND=">=dev-lang/go-1.27.0"
RDEPEND=">=gui-libs/libadwaita-1.9"

src_compile()
{
  ./dist.sh build v${PV}
}

src_install()
{
  ./dist.sh install ${D}/usr
}