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

EAPI=8

inherit git-r3 savedconfig toolchain-funcs

DESCRIPTION="A fast, feature-complete bar for dwl."
HOMEPAGE="https://github.com/kolunmi/dwlb"

EGIT_REPO_URI="https://github.com/kolunmi/dwlb"
EGIT_BRANCH="main"

LICENSE="GPL-3"
SLOT="0"
IUSE=""
KEYWORDS="~amd64"
RESTRICT="mirror"

RDEPEND="
	dev-libs/wayland
	dev-libs/wayland-protocols
"
DEPEND="
	${RDEPEND}
	x11-base/xorg-proto
"
BDEPEND="
	dev-util/wayland-scanner
	virtual/pkgconfig
"

src_prepare() {
	default
	restore_config config.h
}

src_compile() {
	emake CC="$(tc-getCC)"
}

src_install() {
	emake PREFIX="${D}${EPREFIX}/usr" install
	save_config config.h
}