summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libmateweather-use-TZDIR.patch
diff options
context:
space:
mode:
authorAndy Tai <atai@atai.org>2023-06-15 10:35:04 -0700
committer宋文武 <iyzsong@member.fsf.org>2023-07-22 16:36:49 +0800
commit27d4563e82bda5d0520fda83c137c43935862cec (patch)
tree2bb442dfaa8e2b73a0b6d107f713100924930ad3 /gnu/packages/patches/libmateweather-use-TZDIR.patch
parent1c814ec90b048809c521f73357c4aa75bffc6c59 (diff)
gnu: libmateweather: Update to 1.26.1.
* gnu/packages/mate.scm (libmateweather): Update to 1.26.1. [source]: Add libmateweather-use-TZDIR.patch. [inputs]: Replace tzdata with tzdata-for-tests. [arguments]: Set TZDIR, ignore test failure for 'check-timezones.sh'. * gnu/packages/patches/libmateweather-use-TZDIR.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Co-authored-by: 宋文武 <iyzsong@member.fsf.org>
Diffstat (limited to 'gnu/packages/patches/libmateweather-use-TZDIR.patch')
-rw-r--r--gnu/packages/patches/libmateweather-use-TZDIR.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/gnu/packages/patches/libmateweather-use-TZDIR.patch b/gnu/packages/patches/libmateweather-use-TZDIR.patch
new file mode 100644
index 0000000000..5f72043986
--- /dev/null
+++ b/gnu/packages/patches/libmateweather-use-TZDIR.patch
@@ -0,0 +1,42 @@
+From 109fef8208188ddf4be76d6899f7d8fde5b8b3be Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
+Date: Sat, 22 Jul 2023 14:40:31 +0800
+Subject: [PATCH] Use TZDIR for ZONEINFO_DIR if the variable is set.
+
+---
+ libmateweather/mateweather-timezone.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/libmateweather/mateweather-timezone.c b/libmateweather/mateweather-timezone.c
+index 2754728..6c858c4 100644
+--- a/libmateweather/mateweather-timezone.c
++++ b/libmateweather/mateweather-timezone.c
+@@ -61,7 +61,7 @@ static gboolean
+ parse_tzdata (const char *tzname, time_t start, time_t end,
+ int *offset, gboolean *has_dst, int *dst_offset)
+ {
+- char *filename, *contents;
++ char *tzdir, *filename, *contents;
+ gsize length;
+ int timecnt, transitions_size, ttinfo_map_size;
+ int initial_transition = -1, second_transition = -1;
+@@ -71,7 +71,10 @@ parse_tzdata (const char *tzname, time_t start, time_t end,
+ char initial_isdst, second_isdst;
+ int i;
+
+- filename = g_build_filename (ZONEINFO_DIR, tzname, NULL);
++ tzdir = g_getenv("TZDIR");
++ if (tzdir == NULL)
++ tzdir = ZONEINFO_DIR;
++ filename = g_build_filename (tzdir, tzname, NULL);
+ if (!g_file_get_contents (filename, &contents, &length, NULL)) {
+ g_free (filename);
+ return FALSE;
+@@ -403,4 +406,3 @@ mateweather_timezone_get_dst_offset (MateWeatherTimezone *zone)
+ g_return_val_if_fail (zone->has_dst, 0);
+ return zone->dst_offset;
+ }
+-
+--
+2.41.0
+