uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
54
pkgs/build-support/rust/hooks/cargo-build-hook.sh
Normal file
54
pkgs/build-support/rust/hooks/cargo-build-hook.sh
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
declare -a cargoBuildFlags
|
||||
|
||||
cargoBuildHook() {
|
||||
echo "Executing cargoBuildHook"
|
||||
|
||||
runHook preBuild
|
||||
|
||||
if [ ! -z "${buildAndTestSubdir-}" ]; then
|
||||
# ensure the output doesn't end up in the subdirectory
|
||||
export CARGO_TARGET_DIR="$(pwd)/target"
|
||||
|
||||
pushd "${buildAndTestSubdir}"
|
||||
fi
|
||||
|
||||
if [ "${cargoBuildType}" != "debug" ]; then
|
||||
cargoBuildProfileFlag="--${cargoBuildType}"
|
||||
fi
|
||||
|
||||
if [ -n "${cargoBuildNoDefaultFeatures-}" ]; then
|
||||
cargoBuildNoDefaultFeaturesFlag=--no-default-features
|
||||
fi
|
||||
|
||||
if [ -n "${cargoBuildFeatures-}" ]; then
|
||||
cargoBuildFeaturesFlag="--features=${cargoBuildFeatures// /,}"
|
||||
fi
|
||||
|
||||
(
|
||||
set -x
|
||||
env \
|
||||
"CC_@rustBuildPlatform@=@ccForBuild@" \
|
||||
"CXX_@rustBuildPlatform@=@cxxForBuild@" \
|
||||
"CC_@rustTargetPlatform@=@ccForHost@" \
|
||||
"CXX_@rustTargetPlatform@=@cxxForHost@" \
|
||||
cargo build -j $NIX_BUILD_CORES \
|
||||
--target @rustTargetPlatformSpec@ \
|
||||
--frozen \
|
||||
${cargoBuildProfileFlag} \
|
||||
${cargoBuildNoDefaultFeaturesFlag} \
|
||||
${cargoBuildFeaturesFlag} \
|
||||
${cargoBuildFlags}
|
||||
)
|
||||
|
||||
if [ ! -z "${buildAndTestSubdir-}" ]; then
|
||||
popd
|
||||
fi
|
||||
|
||||
runHook postBuild
|
||||
|
||||
echo "Finished cargoBuildHook"
|
||||
}
|
||||
|
||||
if [ -z "${dontCargoBuild-}" ] && [ -z "${buildPhase-}" ]; then
|
||||
buildPhase=cargoBuildHook
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue