haskell.compiler.ghc94*: backport Cabal bugfix for Paths_ modules

There is a code generation bug in Cabal-3.6.3.0. For packages configured with
--enable-relocatable, Cabal would generate code that doesn't compile.

There isn't an upstream issue, but the issue is described in the commit that
fixed it:
6c796218c9

It was fixed in Cabal-3.8.*
Backport the fix to the Cabal library that ships with ghc-9.4.4

Cabal 3.8 ships with ghc-9.6, so when 9.6 is released this fix shouldn't be
necessary.
This commit is contained in:
Kyle Butt 2023-02-23 09:58:41 -07:00 committed by sternenseemann
parent 6a4dc401ab
commit 9ace1d895c

View File

@ -189,6 +189,16 @@ stdenv.mkDerivation (rec {
outputs = [ "out" "doc" ];
patches = [
# Don't generate code that doesn't compile when --enable-relocatable is passed to Setup.hs
# Can be removed if the Cabal library included with ghc backports the linked fix
(fetchpatch {
url = "https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98.patch";
stripLen = 1;
extraPrefix = "libraries/Cabal/";
sha256 = "sha256-yRQ6YmMiwBwiYseC5BsrEtDgFbWvst+maGgDtdD0vAY=";
})
];
postPatch = "patchShebangs .";