1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-23 07:26:54 +00:00
nixpkgs/pkgs/development/tools/build-managers/ninja/setup-hook.sh
Lukas Werling f0a1ab78b4 meson/ninja: add setup hooks (#28444)
* Add setupHook for meson/ninja build

* libhttpseverywhere: Use meson/ninja setupHooks

* jamomacore: Remove superfluous ninja buildInput

* Remove obsolete ninja buildPhases

These are all handled by ninja's setup hook.

* lean2, xcbuild: fix build with ninja setup hook

Ninja is a runtime dependency here. However, cmake can generate Ninja
build files as well to satisfy the setup hook.

* qtwebengine: fix build with ninja setup hook
2017-08-27 19:42:21 +02:00

44 lines
1 KiB
Bash

ninjaBuildPhase() {
runHook preBuild
if [[ -z "$ninjaFlags" && ! ( -e build.ninja ) ]]; then
echo "no build.ninja, doing nothing"
else
# shellcheck disable=SC2086
local flagsArray=( \
${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
$ninjaFlags "${ninjaFlagsArray[@]}" \
$buildFlags "${buildFlagsArray[@]}")
echoCmd 'build flags' "${flagsArray[@]}"
ninja "${flagsArray[@]}"
unset flagsArray
fi
runHook postBuild
}
if [ -z "$dontUseNinjaBuild" -a -z "$buildPhase" ]; then
buildPhase=ninjaBuildPhase
fi
ninjaInstallPhase() {
runHook preInstall
installTargets="${installTargets:-install}"
# shellcheck disable=SC2086
local flagsArray=( $installTargets \
$ninjaFlags "${ninjaFlagsArray[@]}")
echoCmd 'install flags' "${flagsArray[@]}"
ninja "${flagsArray[@]}"
unset flagsArray
runHook postInstall
}
if [ -z "$dontUseNinjaInstall" -a -z "$installPhase" ]; then
installPhase=ninjaInstallPhase
fi