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

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Drop-in replacement for libudev with gardendev database integration"
HOMEPAGE="https://git.pinkro.se/Rose/gardenhouse/libudev-zero.git"
SRC_URI="https://git.pinkro.se/Rose/gardenhouse/libudev-zero.git/snapshot/${P}.tar.gz"

LICENSE="ISC"
SLOT="0"
KEYWORDS="~*"
IUSE="+static-libs"

RDEPEND="
	!sys-apps/systemd-utils[udev]
	!sys-apps/systemd
"

src_compile() {
	emake CC="$(tc-getCC)" PREFIX=/usr LIBDIR=/usr/$(get_libdir)
}

src_install() {
	emake DESTDIR="${D}" PREFIX=/usr LIBDIR=/usr/$(get_libdir) install-shared

	if use static-libs; then
		emake DESTDIR="${D}" PREFIX=/usr LIBDIR=/usr/$(get_libdir) install-static
	fi

	dodoc README.md
}