-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sh
executable file
·31 lines (27 loc) · 1.36 KB
/
build.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/sh
#
# Builds cargo using bootstrap.py
VERSION="master"
TARGET="x86_64-unknown-linux-gnu"
BLACKLIST="winapi winapi-build advapi32-sys kernel32-sys"
OPTS="miniz-sys"
rootpath="$(pwd)"
buildpath="build"
cachepath="$rootpath/cache"
if [ "x$1" = "xcompile" ]; then
cd "$rootpath/$buildpath/cargo" || exit
"$rootpath/bootstrap.py" --crate-index "$rootpath/build/crates.io-index" --target-dir "$rootpath/build/out" --no-clone --no-clean --target "$TARGET" --blacklist "$BLACKLIST" --include-optional "$OPTS"
exit
fi
echo "clearing $buildpath directory..."
[ -d "$buildpath" ] && rm --preserve-root -r -- "$buildpath"
mkdir -p "$buildpath/out"
mkdir -p "$cachepath"
cd "$rootpath/$buildpath" || exit
git clone [email protected]:rust-lang/crates.io-index
git clone [email protected]:rust-lang/cargo
cd "$rootpath/$buildpath/cargo" || exit
git checkout "$VERSION"
"$rootpath/bootstrap.py" --crate-index "$rootpath/build/crates.io-index" --target-dir "$rootpath/build/out" --no-clone --no-clean --urls-file "$rootpath/build/urls.txt" --target "$TARGET" --blacklist "$BLACKLIST" --include-optional "$OPTS" --patchdir "$rootpath/patches" --download --crate-cache "$cachepath"
[ $? ] || exit
"$rootpath/bootstrap.py" --crate-index "$rootpath/build/crates.io-index" --target-dir "$rootpath/build/out" --no-clone --no-clean --target "$TARGET" --blacklist "$BLACKLIST" --include-optional "$OPTS"