2022-10-06 21:41:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y
|
|
|
|
mkdir "$HOME/development"
|
|
|
|
mkdir "$HOME/projects"
|
|
|
|
sudo apt install -y git build-essential curl
|
|
|
|
export DEVELOPMENT=$HOME/development
|
|
|
|
export PROJECTS=$HOME/projects
|
|
|
|
|
|
|
|
# setup flutter
|
|
|
|
sudo apt install -y unzip pkg-config clang cmake ninja-build libgtk-3-dev
|
|
|
|
cd $DEVELOPMENT
|
|
|
|
git clone https://github.com/flutter/flutter.git
|
|
|
|
cd flutter
|
2023-03-09 15:53:59 +00:00
|
|
|
git checkout 3.7.6
|
2022-10-06 21:41:24 +00:00
|
|
|
export FLUTTER_DIR=$(pwd)/bin
|
|
|
|
echo 'export PATH="$PATH:'${FLUTTER_DIR}'"' >> ~/.bashrc
|
|
|
|
source ~/.bashrc
|
|
|
|
flutter doctor
|
|
|
|
|
|
|
|
# setup stack_wallet github
|
|
|
|
cd $PROJECTS
|
|
|
|
git clone https://github.com/cypherstack/stack_wallet.git
|
|
|
|
cd stack_wallet
|
|
|
|
export STACK_WALLET=$(pwd)
|
|
|
|
git submodule update --init --recursive
|
|
|
|
|
2022-10-07 01:01:19 +00:00
|
|
|
# Create template lib/external_api_keys.dart file if it doesn't already exist
|
|
|
|
KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart"
|
|
|
|
if ! test -f "$KEYS"; then
|
|
|
|
echo 'prebuild.sh: creating template lib/external_api_keys.dart file'
|
2022-10-14 23:48:00 +00:00
|
|
|
printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS
|
2022-10-07 01:01:19 +00:00
|
|
|
fi
|
2022-10-06 21:41:24 +00:00
|
|
|
|
|
|
|
#install stack wallet dependencies
|
|
|
|
sudo apt-get install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm
|
|
|
|
|
|
|
|
sudo apt-get install -y debhelper libclang-dev cargo rustc opencl-headers libssl-dev ocl-icd-opencl-dev
|
|
|
|
|
|
|
|
sudo apt-get install -y unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake openjdk-8-jre-headless
|
|
|
|
|
|
|
|
sudo apt install -y libc6-dev-i386
|
|
|
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
|
|
cargo install cargo-ndk
|
|
|
|
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
|
|
|
|
|
|
|
# build stack wallet plugins
|
|
|
|
cd $STACK_WALLET
|
|
|
|
cd scripts/android
|
|
|
|
./build_all.sh
|