Skip to content

Commit

Permalink
android: add fdroid build script (#1317)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneschepke authored Oct 16, 2024
1 parent dd3484c commit 4e4a531
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions nym-vpn-android/scripts/fdroid-prebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

set -eux

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

REPO_DIR="$SCRIPT_DIR/../../"

# Install Rust
curl -sf -L https://sh.rustup.rs > /tmp/rustup.sh
chmod +x /tmp/rustup.sh
/tmp/rustup.sh -y
# shellcheck source=/dev/null
source "$HOME/.cargo/env"
rustup set profile minimal
rustup target add \
i686-linux-android \
x86_64-linux-android \
aarch64-linux-android \
armv7-linux-androideabi

# Install golang
GOLANG_VERSION="1.21.3"
# Checksum from: https://golang.org/dl/
GOLANG_HASH="1241381b2843fae5a9707eec1f8fb2ef94d827990582c7c7c32f5bdfbfd420c8"
cd "$HOME"
curl -sf -L -o go.tgz https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz
echo "$GOLANG_HASH go.tgz" | sha256sum -c
tar -xzvf go.tgz
patch -p1 -f -N -r- -d "$HOME/go" < "$REPO_DIR/wireguard/libwg/goruntime-boottime-over-monotonic.diff"

# Ensure Go compiler is accessible
export GOROOT="$HOME/go"
export PATH="$PATH:$GOROOT/bin"

# install cargo dependencies
cargo install cargo-ndk cargo-license --locked

# install other dependencies
sudo apt-get update && sudo apt-get install -y libdbus-1-dev libmnl-dev libnftnl-dev protobuf-compiler git curl gcc g++ make unzip

0 comments on commit 4e4a531

Please sign in to comment.