forked from fdo-rs/fido-device-onboard-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-vendored-tarfile.sh
executable file
·31 lines (24 loc) · 1.02 KB
/
make-vendored-tarfile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/bash
set -x
VER=${1:-$(git rev-parse HEAD)}
shift
PLATFORMS=$*
[ -n "$PLATFORMS" ] || PLATFORMS=$(echo {x86_64,aarch64,powerpc64le,s390x}-unknown-linux-gnu)
for PLATFORM in $PLATFORMS; do
ARGS+="--platform ${PLATFORM} "
done
# Clean vendor dir or the filterer will refuse to do the job
rm -rf vendor
# We need v0.5.7 because of RHEL rust version
cargo install --quiet [email protected]
# Use the official crate version
git apply patches/0001-Revert-chore-use-git-fork-for-aws-nitro-enclaves-cos.patch
# Filter the vendor files for the given platforms
cargo vendor-filterer ${ARGS}
# Reapply the crate patch so cargo build keeps working
git apply -R patches/0001-Revert-chore-use-git-fork-for-aws-nitro-enclaves-cos.patch
# Patch the official crate so the build works.
git apply patches/0002-fix-aws-nitro-enclaves-cose.patch
tar cJf "fido-device-onboard-rs-${VER}-vendor-patched.tar.xz" vendor/
# Remove previous patch and leave the official crate as it was.
git apply -R patches/0002-fix-aws-nitro-enclaves-cose.patch