From dc594280fd18dc5f0f2be1039e2375711327f8a3 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Thu, 18 Aug 2022 14:43:13 +0200 Subject: [PATCH] haskell-language-server: fix with ghc-lib >= 9.0 and ghc <= 8.10.7 This cherry-picks the relevant changes from https://github.com/haskell/haskell-language-server/pull/2854 into the 8.10.x version of hls-hlint-plugin, as suggested in https://github.com/NixOS/nixpkgs/issues/168064#issuecomment-1146691884 Co-Authored-By: Florian Klink --- .../haskell-modules/configuration-ghc-8.10.x.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix index d0eb90da4b7d3..b9dfb671ef870 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix @@ -92,13 +92,15 @@ self: super: { mime-string = disableOptimization super.mime-string; # Older compilers need the latest ghc-lib to build this package. - hls-hlint-plugin = addBuildDepend self.ghc-lib (overrideCabal (drv: { - # Workaround for https://github.com/haskell/haskell-language-server/issues/2728 - postPatch = '' - sed -i 's/(GHC.RealSrcSpan x,/(GHC.RealSrcSpan x Nothing,/' src/Ide/Plugin/Hlint.hs - ''; - }) - super.hls-hlint-plugin); + # Fix build with ghc-lib >= 9.0 and ghc <= 8.10.7 + # https://github.com/haskell/haskell-language-server/issues/2728 + hls-hlint-plugin = addBuildDepend self.ghc-lib (appendPatch (pkgs.fetchpatch { + name = "hls-hlint-plugin-workaround.patch"; + url = "https://github.com/haskell/haskell-language-server/pull/2854.patch"; + hash = "sha256-bLGu0OQtXsmMF3rZM+R6k7bsZm4Vgf2r0ert5Wunong="; + stripLen = 2; + includes = ["src/Ide/Plugin/Hlint.hs"]; + }) super.hls-hlint-plugin); haskell-language-server = appendConfigureFlags [ "-f-stylishhaskell"