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 19:21:09 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
. scripts/lib.sh
|
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 19:21:09 +02:00
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
cd "$GITHUB_WORKSPACE" || exit 1
|
2024-07-02 17:58:53 +02:00
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
# "booo, bash feature!", -- posix sh users, probably
|
|
|
|
declare -A BASE_BUILD_PACKAGES SDL_BUILD_PACKAGES APPIMAGETOOL
|
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 19:21:09 +02:00
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
# bzip2 and opus are added from submodules, freetype replaced by stb_truetype in this build, so it's just compiler toolchain
|
|
|
|
BASE_BUILD_PACKAGES[common]="desktop-file-utils"
|
|
|
|
BASE_BUILD_PACKAGES[amd64]="build-essential"
|
|
|
|
BASE_BUILD_PACKAGES[i386]="gcc-multilib g++-multilib"
|
|
|
|
BASE_BUILD_PACKAGES[arm64]="crossbuild-essential-arm64"
|
|
|
|
BASE_BUILD_PACKAGES[armhf]="crossbuild-essential-armhf"
|
|
|
|
BASE_BUILD_PACKAGES[riscv64]="crossbuild-essential-riscv64"
|
|
|
|
BASE_BUILD_PACKAGES[ppc64el]="crossbuild-essential-ppc64el"
|
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 19:21:09 +02:00
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
SDL_BUILD_PACKAGES[common]="cmake ninja-build"
|
|
|
|
# TODO: add libpipewire-0.3-dev and libdecor-0-dev after we migrate from 20.04
|
|
|
|
# TODO: figure out how to install fcitx and ibus dev in cross compile environment on gha
|
|
|
|
# In theory, we better run this in limited container. Right now, some preinstalled PHP shit breaks libpcre builds
|
|
|
|
# and prevents us from installing crosscompiling packages
|
|
|
|
SDL_BUILD_PACKAGES[amd64]="libasound2-dev libpulse-dev \
|
|
|
|
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \
|
|
|
|
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
|
|
|
|
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
|
|
|
|
libegl1-mesa-dev libdbus-1-dev libudev-dev"
|
|
|
|
SDL_BUILD_PACKAGES[i386]="${SDL_BUILD_PACKAGES[amd64]//-dev/-dev:i386} libjack0:i386" # test
|
|
|
|
SDL_BUILD_PACKAGES[arm64]=${SDL_BUILD_PACKAGES[amd64]//-dev/-dev:arm64}
|
|
|
|
SDL_BUILD_PACKAGES[armhf]=${SDL_BUILD_PACKAGES[amd64]//-dev/-dev:armhf}
|
|
|
|
SDL_BUILD_PACKAGES[riscv64]=${SDL_BUILD_PACKAGES[amd64]//-dev/-dev:riscv64}
|
|
|
|
SDL_BUILD_PACKAGES[ppc64el]=${SDL_BUILD_PACKAGES[amd64]//-dev/-dev:ppc64el}
|
2021-12-31 03:29:11 +01:00
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
APPIMAGETOOL[amd64]=https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
|
|
|
|
APPIMAGETOOL[i386]=https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-i686.AppImage
|
|
|
|
|
|
|
|
# can't run AppImageTool yet because it's compiled for these platforms natively and don't support cross compilation yet
|
|
|
|
# uncomment when we will enable qemu-user for tests
|
|
|
|
# APPIMAGETOOL[arm64]=https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage
|
|
|
|
# APPIMAGETOOL[armhf]=https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-armhf.AppImage
|
|
|
|
|
|
|
|
regenerate_sources_list()
|
|
|
|
{
|
|
|
|
# this is evil but to speed up update, specify all repositories manually
|
|
|
|
sudo rm /etc/apt/sources.list
|
|
|
|
sudo rm -rf /etc/apt/sources.list.d
|
|
|
|
|
|
|
|
for i in focal focal-updates focal-backports focal-security; do
|
|
|
|
echo "deb [arch=$GH_CPU_ARCH] http://azure.ports.ubuntu.com/ubuntu-ports $i main universe" | sudo tee -a /etc/apt/sources.list
|
|
|
|
echo "deb [arch=amd64] http://azure.archive.ubuntu.com/ubuntu $i main universe" | sudo tee -a /etc/apt/sources.list
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$GH_CPU_ARCH" != "amd64" ] && [ -n "$GH_CPU_ARCH" ]; then
|
|
|
|
if [ "$GH_CPU_ARCH" != "i386" ]; then
|
|
|
|
regenerate_sources_list
|
|
|
|
fi
|
|
|
|
sudo dpkg --add-architecture "$GH_CPU_ARCH"
|
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 19:21:09 +02:00
|
|
|
fi
|
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
sudo apt update || die
|
|
|
|
sudo apt install aptitude || die # aptitude is just more reliable at resolving dependencies
|
|
|
|
|
|
|
|
# shellcheck disable=SC2086 # splitting is intended here
|
|
|
|
sudo aptitude install -y ${BASE_BUILD_PACKAGES[common]} ${BASE_BUILD_PACKAGES[$GH_CPU_ARCH]} ${SDL_BUILD_PACKAGES[common]} ${SDL_BUILD_PACKAGES[$GH_CPU_ARCH]} || die
|
|
|
|
|
|
|
|
if [ -n "${APPIMAGETOOL[$GH_CPU_ARCH]}" ]; then
|
|
|
|
wget -O appimagetool.AppImage "${APPIMAGETOOL[$GH_CPU_ARCH]}"
|
|
|
|
chmod +x appimagetool.AppImage
|
|
|
|
fi
|
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 19:21:09 +02:00
|
|
|
|
2024-11-18 14:53:47 +01:00
|
|
|
wget "https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL2-$SDL_VERSION.tar.gz" -qO- | tar -xzf -
|
|
|
|
mv "SDL2-$SDL_VERSION" SDL2_src
|