1 |
commit: 0a9dcd47814bfdc36c92de4e57071ad692fd4480 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 29 05:30:13 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 29 05:30:25 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a9dcd47 |
7 |
|
8 |
net-libs/glib-networking: apply upstream patch for 32-bit test failure |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
.../glib-networking-2.70.0-time_t-32-bit.patch | 52 ++++++++++++++++++++++ |
13 |
.../glib-networking/glib-networking-2.70.0.ebuild | 4 ++ |
14 |
2 files changed, 56 insertions(+) |
15 |
|
16 |
diff --git a/net-libs/glib-networking/files/glib-networking-2.70.0-time_t-32-bit.patch b/net-libs/glib-networking/files/glib-networking-2.70.0-time_t-32-bit.patch |
17 |
new file mode 100644 |
18 |
index 000000000000..fc9ccea13952 |
19 |
--- /dev/null |
20 |
+++ b/net-libs/glib-networking/files/glib-networking-2.70.0-time_t-32-bit.patch |
21 |
@@ -0,0 +1,52 @@ |
22 |
+Workaround/fix test failure on 32-bit arches. Should be in release |
23 |
+after 2.70.0. |
24 |
+ |
25 |
+https://gitlab.gnome.org/GNOME/glib-networking/-/commit/4f8ca86a0e460794188c3355f0c7cc11fdbe4229.patch |
26 |
+ |
27 |
+From: Simon McVittie <simon.mcvittie@××××××××××××.uk> |
28 |
+Date: Tue, 21 Sep 2021 17:07:44 +0000 |
29 |
+Subject: [PATCH] tests: Accept GNUTLS' workaround for limited size of time_t |
30 |
+ |
31 |
+--- a/tls/tests/certificate.c |
32 |
++++ b/tls/tests/certificate.c |
33 |
+@@ -672,6 +672,12 @@ test_certificate_not_valid_before (void) |
34 |
+ g_object_unref (cert); |
35 |
+ } |
36 |
+ |
37 |
++/* On 32-bit, GNUTLS caps expiry times at 2037-12-31 23:23:23 to avoid |
38 |
++ * overflowing time_t. Hopefully by 2037, either 32-bit will finally have |
39 |
++ * died out, or GNUTLS will rethink its approach to |
40 |
++ * https://gitlab.com/gnutls/gnutls/-/issues/370 */ |
41 |
++#define GNUTLS_32_BIT_NOT_VALID_AFTER_MAX 2145914603 |
42 |
++ |
43 |
+ static void |
44 |
+ test_certificate_not_valid_after (void) |
45 |
+ { |
46 |
+@@ -686,7 +692,16 @@ test_certificate_not_valid_after (void) |
47 |
+ actual = g_tls_certificate_get_not_valid_after (cert); |
48 |
+ g_assert_nonnull (actual); |
49 |
+ actual_str = g_date_time_format_iso8601 (actual); |
50 |
++ |
51 |
++#if SIZEOF_TIME_T <= 4 |
52 |
++ if (g_date_time_to_unix (actual) == GNUTLS_32_BIT_NOT_VALID_AFTER_MAX) |
53 |
++ g_test_incomplete ("not-valid-after date not representable on 32-bit"); |
54 |
++ else |
55 |
++ g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER); |
56 |
++#else |
57 |
+ g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER); |
58 |
++#endif |
59 |
++ |
60 |
+ g_free (actual_str); |
61 |
+ g_date_time_unref (actual); |
62 |
+ g_object_unref (cert); |
63 |
+--- a/tls/tests/meson.build |
64 |
++++ b/tls/tests/meson.build |
65 |
+@@ -69,6 +69,7 @@ foreach backend: backends |
66 |
+ test_cflags = cflags + [ |
67 |
+ '-DBACKEND="@0@"'.format(backend), |
68 |
+ '-DBACKEND_IS_' + backend.to_upper(), |
69 |
++ '-DSIZEOF_TIME_T=@0@'.format(cc.sizeof('time_t', prefix: '#include <time.h>')), |
70 |
+ ] |
71 |
+ |
72 |
+ if backend == 'openssl' |
73 |
+GitLab |
74 |
|
75 |
diff --git a/net-libs/glib-networking/glib-networking-2.70.0.ebuild b/net-libs/glib-networking/glib-networking-2.70.0.ebuild |
76 |
index 860454cb0242..8bdcf6b9b5c7 100644 |
77 |
--- a/net-libs/glib-networking/glib-networking-2.70.0.ebuild |
78 |
+++ b/net-libs/glib-networking/glib-networking-2.70.0.ebuild |
79 |
@@ -30,6 +30,10 @@ BDEPEND=" |
80 |
test? ( sys-apps/dbus ) |
81 |
" |
82 |
|
83 |
+PATCHES=( |
84 |
+ "${FILESDIR}"/${P}-time_t-32-bit.patch |
85 |
+) |
86 |
+ |
87 |
src_prepare() { |
88 |
xdg_src_prepare |