mirror of
https://github.com/Phantop/appdwarf.git
synced 2024-11-10 00:46:30 +00:00
23 lines
510 B
Bash
Executable file
23 lines
510 B
Bash
Executable file
#!/bin/bash
|
|
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH
|
|
DIR=/tmp/appdwarf
|
|
mkdir -p $DIR
|
|
LINK=https://static.rust-lang.org/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.gz
|
|
curl -L $LINK | tar xz -C$DIR
|
|
|
|
mkdir $DIR/rust
|
|
cp -r $DIR/rust*/{cargo,rustc,rust-std*}/* $DIR/rust
|
|
|
|
cat > $DIR/rust/AppRun << 'EOF'
|
|
#!/bin/sh
|
|
HERE=$(dirname $(readlink -f "${0}"))
|
|
export PATH="${HERE}/bin":$PATH
|
|
"${HERE}"/bin/$APPDWARF_CMD $@
|
|
EOF
|
|
|
|
chmod +x $DIR/rust/AppRun
|
|
|
|
appdwarf $DIR/rust
|
|
mv $DIR/rust.sh cargo
|
|
rm -rf $DIR/rust*
|