mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
8742c0cd2e
With `cargoRoot` set to a subdirectory of the source, where the Cargo.{lock,toml} are found, the final mv would previously fail, since the build results appear relative to cargoRoot, not to the original build directory.
37 lines
789 B
Bash
37 lines
789 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 ${cargoRoot:+$cargoRoot/}target/wheels/*.whl dist/
|
|
|
|
# These are python build hooks and may depend on ./dist
|
|
runHook postBuild
|
|
|
|
echo "Finished maturinBuildHook"
|
|
}
|
|
|
|
buildPhase=maturinBuildHook
|