1 |
commit: 40a698334696b6b915bbbefa349df23cd8ef860c |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Aug 30 07:05:48 2020 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 30 07:40:00 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40a69833 |
7 |
|
8 |
dev-libs/libgweather: fix tests when system has no French locale |
9 |
|
10 |
Bug: https://bugs.gentoo.org/739592 |
11 |
Package-Manager: Portage-2.3.103, Repoman-2.3.20 |
12 |
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org> |
13 |
|
14 |
.../libgweather/files/3.36.1-tests-locale.patch | 52 ++++++++++++++++++++++ |
15 |
dev-libs/libgweather/libgweather-3.36.1.ebuild | 1 + |
16 |
2 files changed, 53 insertions(+) |
17 |
|
18 |
diff --git a/dev-libs/libgweather/files/3.36.1-tests-locale.patch b/dev-libs/libgweather/files/3.36.1-tests-locale.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..fb35d2f00b7 |
21 |
--- /dev/null |
22 |
+++ b/dev-libs/libgweather/files/3.36.1-tests-locale.patch |
23 |
@@ -0,0 +1,52 @@ |
24 |
+From 8b20cd91a96eae39bafe82ccf444dbc00759ad43 Mon Sep 17 00:00:00 2001 |
25 |
+From: Emmanuele Bassi <ebassi@×××××.org> |
26 |
+Date: Mon, 9 Mar 2020 12:21:57 +0000 |
27 |
+Subject: [PATCH] Do not run local-dependent tests with missing locales |
28 |
+ |
29 |
+Not everyone has all the locales installed all the time, so let's check |
30 |
+if a locale is available before using it. |
31 |
+--- |
32 |
+ libgweather/test_libgweather.c | 12 +++++++++++- |
33 |
+ 1 file changed, 11 insertions(+), 1 deletion(-) |
34 |
+ |
35 |
+diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c |
36 |
+index 8a219115..77ee459b 100644 |
37 |
+--- a/libgweather/test_libgweather.c |
38 |
++++ b/libgweather/test_libgweather.c |
39 |
+@@ -643,6 +643,7 @@ static void |
40 |
+ test_location_names (void) |
41 |
+ { |
42 |
+ GWeatherLocation *world, *brussels; |
43 |
++ char *old_locale; |
44 |
+ |
45 |
+ world = gweather_location_get_world (); |
46 |
+ g_assert (world); |
47 |
+@@ -653,7 +654,16 @@ test_location_names (void) |
48 |
+ g_assert_cmpstr (gweather_location_get_sort_name (brussels), ==, "brussels"); |
49 |
+ g_assert_cmpstr (gweather_location_get_english_name (brussels), ==, "Brussels"); |
50 |
+ |
51 |
++ old_locale = g_strdup (setlocale (LC_ALL, NULL)); |
52 |
+ setlocale (LC_ALL, "fr_FR.UTF-8"); |
53 |
++ if (strstr (setlocale (LC_ALL, NULL), "fr_FR.UTF-8") == NULL) |
54 |
++ { |
55 |
++ g_test_skip ("locale fr_FR.UTF-8 not available, skipping localization tests"); |
56 |
++ setlocale (LC_ALL, old_locale); |
57 |
++ g_free (old_locale); |
58 |
++ return; |
59 |
++ } |
60 |
++ |
61 |
+ _gweather_location_reset_world (); |
62 |
+ |
63 |
+ world = gweather_location_get_world (); |
64 |
+@@ -665,7 +675,7 @@ test_location_names (void) |
65 |
+ g_assert_cmpstr (gweather_location_get_sort_name (brussels), ==, "bruxelles"); |
66 |
+ g_assert_cmpstr (gweather_location_get_english_name (brussels), ==, "Brussels"); |
67 |
+ |
68 |
+- setlocale (LC_ALL, ""); |
69 |
++ setlocale (LC_ALL, old_locale); |
70 |
+ _gweather_location_reset_world (); |
71 |
+ } |
72 |
+ |
73 |
+-- |
74 |
+GitLab |
75 |
+ |
76 |
|
77 |
diff --git a/dev-libs/libgweather/libgweather-3.36.1.ebuild b/dev-libs/libgweather/libgweather-3.36.1.ebuild |
78 |
index f3d82c03f4c..0db353126e4 100644 |
79 |
--- a/dev-libs/libgweather/libgweather-3.36.1.ebuild |
80 |
+++ b/dev-libs/libgweather/libgweather-3.36.1.ebuild |
81 |
@@ -40,6 +40,7 @@ BDEPEND=" |
82 |
|
83 |
PATCHES=( |
84 |
"${FILESDIR}"/3.32.1-meson-tweaks.patch # Provide introspection optionality and don't build tests that aren't ran automatically |
85 |
+ "${FILESDIR}"/3.36.1-tests-locale.patch # Don't fail tests when a locale is not present, https://gitlab.gnome.org/GNOME/libgweather/-/merge_requests/58 |
86 |
) |
87 |
|
88 |
src_prepare() { |