diff options
author | Evangelos Paterakis <evan@geopjr.dev> | 2022-12-21 16:30:37 +0200 |
---|---|---|
committer | Evangelos Paterakis <evan@geopjr.dev> | 2022-12-21 16:30:37 +0200 |
commit | a979bd9214a622ef444a20e2023d37c268c43ea4 (patch) | |
tree | a1d7db920138a526b486480224e37a41aca01ccb | |
parent | 44073f6d1667ba1c723a6240b91ebacb3e72ee05 (diff) |
fix(tzdata): prepend to ZONE_SOURCES instead of substituting in place
-rw-r--r-- | pkgs/development/compilers/crystal/default.nix | 11 | ||||
-rw-r--r-- | pkgs/development/compilers/crystal/tzdata.patch | 12 |
2 files changed, 19 insertions, 4 deletions
diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index ef835ff69f0a3..e642e8ee7bc59 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -4,6 +4,7 @@ , fetchurl , fetchpatch , lib +, substituteAll # Dependencies , boehmgc , coreutils @@ -100,7 +101,12 @@ let inherit sha256; }; - patches = [ ] + patches = [ + (substituteAll { + src = ./tzdata.patch; + inherit tzdata; + }) + ] ++ lib.optionals (lib.versionOlder version "1.2.0") [ # add support for DWARF5 debuginfo, fixes builds on recent compilers # the PR is 8 commits from 2019, so just fetch the whole thing @@ -124,9 +130,6 @@ let substituteInPlace Makefile \ --replace 'docs: ## Generate standard library documentation' 'docs: crystal ## Generate standard library documentation' - substituteInPlace src/crystal/system/unix/time.cr \ - --replace /usr/share/zoneinfo ${tzdata}/share/zoneinfo - mkdir -p $TMP/crystal substituteInPlace spec/std/file_spec.cr \ diff --git a/pkgs/development/compilers/crystal/tzdata.patch b/pkgs/development/compilers/crystal/tzdata.patch new file mode 100644 index 0000000000000..b687336753ad9 --- /dev/null +++ b/pkgs/development/compilers/crystal/tzdata.patch @@ -0,0 +1,12 @@ +diff --git a/src/crystal/system/unix/time.cr b/src/crystal/system/unix/time.cr +index 333b66075..1c29a0e55 100644 +--- a/src/crystal/system/unix/time.cr ++++ b/src/crystal/system/unix/time.cr +@@ -43,6 +43,7 @@ module Crystal::System::Time + # Many systems use /usr/share/zoneinfo, Solaris 2 has + # /usr/share/lib/zoneinfo, IRIX 6 has /usr/lib/locale/TZ. + ZONE_SOURCES = { ++ "@tzdata@/share/zoneinfo/", + "/usr/share/zoneinfo/", + "/usr/share/lib/zoneinfo/", + "/usr/lib/locale/TZ/", |