nixpkgs/pkgs/build-support/rust/hooks/maturin-build-hook.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
789 B
Bash
Raw Normal View History

maturinBuildHook() {
echo "Executing maturinBuildHook"
runHook preBuild
if [ ! -z "${buildAndTestSubdir-}" ]; then
pushd "${buildAndTestSubdir}"
fi
(
set -x
@setEnv@ maturin build \
2022-07-21 16:21:53 +02:00
--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 ${cargoRoot:+$cargoRoot/}target/wheels/*.whl dist/
# These are python build hooks and may depend on ./dist
runHook postBuild
echo "Finished maturinBuildHook"
}
buildPhase=maturinBuildHook