glib: update to 2.68.0.

* disable broken tests on musl

* add backport fix.
This commit is contained in:
Enno Boland 2021-04-03 12:54:05 +02:00
parent 97fabd5921
commit 69c131c899
No known key found for this signature in database
GPG key ID: 5A7B9F1D0DFEB55D
5 changed files with 160 additions and 15 deletions

View file

@ -78,11 +78,11 @@ libmagic.so.1 libmagic-5.12_1
libbluetooth.so.3 libbluetooth-4.58_1
libwmf-0.2.so.7 libwmf-0.2.8.4_1
libwmflite-0.2.so.7 libwmf-0.2.8.4_1
libgthread-2.0.so.0 glib-2.18.0_1
libglib-2.0.so.0 glib-2.18.0_1
libgmodule-2.0.so.0 glib-2.18.0_1
libgio-2.0.so.0 glib-2.18.0_1
libgobject-2.0.so.0 glib-2.18.0_1
libgthread-2.0.so.0 glib-2.68.0_1
libglib-2.0.so.0 glib-2.68.0_1
libgmodule-2.0.so.0 glib-2.68.0_1
libgio-2.0.so.0 glib-2.68.0_1
libgobject-2.0.so.0 glib-2.68.0_1
libatk-1.0.so.0 atk-1.26.0_1
libpangocairo-1.0.so.0 pango-1.24.0_1
libpangoft2-1.0.so.0 pango-1.24.0_1

View file

@ -0,0 +1,130 @@
From 07ab2e26c937a93ae7389e002014e32aa78e4ec6 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Tue, 23 Mar 2021 16:27:49 +0000
Subject: [PATCH 1/2] gkeyfile: Drop a redundant check
It should not be possible for `->locales` to be set without
`->checked_locales` being set, so drop the redundant check. This helps
with branch code coverage.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
---
glib/gkeyfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git glib/gkeyfile.c glib/gkeyfile.c
index 50859164b..06c4b7c47 100644
--- glib/gkeyfile.c
+++ glib/gkeyfile.c
@@ -1232,7 +1232,7 @@ g_key_file_locale_is_interesting (GKeyFile *key_file,
if (key_file->flags & G_KEY_FILE_KEEP_TRANSLATIONS)
return TRUE;
- if (!key_file->checked_locales && !key_file->locales)
+ if (!key_file->checked_locales)
{
key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
key_file->checked_locales = TRUE;
--
GitLab
From 77649d3d3d94b7cd57cd165eb44105d7d196c2e4 Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Tue, 23 Mar 2021 16:28:31 +0000
Subject: [PATCH 2/2] gkeyfile: Fix crash when parsing translations on a second
load
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If the same `GKeyFile` is reused to load multiple different key files,
any loads after the first which encounter translated keys will crash,
because clearing the data from the first load cleared the cached
language names, but didnt clear `checked_locales`, so they were never
reloaded.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2361
---
glib/gkeyfile.c | 1 +
glib/tests/keyfile.c | 43 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git glib/gkeyfile.c glib/gkeyfile.c
index 06c4b7c47..0b58edb3f 100644
--- glib/gkeyfile.c
+++ glib/gkeyfile.c
@@ -648,6 +648,7 @@ g_key_file_clear (GKeyFile *key_file)
g_strfreev (key_file->locales);
key_file->locales = NULL;
}
+ key_file->checked_locales = FALSE;
if (key_file->parse_buffer)
{
diff --git glib/tests/keyfile.c glib/tests/keyfile.c
index 7530bc8c3..975ef8167 100644
--- glib/tests/keyfile.c
+++ glib/tests/keyfile.c
@@ -758,6 +758,48 @@ test_locale_string (void)
g_free (old_locale);
}
+static void
+test_locale_string_multiple_loads (void)
+{
+ GKeyFile *keyfile = NULL;
+ GError *local_error = NULL;
+ gchar *old_locale = NULL;
+ guint i;
+ const gchar *data =
+ "[valid]\n"
+ "key1=v1\n"
+ "key1[de]=v1-de\n"
+ "key1[de_DE]=v1-de_DE\n"
+ "key1[de_DE.UTF8]=v1-de_DE.UTF8\n"
+ "key1[fr]=v1-fr\n"
+ "key1[en] =v1-en\n"
+ "key1[sr@Latn]=v1-sr\n";
+
+ g_test_summary ("Check that loading with translations multiple times works");
+ g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2361");
+
+ old_locale = g_strdup (setlocale (LC_ALL, NULL));
+ g_setenv ("LANGUAGE", "de", TRUE);
+ setlocale (LC_ALL, "");
+
+ keyfile = g_key_file_new ();
+
+ for (i = 0; i < 3; i++)
+ {
+ g_key_file_load_from_data (keyfile, data, -1, G_KEY_FILE_NONE, &local_error);
+ g_assert_no_error (local_error);
+
+ check_locale_string_value (keyfile, "valid", "key1", "it", "v1");
+ check_locale_string_value (keyfile, "valid", "key1", "de", "v1-de");
+ check_locale_string_value (keyfile, "valid", "key1", "de_DE", "v1-de");
+ }
+
+ g_key_file_free (keyfile);
+
+ setlocale (LC_ALL, old_locale);
+ g_free (old_locale);
+}
+
static void
test_lists (void)
{
@@ -1791,6 +1833,7 @@ main (int argc, char *argv[])
g_test_add_func ("/keyfile/boolean", test_boolean);
g_test_add_func ("/keyfile/number", test_number);
g_test_add_func ("/keyfile/locale-string", test_locale_string);
+ g_test_add_func ("/keyfile/locale-string/multiple-loads", test_locale_string_multiple_loads);
g_test_add_func ("/keyfile/lists", test_lists);
g_test_add_func ("/keyfile/lists-set-get", test_lists_set_get);
g_test_add_func ("/keyfile/group-remove", test_group_remove);
--
GitLab

View file

@ -1,8 +1,8 @@
diff --git gio/tests/meson.build gio/tests/meson.build
index d8ebd56..be72f5c 100644
index a926ae01a..c2093cf4e 100644
--- gio/tests/meson.build
+++ gio/tests/meson.build
@@ -35,7 +35,6 @@ gio_tests = {
@@ -50,7 +50,6 @@ gio_tests = {
'cancellable' : {},
'contexts' : {},
'contenttype' : {},
@ -10,7 +10,15 @@ index d8ebd56..be72f5c 100644
'credentials' : {},
'data-input-stream' : {},
'data-output-stream' : {},
@@ -550,7 +549,7 @@ if installed_tests_enabled
@@ -74,7 +73,6 @@ gio_tests = {
'network-monitor' : {},
'network-monitor-race' : {},
'permission' : {},
- 'pollable' : {'dependencies' : [libdl_dep]},
'proxy-test' : {},
'readwrite' : {},
'simple-async-result' : {},
@@ -567,7 +565,7 @@ if installed_tests_enabled
endforeach
endif
@ -20,21 +28,24 @@ index d8ebd56..be72f5c 100644
plugin_resources_c = custom_target('plugin-resources.c',
input : 'test4.gresource.xml',
diff --git glib/tests/meson.build glib/tests/meson.build
index 6eb23e8..d7aacfa 100644
index c77ccdd14..b0dab692a 100644
--- glib/tests/meson.build
+++ glib/tests/meson.build
@@ -11,18 +11,11 @@ glib_tests = {
@@ -11,21 +11,13 @@ glib_tests = {
'cache' : {},
'charset' : {},
'checksum' : {},
- 'collate' : {},
'cond' : {},
- 'convert' : {},
'cxx' : {
'source' : ['cxx.cpp'],
},
'dataset' : {},
- 'date' : {},
'dir' : {},
'environment' : {},
'error' : {},
- 'error' : {},
- 'fileutils' : {},
- 'gdatetime' : {
- 'suite' : ['slow'],
@ -42,7 +53,7 @@ index 6eb23e8..d7aacfa 100644
'guuid' : {},
'gvariant' : {
'suite' : ['slow'],
@@ -54,7 +47,6 @@ glib_tests = {
@@ -57,7 +49,6 @@ glib_tests = {
'mutex' : {},
'node' : {},
'once' : {},
@ -50,3 +61,6 @@ index 6eb23e8..d7aacfa 100644
'option-argv0' : {},
'overflow' : {},
'overflow-fallback' : {
--
2.31.0

View file

@ -1,6 +1,6 @@
# Template file for 'glib'
pkgname=glib
version=2.66.8
version=2.68.0
revision=1
build_style=meson
# static version is necessary for qemu-user-static;
@ -9,14 +9,14 @@ configure_args="-Dfam=false -Dman=true -Dselinux=disabled
$(vopt_bool gtk_doc gtk_doc) --default-library=both -Db_lto=false"
hostmakedepends="gettext pkg-config libxslt docbook-xsl $(vopt_if gtk_doc gtk-doc)"
makedepends="zlib-devel pcre-devel libffi-devel dbus-devel elfutils-devel libmount-devel"
checkdepends="desktop-file-utils shared-mime-info tzdata dbus"
checkdepends="desktop-file-utils shared-mime-info tzdata dbus python3-pytest"
short_desc="GNU library of C routines"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/GLib"
changelog="https://gitlab.gnome.org/GNOME/glib/raw/master/NEWS"
distfiles="${GNOME_SITE}/glib/${version%.*}/glib-${version}.tar.xz"
checksum=97bc87dd91365589af5cbbfea2574833aea7a1b71840fd365ecd2852c76b9c8b
checksum=67734f584f3a05a2872f57e9a8db38f3b06c7087fb531c5a839d9171968103ea
build_options="gtk_doc"
desc_option_gtk_doc="Build GTK API docs"

1
srcpkgs/glib/update Normal file
View file

@ -0,0 +1 @@
site="https://gitlab.gnome.org/GNOME/glib/-/tags"