-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure
executable file
·41 lines (38 loc) · 1.38 KB
/
configure
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
35
36
37
38
39
40
41
#!/bin/sh
# mimics: source ~/.cargo/env
export PATH="$HOME/.cargo/bin:$PATH"
# On Debian, cargo and rustc are sometimes different
VERSION=$(rustc --version)
if [ $? -eq 0 ]; then
echo "Using `which cargo`"
echo "Rustc version: $VERSION"
# Check for old version of rustc (edition:2021 requires rust 1.56)
VERNUM=$(echo $VERSION | cut -d' ' -f2) || true
MAJOR=$(echo $VERNUM | cut -d'.' -f1) || true
MINOR=$(echo $VERNUM | cut -d'.' -f2) || true
if [ "$MAJOR" -eq "1" ] && [ "$MINOR" -lt "56" ]; then
echo "Found old rust. Using legacy gifski 1.4.3 build."
rm -f src/myrustlib/vendor.tar.xz
cp -f src/old-1.4.3/* src/myrustlib/
elif [ "$MAJOR" -eq "1" ] && [ "$MINOR" -lt "74" ]; then
echo "Found old rust. Using legacy gifski 1.6.6 build."
rm -f src/myrustlib/vendor.tar.xz
cp -f src/old-1.6.6/* src/myrustlib/
./cleanup || true
fi
exit 0
fi
# Try local version on MacOS, otherwise error
echo "------------------ RUST COMPILER NOT FOUND --------------------"
echo ""
echo "Cargo was not found on the PATH. Please install cargo / rustc:"
echo ""
echo " - yum install cargo (Fedora/CentOS)"
echo " - apt-get install cargo (Debian/Ubuntu)"
echo " - brew install rust (MacOS)"
echo ""
echo "Alternatively install Rust from: <https://www.rust-lang.org>"
echo ""
echo "---------------------------------------------------------------"
echo ""
exit 1