dev-python/agate: Bump to 1.13.0
[gentoo/gentoo.git] / x11-misc / redshift / redshift-1.12-r10.ebuild
blobc0fecea4ac9d0e7db7e307fada0b7277160331aa
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
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"
14 LICENSE="GPL-3"
15 SLOT="0"
16 KEYWORDS="amd64 arm64 ppc64 ~riscv x86"
17 IUSE="appindicator geoclue gtk nls"
19 COMMON_DEPEND=">=x11-libs/libX11-1.4
20         x11-libs/libXxf86vm
21         x11-libs/libxcb
22         x11-libs/libdrm
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 PATCHES=(
37         "${FILESDIR}"/${P}-apparmor.patch
38         "${FILESDIR}"/${P}-libayatana-appindicator.patch
41 src_configure() {
42         use gtk && python_setup
44         # Fix compile for Clang (bug #732438)
45         append-cflags -fPIE
47         econf \
48                 $(use_enable nls) \
49                 --enable-drm \
50                 --enable-randr \
51                 --enable-vidmode \
52                 --disable-wingdi \
53                 \
54                 --disable-corelocation \
55                 $(use_enable geoclue geoclue2) \
56                 \
57                 $(use_enable gtk gui) \
58                 --with-systemduserunitdir="$(systemd_get_userunitdir)" \
59                 --enable-apparmor \
60                 --disable-quartz \
61                 --disable-ubuntu
64 _impl_specific_src_install() {
65         emake DESTDIR="${D}" \
66                 PYTHON="${PYTHON}" \
67                 pythondir="$(python_get_sitedir)" \
68                 -C src/redshift-gtk install
71 src_install() {
72         emake DESTDIR="${D}" UPDATE_ICON_CACHE=/bin/true install
74         if use gtk; then
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
83         fi
86 pkg_postinst() {
87         use gtk && xdg_icon_cache_update
90 pkg_postrm() {
91         use gtk && xdg_icon_cache_update