Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-arcade/gnome-nibbles/, games-arcade/gnome-nibbles/files/
Date: Sat, 15 May 2021 17:24:23
Message-Id: 1621099440.acbfede4da1d21fef462a027ec6022e06218285f.soap@gentoo
1 commit: acbfede4da1d21fef462a027ec6022e06218285f
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 15 17:24:00 2021 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat May 15 17:24:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acbfede4
7
8 games-arcade/gnome-nibbles: Fix for vala 0.50.4 regression
9
10 * https://gitlab.gnome.org/GNOME/vala/issues/1121
11
12 Package-Manager: Portage-3.0.18, Repoman-3.0.3
13 Signed-off-by: David Seifert <soap <AT> gentoo.org>
14
15 ...ome-nibbles-3.38.2-vala-0.50.4-GtkChild-1.patch | 66 ++++++++
16 ...ome-nibbles-3.38.2-vala-0.50.4-GtkChild-2.patch | 178 +++++++++++++++++++++
17 .../gnome-nibbles/gnome-nibbles-3.38.2.ebuild | 6 +
18 3 files changed, 250 insertions(+)
19
20 diff --git a/games-arcade/gnome-nibbles/files/gnome-nibbles-3.38.2-vala-0.50.4-GtkChild-1.patch b/games-arcade/gnome-nibbles/files/gnome-nibbles-3.38.2-vala-0.50.4-GtkChild-1.patch
21 new file mode 100644
22 index 00000000000..c7a86316925
23 --- /dev/null
24 +++ b/games-arcade/gnome-nibbles/files/gnome-nibbles-3.38.2-vala-0.50.4-GtkChild-1.patch
25 @@ -0,0 +1,66 @@
26 +From 1b48446068608aff9b5edf1fdbd4b8c0d9f0be94 Mon Sep 17 00:00:00 2001
27 +From: Rico Tzschichholz <ricotz@××××××.com>
28 +Date: Sat, 16 Jan 2021 13:56:10 +0100
29 +Subject: [PATCH] Don't alter or try to write [GtkChild] fields
30 +
31 +See https://gitlab.gnome.org/GNOME/vala/issues/1121
32 +---
33 + src/controls.vala | 30 +++++++++++++++---------------
34 + 1 file changed, 15 insertions(+), 15 deletions(-)
35 +
36 +diff --git a/src/controls.vala b/src/controls.vala
37 +index 4f07358..584c9ff 100644
38 +--- a/src/controls.vala
39 ++++ b/src/controls.vala
40 +@@ -140,25 +140,25 @@ private class ControlsGrid : Button
41 + arrow_left.set_from_pixbuf (arrow.rotate_simple (Gdk.PixbufRotation.COUNTERCLOCKWISE));
42 + arrow_right.set_from_pixbuf (arrow.rotate_simple (Gdk.PixbufRotation.CLOCKWISE));
43 +
44 +- up_handler = worm_props.notify ["up"].connect (() => configure_label (worm_props.up, ref move_up_label));
45 +- down_handler = worm_props.notify ["down"].connect (() => configure_label (worm_props.down, ref move_down_label));
46 +- left_handler = worm_props.notify ["left"].connect (() => configure_label (worm_props.left, ref move_left_label));
47 +- right_handler = worm_props.notify ["right"].connect (() => configure_label (worm_props.right, ref move_right_label));
48 +-
49 +- configure_label (worm_props.up, ref move_up_label);
50 +- configure_label (worm_props.down, ref move_down_label);
51 +- configure_label (worm_props.left, ref move_left_label);
52 +- configure_label (worm_props.right, ref move_right_label);
53 ++ up_handler = worm_props.notify ["up"].connect (() => configure_label (worm_props.up, move_up_label));
54 ++ down_handler = worm_props.notify ["down"].connect (() => configure_label (worm_props.down, move_down_label));
55 ++ left_handler = worm_props.notify ["left"].connect (() => configure_label (worm_props.left, move_left_label));
56 ++ right_handler = worm_props.notify ["right"].connect (() => configure_label (worm_props.right, move_right_label));
57 ++
58 ++ configure_label (worm_props.up, move_up_label);
59 ++ configure_label (worm_props.down, move_down_label);
60 ++ configure_label (worm_props.left, move_left_label);
61 ++ configure_label (worm_props.right, move_right_label);
62 + }
63 +
64 + internal void mark_duplicated_keys (GenericSet<uint> duplicate_keys)
65 + {
66 +- set_duplicate_class (worm_props.up in duplicate_keys, ref move_up_label);
67 +- set_duplicate_class (worm_props.down in duplicate_keys, ref move_down_label);
68 +- set_duplicate_class (worm_props.left in duplicate_keys, ref move_left_label);
69 +- set_duplicate_class (worm_props.right in duplicate_keys, ref move_right_label);
70 ++ set_duplicate_class (worm_props.up in duplicate_keys, move_up_label);
71 ++ set_duplicate_class (worm_props.down in duplicate_keys, move_down_label);
72 ++ set_duplicate_class (worm_props.left in duplicate_keys, move_left_label);
73 ++ set_duplicate_class (worm_props.right in duplicate_keys, move_right_label);
74 + }
75 +- private static void set_duplicate_class (bool new_value, ref Label label)
76 ++ private static void set_duplicate_class (bool new_value, Label label)
77 + {
78 + if (new_value)
79 + label.get_style_context ().add_class ("duplicate");
80 +@@ -175,7 +175,7 @@ private class ControlsGrid : Button
81 + worm_props.disconnect (color_handler);
82 + }
83 +
84 +- private static void configure_label (uint key_value, ref Label label)
85 ++ private static void configure_label (uint key_value, Label label)
86 + {
87 + string? key_name = Gdk.keyval_name (key_value);
88 + if (key_name == "Up")
89 +--
90 +GitLab
91 +
92
93 diff --git a/games-arcade/gnome-nibbles/files/gnome-nibbles-3.38.2-vala-0.50.4-GtkChild-2.patch b/games-arcade/gnome-nibbles/files/gnome-nibbles-3.38.2-vala-0.50.4-GtkChild-2.patch
94 new file mode 100644
95 index 00000000000..48c56530319
96 --- /dev/null
97 +++ b/games-arcade/gnome-nibbles/files/gnome-nibbles-3.38.2-vala-0.50.4-GtkChild-2.patch
98 @@ -0,0 +1,178 @@
99 +From 62964e9256fcac616109af874dbb2bd8342a9853 Mon Sep 17 00:00:00 2001
100 +From: Rico Tzschichholz <ricotz@××××××.com>
101 +Date: Wed, 17 Mar 2021 11:25:05 +0100
102 +Subject: [PATCH] Reference of [GtkChild] fields is handled by GtkBuilder, type
103 + must be unowned
104 +
105 +---
106 + src/controls.vala | 20 ++++++++++----------
107 + src/nibbles-window.vala | 26 +++++++++++++-------------
108 + src/players.vala | 6 +++---
109 + src/preferences-dialog.vala | 30 +++++++++++++++---------------
110 + src/scoreboard.vala | 6 +++---
111 + 5 files changed, 44 insertions(+), 44 deletions(-)
112 +
113 +diff --git a/src/controls.vala b/src/controls.vala
114 +index 584c9ff..f95d210 100644
115 +--- a/src/controls.vala
116 ++++ b/src/controls.vala
117 +@@ -22,7 +22,7 @@ using Gtk;
118 + [GtkTemplate (ui = "/org/gnome/Nibbles/ui/controls.ui")]
119 + private class Controls : Box
120 + {
121 +- [GtkChild] private Box grids_box;
122 ++ [GtkChild] private unowned Box grids_box;
123 + private Gee.LinkedList<ControlsGrid> grids = new Gee.LinkedList<ControlsGrid> ();
124 +
125 + private Gdk.Pixbuf arrow_pixbuf;
126 +@@ -100,15 +100,15 @@ private class Controls : Box
127 + [GtkTemplate (ui = "/org/gnome/Nibbles/ui/controls-grid.ui")]
128 + private class ControlsGrid : Button
129 + {
130 +- [GtkChild] private Label name_label;
131 +- [GtkChild] private Image arrow_up;
132 +- [GtkChild] private Image arrow_down;
133 +- [GtkChild] private Image arrow_left;
134 +- [GtkChild] private Image arrow_right;
135 +- [GtkChild] private Label move_up_label;
136 +- [GtkChild] private Label move_down_label;
137 +- [GtkChild] private Label move_left_label;
138 +- [GtkChild] private Label move_right_label;
139 ++ [GtkChild] private unowned Label name_label;
140 ++ [GtkChild] private unowned Image arrow_up;
141 ++ [GtkChild] private unowned Image arrow_down;
142 ++ [GtkChild] private unowned Image arrow_left;
143 ++ [GtkChild] private unowned Image arrow_right;
144 ++ [GtkChild] private unowned Label move_up_label;
145 ++ [GtkChild] private unowned Label move_down_label;
146 ++ [GtkChild] private unowned Label move_left_label;
147 ++ [GtkChild] private unowned Label move_right_label;
148 +
149 + internal WormProperties worm_props;
150 + internal ulong external_handler;
151 +diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
152 +index 6961326..6bfb74a 100644
153 +--- a/src/nibbles-window.vala
154 ++++ b/src/nibbles-window.vala
155 +@@ -40,30 +40,30 @@ private class NibblesWindow : ApplicationWindow
156 + private int window_height;
157 +
158 + /* Main widgets */
159 +- [GtkChild] private Stack main_stack;
160 +- [GtkChild] private Overlay overlay;
161 ++ [GtkChild] private unowned Stack main_stack;
162 ++ [GtkChild] private unowned Overlay overlay;
163 +
164 + /* HeaderBar */
165 +- [GtkChild] private HeaderBar headerbar;
166 +- [GtkChild] private MenuButton hamburger_menu;
167 +- [GtkChild] private Button new_game_button;
168 +- [GtkChild] private Button pause_button;
169 ++ [GtkChild] private unowned HeaderBar headerbar;
170 ++ [GtkChild] private unowned MenuButton hamburger_menu;
171 ++ [GtkChild] private unowned Button new_game_button;
172 ++ [GtkChild] private unowned Button pause_button;
173 +
174 + /* Pre-game screen widgets */
175 +- [GtkChild] private Players players;
176 +- [GtkChild] private Speed speed;
177 +- [GtkChild] private Controls controls;
178 ++ [GtkChild] private unowned Players players;
179 ++ [GtkChild] private unowned Speed speed;
180 ++ [GtkChild] private unowned Controls controls;
181 +
182 + /* Statusbar widgets */
183 +- [GtkChild] private Stack statusbar_stack;
184 +- [GtkChild] private Label countdown;
185 +- [GtkChild] private Scoreboard scoreboard;
186 ++ [GtkChild] private unowned Stack statusbar_stack;
187 ++ [GtkChild] private unowned Label countdown;
188 ++ [GtkChild] private unowned Scoreboard scoreboard;
189 + private Gdk.Pixbuf scoreboard_life;
190 +
191 + /* Rendering of the game */
192 + private NibblesView? view;
193 +
194 +- [GtkChild] private Box game_box;
195 ++ [GtkChild] private unowned Box game_box;
196 + private Games.GridFrame frame;
197 +
198 + /* Game being played */
199 +diff --git a/src/players.vala b/src/players.vala
200 +index 9198412..4bde18e 100644
201 +--- a/src/players.vala
202 ++++ b/src/players.vala
203 +@@ -21,9 +21,9 @@ using Gtk;
204 + [GtkTemplate (ui = "/org/gnome/Nibbles/ui/players.ui")]
205 + private class Players : Box
206 + {
207 +- [GtkChild] private ToggleButton worms4;
208 +- [GtkChild] private ToggleButton worms5;
209 +- [GtkChild] private ToggleButton worms6;
210 ++ [GtkChild] private unowned ToggleButton worms4;
211 ++ [GtkChild] private unowned ToggleButton worms5;
212 ++ [GtkChild] private unowned ToggleButton worms6;
213 +
214 + private SimpleAction nibbles_number_action;
215 + private SimpleAction players_number_action;
216 +diff --git a/src/preferences-dialog.vala b/src/preferences-dialog.vala
217 +index 216a1e2..2d3a7bf 100644
218 +--- a/src/preferences-dialog.vala
219 ++++ b/src/preferences-dialog.vala
220 +@@ -24,21 +24,21 @@ private class PreferencesDialog : Window
221 + private GLib.Settings settings;
222 + private Gee.ArrayList<GLib.Settings> worm_settings;
223 +
224 +- [GtkChild] private Stack stack;
225 +- [GtkChild] private Stack headerbar_stack;
226 +- [GtkChild] private ComboBoxText worm_combobox;
227 +- [GtkChild] private Gtk.ListStore list_store_1;
228 +- [GtkChild] private Gtk.ListStore list_store_2;
229 +- [GtkChild] private Gtk.ListStore list_store_3;
230 +- [GtkChild] private Gtk.ListStore list_store_4;
231 +- [GtkChild] private TreeView tree_view_1;
232 +- [GtkChild] private TreeView tree_view_2;
233 +- [GtkChild] private TreeView tree_view_3;
234 +- [GtkChild] private TreeView tree_view_4;
235 +- [GtkChild] private ComboBoxText combo_box_1;
236 +- [GtkChild] private ComboBoxText combo_box_2;
237 +- [GtkChild] private ComboBoxText combo_box_3;
238 +- [GtkChild] private ComboBoxText combo_box_4;
239 ++ [GtkChild] private unowned Stack stack;
240 ++ [GtkChild] private unowned Stack headerbar_stack;
241 ++ [GtkChild] private unowned ComboBoxText worm_combobox;
242 ++ [GtkChild] private unowned Gtk.ListStore list_store_1;
243 ++ [GtkChild] private unowned Gtk.ListStore list_store_2;
244 ++ [GtkChild] private unowned Gtk.ListStore list_store_3;
245 ++ [GtkChild] private unowned Gtk.ListStore list_store_4;
246 ++ [GtkChild] private unowned TreeView tree_view_1;
247 ++ [GtkChild] private unowned TreeView tree_view_2;
248 ++ [GtkChild] private unowned TreeView tree_view_3;
249 ++ [GtkChild] private unowned TreeView tree_view_4;
250 ++ [GtkChild] private unowned ComboBoxText combo_box_1;
251 ++ [GtkChild] private unowned ComboBoxText combo_box_2;
252 ++ [GtkChild] private unowned ComboBoxText combo_box_3;
253 ++ [GtkChild] private unowned ComboBoxText combo_box_4;
254 +
255 + private Gee.ArrayList<Gtk.ListStore> list_stores;
256 + private Gee.ArrayList<TreeView> tree_views;
257 +diff --git a/src/scoreboard.vala b/src/scoreboard.vala
258 +index a41aee1..aebc1cc 100644
259 +--- a/src/scoreboard.vala
260 ++++ b/src/scoreboard.vala
261 +@@ -59,9 +59,9 @@ private class Scoreboard : Box
262 + [GtkTemplate (ui = "/org/gnome/Nibbles/ui/player-score-box.ui")]
263 + private class PlayerScoreBox : Box
264 + {
265 +- [GtkChild] private Label name_label;
266 +- [GtkChild] private Label score_label;
267 +- [GtkChild] private Grid lives_grid;
268 ++ [GtkChild] private unowned Label name_label;
269 ++ [GtkChild] private unowned Label score_label;
270 ++ [GtkChild] private unowned Grid lives_grid;
271 +
272 + private Gee.LinkedList<Image> life_images = new Gee.LinkedList<Image> ();
273 +
274 +--
275 +GitLab
276 +
277
278 diff --git a/games-arcade/gnome-nibbles/gnome-nibbles-3.38.2.ebuild b/games-arcade/gnome-nibbles/gnome-nibbles-3.38.2.ebuild
279 index 3ede2295995..a9e6f5676b0 100644
280 --- a/games-arcade/gnome-nibbles/gnome-nibbles-3.38.2.ebuild
281 +++ b/games-arcade/gnome-nibbles/gnome-nibbles-3.38.2.ebuild
282 @@ -32,6 +32,12 @@ BDEPEND="
283 media-libs/gsound[vala]
284 "
285
286 +PATCHES=(
287 + # backport for https://gitlab.gnome.org/GNOME/gnome-nibbles/-/issues/52
288 + "${FILESDIR}"/${P}-vala-0.50.4-GtkChild-1.patch
289 + "${FILESDIR}"/${P}-vala-0.50.4-GtkChild-2.patch
290 +)
291 +
292 src_prepare() {
293 xdg_src_prepare
294 vala_src_prepare