2021-02-11 19:17:06 +01:00
|
|
|
maturinBuildHook() {
|
|
|
|
echo "Executing maturinBuildHook"
|
|
|
|
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
if [ ! -z "${buildAndTestSubdir-}" ]; then
|
|
|
|
pushd "${buildAndTestSubdir}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
(
|
|
|
|
set -x
|
2023-08-06 05:21:02 +02:00
|
|
|
@setEnv@ maturin build \
|
2022-07-21 16:21:53 +02:00
|
|
|
--jobs=$NIX_BUILD_CORES \
|
|
|
|
--frozen \
|
2021-02-11 19:17:06 +01:00
|
|
|
--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
|
2023-12-07 04:46:06 +01:00
|
|
|
mv ${cargoRoot:+$cargoRoot/}target/wheels/*.whl dist/
|
2021-02-11 19:17:06 +01:00
|
|
|
|
2023-07-16 00:14:33 +02:00
|
|
|
# These are python build hooks and may depend on ./dist
|
|
|
|
runHook postBuild
|
|
|
|
|
2021-02-11 19:17:06 +01:00
|
|
|
echo "Finished maturinBuildHook"
|
|
|
|
}
|
|
|
|
|
|
|
|
buildPhase=maturinBuildHook
|