From 1187ef5fe3880bb8a105f1d56a7bf319972fa332 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Thu, 16 May 2024 22:47:23 +0200 Subject: [PATCH] properly inject tzdata --- .gitignore | 1 + pkgs/001-tzdata.patch | 17 +++++++++++++++++ pkgs/hare.nix | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 pkgs/001-tzdata.patch diff --git a/.gitignore b/.gitignore index 5ef9adf..850b1be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ hello* tmp +result* diff --git a/pkgs/001-tzdata.patch b/pkgs/001-tzdata.patch new file mode 100644 index 0000000..0ccef5d --- /dev/null +++ b/pkgs/001-tzdata.patch @@ -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 + + 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"; diff --git a/pkgs/hare.nix b/pkgs/hare.nix index af1f946..32e1c09 100644 --- a/pkgs/hare.nix +++ b/pkgs/hare.nix @@ -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