1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{9..12} )
8 inherit autotools systemd xdg-utils python-r1
10 DESCRIPTION="A screen color temperature adjusting software"
11 HOMEPAGE="https://gitlab.com/chinstrap/gammastep"
12 SRC_URI="https://gitlab.com/chinstrap/gammastep/-/archive/v${PV}/gammastep-v${PV}.tar.bz2"
16 KEYWORDS="amd64 arm64 ppc64 ~x86"
17 IUSE="appindicator geoclue gtk nls wayland"
19 COMMON_DEPEND=">=x11-libs/libX11-1.4
23 appindicator? ( dev-libs/libayatana-appindicator )
24 geoclue? ( app-misc/geoclue:2.0 dev-libs/glib:2 )
25 gtk? ( ${PYTHON_DEPS} )"
26 RDEPEND="${COMMON_DEPEND}
27 gtk? ( dev-python/pygobject[${PYTHON_USEDEP}]
28 x11-libs/gtk+:3[introspection]
29 dev-python/pyxdg[${PYTHON_USEDEP}] )"
30 DEPEND="${COMMON_DEPEND}
31 >=dev-util/intltool-0.50
32 nls? ( sys-devel/gettext )
34 REQUIRED_USE="gtk? ( ${PYTHON_REQUIRED_USE} )"
36 S="${WORKDIR}"/${PN}-v${PV}
44 use gtk && python_setup
49 $(use_enable wayland) \
52 $(use_enable geoclue geoclue2) \
53 $(use_enable gtk gui) \
55 --with-systemduserunitdir="$(systemd_get_userunitdir)"
58 _impl_specific_src_install() {
59 emake DESTDIR="${D}" \
61 pythondir="$(python_get_sitedir)" \
62 -C src/gammastep_indicator install
66 emake DESTDIR="${D}" UPDATE_ICON_CACHE=/bin/true install
69 python_foreach_impl _impl_specific_src_install
70 python_replicate_script "${D}"/usr/bin/gammastep-indicator
72 python_foreach_impl python_optimize
75 insinto /etc/gammastep/
76 newins gammastep.conf.sample config.ini.example
80 use gtk && xdg_icon_cache_update
84 use gtk && xdg_icon_cache_update