From 314b03125f348a2970b86dcf77d9dc8039c7a981 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 6 Jan 2023 01:48:11 +0200 Subject: [PATCH] stdenv: don't fail installPhase on missing makefile otherwise the build just fails with 'make: *** No rule to make target 'install'. Stop.' and update buildPhase message i don't know if the 'makefile may have been created in buildPhase' is true but i guess it might be possible --- pkgs/stdenv/generic/setup.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index b07420bb4185..d37fc029cfed 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1253,7 +1253,7 @@ buildPhase() { runHook preBuild if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile, doing nothing" + echo "no Makefile or custom buildPhase, doing nothing" else foundMakefile=1 @@ -1323,6 +1323,15 @@ checkPhase() { installPhase() { runHook preInstall + # Dont reuse 'foundMakefile' set in buildPhase, a makefile may have been created in buildPhase + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing" + runHook postInstall + return + else + foundMakefile=1 + fi + if [ -n "$prefix" ]; then mkdir -p "$prefix" fi