-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
android: add fdroid build script (#1317)
- Loading branch information
1 parent
dd3484c
commit 4e4a531
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |