2020-04-24 23:36:52 +00:00
|
|
|
# Setup hook for setuptools.
|
|
|
|
echo "Sourcing setuptools-build-hook"
|
|
|
|
|
|
|
|
setuptoolsBuildPhase() {
|
|
|
|
echo "Executing setuptoolsBuildPhase"
|
2024-04-21 15:54:59 +00:00
|
|
|
local args setuptools_has_parallel=@setuptools_has_parallel@
|
2020-04-24 23:36:52 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
cp -f @setuppy@ nix_run_setup
|
|
|
|
args=""
|
|
|
|
if [ -n "$setupPyGlobalFlags" ]; then
|
|
|
|
args+="$setupPyGlobalFlags"
|
|
|
|
fi
|
2022-04-27 09:35:20 +00:00
|
|
|
if [ -n "$enableParallelBuilding" ]; then
|
2024-04-21 15:54:59 +00:00
|
|
|
if [ -n "$setuptools_has_parallel" ]; then
|
|
|
|
setupPyBuildFlags+=" --parallel $NIX_BUILD_CORES"
|
|
|
|
fi
|
2022-04-27 09:35:20 +00:00
|
|
|
fi
|
2020-04-24 23:36:52 +00:00
|
|
|
if [ -n "$setupPyBuildFlags" ]; then
|
2022-05-18 14:49:53 +00:00
|
|
|
args+=" build_ext $setupPyBuildFlags"
|
2020-04-24 23:36:52 +00:00
|
|
|
fi
|
|
|
|
eval "@pythonInterpreter@ nix_run_setup $args bdist_wheel"
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
echo "Finished executing setuptoolsBuildPhase"
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -z "${dontUseSetuptoolsBuild-}" ] && [ -z "${buildPhase-}" ]; then
|
|
|
|
echo "Using setuptoolsBuildPhase"
|
|
|
|
buildPhase=setuptoolsBuildPhase
|
|
|
|
fi
|