1
Fork 0

properly inject tzdata

This commit is contained in:
Jan-Erik Rediger 2024-05-16 22:47:23 +02:00
parent 11b375657d
commit 1187ef5fe3
3 changed files with 26 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
hello*
tmp
result*

17
pkgs/001-tzdata.patch Normal file
View file

@ -0,0 +1,17 @@
diff --git a/time/chrono/+darwin.ha b/time/chrono/+darwin.ha
--- a/time/chrono/+darwin.ha
+++ b/time/chrono/+darwin.ha
@@ -2,11 +2,11 @@
// (c) Hare authors <https://harelang.org>
def LOCALTIME_PATH: str = "/etc/localtime";
-def TZDB_PATH: str = "/usr/share/zoneinfo/";
+def TZDB_PATH: str = "@tzdata@/share/zoneinfo/";
// The filepath of the system's "leap-seconds.list" file, which contains UTC/TAI
// leap second data.
// export def UTC_LEAPSECS_FILE: str = "/usr/share/zoneinfo/leapseconds";
// Download the file from ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list,
// and move it to this location.
-export def UTC_LEAPSECS_PATH: str = "/var/db/ntpd.leap-seconds.list";
+export def UTC_LEAPSECS_PATH: str = "@tzdata@/share/zoneinfo/leap-seconds.list";

View file

@ -7,6 +7,7 @@
harec,
tzdata,
python3,
substituteAll,
hareAs,
hareCc,
hareLd,
@ -28,6 +29,13 @@ stdenv.mkDerivation (finalAttrs: {
};
doCheck = true;
patches = [
(substituteAll {
src = ./001-tzdata.patch;
inherit tzdata;
})
];
nativeBuildInputs = [
harec
makeWrapper