diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index ef835ff69f0a..e642e8ee7bc5 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 000000000000..b687336753ad --- /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/",