stdenv/setup.sh: don't skip post-hooks (close #12032)

So far if no configure script is found or no makefile,
the rest of the phase is skipped, *including* post-hooks.
I find that behavior unexpected/unintuitive.

Earlier version of this patch had problems due to me assuming
that $configureScript is always a simple path, but that turned out
to be false in many cases, e.g. perl.

+16 -17
+16 -17
pkgs/stdenv/generic/setup.sh
··· 612 configurePhase() { 613 runHook preConfigure 614 615 - if [ -z "$configureScript" ]; then 616 configureScript=./configure 617 - if ! [ -x $configureScript ]; then 618 - echo "no configure script, doing nothing" 619 - return 620 - fi 621 fi 622 623 if [ -z "$dontFixLibtool" ]; then ··· 645 fi 646 fi 647 648 - echo "configure flags: $configureFlags ${configureFlagsArray[@]}" 649 - $configureScript $configureFlags "${configureFlagsArray[@]}" 650 651 runHook postConfigure 652 } ··· 657 658 if [ -z "$makeFlags" ] && ! [ -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile" ]; then 659 echo "no Makefile, doing nothing" 660 - return 661 - fi 662 663 - # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409 664 - makeFlags="SHELL=$SHELL $makeFlags" 665 - 666 - echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}" 667 - make ${makefile:+-f $makefile} \ 668 - ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \ 669 - $makeFlags "${makeFlagsArray[@]}" \ 670 - $buildFlags "${buildFlagsArray[@]}" 671 672 runHook postBuild 673 }
··· 612 configurePhase() { 613 runHook preConfigure 614 615 + if [ -z "$configureScript" -a -x ./configure ]; then 616 configureScript=./configure 617 fi 618 619 if [ -z "$dontFixLibtool" ]; then ··· 641 fi 642 fi 643 644 + if [ -n "$configureScript" ]; then 645 + echo "configure flags: $configureFlags ${configureFlagsArray[@]}" 646 + $configureScript $configureFlags "${configureFlagsArray[@]}" 647 + else 648 + echo "no configure script, doing nothing" 649 + fi 650 651 runHook postConfigure 652 } ··· 657 658 if [ -z "$makeFlags" ] && ! [ -n "$makefile" -o -e "Makefile" -o -e "makefile" -o -e "GNUmakefile" ]; then 659 echo "no Makefile, doing nothing" 660 + else 661 + # See https://github.com/NixOS/nixpkgs/pull/1354#issuecomment-31260409 662 + makeFlags="SHELL=$SHELL $makeFlags" 663 664 + echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}" 665 + make ${makefile:+-f $makefile} \ 666 + ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \ 667 + $makeFlags "${makeFlagsArray[@]}" \ 668 + $buildFlags "${buildFlagsArray[@]}" 669 + fi 670 671 runHook postBuild 672 }