gn: run hooks in build phases

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
This commit is contained in:
Marcin Serwin
2025-08-09 08:52:24 +02:00
parent ec54698151
commit d66400cd89
+12
View File
@@ -43,6 +43,8 @@ stdenv.mkDerivation {
hardeningDisable = [ "format" ];
configurePhase = ''
runHook preConfigure
python build/gen.py --no-last-commit-position
cat > out/last_commit_position.h << EOF
#ifndef OUT_LAST_COMMIT_POSITION_H_
@@ -53,14 +55,24 @@ stdenv.mkDerivation {
#endif // OUT_LAST_COMMIT_POSITION_H_
EOF
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
ninja -j $NIX_BUILD_CORES -C out gn
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -vD out/gn "$out/bin/gn"
runHook postInstall
'';
setupHook = ./setup-hook.sh;