1 |
commit: 9e7f4a57a39ce46146eb00c02409367b69b569d1 |
2 |
Author: Conrad Kostecki <conrad <AT> kostecki <DOT> com> |
3 |
AuthorDate: Sat Jul 7 22:11:08 2018 +0000 |
4 |
Commit: Tony Vroon <chainsaw <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 11 08:29:25 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e7f4a57 |
7 |
|
8 |
x11-misc/mugshot: New package |
9 |
|
10 |
Closes: https://bugs.gentoo.org/571382 |
11 |
Package-Manager: Portage-2.3.41, Repoman-2.3.9 |
12 |
Closes: https://github.com/gentoo/gentoo/pull/9103 |
13 |
Closes: https://bugs.gentoo.org/571382 |
14 |
|
15 |
x11-misc/mugshot/Manifest | 1 + |
16 |
x11-misc/mugshot/files/fix_env_spawn_args.patch | 47 ++++++++++++++++++++ |
17 |
x11-misc/mugshot/files/missing_default_face.patch | 18 ++++++++ |
18 |
x11-misc/mugshot/files/use_office_phone.patch | 18 ++++++++ |
19 |
x11-misc/mugshot/metadata.xml | 27 ++++++++++++ |
20 |
x11-misc/mugshot/mugshot-0.4.0.ebuild | 54 +++++++++++++++++++++++ |
21 |
6 files changed, 165 insertions(+) |
22 |
|
23 |
diff --git a/x11-misc/mugshot/Manifest b/x11-misc/mugshot/Manifest |
24 |
new file mode 100644 |
25 |
index 00000000000..6328edd164f |
26 |
--- /dev/null |
27 |
+++ b/x11-misc/mugshot/Manifest |
28 |
@@ -0,0 +1 @@ |
29 |
+DIST mugshot-0.4.0.tar.gz 126101 BLAKE2B be0d84fd09a1ff6477d32a77d979b1606597b2ca38524b9cc65c254dd9d5d43697123b10d2b836c1193a9ba0f3dadebb15d1fe89ab7fb1743cc7b4d177ace65d SHA512 5936ec3def5a70db21f9bcc7fce873ce374f8df0795fb944593f398704dcba8c81be30393603e1753e176da87f4a6fd8a3218de2aeb7f33ea6018735ce1b2c09 |
30 |
|
31 |
diff --git a/x11-misc/mugshot/files/fix_env_spawn_args.patch b/x11-misc/mugshot/files/fix_env_spawn_args.patch |
32 |
new file mode 100644 |
33 |
index 00000000000..bb24418a7db |
34 |
--- /dev/null |
35 |
+++ b/x11-misc/mugshot/files/fix_env_spawn_args.patch |
36 |
@@ -0,0 +1,47 @@ |
37 |
+--- a/mugshot_lib/SudoDialog.py 2018-04-12 00:23:21.000000000 +0200 |
38 |
++++ b/mugshot_lib/SudoDialog.py 2018-06-22 22:21:10.876589365 +0200 |
39 |
+@@ -48,7 +48,7 @@ |
40 |
+ return False |
41 |
+ |
42 |
+ # Check for LANG requirements |
43 |
+- child = env_spawn('sudo -v', 1) |
44 |
++ child = env_spawn('sudo', ['-v'], 1) |
45 |
+ if child.expect([".*ssword.*", "Sorry", |
46 |
+ pexpect.EOF, |
47 |
+ pexpect.TIMEOUT]) == 3: |
48 |
+@@ -57,7 +57,7 @@ |
49 |
+ child.close() |
50 |
+ |
51 |
+ # Check for sudo rights |
52 |
+- child = env_spawn('sudo -v', 1) |
53 |
++ child = env_spawn('sudo', ['-v'], 1) |
54 |
+ try: |
55 |
+ index = child.expect([".*ssword.*", "Sorry", |
56 |
+ pexpect.EOF, pexpect.TIMEOUT]) |
57 |
+@@ -76,14 +76,14 @@ |
58 |
+ return False |
59 |
+ |
60 |
+ |
61 |
+-def env_spawn(command, timeout): |
62 |
++def env_spawn(command, args, timeout): |
63 |
+ """Use pexpect.spawn, adapt for timeout and env requirements.""" |
64 |
+ env = os.environ |
65 |
+ env["LANG"] = "C" |
66 |
+ if use_env: |
67 |
+- child = pexpect.spawn(command, env) |
68 |
++ child = pexpect.spawn(command, args, env) |
69 |
+ else: |
70 |
+- child = pexpect.spawn(command) |
71 |
++ child = pexpect.spawn(command, args) |
72 |
+ child.timeout = timeout |
73 |
+ return child |
74 |
+ |
75 |
+@@ -304,7 +304,7 @@ |
76 |
+ Return True if successful. |
77 |
+ ''' |
78 |
+ # Set the pexpect variables and spawn the process. |
79 |
+- child = env_spawn('sudo /bin/true', 1) |
80 |
++ child = env_spawn('sudo', ['/bin/true'], 1) |
81 |
+ try: |
82 |
+ # Check for password prompt or program exit. |
83 |
+ child.expect([".*ssword.*", pexpect.EOF]) |
84 |
|
85 |
diff --git a/x11-misc/mugshot/files/missing_default_face.patch b/x11-misc/mugshot/files/missing_default_face.patch |
86 |
new file mode 100644 |
87 |
index 00000000000..0d25fb61013 |
88 |
--- /dev/null |
89 |
+++ b/x11-misc/mugshot/files/missing_default_face.patch |
90 |
@@ -0,0 +1,18 @@ |
91 |
+--- a/mugshot/MugshotWindow.py 2018-04-12 00:23:21.000000000 +0200 |
92 |
++++ b/mugshot/MugshotWindow.py 2018-06-22 22:27:05.515588012 +0200 |
93 |
+@@ -257,10 +257,11 @@ |
94 |
+ logger.debug('Found profile image: %s' % str(image)) |
95 |
+ |
96 |
+ if os.path.isfile(face): |
97 |
+- if os.path.samefile(image, face): |
98 |
+- self.updated_image = face |
99 |
+- else: |
100 |
+- self.updated_image = None |
101 |
++ if os.path.exists(image): |
102 |
++ if os.path.samefile(image, face): |
103 |
++ self.updated_image = face |
104 |
++ else: |
105 |
++ self.updated_image = None |
106 |
+ self.set_user_image(face) |
107 |
+ elif os.path.isfile(image): |
108 |
+ self.updated_image = image |
109 |
|
110 |
diff --git a/x11-misc/mugshot/files/use_office_phone.patch b/x11-misc/mugshot/files/use_office_phone.patch |
111 |
new file mode 100644 |
112 |
index 00000000000..bea3f7ce4da |
113 |
--- /dev/null |
114 |
+++ b/x11-misc/mugshot/files/use_office_phone.patch |
115 |
@@ -0,0 +1,18 @@ |
116 |
+--- a/mugshot/MugshotWindow.py 2018-06-22 22:33:03.980586645 +0200 |
117 |
++++ b/mugshot/MugshotWindow.py 2018-06-22 22:41:44.120584661 +0200 |
118 |
+@@ -614,10 +614,14 @@ |
119 |
+ |
120 |
+ logger.debug('Updating Office Phone...') |
121 |
+ command = "%s -w \"%s\" %s" % (chfn, office_phone, username) |
122 |
++ command2 = "%s -o \"%s\" %s" % (chfn, office_phone, username) |
123 |
+ if self.process_terminal_password(command, password): |
124 |
+ self.office_phone = office_phone |
125 |
+ else: |
126 |
+- success = False |
127 |
++ if self.process_terminal_password(command2, password): |
128 |
++ self.office_phone = office_phone |
129 |
++ else: |
130 |
++ success = False |
131 |
+ |
132 |
+ return (success, response) |
133 |
+ |
134 |
|
135 |
diff --git a/x11-misc/mugshot/metadata.xml b/x11-misc/mugshot/metadata.xml |
136 |
new file mode 100644 |
137 |
index 00000000000..9e143660d31 |
138 |
--- /dev/null |
139 |
+++ b/x11-misc/mugshot/metadata.xml |
140 |
@@ -0,0 +1,27 @@ |
141 |
+<?xml version="1.0" encoding="UTF-8"?> |
142 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
143 |
+<pkgmetadata> |
144 |
+ <maintainer type="person"> |
145 |
+ <email>ck+gentoo@××××××××.de</email> |
146 |
+ <name>Conrad Kostecki</name> |
147 |
+ </maintainer> |
148 |
+ <maintainer type="project"> |
149 |
+ <email>proxy-maint@g.o</email> |
150 |
+ <name>Proxy Maintainers</name> |
151 |
+ </maintainer> |
152 |
+ <longdescription> |
153 |
+ Mugshot is a lightweight user configuration utility. |
154 |
+ Mugshot allows you to easily set profile image |
155 |
+ and user details for your user profile and any supported applications. |
156 |
+ </longdescription> |
157 |
+ <use> |
158 |
+ <flag name="gnome">Add support for <pkg>gnome-base/gnome-control-center</pkg></flag> |
159 |
+ <flag name="libreoffice">Add support for <pkg>app-office/libreoffice</pkg> and <pkg>app-office/libreoffice-bin</pkg></flag> |
160 |
+ <flag name="pidgin">Add support for setting the avatar in <pkg>net-im/pidgin</pkg> </flag> |
161 |
+ <flag name="webcam">Add support for setting a profile photo in <pkg>media-video/cheese</pkg></flag> |
162 |
+ </use> |
163 |
+ <upstream> |
164 |
+ <bugs-to>https://bugs.launchpad.net/mugshot</bugs-to> |
165 |
+ <remote-id type="launchpad">mugshot</remote-id> |
166 |
+ </upstream> |
167 |
+</pkgmetadata> |
168 |
|
169 |
diff --git a/x11-misc/mugshot/mugshot-0.4.0.ebuild b/x11-misc/mugshot/mugshot-0.4.0.ebuild |
170 |
new file mode 100644 |
171 |
index 00000000000..23ceab58d94 |
172 |
--- /dev/null |
173 |
+++ b/x11-misc/mugshot/mugshot-0.4.0.ebuild |
174 |
@@ -0,0 +1,54 @@ |
175 |
+# Copyright 1999-2018 Gentoo Foundation |
176 |
+# Distributed under the terms of the GNU General Public License v2 |
177 |
+ |
178 |
+EAPI=6 |
179 |
+ |
180 |
+PYTHON_COMPAT=( python2_7 ) |
181 |
+ |
182 |
+inherit distutils-r1 eapi7-ver gnome2-utils |
183 |
+ |
184 |
+DESCRIPTION="A lightweight user-configuration application" |
185 |
+HOMEPAGE="https://launchpad.net/mugshot" |
186 |
+SRC_URI="https://launchpad.net/${PN}/$(ver_cut 1-2)/${PV}/+download/${P}.tar.gz" |
187 |
+ |
188 |
+LICENSE="GPL-3+" |
189 |
+SLOT="0" |
190 |
+KEYWORDS="~amd64 ~x86" |
191 |
+IUSE="gnome libreoffice pidgin webcam" |
192 |
+ |
193 |
+RDEPEND="dev-libs/gobject-introspection |
194 |
+ dev-python/dbus-python[${PYTHON_USEDEP}] |
195 |
+ dev-python/pexpect[${PYTHON_USEDEP}] |
196 |
+ dev-python/pycairo[${PYTHON_USEDEP}] |
197 |
+ dev-python/pygobject:3[${PYTHON_USEDEP}] |
198 |
+ sys-apps/accountsservice |
199 |
+ x11-libs/gtk+:3 |
200 |
+ gnome? ( gnome-base/gnome-control-center ) |
201 |
+ libreoffice? ( || ( app-office/libreoffice-bin app-office/libreoffice ) ) |
202 |
+ pidgin? ( net-im/pidgin[${PYTHON_USEDEP}] ) |
203 |
+ webcam? ( media-libs/gstreamer:1.0 |
204 |
+ media-libs/gst-plugins-good:1.0 |
205 |
+ gnome? ( media-libs/clutter-gtk[introspection] |
206 |
+ media-video/cheese[introspection] ) )" |
207 |
+ |
208 |
+DEPEND="dev-python/python-distutils-extra[${PYTHON_USEDEP}] |
209 |
+ dev-util/intltool |
210 |
+ ${RDEPEND}" |
211 |
+ |
212 |
+PATCHES=( |
213 |
+ # https://bugs.launchpad.net/ubuntu/+source/mugshot/+bug/1443283 |
214 |
+ "${FILESDIR}/fix_env_spawn_args.patch" |
215 |
+ # Both patches are taken from Arch Linux |
216 |
+ "${FILESDIR}/missing_default_face.patch" |
217 |
+ "${FILESDIR}/use_office_phone.patch" |
218 |
+) |
219 |
+ |
220 |
+pkg_postinst() { |
221 |
+ gnome2_schemas_update |
222 |
+ gnome2_icon_cache_update |
223 |
+} |
224 |
+ |
225 |
+pkg_postrm() { |
226 |
+ gnome2_schemas_update |
227 |
+ gnome2_icon_cache_update |
228 |
+} |