Skip to content

Commit 6a28c90

Browse files
authored
Upgrade gtk-vnc version to 1.5.0 (microsoft#14844)
1 parent f99672f commit 6a28c90

File tree

5 files changed

+196
-12
lines changed

5 files changed

+196
-12
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From ad62a80a4a3b4861e680e17f8877ffdbe024fbda Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <[email protected]>
3+
Date: Wed, 19 Feb 2025 15:18:10 +0000
4+
Subject: [PATCH 1/2] make --gtk-vnc-debug work with new glib
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
Glib 2.80 changed its logging impl so that G_MESSAGES_DEBUG is
10+
only ever read once, which makes it impossible for --gtk-vnc-debug
11+
to change in many cases.
12+
13+
The only viable way to change logging at runtime is to register
14+
a custom handler and print to the console ourselves. This is what
15+
we probably should have done from the start.
16+
17+
Signed-off-by: Daniel P. Berrangé <[email protected]>
18+
---
19+
src/vncutil.c | 25 ++++++++++++++++++-------
20+
1 file changed, 18 insertions(+), 7 deletions(-)
21+
22+
diff --git a/src/vncutil.c b/src/vncutil.c
23+
index b9ad611..ec14ff7 100644
24+
--- a/src/vncutil.c
25+
+++ b/src/vncutil.c
26+
@@ -27,6 +27,15 @@
27+
28+
29+
static gboolean debugFlag = FALSE;
30+
+static guint debugHandler = 0;
31+
+
32+
+static void vnc_log_handler(
33+
+ const gchar *log_domain G_GNUC_UNUSED,
34+
+ GLogLevelFlags log_level G_GNUC_UNUSED,
35+
+ const gchar *message,
36+
+ gpointer user_data G_GNUC_UNUSED) {
37+
+ g_printerr("%s\n", message);
38+
+}
39+
40+
/**
41+
* vnc_util_set_debug:
42+
@@ -38,13 +47,15 @@ static gboolean debugFlag = FALSE;
43+
void vnc_util_set_debug(gboolean enabled)
44+
{
45+
if (enabled) {
46+
- const gchar *doms = g_getenv("G_MESSAGES_DEBUG");
47+
- if (!doms) {
48+
- g_setenv("G_MESSAGES_DEBUG", G_LOG_DOMAIN, 1);
49+
- } else if (!strstr(doms, G_LOG_DOMAIN)) {
50+
- gchar *newdoms = g_strdup_printf("%s %s", doms, G_LOG_DOMAIN);
51+
- g_setenv("G_MESSAGES_DEBUG", newdoms, 1);
52+
- g_free(newdoms);
53+
+ if (debugHandler == 0) {
54+
+ debugHandler =
55+
+ g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
56+
+ vnc_log_handler, NULL);
57+
+ }
58+
+ } else {
59+
+ if (debugHandler != 0) {
60+
+ g_log_remove_handler(G_LOG_DOMAIN, debugHandler);
61+
+ debugHandler = 0;
62+
}
63+
}
64+
debugFlag = enabled;
65+
--
66+
2.47.1
67+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From 333032105927ab9ae53563f889a3edd9beba0704 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <[email protected]>
3+
Date: Wed, 19 Feb 2025 16:22:14 +0000
4+
Subject: [PATCH 2/2] Expand log message to include log domain and timestamp
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
This helps correlate and distinguish logs from other components
10+
11+
Signed-off-by: Daniel P. Berrangé <[email protected]>
12+
---
13+
src/vncutil.c | 15 +++++++++++++--
14+
1 file changed, 13 insertions(+), 2 deletions(-)
15+
16+
diff --git a/src/vncutil.c b/src/vncutil.c
17+
index ec14ff7..18fe41e 100644
18+
--- a/src/vncutil.c
19+
+++ b/src/vncutil.c
20+
@@ -28,13 +28,21 @@
21+
22+
static gboolean debugFlag = FALSE;
23+
static guint debugHandler = 0;
24+
+static GTimeZone *debugTZ = NULL;
25+
26+
static void vnc_log_handler(
27+
- const gchar *log_domain G_GNUC_UNUSED,
28+
+ const gchar *log_domain,
29+
GLogLevelFlags log_level G_GNUC_UNUSED,
30+
const gchar *message,
31+
gpointer user_data G_GNUC_UNUSED) {
32+
- g_printerr("%s\n", message);
33+
+ GDateTime *now = g_date_time_new_now(debugTZ);
34+
+ gchar *nowstr = g_date_time_format(now, "%H:%M:%S");
35+
+ g_printerr("%s: %s.%d: %s\n",
36+
+ log_domain, nowstr,
37+
+ g_date_time_get_microsecond(now)/1000,
38+
+ message);
39+
+ g_free(nowstr);
40+
+ g_date_time_unref(now);
41+
}
42+
43+
/**
44+
@@ -51,11 +59,14 @@ void vnc_util_set_debug(gboolean enabled)
45+
debugHandler =
46+
g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
47+
vnc_log_handler, NULL);
48+
+ debugTZ = g_time_zone_new_utc();
49+
}
50+
} else {
51+
if (debugHandler != 0) {
52+
g_log_remove_handler(G_LOG_DOMAIN, debugHandler);
53+
debugHandler = 0;
54+
+ g_time_zone_unref(debugTZ);
55+
+ debugTZ = NULL;
56+
}
57+
}
58+
debugFlag = enabled;
59+
--
60+
2.47.1
61+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"Signatures": {
3-
"gtk-vnc-1.3.0.tar.xz": "5faaa5823b8cbe8c0b0ba1e456c4e70c4b1ae6685c9fe81a4282d98cf00a211d"
3+
"gtk-vnc-1.5.0.tar.xz": "c0beb4747528ad931da43acc567c6a0190f7fc624465571ed9ccece02c34dd23"
44
}
55
}

SPECS-EXTENDED/gtk-vnc/gtk-vnc.spec

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
%global tls_priority "@LIBVIRT,SYSTEM"
2-
%global verdir 1.3
2+
%global verdir 1.5
33

44
Vendor: Microsoft Corporation
55
Distribution: Azure Linux
66
Summary: A GTK widget for VNC clients
77
Name: gtk-vnc
8-
Version: 1.3.0
8+
Version: 1.5.0
99
Release: 3%{?dist}
10-
License: LGPLv2+
10+
License: LGPL-2.1-or-later
1111
Source: https://download.gnome.org/sources/%{name}/%{verdir}/%{name}-%{version}.tar.xz
12+
Patch: 0001-make-gtk-vnc-debug-work-with-new-glib.patch
13+
Patch: 0002-Expand-log-message-to-include-log-domain-and-timesta.patch
1214
URL: https://gitlab.gnome.org/GNOME/gtk-vnc
1315
Requires: gvnc = %{version}-%{release}
16+
BuildRequires: gcc
1417
BuildRequires: python3-devel
15-
BuildRequires: gnutls-devel libgcrypt-devel cyrus-sasl-devel zlib-devel
18+
BuildRequires: gnutls-devel
19+
BuildRequires: gmp-devel
20+
BuildRequires: cyrus-sasl-devel
21+
BuildRequires: zlib-devel
1622
BuildRequires: gobject-introspection-devel
1723
BuildRequires: gtk3-devel
1824
BuildRequires: vala
1925
BuildRequires: pulseaudio-libs-devel
20-
BuildRequires: /usr/bin/pod2man
26+
BuildRequires: perl-podlators
2127
BuildRequires: meson
28+
BuildRequires: gi-docgen
29+
BuildRequires: python-markdown
30+
BuildRequires: python-markupsafe
31+
BuildRequires: python-typogrify
32+
BuildRequires: python-jinja2
2233

2334
%description
2435
gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
@@ -97,7 +108,7 @@ allowing it to be completely asynchronous while remaining single threaded.
97108
Libraries, includes, etc. to compile with the gtk-vnc library
98109

99110
%prep
100-
%autosetup -n gtk-vnc-%{version}
111+
%autosetup -n gtk-vnc-%{version} -p1
101112

102113
%build
103114
%meson
@@ -115,6 +126,8 @@ chmod -x examples/*.pl examples/*.js examples/*.py
115126
%files -n gvnc -f %{name}.lang
116127
%{_libdir}/libgvnc-1.0.so.*
117128
%{_libdir}/girepository-1.0/GVnc-1.0.typelib
129+
%dir %{_datadir}/vala/
130+
%dir %{_datadir}/vala/vapi/
118131
%{_datadir}/vala/vapi/gvnc-1.0.deps
119132
%{_datadir}/vala/vapi/gvnc-1.0.vapi
120133

@@ -124,6 +137,8 @@ chmod -x examples/*.pl examples/*.js examples/*.py
124137
%{_includedir}/gvnc-1.0/*.h
125138
%{_libdir}/pkgconfig/gvnc-1.0.pc
126139
%{_datadir}/gir-1.0/GVnc-1.0.gir
140+
%{_datadir}/doc/gvnc/
141+
%{_datadir}/doc/gvnc.toml
127142

128143
%files -n gvncpulse -f %{name}.lang
129144
%{_libdir}/libgvncpulse-1.0.so.*
@@ -164,11 +179,52 @@ chmod -x examples/*.pl examples/*.js examples/*.py
164179
%{_includedir}/%{name}-2.0/*.h
165180
%{_libdir}/pkgconfig/%{name}-2.0.pc
166181
%{_datadir}/gir-1.0/GtkVnc-2.0.gir
182+
%{_datadir}/doc/gtk-vnc/
183+
%{_datadir}/doc/gtk-vnc.toml
167184

168185
%changelog
169-
* Mon Mar 06 2023 Muhammad Falak R Wani <[email protected]> - 1.3.0-3
170-
- Initial CBL-Mariner import from Fedora 36 (license: MIT).
171-
- License Verified
186+
* Mon Oct 06 2025 Aditya Singh <[email protected]> - 1.5.0-3
187+
- Initial Azure Linux import from Fedora 41 (license: MIT).
188+
- License Verified.
189+
190+
* Wed Feb 19 2025 Daniel P. Berrangé <[email protected]> - 1.5.0-2
191+
- Fix --gtk-vnc-debug flag with new glib2
192+
193+
* Fri Feb 07 2025 Daniel P. Berrangé <[email protected]> - 1.5.0-1
194+
- Update to 1.5.0 release
195+
196+
* Fri Jan 17 2025 Fedora Release Engineering <[email protected]> - 1.4.0-4
197+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
198+
199+
* Mon Jan 13 2025 Daniel P. Berrangé <[email protected]> - 1.4.0-3
200+
- Own vala dirs (rhbz#2305567)
201+
202+
* Mon Jan 6 2025 Daniel P. Berrangé <[email protected]> - 1.4.0-1
203+
- Update to 1.4.0 release
204+
205+
* Thu Jul 18 2024 Fedora Release Engineering <[email protected]> - 1.3.1-6
206+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
207+
208+
* Wed Jan 24 2024 Fedora Release Engineering <[email protected]> - 1.3.1-5
209+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
210+
211+
* Sat Jan 20 2024 Fedora Release Engineering <[email protected]> - 1.3.1-4
212+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
213+
214+
* Thu Jul 20 2023 Fedora Release Engineering <[email protected]> - 1.3.1-3
215+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
216+
217+
* Thu Jan 19 2023 Fedora Release Engineering <[email protected]> - 1.3.1-2
218+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
219+
220+
* Mon Jan 16 2023 Yaakov Selkowitz <[email protected]> - 1.3.1-1
221+
- Update to 1.3.1 release
222+
223+
* Mon Aug 8 2022 Daniel P. Berrangé <[email protected]> - 1.3.0-5
224+
- Pull in mingw sub-packages
225+
226+
* Thu Jul 21 2022 Fedora Release Engineering <[email protected]> - 1.3.0-3
227+
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
172228

173229
* Thu Jan 20 2022 Fedora Release Engineering <[email protected]> - 1.3.0-2
174230
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

cgmanifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5100,8 +5100,8 @@
51005100
"type": "other",
51015101
"other": {
51025102
"name": "gtk-vnc",
5103-
"version": "1.3.0",
5104-
"downloadUrl": "https://download.gnome.org/sources/gtk-vnc/1.3/gtk-vnc-1.3.0.tar.xz"
5103+
"version": "1.5.0",
5104+
"downloadUrl": "https://download.gnome.org/sources/gtk-vnc/1.5/gtk-vnc-1.5.0.tar.xz"
51055105
}
51065106
}
51075107
},

0 commit comments

Comments
 (0)