depot/third_party/nixpkgs/pkgs/build-support/rust/hooks/maturin-build-hook.sh
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

36 lines
764 B
Bash

maturinBuildHook() {
echo "Executing maturinBuildHook"
runHook preBuild
# Put the wheel to dist/ so that regular Python tooling can find it.
local dist="$PWD/dist"
if [ ! -z "${buildAndTestSubdir-}" ]; then
pushd "${buildAndTestSubdir}"
fi
(
set -x
@setEnv@ maturin build \
--jobs=$NIX_BUILD_CORES \
--offline \
--target @rustTargetPlatformSpec@ \
--manylinux off \
--strip \
--release \
--out "$dist" \
${maturinBuildFlags-}
)
if [ ! -z "${buildAndTestSubdir-}" ]; then
popd
fi
# These are python build hooks and may depend on ./dist
runHook postBuild
echo "Finished maturinBuildHook"
}
buildPhase=maturinBuildHook