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

EAPI=8

PYTHON_COMPAT=( python3_{9..14} )
DISTUTILS_USE_PEP517=hatchling
PYPI_VERIFY_REPO=1
inherit distutils-r1 pypi optfeature

DESCRIPTION="Emoji and unicode picker for rofi, wofi and similar selectors"
HOMEPAGE="https://github.com/fdw/rofimoji"
#SRC_URI=""

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

# checked as of 6.7.0
DEPEND="
	${PYTHON_DEPS}
	$(python_gen_cond_dep '
		<dev-python/configargparse-2.0.0[${PYTHON_USEDEP}]
	')
"
RDEPEND="${DEPEND}"
BDEPEND="${DEPEND}"

pkg_postinst() {
	elog "If optional programs for selectors, types, and clipboards are listed,"
	elog "you don't have the programs installed to use those features."
	elog "A selector is REQUIRED. A typer (default) OR clipboard is also required."
	elog "Only 1 of the listed programs per feature is needed."
	elog "Some programs might be available in ::guru only."
	# https://github.com/fdw/rofimoji?tab=readme-ov-file#supported-selectors
	optfeature_header "rofimoji supports any of these selectors to be installed (REQUIRED):"
	# wofi is last because it's explicitly less maintained now
	# fuzzel and tofi is ::guru, but optfeature does not support repos
	optfeature "rofimoji selectors" \
		x11-misc/rofi \
		gui-apps/fuzzel \
		x11-misc/dmenu \
		gui-apps/tofi \
		dev-libs/bemenu \
		gui-apps/wmenu \
		gui-apps/wofi

	# https://github.com/fdw/rofimoji?tab=readme-ov-file#supported-selectors:~:text=%2D%2Dtyper
	# wtype is ::guru
	# cliclick and wl-ime-type is not found
	optfeature_header "rofimoji uses any of these tools for typing emojis (default action):"
	optfeature "rofimoji typers" \
		x11-misc/xdotool \
		x11-misc/ydotool \
		x11-misc/wtype

	# wayland prioritized first
	# https://github.com/fdw/rofimoji?tab=readme-ov-file#supported-selectors:~:text=%2D%2Dclipboarder
	optfeature_header "rofimoji uses any of these tools for copying to clipboard:"
	optfeature "rofimoji clipboards" \
		gui-apps/wl-clipboard \
		x11-misc/xsel \
		x11-misc/xclip
}