Move intermediates under share/haskell

This commit is contained in:
Rebecca Turner 2023-04-28 09:38:32 -07:00
parent 77b857ffc9
commit 1535bd0c58
No known key found for this signature in database

View file

@ -314,6 +314,8 @@ let
continue continue
fi fi
''; '';
intermediatesDir = "share/haskell/${ghc.version}/${pname}-${version}/dist";
in lib.fix (drv: in lib.fix (drv:
assert allPkgconfigDepends != [] -> pkg-config != null; assert allPkgconfigDepends != [] -> pkg-config != null;
@ -495,7 +497,7 @@ stdenv.mkDerivation ({
'' ''
mkdir -p dist; mkdir -p dist;
rm -r dist/build rm -r dist/build
cp -r ${previousIntermediates}/dist/build dist/build cp -r ${previousIntermediates}/${intermediatesDir}/build dist/build
find dist/build -exec chmod u+w {} + find dist/build -exec chmod u+w {} +
find dist/build -exec touch -d '1970-01-01T00:00:00Z' {} + find dist/build -exec touch -d '1970-01-01T00:00:00Z' {} +
'' ''
@ -587,9 +589,10 @@ stdenv.mkDerivation ({
${if doInstallIntermediates then "installIntermediatesPhase" else null} = '' ${if doInstallIntermediates then "installIntermediatesPhase" else null} = ''
runHook preInstallIntermediates runHook preInstallIntermediates
installIntermediatesDir=${if enableSeparateIntermediatesOutput then "$intermediates" else "$out"} intermediatesOutput=${if enableSeparateIntermediatesOutput then "$intermediates" else "$out"}
mkdir -p $installIntermediatesDir/dist installIntermediatesDir="$intermediatesOutput/${intermediatesDir}"
cp -r dist/build $installIntermediatesDir/dist mkdir -p "$installIntermediatesDir"
cp -r dist/build "$installIntermediatesDir"
runHook postInstallIntermediates runHook postInstallIntermediates
''; '';