Gentoo Archives: gentoo-commits

From: Kristian Fiskerstrand <k_f@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: gnome-extra/cinnamon/, gnome-extra/cinnamon/files/
Date: Mon, 27 May 2019 13:15:53
Message-Id: 1558962827.0d906a3b88ab0f31370c7595f8093765b9f0791d.k_f@gentoo
1 commit: 0d906a3b88ab0f31370c7595f8093765b9f0791d
2 Author: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 27 13:13:10 2019 +0000
4 Commit: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org>
5 CommitDate: Mon May 27 13:13:47 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d906a3b
7
8 gnome-extra/cinnamon: Add fix for pillow >= 6.0.0
9
10 Closes: https://bugs.gentoo.org/684158
11 Signed-off-by: Kristian Fiskerstrand <k_f <AT> gentoo.org>
12 Package-Manager: Portage-2.3.66, Repoman-2.3.11
13
14 gnome-extra/cinnamon/cinnamon-4.0.3-r2.ebuild | 209 +++++++++++++++++++++
15 .../files/cinnamon-4.0-fix-pillow-settings.patch | 43 +++++
16 2 files changed, 252 insertions(+)
17
18 diff --git a/gnome-extra/cinnamon/cinnamon-4.0.3-r2.ebuild b/gnome-extra/cinnamon/cinnamon-4.0.3-r2.ebuild
19 new file mode 100644
20 index 00000000000..312c789f23f
21 --- /dev/null
22 +++ b/gnome-extra/cinnamon/cinnamon-4.0.3-r2.ebuild
23 @@ -0,0 +1,209 @@
24 +# Copyright 1999-2019 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=6
28 +GNOME2_LA_PUNT="yes"
29 +PYTHON_COMPAT=( python{2_7,3_5,3_6} )
30 +PYTHON_REQ_USE="xml"
31 +
32 +inherit autotools eutils flag-o-matic gnome2 multilib pax-utils python-r1
33 +
34 +DESCRIPTION="A fork of GNOME Shell with layout similar to GNOME 2"
35 +HOMEPAGE="http://developer.linuxmint.com/"
36 +
37 +MY_PV="${PV/_p/-UP}"
38 +MY_P="${PN}-${MY_PV}"
39 +
40 +SRC_URI="https://github.com/linuxmint/Cinnamon/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
41 +
42 +LICENSE="GPL-2+"
43 +SLOT="0"
44 +
45 +IUSE="+nls"
46 +
47 +# We need *both* python 2.x and 3.x
48 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
49 + || ( $(python_gen_useflags 'python2*') )
50 + || ( $(python_gen_useflags 'python3*') )
51 +"
52 +
53 +KEYWORDS="~amd64 ~x86"
54 +
55 +COMMON_DEPEND="${PYTHON_DEPS}
56 + app-accessibility/at-spi2-atk:2
57 + app-misc/ca-certificates
58 + dev-libs/dbus-glib
59 + >=dev-libs/glib-2.35.0:2[dbus]
60 + >=dev-libs/gobject-introspection-0.10.1:=
61 + >=dev-libs/json-glib-0.13.2
62 + >=dev-libs/libcroco-0.6.2:0.6
63 + dev-libs/libxml2:2
64 + gnome-base/librsvg
65 + >=gnome-extra/cinnamon-desktop-4.0:0=[introspection]
66 + >=gnome-extra/cinnamon-menus-4.0[introspection]
67 + >=gnome-extra/cjs-4.0.0[cairo]
68 + >=media-libs/clutter-1.10:1.0[introspection]
69 + media-libs/cogl:1.0=[introspection]
70 + >=gnome-base/gsettings-desktop-schemas-2.91.91
71 + media-libs/gstreamer:1.0
72 + media-libs/gst-plugins-base:1.0
73 + net-libs/libsoup:2.4[introspection]
74 + >=sys-auth/polkit-0.100[introspection]
75 + x11-libs/gdk-pixbuf:2[introspection]
76 + >=x11-libs/gtk+-3.12.0:3[introspection]
77 + x11-libs/pango[introspection]
78 + >=x11-libs/startup-notification-0.11
79 + x11-libs/libX11
80 + >=x11-libs/libXfixes-5.0
81 + >=x11-wm/muffin-4.0.0[introspection]
82 + dev-libs/keybinder:3[introspection]
83 + >=x11-libs/libnotify-0.7.3:0=[introspection]
84 +"
85 +# Runtime-only deps are probably incomplete and approximate.
86 +# Each block:
87 +# 2. Introspection stuff + dconf needed via imports.gi.*
88 +# 3. gnome-session is needed for gnome-session-quit
89 +# 4. Control shell settings
90 +# 5. accountsservice is needed for GdmUserManager (0.6.14 needed for fast
91 +# user switching with gdm-3.1.x)
92 +# 6. caribou needed for on-screen keyboard
93 +# 7. xdg-utils needed for xdg-open, used by extension tool
94 +# 8. imaging, lxml needed for cinnamon-settings
95 +# 9. gnome-icon-theme-symbolic needed for various icons
96 +# 10. pygobject needed for menu editor
97 +# 11. nemo - default file manager, tightly integrated with cinnamon
98 +# 12. polkit-gnome - explicitly autostarted by us
99 +# TODO(lxnay): fix error: libgnome-desktop/gnome-rr-labeler.h: No such file or directory
100 +RDEPEND="${COMMON_DEPEND}
101 + >=gnome-base/dconf-0.4.1
102 + >=gnome-base/libgnomekbd-2.91.4[introspection]
103 + sys-power/upower[introspection]
104 +
105 + >=gnome-extra/cinnamon-session-4.0
106 + >=gnome-extra/cinnamon-settings-daemon-4.0
107 +
108 + >=app-accessibility/caribou-0.3
109 +
110 + x11-misc/xdg-utils
111 + x11-libs/xapps[introspection]
112 +
113 + dev-python/dbus-python[${PYTHON_USEDEP}]
114 + dev-python/pygobject:3[${PYTHON_USEDEP}]
115 + $(python_gen_cond_dep 'dev-python/lxml[${PYTHON_USEDEP}]' 'python2*')
116 + $(python_gen_cond_dep 'dev-python/pexpect[${PYTHON_USEDEP}]' 'python2*')
117 + $(python_gen_cond_dep 'dev-python/pycairo[${PYTHON_USEDEP}]' 'python2*')
118 + $(python_gen_cond_dep 'dev-python/pyinotify[${PYTHON_USEDEP}]' 'python2*')
119 + $(python_gen_cond_dep 'dev-python/pypam[${PYTHON_USEDEP}]' 'python2*')
120 + $(python_gen_cond_dep 'dev-python/pillow[${PYTHON_USEDEP}]' 'python2*')
121 +
122 + x11-themes/gnome-themes-standard
123 + x11-themes/adwaita-icon-theme
124 +
125 + >=gnome-extra/nemo-4.0
126 + >=gnome-extra/cinnamon-control-center-4.0
127 + >=gnome-extra/cinnamon-screensaver-4.0
128 +
129 + gnome-extra/polkit-gnome
130 +
131 + nls? ( >=gnome-extra/cinnamon-translations-4.0 )
132 +"
133 +DEPEND="${COMMON_DEPEND}
134 + $(python_gen_cond_dep 'dev-python/polib[${PYTHON_USEDEP}]' 'python2*')
135 + dev-util/gtk-doc
136 + >=dev-util/intltool-0.4
137 + >=sys-devel/gettext-0.17
138 + virtual/pkgconfig
139 + gnome-base/gnome-common
140 + !!=dev-lang/spidermonkey-1.8.2*
141 +"
142 +# libmozjs.so is picked up from /usr/lib while compiling, so block at build-time
143 +# https://bugs.gentoo.org/show_bug.cgi?id=360413
144 +
145 +S="${WORKDIR}/Cinnamon-${PV}"
146 +
147 +pkg_setup() {
148 + python_setup
149 +}
150 +
151 +src_prepare() {
152 + # Fix backgrounds path as cinnamon doesn't provide them
153 + # https://github.com/linuxmint/Cinnamon/issues/3575
154 + eapply "${FILESDIR}"/${PN}-3.8.0-gnome-background-compatibility.patch
155 +
156 + # Use wheel group instead of sudo (from Fedora/Arch)
157 + # https://github.com/linuxmint/Cinnamon/issues/3576
158 + eapply "${FILESDIR}"/${PN}-3.6.6-wheel-sudo.patch
159 +
160 + eapply -p0 "${FILESDIR}"/${PN}-4.0-fix-pillow-settings.patch
161 +
162 + # Use pkexec instead of gksu (from Arch)
163 + # https://github.com/linuxmint/Cinnamon/issues/3565
164 + sed -i 's/gksu/pkexec/' files/usr/bin/cinnamon-settings-users || die
165 +
166 + # Add polkit agent to required components (from Fedora/Arch), bug #523958
167 + # https://github.com/linuxmint/Cinnamon/issues/3579
168 + sed -i 's/RequiredComponents=\(.*\)$/RequiredComponents=\1polkit-gnome-authentication-agent-1;/' \
169 + files/usr/share/cinnamon-session/sessions/cinnamon*.session || die
170 +
171 + # python 2-and-3 shebang fixing craziness
172 + local p
173 + python_setup 'python3*'
174 + for p in $(grep -rl '#!.*python3'); do
175 + python_fix_shebang "${p}"
176 + done
177 +
178 + python_setup 'python2*'
179 + for p in $(grep -rl '#!.*python[^3]'); do
180 + python_fix_shebang "${p}"
181 + done
182 +
183 + eautoreconf
184 + gnome2_src_prepare
185 +}
186 +
187 +src_configure() {
188 + gnome2_src_configure \
189 + --libdir="${EPREFIX}/usr/$(get_libdir)" \
190 + --with-ca-certificates="${EPREFIX}/etc/ssl/certs/ca-certificates.crt" \
191 + BROWSER_PLUGIN_DIR="${EPREFIX}/usr/$(get_libdir)/nsbrowser/plugins"
192 +}
193 +
194 +src_install() {
195 + gnome2_src_install
196 + python_optimize "${ED}"usr/$(get_libdir)/cinnamon-*
197 +
198 + # Required for gnome-shell on hardened/PaX, bug #398941
199 + pax-mark mr "${ED}usr/bin/cinnamon"
200 +
201 + # Doesn't exist on Gentoo, causing this to be a dead symlink
202 + rm -f "${ED}etc/xdg/menus/cinnamon-applications-merged" || die
203 +
204 + # Ensure authentication-agent is started, bug #523958
205 + # https://github.com/linuxmint/Cinnamon/issues/3579
206 + insinto /etc/xdg/autostart/
207 + doins "${FILESDIR}"/polkit-cinnamon-authentication-agent-1.desktop
208 +}
209 +
210 +pkg_postinst() {
211 + gnome2_pkg_postinst
212 +
213 + if ! has_version 'media-libs/gst-plugins-good:1.0' || \
214 + ! has_version 'media-plugins/gst-plugins-vpx:1.0'; then
215 + ewarn "To make use of Cinnamon's built-in screen recording utility,"
216 + ewarn "you need to either install media-libs/gst-plugins-good:1.0"
217 + ewarn "and media-plugins/gst-plugins-vpx:1.0, or use dconf-editor to change"
218 + ewarn "org.cinnamon.recorder/pipeline to what you want to use."
219 + fi
220 +
221 + if ! has_version ">=x11-base/xorg-server-1.11"; then
222 + ewarn "If you use multiple screens, it is highly recommended that you"
223 + ewarn "upgrade to >=x11-base/xorg-server-1.11 to be able to make use of"
224 + ewarn "pointer barriers which will make it easier to use hot corners."
225 + fi
226 +
227 + if has_version "<x11-drivers/ati-drivers-12"; then
228 + ewarn "Cinnamon has been reported to show graphical corruption under"
229 + ewarn "x11-drivers/ati-drivers-11.*; you may want to switch to"
230 + ewarn "open-source drivers."
231 + fi
232 +}
233
234 diff --git a/gnome-extra/cinnamon/files/cinnamon-4.0-fix-pillow-settings.patch b/gnome-extra/cinnamon/files/cinnamon-4.0-fix-pillow-settings.patch
235 new file mode 100644
236 index 00000000000..e06c86b8f3d
237 --- /dev/null
238 +++ b/gnome-extra/cinnamon/files/cinnamon-4.0-fix-pillow-settings.patch
239 @@ -0,0 +1,43 @@
240 +--- files/usr/share/cinnamon/cinnamon-settings/bin/imtools.py.orig 2019-03-21 16:46:14 UTC
241 ++++ files/usr/share/cinnamon/cinnamon-settings/bin/imtools.py
242 +@@ -620,31 +620,6 @@ def has_transparency(image):
243 + has_alpha(image)
244 +
245 +
246 +-if Image.VERSION == '1.1.7':
247 +-
248 +- def split(image):
249 +- """Work around for bug in Pil 1.1.7
250 +-
251 +- :param image: input image
252 +- :type image: PIL image object
253 +- :returns: the different color bands of the image (eg R, G, B)
254 +- :rtype: tuple
255 +- """
256 +- image.load()
257 +- return image.split()
258 +-else:
259 +-
260 +- def split(image):
261 +- """Work around for bug in Pil 1.1.7
262 +-
263 +- :param image: input image
264 +- :type image: PIL image object
265 +- :returns: the different color bands of the image (eg R, G, B)
266 +- :rtype: tuple
267 +- """
268 +- return image.split()
269 +-
270 +-
271 + def get_alpha(image):
272 + """Gets the image alpha band. Can handles P mode images with transpareny.
273 + Returns a band with all values set to 255 if no alpha band exists.
274 +@@ -655,7 +630,7 @@ def get_alpha(image):
275 + :rtype: single band image object
276 + """
277 + if has_alpha(image):
278 +- return split(image)[-1]
279 ++ return image.split()[-1]
280 + if image.mode == 'P' and 'transparency' in image.info:
281 + return image.convert('RGBA').split()[-1]
282 + # No alpha layer, create one.