3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #218472 from figsoda/cargo-setup

This commit is contained in:
figsoda 2023-03-03 19:40:55 -05:00 committed by GitHub
commit eedbf71d0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,13 @@ cargoSetupPostUnpackHook() {
# it writable. If we're using a tarball, the unpackFile hook already handles
# this for us automatically.
if [ -z $cargoVendorDir ]; then
unpackFile "$cargoDeps"
if [ -d "$cargoDeps" ]; then
local dest=$(stripHash "$cargoDeps")
cp -Lr --reflink=auto -- "$cargoDeps" "$dest"
chmod -R +644 -- "$dest"
else
unpackFile "$cargoDeps"
fi
export cargoDepsCopy="$(realpath "$(stripHash $cargoDeps)")"
else
cargoDepsCopy="$(realpath "$(pwd)/$sourceRoot/${cargoRoot:+$cargoRoot/}${cargoVendorDir}")"