-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmk_daemon
More file actions
executable file
·36 lines (30 loc) · 1.19 KB
/
Copy pathmk_daemon
File metadata and controls
executable file
·36 lines (30 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# SPDX-FileCopyrightText: Copyright 2026-present, Bernd Fix >Y<
# SPDX-License-Identifier: AGPL-3.0-only
ASDK=/usr/lib/android-sdk/ndk/28.0.13004108
KATZENPOST_REPO=/usr/local/src/katzenpost
#-----------------------------------------------------------------------
ARCH=${1:-arm64}
BASE=$(realpath ./apk/app/src/main/assets)
OUT=${BASE}/kpclientd
pushd ${KATZENPOST_REPO} >/dev/null 2>&1
rm -f ${OUT}
case ${ARCH} in
arm64)
export NDK_CC=${ASDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android34-clang
export GOTOOLCHAIN=local
go mod verify
CGO_ENABLED=1 GOOS=android GOARCH=arm64 CC=${NDK_CC} go build \
-trimpath -buildvcs=false \
-ldflags="-s -w -buildid= -extldflags=-Wl,--build-id=none" \
-o ${OUT} ./cmd/kpclientd
popd >/dev/null 2>&1
;;
amd64)
export NDK_CC=${ASDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android28-clang
CGO_ENABLED=1 GOOS=android GOARCH=amd64 CC=${NDK_CC} CGO_LDFLAGS="-Wl,--allow-shlib-undefined" \
go build -buildmode=pie -o ${OUT} ./cmd/kpclientd
popd >/dev/null 2>&1
;;
esac
[ -e ${OUT} ] && ls -l ${OUT}