2019-02-26 21:33:42 +01:00
|
|
|
termux_setup_rust() {
|
|
|
|
if [ $TERMUX_ARCH = "arm" ]; then
|
|
|
|
CARGO_TARGET_NAME=armv7-linux-androideabi
|
|
|
|
else
|
|
|
|
CARGO_TARGET_NAME=$TERMUX_ARCH-linux-android
|
|
|
|
fi
|
|
|
|
|
|
|
|
local ENV_NAME=CARGO_TARGET_${CARGO_TARGET_NAME^^}_LINKER
|
|
|
|
ENV_NAME=${ENV_NAME//-/_}
|
|
|
|
export $ENV_NAME=$CC
|
|
|
|
|
|
|
|
curl https://sh.rustup.rs -sSf > $TERMUX_PKG_TMPDIR/rustup.sh
|
2019-03-01 21:36:43 +01:00
|
|
|
sh $TERMUX_PKG_TMPDIR/rustup.sh -y --default-toolchain 1.32.0
|
2019-02-26 21:33:42 +01:00
|
|
|
export PATH=$HOME/.cargo/bin:$PATH
|
|
|
|
|
2019-03-10 23:33:24 +01:00
|
|
|
export RUSTFLAGS="-C link-arg=-Wl,-rpath=$TERMUX_PREFIX/lib -C link-arg=-Wl,--enable-new-dtags"
|
|
|
|
|
2019-02-26 21:33:42 +01:00
|
|
|
rustup target add $CARGO_TARGET_NAME
|
|
|
|
}
|