-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: rework Linux build scripts, allow crosscompiling with whatever is…
… included in Ubuntu 20.04 (which is used on GitHub Actions now) repositories
- Loading branch information
Showing
5 changed files
with
155 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,66 @@ | ||
#!/bin/bash | ||
|
||
cd $GITHUB_WORKSPACE | ||
. scripts/lib.sh | ||
|
||
# TODO: add libpipewire-dev after we migrate from 20.04 | ||
cd "$GITHUB_WORKSPACE" || exit 1 | ||
|
||
if [ "$GH_CPU_ARCH" == "i386" ]; then | ||
sudo dpkg --add-architecture i386 | ||
sudo apt update | ||
sudo apt install gcc-multilib g++-multilib libx11-dev:i386 libxext-dev:i386 x11-utils libgl1-mesa-dev libasound-dev libstdc++6:i386 libfuse2:i386 zlib1g:i386 libpulse0:i386 libpulse-dev libjack-dev:i386 libwayland-dev:i386 libxkbcommon-dev:i386 wayland-scanner++ | ||
# "booo, bash feature!", -- posix sh users, probably | ||
declare -A BASE_BUILD_PACKAGES SDL_BUILD_PACKAGES APPIMAGETOOL | ||
|
||
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage" -O appimagetool.AppImage | ||
elif [ "$GH_CPU_ARCH" == "amd64" ]; then | ||
sudo apt update | ||
sudo apt install libx11-dev libxext-dev x11-utils libgl1-mesa-dev libasound-dev libstdc++6 libfuse2 zlib1g libpulse-dev libjack-dev libwayland-dev libxkbcommon-dev wayland-scanner++ | ||
# bzip2 and opus are added from submodules, freetype replaced by stb_truetype in this build, so it's just compiler toolchain | ||
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" | ||
|
||
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O appimagetool.AppImage | ||
elif [ "$GH_CPU_ARCH" == "aarch64" ]; then | ||
sudo apt update | ||
sudo apt install libx11-dev libxext-dev x11-utils libgl1-mesa-dev libasound-dev libstdc++6 libfuse2 zlib1g libpulse-dev libjack-dev libwayland-dev libxkbcommon-dev wayland-scanner++ | ||
SDL_BUILD_PACKAGES[common]="cmake ninja-build" | ||
# TODO: add libpipewire-0.3-dev and libdecor-0-dev after we migrate from 20.04 | ||
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 libibus-1.0-dev libudev-dev fcitx-libs-dev" | ||
SDL_BUILD_PACKAGES[i386]=${SDL_BUILD_PACKAGES[amd64]//-dev/-dev:i386} | ||
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} | ||
|
||
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage" -O appimagetool.AppImage | ||
else | ||
exit 1 | ||
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 | ||
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" | ||
fi | ||
|
||
chmod +x appimagetool.AppImage | ||
sudo apt update || die | ||
|
||
# shellcheck disable=SC2086 # splitting is intended here | ||
sudo apt install ${BASE_BUILD_PACKAGES[$GH_CPU_ARCH]} ${SDL_BUILD_PACKAGES[common]} ${SDL_BUILD_PACKAGES[$GH_CPU_ARCH]} || die | ||
|
||
if [ -z "${APPIMAGETOOL[$GH_CPU_ARCH]}" ]; then | ||
wget -O appimagetool.AppImage "${APPIMAGETOOL[$GH_CPU_ARCH]}" | ||
chmod +x appimagetool.AppImage | ||
fi | ||
|
||
wget http://libsdl.org/release/SDL2-$SDL_VERSION.zip -O SDL2.zip | ||
unzip -q SDL2.zip | ||
mv SDL2-$SDL_VERSION SDL2_src | ||
wget "https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL2-$SDL_VERSION.tar.gz" -O- | tar -xzvf - | ||
mv "SDL2-$SDL_VERSION" SDL2_src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
if [ "$XASH3D_BASEDIR" = "" ]; then | ||
export XASH3D_BASEDIR="$PWD" | ||
fi | ||
echo "Xash3D FWGS installed as AppImage." | ||
echo "Base directory is $XASH3D_BASEDIR. Set XASH3D_BASEDIR environment variable to override this." | ||
|
||
export XASH3D_EXTRAS_PAK1="${APPDIR}/valve/extras.pk3" | ||
exec $DEBUGGER "${APPDIR}/xash3d" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Desktop Entry] | ||
Categories=Game;Shooter; | ||
Comment=Half-Life compatible game engine | ||
Exec=AppRun | ||
Icon=xash3d-fwgs | ||
Keywords=first;person;shooter;multiplayer;half-life;halflife;singleplayer; | ||
Name=Xash3D FWGS | ||
PrefersNonDefaultGPU=true | ||
Terminal=false | ||
Type=Application |