haskellPackages.mkDerivation: convert .cabal file after prePatch

cabal2nix emits prePatch = "hpack" for packages that need it, so the
.cabal file may not exist before prePatch.
This commit is contained in:
sternenseemann
2025-09-28 21:10:07 +02:00
parent d9757d4fe3
commit bcab0af638
@@ -606,10 +606,13 @@ lib.fix (
echo "Replace Cabal file with edited version from ${newCabalFileUrl}."
cp ${newCabalFile} ${pname}.cabal
''
+ prePatch
+ "\n"
# cabal2nix-generated expressions run hpack not until prePatch to create
# the .cabal file (if necessary)
+ lib.optionalString (!dontConvertCabalFileToUnix) ''
sed -i -e 's/\r$//' *.cabal
''
+ prePatch;
'';
postPatch =
optionalString jailbreak ''