diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index c535e9068ed8..986cbc005bcd 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2177,4 +2177,10 @@ self: super: { ''; }) super.linear-base; + # Fixes compilation with GHC 9.0 and above + # https://hub.darcs.net/shelarcy/regex-compat-tdfa/issue/3 + regex-compat-tdfa = appendPatches [ + ./patches/regex-compat-tdfa-ghc-9.0.patch + ] super.regex-compat-tdfa; + } // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super diff --git a/pkgs/development/haskell-modules/patches/regex-compat-tdfa-ghc-9.0.patch b/pkgs/development/haskell-modules/patches/regex-compat-tdfa-ghc-9.0.patch new file mode 100644 index 000000000000..db2ca02b9d49 --- /dev/null +++ b/pkgs/development/haskell-modules/patches/regex-compat-tdfa-ghc-9.0.patch @@ -0,0 +1,19 @@ +diff -rN -u old-regex-compat-tdfa/Text/Regex.hs new-regex-compat-tdfa/Text/Regex.hs +--- old-regex-compat-tdfa/Text/Regex.hs 2022-02-20 13:42:36.828752458 +0100 ++++ new-regex-compat-tdfa/Text/Regex.hs 2022-02-20 13:42:36.828752458 +0100 +@@ -139,7 +139,7 @@ + splitRegex :: Regex -> String -> [String] + splitRegex _ [] = [] + splitRegex delim strIn = +- let matches = map (!0) (matchAll delim strIn) ++ let matches = map (! 0) (matchAll delim strIn) + go _i str [] = str : [] + go i str ((off,len):rest) = + let i' = off+len +@@ -194,4 +194,4 @@ + then [firstline,""] + else firstline : loop remainder + +--} +\ No newline at end of file ++-}