diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-06-18 14:04:30 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-06-18 14:06:44 -0700 |
commit | 3647fd37ecef8001d23a236353847155f5d49142 (patch) | |
tree | 73ca6798503adc86119e407cd03c5762d84a3ffd /meta-gnome | |
parent | ceff4a5263bdebca3a58452b0a91470c20548124 (diff) | |
download | meta-openembedded-3647fd37ecef8001d23a236353847155f5d49142.tar.gz |
geary: Fix build with vala >= 0.56.8
Backport two patches from main branch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Alexander Kanavin <alex@linutronix.de>
Diffstat (limited to 'meta-gnome')
3 files changed, 217 insertions, 0 deletions
diff --git a/meta-gnome/recipes-connectivity/geary/geary/0001-client-Add-missing-type-arguments-for-interfaces-to-.patch b/meta-gnome/recipes-connectivity/geary/geary/0001-client-Add-missing-type-arguments-for-interfaces-to-.patch new file mode 100644 index 000000000..e5f0cb434 --- /dev/null +++ b/meta-gnome/recipes-connectivity/geary/geary/0001-client-Add-missing-type-arguments-for-interfaces-to-.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 19dddc4b8acaeefc505e1b45f53048901839aede Mon Sep 17 00:00:00 2001 | ||
2 | From: Rico Tzschichholz <ricotz@ubuntu.com> | ||
3 | Date: Sat, 8 Apr 2023 13:06:50 +0200 | ||
4 | Subject: [PATCH] client: Add missing type-arguments for interfaces to fix build with newer vala | ||
5 | |||
6 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/geary/-/commit/4a7ca820b1d3d6130fedf254dc5b4cd7efb58f2c] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | src/client/accounts/accounts-editor-row.vala | 2 +- | ||
10 | src/client/accounts/accounts-editor-servers-pane.vala | 6 +++--- | ||
11 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
12 | |||
13 | diff --git a/src/client/accounts/accounts-editor-row.vala b/src/client/accounts/accounts-editor-row.vala | ||
14 | index 6e7ac2ab..70223d71 100644 | ||
15 | --- a/src/client/accounts/accounts-editor-row.vala | ||
16 | +++ b/src/client/accounts/accounts-editor-row.vala | ||
17 | @@ -386,7 +386,7 @@ private abstract class Accounts.ServiceRow<PaneType,V> : AccountRow<PaneType,V> | ||
18 | |||
19 | |||
20 | /** Interface for rows that use a validator for editable values. */ | ||
21 | -internal interface Accounts.ValidatingRow : EditorRow { | ||
22 | +internal interface Accounts.ValidatingRow<PaneType> : EditorRow<PaneType> { | ||
23 | |||
24 | |||
25 | /** The row's validator */ | ||
26 | diff --git a/src/client/accounts/accounts-editor-servers-pane.vala b/src/client/accounts/accounts-editor-servers-pane.vala | ||
27 | index 8bd9bde1..982acd5c 100644 | ||
28 | --- a/src/client/accounts/accounts-editor-servers-pane.vala | ||
29 | +++ b/src/client/accounts/accounts-editor-servers-pane.vala | ||
30 | @@ -694,7 +694,7 @@ private class Accounts.SaveSentRow : | ||
31 | |||
32 | |||
33 | private class Accounts.ServiceHostRow : | ||
34 | - ServiceRow<EditorServersPane,Gtk.Entry>, ValidatingRow { | ||
35 | + ServiceRow<EditorServersPane,Gtk.Entry>, ValidatingRow<EditorServersPane> { | ||
36 | |||
37 | |||
38 | public Components.Validator validator { | ||
39 | @@ -848,7 +848,7 @@ private class Accounts.ServiceSecurityRow : | ||
40 | |||
41 | |||
42 | private class Accounts.ServiceLoginRow : | ||
43 | - ServiceRow<EditorServersPane,Gtk.Entry>, ValidatingRow { | ||
44 | + ServiceRow<EditorServersPane,Gtk.Entry>, ValidatingRow<EditorServersPane> { | ||
45 | |||
46 | |||
47 | public Components.Validator validator { | ||
48 | @@ -972,7 +972,7 @@ private class Accounts.ServiceLoginRow : | ||
49 | |||
50 | |||
51 | private class Accounts.ServicePasswordRow : | ||
52 | - ServiceRow<EditorServersPane,Gtk.Entry>, ValidatingRow { | ||
53 | + ServiceRow<EditorServersPane,Gtk.Entry>, ValidatingRow<EditorServersPane> { | ||
54 | |||
55 | |||
56 | public Components.Validator validator { | ||
57 | -- | ||
58 | 2.41.0 | ||
59 | |||
diff --git a/meta-gnome/recipes-connectivity/geary/geary/0001-vala-unit-Fix-non-null-build-with-newer-vala.patch b/meta-gnome/recipes-connectivity/geary/geary/0001-vala-unit-Fix-non-null-build-with-newer-vala.patch new file mode 100644 index 000000000..11ed6ae3a --- /dev/null +++ b/meta-gnome/recipes-connectivity/geary/geary/0001-vala-unit-Fix-non-null-build-with-newer-vala.patch | |||
@@ -0,0 +1,156 @@ | |||
1 | From 116aead44e01e046f83931574980991df66f69c3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rico Tzschichholz <ricotz@ubuntu.com> | ||
3 | Date: Fri, 14 Apr 2023 09:42:23 +0200 | ||
4 | Subject: [PATCH] vala-unit: Fix non-null build with newer vala | ||
5 | |||
6 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/geary/-/commit/10f9c133a2ad515127d65f3bba13a0d91b75f4af] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | .../vala-unit/src/collection-assertions.vala | 12 ++++++------ | ||
10 | subprojects/vala-unit/src/mock-object.vala | 6 +++--- | ||
11 | subprojects/vala-unit/src/test-assertions.vala | 18 +++++++++--------- | ||
12 | 3 files changed, 18 insertions(+), 18 deletions(-) | ||
13 | |||
14 | diff --git a/subprojects/vala-unit/src/collection-assertions.vala b/subprojects/vala-unit/src/collection-assertions.vala | ||
15 | index 3b34acda..29223a0d 100644 | ||
16 | --- a/subprojects/vala-unit/src/collection-assertions.vala | ||
17 | +++ b/subprojects/vala-unit/src/collection-assertions.vala | ||
18 | @@ -256,7 +256,7 @@ internal class ValaUnit.ArrayCollectionAssertion<E> : GLib.Object, | ||
19 | |||
20 | public CollectionAssertions<E> contains(E expected) | ||
21 | throws GLib.Error { | ||
22 | - E boxed_expected = box_value(expected); | ||
23 | + E? boxed_expected = box_value(expected); | ||
24 | bool found = false; | ||
25 | for (int i = 0; i < this.actual.length; i++) { | ||
26 | try { | ||
27 | @@ -281,7 +281,7 @@ internal class ValaUnit.ArrayCollectionAssertion<E> : GLib.Object, | ||
28 | |||
29 | public CollectionAssertions<E> not_contains(E expected) | ||
30 | throws GLib.Error { | ||
31 | - E boxed_expected = box_value(expected); | ||
32 | + E? boxed_expected = box_value(expected); | ||
33 | for (int i = 0; i < this.actual.length; i++) { | ||
34 | try { | ||
35 | assert_equal(box_value(this.actual[i]), boxed_expected); | ||
36 | @@ -312,8 +312,8 @@ internal class ValaUnit.ArrayCollectionAssertion<E> : GLib.Object, | ||
37 | this.context | ||
38 | ); | ||
39 | } | ||
40 | - E boxed_actual = box_value(this.actual[index]); | ||
41 | - E boxed_expected = box_value(expected); | ||
42 | + E? boxed_actual = box_value(this.actual[index]); | ||
43 | + E? boxed_expected = box_value(expected); | ||
44 | try { | ||
45 | assert_equal(boxed_actual, boxed_expected); | ||
46 | } catch (TestError.FAILED err) { | ||
47 | @@ -453,8 +453,8 @@ internal class ValaUnit.GeeCollectionAssertion<E> : | ||
48 | for (int i = 0; i <= index; i++) { | ||
49 | iterator.next(); | ||
50 | } | ||
51 | - E boxed_actual = box_value(iterator.get()); | ||
52 | - E boxed_expected = box_value(expected); | ||
53 | + E? boxed_actual = box_value(iterator.get()); | ||
54 | + E? boxed_expected = box_value(expected); | ||
55 | try { | ||
56 | assert_equal(boxed_actual, boxed_expected); | ||
57 | } catch (TestError.FAILED err) { | ||
58 | diff --git a/subprojects/vala-unit/src/mock-object.vala b/subprojects/vala-unit/src/mock-object.vala | ||
59 | index 766777a4..eb086e10 100644 | ||
60 | --- a/subprojects/vala-unit/src/mock-object.vala | ||
61 | +++ b/subprojects/vala-unit/src/mock-object.vala | ||
62 | @@ -138,7 +138,7 @@ public interface ValaUnit.MockObject : GLib.Object, TestAssertions { | ||
63 | throws GLib.Error { | ||
64 | assert_false(this.expected.is_empty, "Unexpected call: %s".printf(name)); | ||
65 | |||
66 | - ExpectedCall expected = this.expected.poll(); | ||
67 | + ExpectedCall expected = (!) this.expected.poll(); | ||
68 | assert_equal(name, expected.name, "Unexpected call"); | ||
69 | if (expected.expected_args != null) { | ||
70 | assert_args(args, expected.expected_args, "Call %s".printf(name)); | ||
71 | @@ -229,7 +229,7 @@ public interface ValaUnit.MockObject : GLib.Object, TestAssertions { | ||
72 | R default_return) | ||
73 | throws GLib.Error { | ||
74 | check_for_exception(expected); | ||
75 | - R? return_object = default_return; | ||
76 | + R return_object = default_return; | ||
77 | if (expected.return_object != null) { | ||
78 | return_object = (R) expected.return_object; | ||
79 | } | ||
80 | @@ -243,7 +243,7 @@ public interface ValaUnit.MockObject : GLib.Object, TestAssertions { | ||
81 | if (expected.return_object == null) { | ||
82 | throw default_error; | ||
83 | } | ||
84 | - return expected.return_object; | ||
85 | + return (!) expected.return_object; | ||
86 | } | ||
87 | |||
88 | private inline void check_for_exception(ExpectedCall expected) | ||
89 | diff --git a/subprojects/vala-unit/src/test-assertions.vala b/subprojects/vala-unit/src/test-assertions.vala | ||
90 | index 784dd9fd..e61fdf82 100644 | ||
91 | --- a/subprojects/vala-unit/src/test-assertions.vala | ||
92 | +++ b/subprojects/vala-unit/src/test-assertions.vala | ||
93 | @@ -21,8 +21,8 @@ namespace ValaUnit { | ||
94 | |||
95 | } | ||
96 | |||
97 | - internal inline void assert_equal<T>(T actual, | ||
98 | - T expected, | ||
99 | + internal inline void assert_equal<T>(T? actual, | ||
100 | + T? expected, | ||
101 | string? context = null) | ||
102 | throws TestError { | ||
103 | if ((actual == null && expected != null) || | ||
104 | @@ -107,9 +107,9 @@ namespace ValaUnit { | ||
105 | * | ||
106 | * This will only work when the values are not already boxed. | ||
107 | */ | ||
108 | - internal T box_value<T>(T value) { | ||
109 | + internal T? box_value<T>(T value) { | ||
110 | var type = typeof(T); | ||
111 | - T boxed = value; | ||
112 | + T? boxed = value; | ||
113 | |||
114 | if (type == typeof(int) || type.is_enum()) { | ||
115 | int actual = (int) value; | ||
116 | @@ -133,7 +133,7 @@ namespace ValaUnit { | ||
117 | return boxed; | ||
118 | } | ||
119 | |||
120 | - internal string to_display_string<T>(T value) { | ||
121 | + internal string to_display_string<T>(T? value) { | ||
122 | var type = typeof(T); | ||
123 | var display = ""; | ||
124 | |||
125 | @@ -191,8 +191,8 @@ namespace ValaUnit { | ||
126 | ); | ||
127 | } | ||
128 | |||
129 | - private void assert_equal_enum<T>(T actual, | ||
130 | - T expected, | ||
131 | + private void assert_equal_enum<T>(T? actual, | ||
132 | + T? expected, | ||
133 | string? context) | ||
134 | throws TestError { | ||
135 | int actual_val = (int) ((int?) actual); | ||
136 | @@ -342,7 +342,7 @@ public interface ValaUnit.TestAssertions : GLib.Object { | ||
137 | |||
138 | |||
139 | /** Asserts a value is null */ | ||
140 | - public void assert_non_null<T>(T actual, string? context = null) | ||
141 | + public void assert_non_null<T>(T? actual, string? context = null) | ||
142 | throws TestError { | ||
143 | if (actual == null) { | ||
144 | ValaUnit.assert( | ||
145 | @@ -353,7 +353,7 @@ public interface ValaUnit.TestAssertions : GLib.Object { | ||
146 | } | ||
147 | |||
148 | /** Asserts a value is null */ | ||
149 | - public void assert_is_null<T>(T actual, string? context = null) | ||
150 | + public void assert_is_null<T>(T? actual, string? context = null) | ||
151 | throws TestError { | ||
152 | if (actual != null) { | ||
153 | ValaUnit.assert( | ||
154 | -- | ||
155 | 2.41.0 | ||
156 | |||
diff --git a/meta-gnome/recipes-connectivity/geary/geary_43.0.bb b/meta-gnome/recipes-connectivity/geary/geary_43.0.bb index ff7a9ee69..6085d94fd 100644 --- a/meta-gnome/recipes-connectivity/geary/geary_43.0.bb +++ b/meta-gnome/recipes-connectivity/geary/geary_43.0.bb | |||
@@ -36,6 +36,8 @@ inherit meson pkgconfig mime-xdg gtk-icon-cache gobject-introspection vala featu | |||
36 | SRC_URI = " \ | 36 | SRC_URI = " \ |
37 | git://github.com/GNOME/geary.git;nobranch=1;protocol=https \ | 37 | git://github.com/GNOME/geary.git;nobranch=1;protocol=https \ |
38 | file://0001-meson-Use-PKG_CONFIG_SYSROOT_DIR-when-using-pkg-conf.patch \ | 38 | file://0001-meson-Use-PKG_CONFIG_SYSROOT_DIR-when-using-pkg-conf.patch \ |
39 | file://0001-client-Add-missing-type-arguments-for-interfaces-to-.patch \ | ||
40 | file://0001-vala-unit-Fix-non-null-build-with-newer-vala.patch \ | ||
39 | " | 41 | " |
40 | 42 | ||
41 | S = "${WORKDIR}/git" | 43 | S = "${WORKDIR}/git" |