-
Notifications
You must be signed in to change notification settings - Fork 34
/
make-vendored-tarfile.sh
executable file
·34 lines (26 loc) · 1.11 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
32
33
34
#! /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
# https://issues.redhat.com/browse/RHEL-65521
ARGS+="--exclude-crate-path idna#tests"
# 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