1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{9..11} )
8 inherit flag-o-matic systemd xdg-utils python-r1
10 DESCRIPTION="A screen color temperature adjusting software"
11 HOMEPAGE="http://jonls.dk/redshift/"
12 SRC_URI="https://github.com/jonls/${PN}/releases/download/v${PV}/${P}.tar.xz"
16 KEYWORDS="amd64 arm64 ppc64 ~riscv x86"
17 IUSE="appindicator geoclue gtk nls"
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} )"
37 "${FILESDIR}"/${P}-apparmor.patch
38 "${FILESDIR}"/${P}-libayatana-appindicator.patch
42 use gtk && python_setup
44 # Fix compile for Clang (bug #732438)
54 --disable-corelocation \
55 $(use_enable geoclue geoclue2) \
57 $(use_enable gtk gui) \
58 --with-systemduserunitdir="$(systemd_get_userunitdir)" \
64 _impl_specific_src_install() {
65 emake DESTDIR="${D}" \
67 pythondir="$(python_get_sitedir)" \
68 -C src/redshift-gtk install
72 emake DESTDIR="${D}" UPDATE_ICON_CACHE=/bin/true install
75 python_foreach_impl _impl_specific_src_install
76 python_replicate_script "${D}"/usr/bin/redshift-gtk
77 dosym redshift-gtk /usr/bin/gtk-redshift
79 python_foreach_impl python_optimize
81 # https://bugs.gentoo.org/784281
82 mv "${D}"/usr/share/{appdata,metainfo}/ || die
87 use gtk && xdg_icon_cache_update
91 use gtk && xdg_icon_cache_update