# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module

DESCRIPTION="UKI builder similiar to ukify that supports pcr measurments, secureboot and multi-stage UKIs"
HOMEPAGE="https://git.pinkro.se/Rose/gardenhouse/graft-kernel.git/about/"

if [[ ${PV} = 9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://git.pinkro.se/Rose/gardenhouse/graft-kernel.git"
	EGIT_BRANCH="main"
else
	SRC_URI="https://git.pinkro.se/Rose/gardenhouse/graft-kernel.git/snapshot/${P}.tar.gz"
	KEYWORDS="~amd64"
fi

LICENSE="GPL-3+"
SLOT="0"

BDEPEND=">=dev-lang/go-1.25.5"

src_compile() {
	ego build -o graft-kernel cmd/graft-kernel/main.go
}

src_install() {
	dobin graft-kernel

	default
}