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

EAPI=8

inherit meson
inherit secureboot

DESCRIPTION="A very simple UEFI bootloader."
HOMEPAGE="https://git.pinkro.se/Rose/gardenhouse/rootloader.git/about/"
SRC_URI="https://git.pinkro.se/Rose/gardenhouse/rootloader.git/snapshot/rootloader-1.0.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="* -~*"
IUSE=""

BDEPEND="dev-python/pyelftools"

src_configure() {
	local emesonargs=(
		-Dc_link_args="-Wl,-z,norelro"
		-Dcpp_link_args="-Wl,-z,norelro"
	)
	meson_src_configure
	secureboot_pkg_setup
}

src_compile() {
	meson_src_compile
}

src_install() {
	meson_src_install
	secureboot_auto_sign
}