@@ -30,7 +30,7 @@ let self =
30
30
( haskellLib . isTest componentId &&
31
31
lib . any ( x : x . identifier . name or "" == "cabal-doctest" ) package . setup-depends
32
32
)
33
- , allComponent # Used when `configureAllComponents` is set to get a suitable configuration.
33
+ , allComponent # Used when `configureAllComponents` is set to get a suitable configuration.
34
34
35
35
, build-tools ? component . build-tools
36
36
, pkgconfig ? component . pkgconfig
259
259
( lib . optionalString ( cleanSrc . subDir != "" ) ''
260
260
cd ${ lib . removePrefix "/" cleanSrc . subDir }
261
261
''
262
- ) +
262
+ ) +
263
263
( if cabalFile != null
264
264
then ''cat ${ cabalFile } > ${ package . identifier . name } .cabal''
265
265
else
@@ -485,19 +485,21 @@ let
485
485
# DB (probably empty unless this is a library component).
486
486
# We also have to remove any refernces to $out to avoid
487
487
# circular references.
488
- if configureAllComponents
489
- then ''
490
- mv dist dist-tmp-dir
491
- mkdir -p dist/build
488
+ lib . optionalString ( configureAllComponents || keepSource ) ''
489
+ mv dist dist-tmp-dir
490
+ mkdir -p dist/build
491
+ if [ -d dist-tmp-dir /build/ ${ componentId . cname } ]; then
492
492
mv dist-tmp-dir/build/${ componentId . cname } /autogen dist/build/
493
- mv dist-tmp-dir/package.conf.inplace dist/
494
- remove-references-to -t $out dist/build/autogen/*
495
- rm -rf dist-tmp-dir
496
- ''
497
- else lib . optionalString keepSource ''
498
- rm -rf dist
499
- ''
500
- ) + ( lib . optionalString ( haskellLib . isTest componentId ) ''
493
+ else
494
+ mv dist-tmp-dir/build/autogen dist/build/
495
+ fi
496
+ mv dist-tmp-dir/package.conf.inplace dist/
497
+ remove-references-to -t $out dist/build/autogen/*
498
+ rm -rf dist-tmp-dir
499
+ ''
500
+ ) + ( lib . optionalString ( keepSource && haskellLib . isLibrary componentId ) ''
501
+ remove-references-to -t $out ${ name } .conf
502
+ '' ) + ( lib . optionalString ( haskellLib . isTest componentId ) ''
501
503
echo The test ${ package . identifier . name } .components.tests.${ componentId . cname } was built. To run the test build ${ package . identifier . name } .checks.${ componentId . cname } .
502
504
'' ) ;
503
505
0 commit comments