rust: move releaseDir to target/release in the buildPhase
This commit is contained in:
parent
912dca193a
commit
60761e65ba
@ -89,7 +89,9 @@ in stdenv.mkDerivation (args // {
|
|||||||
|
|
||||||
buildPhase = with builtins; args.buildPhase or ''
|
buildPhase = with builtins; args.buildPhase or ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
echo "Running cargo build --target ${stdenv.hostPlatform.config} --release ${concatStringsSep " " cargoBuildFlags}"
|
|
||||||
|
(
|
||||||
|
set -x
|
||||||
env \
|
env \
|
||||||
"CC_${stdenv.buildPlatform.config}"="${ccForBuild}" \
|
"CC_${stdenv.buildPlatform.config}"="${ccForBuild}" \
|
||||||
"CXX_${stdenv.buildPlatform.config}"="${cxxForBuild}" \
|
"CXX_${stdenv.buildPlatform.config}"="${cxxForBuild}" \
|
||||||
@ -99,6 +101,15 @@ in stdenv.mkDerivation (args // {
|
|||||||
--release \
|
--release \
|
||||||
--target ${stdenv.hostPlatform.config} \
|
--target ${stdenv.hostPlatform.config} \
|
||||||
--frozen ${concatStringsSep " " cargoBuildFlags}
|
--frozen ${concatStringsSep " " cargoBuildFlags}
|
||||||
|
)
|
||||||
|
|
||||||
|
# rename the output dir to a architecture independent one
|
||||||
|
mapfile -t targets < <(find "$NIX_BUILD_TOP" -type d | grep '${releaseDir}$')
|
||||||
|
for target in "''${targets[@]}"; do
|
||||||
|
rm -rf "$target/../../release"
|
||||||
|
ln -srf "$target" "$target/../../"
|
||||||
|
done
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user