File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -461,12 +461,28 @@ let
461
461
in ''
462
462
runHook preInstall
463
463
${ # `Setup copy` does not install tests and benchmarks.
464
- lib . optionalString ( ! haskellLib . isTest componentId && ! haskellLib . isBenchmark componentId ) ''
465
- $SETUP_HS copy ${ lib . concatStringsSep " " (
466
- setupInstallFlags
467
- ++ lib . optional configureAllComponents
468
- ( haskellLib . componentTarget componentId )
469
- ) } ''}
464
+ if ! haskellLib . isTest componentId && ! haskellLib . isBenchmark componentId
465
+ then ''
466
+ $SETUP_HS copy ${ lib . concatStringsSep " " (
467
+ setupInstallFlags
468
+ ++ lib . optional configureAllComponents
469
+ ( haskellLib . componentTarget componentId )
470
+ ) } ''
471
+ else
472
+ # However if there are exes or libraries it does copy the datadir.
473
+ # So run it, but expect it might complain there was nothing to do.
474
+ ''
475
+ SETUP_OUTPUT=$(mktemp)
476
+ if $SETUP_HS copy ${ lib . concatStringsSep " " (
477
+ setupInstallFlags
478
+ ++ lib . optional configureAllComponents
479
+ ( haskellLib . componentTarget componentId )
480
+ ) } 2>&1 | tee $SETUP_OUTPUT; then
481
+ echo Setup copy success
482
+ else
483
+ cat $SETUP_OUTPUT | grep 'Error: Setup: No executables and no library found\. Nothing to do\.'
484
+ fi
485
+ '' }
470
486
${ lib . optionalString ( haskellLib . isLibrary componentId ) ''
471
487
$SETUP_HS register --gen-pkg-config=${ name } .conf
472
488
${ ghc . targetPrefix } ghc-pkg -v0 init $out/package.conf.d
You can’t perform that action at this time.
0 commit comments