summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2022-04-29 07:02:02 +0200
committerDavid Lönnhager <david.l@mullvad.net>2022-08-15 11:33:09 +0200
commitf815013ccede62946bb55c2210b8e05e5da9f7b2 (patch)
tree2d3b081d7afcf90f22e806657b1c83514d91fff2 /android
parent14c30056b97569da2b7cc178f160638695965437 (diff)
downloadmullvadvpn-f815013ccede62946bb55c2210b8e05e5da9f7b2.tar.xz
mullvadvpn-f815013ccede62946bb55c2210b8e05e5da9f7b2.zip
Improve golang download scripts
Separates golang version and checksum to variables to make it easier to update in the scripts that didn't do this already.
Diffstat (limited to 'android')
-rw-r--r--android/docker/Dockerfile14
-rwxr-xr-xandroid/fdroid-build/init.sh11
2 files changed, 15 insertions, 10 deletions
diff --git a/android/docker/Dockerfile b/android/docker/Dockerfile
index 1f59b3e557..fe897fbf94 100644
--- a/android/docker/Dockerfile
+++ b/android/docker/Dockerfile
@@ -43,17 +43,19 @@ RUN cd /tmp && \
ENV ANDROID_NDK_HOME="/opt/android/android-ndk-r20b" \
NDK_TOOLCHAIN_DIR="/opt/android/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin"
-# Install Go
+# Install golang
+ENV GOLANG_VERSION 1.16
+# Checksum from: https://go.dev/dl/
+ENV GOLANG_HASH 013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2
COPY goruntime-boottime-over-monotonic.diff /tmp/goruntime-boottime-over-monotonic.diff
-
RUN cd /tmp && \
- curl -sf -L -O https://go.dev/dl/go1.16.linux-amd64.tar.gz && \
- echo "013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2 go1.16.linux-amd64.tar.gz" | sha256sum -c && \
+ curl -sf -L -o go.tgz https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
+ echo "$GOLANG_HASH go.tgz" | sha256sum -c && \
cd /opt && \
- tar -xzf /tmp/go1.16.linux-amd64.tar.gz && \
+ tar -xzf /tmp/go.tgz && \
patch -p1 -f -N -r- -d "/opt/go" < /tmp/goruntime-boottime-over-monotonic.diff && \
mkdir /opt/go/go-path && \
- rm /tmp/goruntime-boottime-over-monotonic.diff /tmp/go1.16.linux-amd64.tar.gz
+ rm /tmp/goruntime-boottime-over-monotonic.diff /tmp/go.tgz
ENV GOROOT=/opt/go GOPATH=/opt/go/go-path PATH=${PATH}:/opt/go/bin
diff --git a/android/fdroid-build/init.sh b/android/fdroid-build/init.sh
index e4212c2f47..73ea2463be 100755
--- a/android/fdroid-build/init.sh
+++ b/android/fdroid-build/init.sh
@@ -19,11 +19,14 @@ rustup target add \
aarch64-linux-android \
armv7-linux-androideabi
-# Install Go
+# Install golang
+GOLANG_VERSION="1.16"
+# Checksum from: https://golang.org/dl/
+GOLANG_HASH="013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2"
cd "$HOME"
-curl -sf -L -O https://go.dev/dl/go1.16.linux-amd64.tar.gz
-echo "013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2 go1.16.linux-amd64.tar.gz" | sha256sum -c
-tar -xzvf go1.16.linux-amd64.tar.gz
+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"
# Configure Cargo for cross-compilation