From 4db2830d07a774a4ca460ac94c723573618cf378 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 26 Sep 2021 20:27:25 +0200 Subject: [PATCH] haskellPackages.tz: fix tests for non-glibc platforms tz's test suite (luckily only the test suite, it seems) relies on some non-POSIX behavior of glibc which was easy enough to patch. --- .../haskell-modules/configuration-nix.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index f87aee89d453..d7f64e0ce04c 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -212,7 +212,19 @@ self: super: builtins.intersectAttrs super { mime-mail = appendConfigureFlag super.mime-mail "--ghc-option=-DMIME_MAIL_SENDMAIL_PATH=\"sendmail\""; # Help the test suite find system timezone data. - tz = overrideCabal super.tz (drv: { preConfigure = "export TZDIR=${pkgs.tzdata}/share/zoneinfo"; }); + tz = overrideCabal super.tz (drv: { + preConfigure = "export TZDIR=${pkgs.tzdata}/share/zoneinfo"; + patches = [ + # Fix tests failing with libSystem, musl etc. due to a lack of + # support for glibc's non-POSIX TZDIR environment variable. + # https://github.com/nilcons/haskell-tz/pull/29 + (pkgs.fetchpatch { + name = "support-non-glibc-tzset.patch"; + url = "https://github.com/sternenseemann/haskell-tz/commit/64928f1a50a1a276a718491ae3eeef63abcdb393.patch"; + sha256 = "1f53w8k1vpy39hzalyykpvm946ykkarj2714w988jdp4c2c4l4cf"; + }) + ] ++ (drv.patches or []); + }); # Nix-specific workaround xmonad = appendPatch (dontCheck super.xmonad) ./patches/xmonad-nix.patch;