67a4f828b4
Currently there is a state of severe confusion in pkgs/build-support/rust/hooks/ regarding host vs target; right now there is only "host" defined, but whether it means "host" or "target" seems to fluctuate. This commit corrects that, ensuring that all variables come in all three flavors (build, host, target) and are used consistently with the nixpkgs convention. This also fixes the cross-compilation of packages which use `maturinBuildHook` -- hooks go in `nativeBuildInputs` and are phase-shifted backwards by one platform, so they need to be careful about distinguishing between build and host. Closes #247441
36 lines
764 B
Bash
36 lines
764 B
Bash
maturinBuildHook() {
|
|
echo "Executing maturinBuildHook"
|
|
|
|
runHook preBuild
|
|
|
|
if [ ! -z "${buildAndTestSubdir-}" ]; then
|
|
pushd "${buildAndTestSubdir}"
|
|
fi
|
|
|
|
(
|
|
set -x
|
|
@setEnv@ maturin build \
|
|
--jobs=$NIX_BUILD_CORES \
|
|
--frozen \
|
|
--target @rustTargetPlatformSpec@ \
|
|
--manylinux off \
|
|
--strip \
|
|
--release \
|
|
${maturinBuildFlags-}
|
|
)
|
|
|
|
if [ ! -z "${buildAndTestSubdir-}" ]; then
|
|
popd
|
|
fi
|
|
|
|
# Move the wheel to dist/ so that regular Python tooling can find it.
|
|
mkdir -p dist
|
|
mv target/wheels/*.whl dist/
|
|
|
|
# These are python build hooks and may depend on ./dist
|
|
runHook postBuild
|
|
|
|
echo "Finished maturinBuildHook"
|
|
}
|
|
|
|
buildPhase=maturinBuildHook
|