2021-05-15 21:50:14 +00:00
|
|
|
#!/bin/bash
|
2021-12-31 19:37:50 +00:00
|
|
|
PATH=$(dirname $(readlink -f "${0}"))/..:$PATH
|
2021-05-15 21:50:14 +00:00
|
|
|
DIR=/tmp/dwarf-portable-executable
|
|
|
|
mkdir -p $DIR
|
2021-12-31 19:37:50 +00:00
|
|
|
LINK=$(curl -sL https://golang.org/dl | grep -wo dl/go.\*linux-amd64.tar.gz | head -n1)
|
|
|
|
curl -L https://golang.org/$LINK | tar xz -C$DIR
|
2021-05-15 21:50:14 +00:00
|
|
|
|
|
|
|
cat > $DIR/go/AppRun << 'EOF'
|
|
|
|
#!/bin/sh
|
|
|
|
HERE=$(dirname $(readlink -f "${0}"))
|
|
|
|
export LD_LIBRARY_PATH="${HERE}":$PATH
|
|
|
|
"${HERE}"/bin/go $@
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $DIR/go/AppRun
|
|
|
|
|
|
|
|
appdwarf $DIR/go
|
|
|
|
mv go.sh go
|
|
|
|
rm -rf $DIR/go
|