2021-12-27 05:06:19 +03:00
|
|
|
copyCargoTargetToOutput() {
|
|
|
|
echo "Executing copyCargoTargetToOutput"
|
|
|
|
|
2021-12-29 02:15:10 +03:00
|
|
|
export SOURCE_DATE_EPOCH=1
|
|
|
|
mkdir -p "${target}"
|
|
|
|
|
2021-12-27 07:25:36 +03:00
|
|
|
# See: https://reproducible-builds.org/docs/archives/
|
|
|
|
tar --sort=name \
|
|
|
|
--mtime="@${SOURCE_DATE_EPOCH}" \
|
|
|
|
--owner=0 --group=0 --numeric-owner \
|
|
|
|
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
|
2021-12-31 07:25:33 +03:00
|
|
|
-c "${CARGO_TARGET_DIR:-target}" | @zstd@ -o "${target}/target.tar.zst"
|
2021-12-27 05:06:19 +03:00
|
|
|
}
|
|
|
|
|
2021-12-29 05:53:05 +03:00
|
|
|
if [ "1" = "${doCopyTargetToOutput-}" ]; then
|
|
|
|
postInstallHooks+=(copyCargoTargetToOutput)
|
|
|
|
fi
|