1 |
commit: e86753a92486328a9684288ff2f15bc9e6f1703e |
2 |
Author: Marco Scardovi <marco <AT> scardovi <DOT> com> |
3 |
AuthorDate: Tue Jun 22 13:16:31 2021 +0000 |
4 |
Commit: Marco Scardovi <marco <AT> scardovi <DOT> com> |
5 |
CommitDate: Tue Jun 22 13:16:58 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e86753a9 |
7 |
|
8 |
x11-wm/phoc: new package |
9 |
|
10 |
phoc is a windows manager used for mobile devices like |
11 |
librem 5 and pinephone. It can be used on tablet too like |
12 |
pinetab. I will slowly add all the needed packages for phosh |
13 |
too (phosh is the interface). |
14 |
|
15 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
16 |
Signed-off-by: Marco Scardovi <marco <AT> scardovi.com> |
17 |
|
18 |
x11-wm/phoc/Manifest | 2 + |
19 |
.../0001-seat-Don-t-notify-on-key-release.patch | 27 +++++ |
20 |
...t-touch-events-when-in-power-save-mode-or.patch | 112 +++++++++++++++++++++ |
21 |
x11-wm/phoc/metadata.xml | 8 ++ |
22 |
x11-wm/phoc/phoc-0.7.1.ebuild | 84 ++++++++++++++++ |
23 |
5 files changed, 233 insertions(+) |
24 |
|
25 |
diff --git a/x11-wm/phoc/Manifest b/x11-wm/phoc/Manifest |
26 |
new file mode 100644 |
27 |
index 000000000..6019f26ab |
28 |
--- /dev/null |
29 |
+++ b/x11-wm/phoc/Manifest |
30 |
@@ -0,0 +1,2 @@ |
31 |
+DIST phoc-v0.7.1.tar.gz 143801 BLAKE2B 4db2fb40d2b85ee27d53a71b0dc158b3b37b47f9517bf5133958bc2328892aa8a54c679b5293efc4b3d84ccee04866471c729c4d77d9e903136bed3fe9e35030 SHA512 80869036c36837c2e260a8662aee975f86797c0a68a0a513d2d52b904d1ca44bcd93e8bee850c08a9b3b3395727e4e28085860750acd1b092349c7da6410c820 |
32 |
+DIST wlroots-0.12.0.tar.gz 476936 BLAKE2B 4129c87a148085f95f4cee6973308d79ab3f8b024247287a68dadd6729da8a5f8cc1e4ada63c15477a2c8e8258032440afe4a21a26f947143d17c87b0ca8a1a4 SHA512 560eae30932b777c1f07fb44592d5601c5d10ef74b31b6b9e4166a14caadab2bfa88d39282f159785d4c7f22f78d204f9bb7fab65d58afaf14b72a8486f9b415 |
33 |
|
34 |
diff --git a/x11-wm/phoc/files/0001-seat-Don-t-notify-on-key-release.patch b/x11-wm/phoc/files/0001-seat-Don-t-notify-on-key-release.patch |
35 |
new file mode 100644 |
36 |
index 000000000..a2928002b |
37 |
--- /dev/null |
38 |
+++ b/x11-wm/phoc/files/0001-seat-Don-t-notify-on-key-release.patch |
39 |
@@ -0,0 +1,27 @@ |
40 |
+From 63d8f9ceb0d2336db4276e717aabe427153b76bb Mon Sep 17 00:00:00 2001 |
41 |
+From: Arnaud Ferraris <arnaud.ferraris@×××××.com> |
42 |
+Date: Sat, 6 Jun 2020 02:24:37 +0200 |
43 |
+Subject: [PATCH 1/2] seat: Don't notify on key release |
44 |
+ |
45 |
+--- |
46 |
+ src/seat.c | 3 ++- |
47 |
+ 1 file changed, 2 insertions(+), 1 deletion(-) |
48 |
+ |
49 |
+diff --git a/src/seat.c b/src/seat.c |
50 |
+index b04fed1..679a3f5 100644 |
51 |
+--- a/src/seat.c |
52 |
++++ b/src/seat.c |
53 |
+@@ -30,8 +30,9 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) { |
54 |
+ PhocKeyboard *keyboard = |
55 |
+ wl_container_of(listener, keyboard, keyboard_key); |
56 |
+ PhocDesktop *desktop = server->desktop; |
57 |
+- wlr_idle_notify_activity(desktop->idle, keyboard->seat->seat); |
58 |
+ struct wlr_event_keyboard_key *event = data; |
59 |
++ if (event->state == WLR_KEY_PRESSED) |
60 |
++ wlr_idle_notify_activity(desktop->idle, keyboard->seat->seat); |
61 |
+ phoc_keyboard_handle_key(keyboard, event); |
62 |
+ } |
63 |
+ |
64 |
+-- |
65 |
+2.26.2 |
66 |
+ |
67 |
|
68 |
diff --git a/x11-wm/phoc/files/0002-seat-inhibit-touch-events-when-in-power-save-mode-or.patch b/x11-wm/phoc/files/0002-seat-inhibit-touch-events-when-in-power-save-mode-or.patch |
69 |
new file mode 100644 |
70 |
index 000000000..5f02f4aed |
71 |
--- /dev/null |
72 |
+++ b/x11-wm/phoc/files/0002-seat-inhibit-touch-events-when-in-power-save-mode-or.patch |
73 |
@@ -0,0 +1,112 @@ |
74 |
+From c6aeee2009a2ee4647fd74da0fc3bd87f61a70fd Mon Sep 17 00:00:00 2001 |
75 |
+From: Arnaud Ferraris <arnaud.ferraris@×××××.com> |
76 |
+Date: Sat, 6 Jun 2020 02:52:10 +0200 |
77 |
+Subject: [PATCH 2/2] seat: inhibit touch events when in power save mode or |
78 |
+ blank display |
79 |
+ |
80 |
+--- |
81 |
+ src/desktop.c | 2 ++ |
82 |
+ src/output.c | 3 +++ |
83 |
+ src/seat.c | 6 ++++++ |
84 |
+ src/server.c | 1 + |
85 |
+ src/server.h | 1 + |
86 |
+ 5 files changed, 13 insertions(+) |
87 |
+ |
88 |
+diff --git a/src/desktop.c b/src/desktop.c |
89 |
+index 8fbb98e..40b2492 100644 |
90 |
+--- a/src/desktop.c |
91 |
++++ b/src/desktop.c |
92 |
+@@ -703,6 +703,7 @@ phoc_desktop_new (struct roots_config *c |
93 |
+ void |
94 |
+ phoc_desktop_toggle_output_blank (PhocDesktop *self) |
95 |
+ { |
96 |
++ PhocServer *server = phoc_server_get_default (); |
97 |
+ PhocOutput *output; |
98 |
+ |
99 |
+ wl_list_for_each(output, &self->outputs, link) { |
100 |
+@@ -710,6 +711,7 @@ phoc_desktop_toggle_output_blank (PhocDe |
101 |
+ |
102 |
+ wlr_output_enable (output->wlr_output, enable); |
103 |
+ wlr_output_commit (output->wlr_output); |
104 |
++ server->active = enable; |
105 |
+ if (enable) |
106 |
+ phoc_output_damage_whole(output); |
107 |
+ } |
108 |
+diff --git a/src/output.c b/src/output.c |
109 |
+index c03889f..045cbc0 100644 |
110 |
+--- a/src/output.c |
111 |
++++ b/src/output.c |
112 |
+@@ -928,6 +928,7 @@ handle_output_manager_test (struct wl_li |
113 |
+ void |
114 |
+ phoc_output_handle_output_power_manager_set_mode (struct wl_listener *listener, void *data) |
115 |
+ { |
116 |
++ PhocServer *server = phoc_server_get_default (); |
117 |
+ struct wlr_output_power_v1_set_mode_event *event = data; |
118 |
+ PhocOutput *self; |
119 |
+ bool enable = true; |
120 |
+@@ -951,6 +952,8 @@ phoc_output_handle_output_power_manager_ |
121 |
+ if (enable == self->wlr_output->enabled) |
122 |
+ return; |
123 |
+ |
124 |
++ server->active = enable; |
125 |
++ |
126 |
+ wlr_output_enable (self->wlr_output, enable); |
127 |
+ if (!wlr_output_commit (self->wlr_output)) { |
128 |
+ g_warning ("Failed to commit power mode change to %d for %p", enable, self); |
129 |
+diff --git a/src/seat.c b/src/seat.c |
130 |
+index 679a3f5..2a4c007 100644 |
131 |
+--- a/src/seat.c |
132 |
++++ b/src/seat.c |
133 |
+@@ -178,6 +178,8 @@ static void handle_touch_down(struct wl_listener *listener, void *data) { |
134 |
+ struct roots_cursor *cursor = |
135 |
+ wl_container_of(listener, cursor, touch_down); |
136 |
+ PhocDesktop *desktop = server->desktop; |
137 |
++ if (!server->active) |
138 |
++ return; |
139 |
+ wlr_idle_notify_activity(desktop->idle, cursor->seat->seat); |
140 |
+ struct wlr_event_touch_down *event = data; |
141 |
+ roots_cursor_handle_touch_down(cursor, event); |
142 |
+@@ -188,6 +190,8 @@ static void handle_touch_up(struct wl_listener *listener, void *data) { |
143 |
+ struct roots_cursor *cursor = |
144 |
+ wl_container_of(listener, cursor, touch_up); |
145 |
+ PhocDesktop *desktop = server->desktop; |
146 |
++ if (!server->active) |
147 |
++ return; |
148 |
+ wlr_idle_notify_activity(desktop->idle, cursor->seat->seat); |
149 |
+ struct wlr_event_touch_up *event = data; |
150 |
+ roots_cursor_handle_touch_up(cursor, event); |
151 |
+@@ -198,6 +202,8 @@ static void handle_touch_motion(struct wl_listener *listener, void *data) { |
152 |
+ struct roots_cursor *cursor = |
153 |
+ wl_container_of(listener, cursor, touch_motion); |
154 |
+ PhocDesktop *desktop = server->desktop; |
155 |
++ if (!server->active) |
156 |
++ return; |
157 |
+ wlr_idle_notify_activity(desktop->idle, cursor->seat->seat); |
158 |
+ struct wlr_event_touch_motion *event = data; |
159 |
+ roots_cursor_handle_touch_motion(cursor, event); |
160 |
+diff --git a/src/server.c b/src/server.c |
161 |
+index 838841b..41452cf 100644 |
162 |
+--- a/src/server.c |
163 |
++++ b/src/server.c |
164 |
+@@ -276,6 +276,7 @@ phoc_server_setup (PhocServer *self, const char *config_path, |
165 |
+ phoc_startup_session (self); |
166 |
+ |
167 |
+ self->inited = TRUE; |
168 |
++ self->active = TRUE; |
169 |
+ return TRUE; |
170 |
+ } |
171 |
+ |
172 |
+diff --git a/src/server.h b/src/server.h |
173 |
+index 9501432..532b064 100644 |
174 |
+--- a/src/server.h |
175 |
++++ b/src/server.h |
176 |
+@@ -37,6 +37,7 @@ struct _PhocServer { |
177 |
+ PhocInput *input; |
178 |
+ PhocServerDebugFlags debug_flags; |
179 |
+ gboolean inited; |
180 |
++ gboolean active; |
181 |
+ |
182 |
+ /* The session */ |
183 |
+ gchar *session; |
184 |
+-- |
185 |
+2.26.2 |
186 |
|
187 |
diff --git a/x11-wm/phoc/metadata.xml b/x11-wm/phoc/metadata.xml |
188 |
new file mode 100644 |
189 |
index 000000000..144c8091c |
190 |
--- /dev/null |
191 |
+++ b/x11-wm/phoc/metadata.xml |
192 |
@@ -0,0 +1,8 @@ |
193 |
+<?xml version='1.0' encoding='UTF-8'?> |
194 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
195 |
+<pkgmetadata> |
196 |
+ <maintainer type="person"> |
197 |
+ <email>marco@××××××××.com</email> |
198 |
+ <name>Marco Scardovi</name> |
199 |
+ </maintainer> |
200 |
+</pkgmetadata> |
201 |
|
202 |
diff --git a/x11-wm/phoc/phoc-0.7.1.ebuild b/x11-wm/phoc/phoc-0.7.1.ebuild |
203 |
new file mode 100644 |
204 |
index 000000000..4d5eaea51 |
205 |
--- /dev/null |
206 |
+++ b/x11-wm/phoc/phoc-0.7.1.ebuild |
207 |
@@ -0,0 +1,84 @@ |
208 |
+# Copyright 1999-2021 Gentoo Authors |
209 |
+# Distributed under the terms of the GNU General Public License v2 |
210 |
+ |
211 |
+EAPI=7 |
212 |
+ |
213 |
+inherit vala meson gnome2-utils xdg |
214 |
+ |
215 |
+MY_PV="v${PV}" |
216 |
+MY_P="${PN}-${MY_PV}" |
217 |
+# 0.13.0 does not work atm |
218 |
+WL_PV="0.12.0" |
219 |
+WL_P="wlroots-${WL_PV}" |
220 |
+ |
221 |
+DESCRIPTION="Wlroots based Phone compositor" |
222 |
+HOMEPAGE="https://source.puri.sm/Librem5/phoc" |
223 |
+ |
224 |
+# we don't use the version on gentoo because it breaks |
225 |
+# the phoc installation. we follow method used in archlinuxarm |
226 |
+SRC_URI=" |
227 |
+ https://source.puri.sm/Librem5/phoc/-/archive/${MY_PV}/${MY_P}.tar.gz |
228 |
+ https://github.com/swaywm/wlroots/releases/download/${WL_PV}/${WL_P}.tar.gz |
229 |
+" |
230 |
+ |
231 |
+LICENSE="GPL-3" |
232 |
+SLOT="0" |
233 |
+KEYWORDS="~amd64 ~arm64" |
234 |
+IUSE="+introspection" |
235 |
+ |
236 |
+DEPEND=" |
237 |
+ dev-libs/glib |
238 |
+ dev-libs/gobject-introspection |
239 |
+ dev-libs/libinput |
240 |
+ gnome-base/gnome-desktop |
241 |
+ !gui-libs/wlroots |
242 |
+ x11-libs/xcb-util |
243 |
+ x11-libs/xcb-util-wm |
244 |
+ x11-wm/mutter |
245 |
+" |
246 |
+RDEPEND="${DEPEND}" |
247 |
+BDEPEND=" |
248 |
+ dev-util/ctags |
249 |
+ dev-util/meson |
250 |
+ virtual/pkgconfig |
251 |
+ x11-base/xorg-server |
252 |
+" |
253 |
+ |
254 |
+PATCHES=( |
255 |
+ "${FILESDIR}/0001-seat-Don-t-notify-on-key-release.patch" |
256 |
+ "${FILESDIR}/0002-seat-inhibit-touch-events-when-in-power-save-mode-or.patch" |
257 |
+) |
258 |
+ |
259 |
+S="${WORKDIR}/${MY_P}" |
260 |
+ |
261 |
+src_prepare() { |
262 |
+ default |
263 |
+ eapply_user |
264 |
+ rm -r "${S}"/subprojects/wlroots || die |
265 |
+ mv "${WORKDIR}/${WL_P}" "${S}"/subprojects/wlroots || die |
266 |
+} |
267 |
+ |
268 |
+src_configure() { |
269 |
+ local emesonargs=( |
270 |
+ -Ddefault_library=shared |
271 |
+ -Dtests=false |
272 |
+ -Dwlroots:logind-provider=systemd |
273 |
+ -Dwlroots:libseat=disabled |
274 |
+ ) |
275 |
+ meson_src_configure |
276 |
+} |
277 |
+ |
278 |
+src_install() { |
279 |
+ meson_src_install |
280 |
+ dobin "${S}"/helpers/scale-to-fit |
281 |
+} |
282 |
+ |
283 |
+pkg_postinst() { |
284 |
+ xdg_pkg_postinst |
285 |
+ gnome2_schemas_update |
286 |
+} |
287 |
+ |
288 |
+pkg_postrm() { |
289 |
+ xdg_pkg_postrm |
290 |
+ gnome2_schemas_update |
291 |
+} |