You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
3.2 KiB

# Mount Virtual Disk for More Space
apt update -qq
apt install -qq -y --no-install-recommends strace netcat git wget libc6-dev make gcc unzip ca-certificates p11-kit
@%uname -a
@%ldd --version
export LANG=C.UTF-8
# Install JDK8
cd /mount
@!check OpenJDK8U-jdk_x64_linux_8u342b07.tar.gz 9a871e4dd2698ae8f4063aad7998414a7472926fbe46b3c89567d86338427bb85acb7e390e88c3c311cd5e631051b358530352fc6e7d65e9ea6c8cff0e72bc09
tar --extract --file OpenJDK8U-jdk_x64_linux_8u342b07.tar.gz --no-same-owner
ln -s /mount/openjdk-8u342-b07 /usr/local/openjdk-8
export JAVA_HOME=/usr/local/openjdk-8
export PATH="/usr/local/openjdk-8/bin/:$PATH"
@%find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/
@%trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$JAVA_HOME/jre/lib/security/cacerts"
@%java -version
# Setup Android SDK
mkdir -p /usr/local/android-sdk
cd /usr/local/android-sdk
mkdir .android
wget -q -O
unzip -q
export ANDROID_SDK=/usr/local/android-sdk
export ANDROID_HOME=/usr/local/android-sdk
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
$ANDROID_HOME/tools/bin/sdkmanager --update
$ANDROID_HOME/tools/bin/sdkmanager "build-tools;30.0.2" "platforms;android-31" "platform-tools"
$ANDROID_HOME/tools/bin/sdkmanager "ndk;22.1.7171670"
export NDK_VER="22.1.7171670"
export ANDROID_NDK_HOME=/usr/local/android-sdk/ndk/$NDK_VER
@%ln -sf $ANDROID_HOME/ndk/$NDK_VER $ANDROID_HOME/ndk-bundle
echo 'hosts: files dns' > /etc/nsswitch.conf
# Setup Go
cd /mount
mkdir gopath
# Downloading Go
@!check go1.19.5.linux-amd64.tar.gz 41cb5e267aca9c3120bc218a81921e4ef1e1b8a5eeb609f82f697092a86fbfc252130a5b87794ce08a21c41f7926b0672273cf1b831d57208e8caaa18c5181bf
tar -xzf go1.19.5.linux-amd64.tar.gz
ln -s /mount/go /usr/local/go
ln -s /mount/gopath /gomobile
export GOROOT="/usr/local/go"
export GOPATH="/gomobile"
export PATH="$GOPATH/bin:/usr/local/go/bin:$PATH"
go version
# Building gomobile
export GOMOBILEHASH="43a0384520996c8376bfb8637390f12b44773e65"
mkdir -p $GOPATH/src/
mkdir -p $GOPATH/bin/
mkdir -p $GOPATH/pkg/
cd $GOPATH/src/
git clone
cd mobile
git checkout $GOMOBILEHASH
#go install -trimpath -ldflags "-buildid="$GOMOBILEHASH
#go install -trimpath -ldflags "-buildid="$GOMOBILEHASH
go install ./cmd/gobind
go install ./cmd/gomobile
@%gomobile version
@%go env
gomobile clean
# Building
cd /mount
git clone
mkdir /drone
ln -s /mount/libcwtch-go /drone/src
cd /drone/src
git fetch --tags
git checkout tags/v1.10.5 -b v1.10.5
echo `git describe --tags` > VERSION
go mod download
gomobile init
@%make android
@!extract cwtch.aar
sha512sum cwtch.aar
@!check cwtch.aar 3f46c82e772690d71a78fc15b50df54c585b74f142e46c0172895bccf9e9dde48d9e471e1621852fb373f475da3ed9831bb82ad6d97b983f07caa43f06bc7caa