diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index 055e6c40c784..372a9417906a 100644 --- a/pkgs/development/haskell-modules/lib/compose.nix +++ b/pkgs/development/haskell-modules/lib/compose.nix @@ -482,10 +482,11 @@ rec { overrideCabal (drv: { src = "${sdistTarball pkg}/${pkg.pname}-${pkg.version}.tar.gz"; - # Revising and jailbreaking the cabal file has been handled in sdistTarball + # Revising, jailbreaking and patches have been handled in sdistTarball revision = null; editedCabalFile = null; jailbreak = false; + patches = [ ]; }) pkg; /* diff --git a/pkgs/test/haskell/cabalSdist/default.nix b/pkgs/test/haskell/cabalSdist/default.nix index 1da18146b9d6..05d22e485e12 100644 --- a/pkgs/test/haskell/cabalSdist/default.nix +++ b/pkgs/test/haskell/cabalSdist/default.nix @@ -57,4 +57,17 @@ lib.recurseIntoAttrs rec { ${lib.getExe localPatchedFromCabalSdist} | grep "Patched" >/dev/null touch $out ''; + + # Test that buildFromSdist (non-cabal-install variant) also respects patches. + localPatchedFromSdist = haskell.lib.buildFromSdist localPatched; + + patchRespectedSdist = + runCommand "patchRespectedSdist" + { + nativeBuildInputs = [ localPatchedFromSdist ]; + } + '' + ${lib.getExe localPatchedFromSdist} | grep "Patched" >/dev/null + touch $out + ''; }