prereq script

This commit is contained in:
John Smith 2023-03-05 15:42:31 +00:00
parent f47e977657
commit 0daffab4a7
5 changed files with 36 additions and 27 deletions

View File

@ -54,7 +54,8 @@ deps-android:
RUN mkdir /Android; mkdir /Android/Sdk RUN mkdir /Android; mkdir /Android/Sdk
RUN curl -o /Android/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip RUN curl -o /Android/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
RUN cd /Android; unzip /Android/cmdline-tools.zip RUN cd /Android; unzip /Android/cmdline-tools.zip
RUN yes | /Android/cmdline-tools/bin/sdkmanager --sdk_root=/Android/Sdk build-tools\;33.0.1 ndk\;25.1.8937393 cmake\;3.22.1 platform-tools platforms\;android-33 RUN yes | /Android/cmdline-tools/bin/sdkmanager --sdk_root=/Android/Sdk build-tools\;33.0.1 ndk\;25.1.8937393 cmake\;3.22.1 platform-tools platforms\;android-33 cmdline-tools\;latest
RUN rm -rf /Android/cmdline-tools
RUN apt-get clean RUN apt-get clean
# Just linux build not android # Just linux build not android

33
install_linux_prerequisites.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
set -eo pipefail
if [ $(id -u) -eq 0 ]; then
echo "Don't run this as root"
exit
fi
# Install APT dependencies
sudo apt update -y
sudo apt install -y openjdk-11-jdk-headless iproute2 curl build-essential cmake libssl-dev openssl file git pkg-config libdbus-1-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-dev checkinstall unzip llvm wabt checkinstall
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -c clippy --profile default
source "$HOME/.cargo/env"
# Install Android SDK
mkdir $HOME/Android; mkdir $HOME/Android/Sdk
curl -o $HOME/Android/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
cd $HOME/Android; unzip $HOME/Android/cmdline-tools.zip
$HOME/Android/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/Android/Sdk build-tools\;33.0.1 ndk\;25.1.8937393 cmake\;3.22.1 platform-tools platforms\;android-33 cmdline-tools\;latest emulator
cd $HOME
rm -rf $HOME/Android/cmdline-tools $HOME/Android/cmdline-tools.zip
# Add environment variables
cat >> $HOME/.profile <<END
source "\$HOME/.cargo/env"
export PATH=\$PATH:\$HOME/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin:\$HOME/Android/Sdk/platform-tools:\$HOME/Android/Sdk/cmdline-tools/latest/bin
export ANDROID_NDK_HOME=\$HOME/Android/Sdk/ndk/25.1.8937393
export ANDROID_SDK_ROOT=\$HOME/Android/Sdk
END
echo Exit and reopen the shell and continue with ./setup_linux.sh

View File

@ -1,7 +0,0 @@
#!/bin/bash
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
killall lldb-server 2> /dev/null
echo Running lldb-server
pushd /tmp > /dev/null
sudo -u veilid lldb-server platform --server --listen 127.0.0.1:6969 --gdbserver-port 6970
popd > /dev/null

View File

@ -1,12 +0,0 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SSHHOST=$1
if [[ "$SSHHOST" == "" ]]; then
SSHHOST="root@bootstrap-1.dev.veilid.net"
fi
echo Copying debug script
scp -q $SCRIPTDIR/debug.sh $SSHHOST:/tmp/debug.sh
echo Connecting to debug server
ssh -t $SSHHOST -L 6969:127.0.0.1:6969 -L 6970:127.0.0.1:6970 'bash /tmp/debug.sh'

View File

@ -22,7 +22,7 @@ else
fi fi
# ensure Android Command Line Tools exist # ensure Android Command Line Tools exist
if [ -d "$ANDROID_SDK_ROOT/cmdline-tools" ]; then if [ -d "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin" ]; then
echo '[X] Android command line tools are installed' echo '[X] Android command line tools are installed'
else else
echo 'Android command line tools are not installed' echo 'Android command line tools are not installed'
@ -91,12 +91,6 @@ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-andro
# install cargo packages # install cargo packages
cargo install wasm-bindgen-cli wasm-pack cargo install wasm-bindgen-cli wasm-pack
# Ensure packages are installed
sudo apt-get install libc6-dev-i386 libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 openjdk-11-jdk llvm wabt checkinstall
# Ensure android sdk packages are installed
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager build-tools\;33.0.1 ndk\;25.1.8937393 cmake\;3.22.1 platform-tools platforms\;android-33
# Install capnproto using the same mechanism as our earthly build # Install capnproto using the same mechanism as our earthly build
$SCRIPTDIR/scripts/earthly/install_capnproto.sh $SCRIPTDIR/scripts/earthly/install_capnproto.sh
# Install protoc using the same mechanism as our earthly build # Install protoc using the same mechanism as our earthly build