Gentoo Archives: gentoo-commits

From: Sebastian Pipping <sping@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/redshift/
Date: Tue, 20 Apr 2021 16:57:59
Message-Id: 1618937830.7e4aa823d94eb3c0e05a6e4becad19a6e973277a.sping@gentoo
1 commit: 7e4aa823d94eb3c0e05a6e4becad19a6e973277a
2 Author: Sebastian Pipping <sping <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 20 16:51:19 2021 +0000
4 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 20 16:57:10 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e4aa823
7
8 x11-misc/redshift: Stop using /usr/share/appdata
9
10 Closes: https://bugs.gentoo.org/784281
11 Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>
12 Package-Manager: Portage-3.0.18, Repoman-3.0.3
13
14 x11-misc/redshift/redshift-1.12-r5.ebuild | 93 +++++++++++++++++++++++++++++++
15 1 file changed, 93 insertions(+)
16
17 diff --git a/x11-misc/redshift/redshift-1.12-r5.ebuild b/x11-misc/redshift/redshift-1.12-r5.ebuild
18 new file mode 100644
19 index 00000000000..0030954649e
20 --- /dev/null
21 +++ b/x11-misc/redshift/redshift-1.12-r5.ebuild
22 @@ -0,0 +1,93 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=6
27 +PYTHON_COMPAT=( python3_{7,8,9} )
28 +
29 +inherit flag-o-matic systemd autotools gnome2-utils python-r1
30 +
31 +DESCRIPTION="A screen color temperature adjusting software"
32 +HOMEPAGE="http://jonls.dk/redshift/"
33 +SRC_URI="https://github.com/jonls/redshift/archive/v${PV}.tar.gz -> ${P}.tar.gz"
34 +
35 +LICENSE="GPL-3"
36 +SLOT="0"
37 +KEYWORDS="~amd64 ~arm64 ~x86"
38 +IUSE="appindicator geoclue gtk nls"
39 +
40 +COMMON_DEPEND=">=x11-libs/libX11-1.4
41 + x11-libs/libXxf86vm
42 + x11-libs/libxcb
43 + x11-libs/libdrm
44 + appindicator? ( dev-libs/libappindicator:3[introspection] )
45 + geoclue? ( app-misc/geoclue:2.0 dev-libs/glib:2 )
46 + gtk? ( ${PYTHON_DEPS} )"
47 +RDEPEND="${COMMON_DEPEND}
48 + gtk? ( dev-python/pygobject[${PYTHON_USEDEP}]
49 + x11-libs/gtk+:3[introspection]
50 + dev-python/pyxdg[${PYTHON_USEDEP}] )"
51 +DEPEND="${COMMON_DEPEND}
52 + >=dev-util/intltool-0.50
53 + nls? ( sys-devel/gettext )
54 +"
55 +REQUIRED_USE="gtk? ( ${PYTHON_REQUIRED_USE} )"
56 +
57 +src_prepare() {
58 + default
59 + eautoreconf
60 +}
61 +
62 +src_configure() {
63 + use gtk && python_setup
64 +
65 + # Fix compile for Clang (bug #732438)
66 + append-cflags -fPIE
67 +
68 + econf \
69 + $(use_enable nls) \
70 + --enable-drm \
71 + --enable-randr \
72 + --enable-vidmode \
73 + --disable-wingdi \
74 + \
75 + --disable-corelocation \
76 + $(use_enable geoclue geoclue2) \
77 + \
78 + $(use_enable gtk gui) \
79 + --with-systemduserunitdir="$(systemd_get_userunitdir)" \
80 + --enable-apparmor \
81 + --disable-quartz \
82 + --disable-ubuntu
83 +}
84 +
85 +_impl_specific_src_install() {
86 + emake DESTDIR="${D}" pythondir="$(python_get_sitedir)" \
87 + -C src/redshift-gtk install
88 +}
89 +
90 +src_install() {
91 + emake DESTDIR="${D}" UPDATE_ICON_CACHE=/bin/true install
92 +
93 + if use gtk; then
94 + python_foreach_impl _impl_specific_src_install
95 + python_replicate_script "${D}"/usr/bin/redshift-gtk
96 + dosym redshift-gtk /usr/bin/gtk-redshift
97 +
98 + python_foreach_impl python_optimize
99 + fi
100 +
101 + # https://bugs.gentoo.org/784281
102 + mv "${D}"/usr/share/{appdata,metainfo}/ || die
103 +}
104 +
105 +pkg_preinst() {
106 + use gtk && gnome2_icon_savelist
107 +}
108 +
109 +pkg_postinst() {
110 + use gtk && gnome2_icon_cache_update
111 +}
112 +
113 +pkg_postrm() {
114 + use gtk && gnome2_icon_cache_update
115 +}