# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the MIT License

EAPI=8

DESCRIPTION="Emulates the main features of tdrop in Hyprland"
HOMEPAGE="https://github.com/hyprwm/contrib"

COMMIT="8e6c02ac3dfbff878ef300266598737ee9cedf94"

if [[ "${PV}" = *9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/hyprwm/contrib.git"
else
	SRC_URI="https://github.com/hyprwm/contrib/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
	S="${WORKDIR}/contrib-${COMMIT}"

	KEYWORDS="~amd64"
fi

LICENSE="MIT"
SLOT="0"

RDEPEND="
	app-misc/jq
	gui-wm/hyprland
	sys-apps/util-linux
"
DEPEND="${RDEPEND}"

src_install() {
	pushd ${PN} || die
	emake DESTDIR="${D}" PREFIX="${D}/usr" install
}