mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
haskell.lib.buildFromSdist: add test, fix double-patch
Same issue as buildFromCabalSdist: sdistTarball applies patches via overrideDerivation, but the patches attribute remained, causing patchPhase to apply them again.
This commit is contained in:
@@ -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;
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user