all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob b6c377b133c899d228901499d226ae6514fd2087 1772 bytes (raw)
name: gnu/packages/patches/qtbase-5-use-TZDIR.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
Use $TZDIR to search for time-zone data. Thus avoid depending on package
"tzdata", which often introduces changes with near-immediate effects, so it's
important to be able to update it fast.

Based on a patch fron NixOS.
===================================================================
--- qtbase-opensource-src-5.14.2.orig/src/corelib/time/qtimezoneprivate_tz.cpp
+++ qtbase-opensource-src-5.15.2/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -70,7 +70,11 @@
 // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
 static QTzTimeZoneHash loadTzTimeZones()
 {
-    QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+    // Try TZDIR first, in case we're running on GuixSD.
+    QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
+    // Fallback to traditional paths in case we are not on GuixSD.
+    if (!QFile::exists(path))
+        path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
     if (!QFile::exists(path))
         path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
 
@@ -645,6 +649,9 @@
         if (!tzif.open(QIODevice::ReadOnly))
             return;
     } else {
+      // Try TZDIR first, in case we're running on GuixSD.
+      tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
+      if (!tzif.open(QIODevice::ReadOnly)) {
         // Open named tz, try modern path first, if fails try legacy path
         tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
         if (!tzif.open(QIODevice::ReadOnly)) {
@@ -652,6 +659,7 @@
             if (!tzif.open(QIODevice::ReadOnly))
                 return;
         }
+      }
     }
 
     QDataStream ds(&tzif);

debug log:

solving b6c377b133c ...
found b6c377b133c in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.