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

EAPI=8

ZIG_SLOT="0.15"

inherit git-r3 savedconfig zig

DESCRIPTION="A window manager based on River Wayland compositor"
HOMEPAGE="https://github.com/kewuaa/kwm"
EGIT_REPO_URI="https://github.com/kewuaa/kwm.git"

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

DEPEND="
	dev-libs/wayland
	media-libs/fcft
	x11-libs/pixman
"
RDEPEND="${DEPEND}"
BDEPEND="
	dev-libs/wayland-protocols
	dev-util/wayland-scanner
"

src_unpack() {
	git-r3_src_unpack
	zig_live_fetch
}

src_prepare() {
	zig_src_prepare
	cp config.def.zig config.zig || die "copying config.zig failed"
	restore_config config.zig
}

src_install() {
	zig_src_install
	save_config config.zig
}