From: Leo Famulari <leo@famulari.name>
To: 63006@debbugs.gnu.org
Subject: [bug#63006] [PATCH 1/3] gnu: libical: Find the time zone database in the environment.
Date: Fri, 21 Apr 2023 17:01:00 -0400 [thread overview]
Message-ID: <724078bec9b692f2d0e3fae4a03a23ef96d94ee5.1682110862.git.leo@famulari.name> (raw)
In-Reply-To: <ZEL5PdiZbj243ZRD@jasmine.lan>
* gnu/packages/patches/libical-respect-tzdir.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/calendar.scm (libical)[source]: Use it.
[inputs]: Remove tzdata.
---
gnu/local.mk | 1 +
gnu/packages/calendar.scm | 3 +-
.../patches/libical-respect-tzdir.patch | 38 +++++++++++++++++++
3 files changed, 41 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/libical-respect-tzdir.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index b631fa6d5a..f301c33cfa 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1393,6 +1393,7 @@ dist_patch_DATA = \
%D%/packages/patches/libffi-3.3-powerpc-fixes.patch \
%D%/packages/patches/libffi-float128-powerpc64le.patch \
%D%/packages/patches/libgeotiff-fix-tests-with-proj-9.1.1.patch \
+ %D%/packages/patches/libical-respect-tzdir.patch \
%D%/packages/patches/libobjc2-unbundle-robin-map.patch \
%D%/packages/patches/librime-fix-build-with-gcc10.patch \
%D%/packages/patches/libvirt-add-install-prefix.patch \
diff --git a/gnu/packages/calendar.scm b/gnu/packages/calendar.scm
index cf4286100d..030f9c52e7 100644
--- a/gnu/packages/calendar.scm
+++ b/gnu/packages/calendar.scm
@@ -127,6 +127,7 @@ (define-public libical
(uri (string-append
"https://github.com/libical/libical/releases/download/v"
version "/libical-" version ".tar.gz"))
+ (patches (search-patches "libical-respect-tzdir.patch"))
(sha256
(base32
"0cqc1wpalxmxjx8dmcaga9w8kd5l7944hqmidz43hifaf7fhaixl"))))
@@ -166,7 +167,7 @@ (define-public libical
pkg-config
vala))
(inputs
- (list glib libxml2 tzdata))
+ (list glib libxml2))
(propagated-inputs
;; In Requires.private of libical.pc.
(list icu4c))
diff --git a/gnu/packages/patches/libical-respect-tzdir.patch b/gnu/packages/patches/libical-respect-tzdir.patch
new file mode 100644
index 0000000000..f749addf44
--- /dev/null
+++ b/gnu/packages/patches/libical-respect-tzdir.patch
@@ -0,0 +1,38 @@
+Copied from Nix:
+
+https://github.com/NixOS/nixpkgs/blob/0336bd874374a9e33947ace8a289e5c785e44a19/pkgs/development/libraries/libical/respect-env-tzdir.patch
+
+This functionality will be available in libical 3.1.0, whenever that is
+released:
+
+https://github.com/libical/libical/issues/350
+
+--- a/src/libical/icaltz-util.c
++++ b/src/libical/icaltz-util.c
+@@ -94,9 +94,9 @@
+ static const char *zdir = NULL;
+
+ static const char *search_paths[] = {
++ "/etc/zoneinfo",
+ "/usr/share/zoneinfo",
+ "/usr/lib/zoneinfo",
+- "/etc/zoneinfo",
+ "/usr/share/lib/zoneinfo"
+ };
+
+@@ -178,6 +178,15 @@
+ const char *fname = ZONES_TAB_SYSTEM_FILENAME;
+ size_t i, num_search_paths;
+
++ const char *env_tzdir = getenv ("TZDIR");
++ if (env_tzdir) {
++ sprintf (file_path, "%s/%s", env_tzdir, fname);
++ if (!access (file_path, F_OK|R_OK)) {
++ zdir = env_tzdir;
++ return;
++ }
++ }
++
+ num_search_paths = sizeof(search_paths) / sizeof(search_paths[0]);
+ for (i = 0; i < num_search_paths; i++) {
+ snprintf(file_path, MAXPATHLEN, "%s/%s", search_paths[i], fname);
--
2.39.2
next prev parent reply other threads:[~2023-04-21 21:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 20:59 [bug#63006] Time zone database improvements Leo Famulari
2023-04-21 21:01 ` Leo Famulari [this message]
2023-04-21 21:01 ` [bug#63006] [PATCH 2/3] gnu: Go: Do not depend on tzdata Leo Famulari
2023-04-21 21:01 ` [bug#63006] [PATCH 3/3] gnu: tzdata: Update to 2023c Leo Famulari
2023-04-30 21:00 ` [bug#63006] Time zone database improvements Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=724078bec9b692f2d0e3fae4a03a23ef96d94ee5.1682110862.git.leo@famulari.name \
--to=leo@famulari.name \
--cc=63006@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).