xash3d-fwgs/scripts/gha/deps_android.sh
Alibek Omarov #SupportRMS 21a31ec81d
ci: migrate to GitHub Actions
* travis: disable build, disable deploy, add free aarch64/ppc64le/s390x builds

* scripts: cleanup of old CI scripts

* scripts: now port to GitHub Actions

* actions: fix extras checkout

* github: remove codeql action, turned out not to be very useful

* github: remove quiet flag on wget

* github: are we allowed to use envvars?

* github: add needed dependencies for linux

* github: install wget for windows

* scripts: convert our CPU architecture naming into what AppImage uses

* github: run scripts with bash explicitly

* github: first try to upload to GitHub Releases, enable amd64 win32 builds

* Use our uploadtool fork

* ci: include android, motomagx build for gha, refactor cirrus and travis ci scripts

* gha: try to fix build

* travis: try to fix build

* gha: try to fix upload, fix win32 build

* gha: use curl instead of wget, as it's preinstalled for windows. Fix Android build

* gha: add llvm repository, install clang-12 for android

* gha: motomagx: fail fast

* gha: android: explicitly set clang-12 as compiler and llvm-strip-12 as strip

* waifulib: xcompile: respect environment variables when using host compiler for Android

* waifulib: xcompile: use correct environ dict

* gha: try to fix -fuse-ld=lld with clang-12

* waifulib: xcompile: fix typo

* scripts: xcompile: fix motomagx build

* mainui: upgrade

* gha: fix android build, last time

* engine: wscript: disable crashhandler for magx
2021-07-03 20:21:09 +03:00

54 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
echo "Install packages"
echo "deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main" | sudo tee -a /etc/apt/sources.list
wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt update
sudo apt install clang-12 lld-12 llvm-12 llvm-12-tools p7zip-full
sudo rm /usr/bin/lld /usr/bin/ld.lld
sudo ln -s /usr/bin/lld-12 /usr/bin/lld
sudo ln -s /usr/bin/ld.lld-12 /usr/bin/ld.lld
echo "Download HLSDK"
cd $GITHUB_WORKSPACE
git clone --depth 1 --recursive https://github.com/FWGS/hlsdk-xash3d -b mobile_hacks hlsdk || exit 1
echo "Download and unpack Android SDK"
mkdir -p sdk || exit 1
pushd sdk
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -qO sdk.zip > /dev/null || exit 1
unzip -q sdk.zip || exit 1
popd
echo "Download all needed tools and NDK"
yes | sdk/tools/bin/sdkmanager --licenses > /dev/null 2>/dev/null # who even reads licenses? :)
NDK_BUNDLE="ndk-bundle"
if [ "$ANDROID_NDK_VER" = "r10e" ]; then
NDK_BUNDLE=""
fi
sdk/tools/bin/sdkmanager --install build-tools\;29.0.1 platform-tools platforms\;android-29 $NDK_BUNDLE > /dev/null 2>/dev/null
if [ "$ANDROID_NDK_VER" = "r10e" ]; then
wget https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -qO ndk.zip > /dev/null || exit 1
unzip -q ndk.zip || exit 1
mv android-ndk-r10e sdk/ndk-bundle
fi
echo "Download Xash3D FWGS Android source"
git clone --depth 1 https://github.com/FWGS/xash3d-android-project -b waf android || exit 1
pushd android
mv xash3d-fwgs xash3d-fwgs-sub
ln -s $GITHUB_WORKSPACE xash3d-fwgs
echo "Installed Xash3D FWGS source symlink"
mv hlsdk-xash3d hlsdk-xash3d-sub
ln -s $GITHUB_WORKSPACE/hlsdk hlsdk-xash3d
echo "Installed HLSDK source symlink"
mv xash-extras xash-extras-sub
ln -s $GITHUB_WORKSPACE/xash-extras xash-extras
echo "Installed xash-extras symlink"
popd