mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
scripts: gha: build for e2k-8c on GitHub Actions machines
This commit is contained in:
4
.github/workflows/c-cpp.yml
vendored
4
.github/workflows/c-cpp.yml
vendored
@@ -40,6 +40,10 @@ jobs:
|
||||
# - os: ubuntu-aarch64-20.04
|
||||
# targetos: linux
|
||||
# targetarch: aarch64
|
||||
- os: ubuntu-latest
|
||||
targetos: linux
|
||||
targetarch: e2k-8c
|
||||
cross: true
|
||||
- os: ubuntu-20.04
|
||||
targetos: android
|
||||
targetarch: multiarch
|
||||
|
||||
52
scripts/gha/build_linux-e2k.sh
Executable file
52
scripts/gha/build_linux-e2k.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
. scripts/lib.sh
|
||||
. scripts/lib-e2k.sh
|
||||
|
||||
export CC=${E2K_CROSS_COMPILER_PATH[$GH_CPU_ARCH]}/bin/lcc
|
||||
export CXX=${E2K_CROSS_COMPILER_PATH[$GH_CPU_ARCH]}/bin/l++
|
||||
|
||||
APP=xash3d-fwgs
|
||||
|
||||
APPDIR=$APP-linux-$ARCH # FIXME: not conforms to libpublic's build arch strings but in parity with xashds directory name
|
||||
APPTARGZ=$APP-linux-$ARCH.tar.gz
|
||||
|
||||
DS=xashds-linux
|
||||
DSDIR=$DS-$ARCH
|
||||
DSTARGZ=$DS-$ARCH.tar.gz
|
||||
|
||||
build_engine()
|
||||
{
|
||||
# Build engine
|
||||
cd "$BUILDDIR"
|
||||
|
||||
./waf configure --enable-dedicated -s usr --enable-stbtt --enable-utils --enable-bundled-deps --enable-all-renderers || die_configure
|
||||
./waf build || die_configure
|
||||
}
|
||||
|
||||
make_client_tarball()
|
||||
{
|
||||
cd "$BUILDDIR"
|
||||
./waf install --destdir="$APPDIR"
|
||||
tar -czvf "artifacts/$APPTARGZ" "$APPDIR"
|
||||
}
|
||||
|
||||
make_server_tarball()
|
||||
{
|
||||
cd "$BUILDDIR"
|
||||
|
||||
# FIXME: make an option for Waf to only install dedicated
|
||||
mkdir -p "$DSDIR"
|
||||
cp -v "$APPDIR"/xash "$APPDIR"/filesystem_stdio.so "$DSDIR"
|
||||
tar -czvf "artifacts/$DSTARGZ" "$DSDIR"
|
||||
}
|
||||
|
||||
mkdir -p artifacts/
|
||||
|
||||
rm -rf build # clean-up build directory
|
||||
build_engine
|
||||
|
||||
make_client_tarball
|
||||
make_server_tarball
|
||||
@@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# As e2k builds for distro that's vastly different from Ubuntu/Debian and specially handles cross-compiling
|
||||
# keep it in separate script for now
|
||||
if [[ $GH_CPU_ARCH == e2k* ]]; then
|
||||
exec bash scripts/gha/build_linux-e2k.sh
|
||||
fi
|
||||
|
||||
. scripts/lib.sh
|
||||
|
||||
# "booo, bash feature!"
|
||||
|
||||
16
scripts/gha/deps_linux-e2k.sh
Executable file
16
scripts/gha/deps_linux-e2k.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
|
||||
. scripts/lib-e2k.sh
|
||||
|
||||
wget "${E2K_CROSS_COMPILER_URL[$GH_CPU_ARCH]}" -O- | sudo tar -C / -xzvf -
|
||||
|
||||
for i in ${E2K_PACKAGES_URLS[$GH_CPU_ARCH]}; do
|
||||
wget "$i" -O package.deb
|
||||
ar x package.deb data.tar.xz
|
||||
tar -xvf data.tar.xz
|
||||
rm package.deb data.tar.xz
|
||||
done
|
||||
@@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# As e2k builds for distro that's vastly different from Ubuntu/Debian and specially handles cross-compiling
|
||||
# keep it in separate script for now
|
||||
if [[ $GH_CPU_ARCH == e2k* ]]; then
|
||||
exec bash scripts/gha/deps_linux-e2k.sh
|
||||
fi
|
||||
|
||||
. scripts/lib.sh
|
||||
|
||||
cd "$GITHUB_WORKSPACE" || exit 1
|
||||
|
||||
25
scripts/lib-e2k.sh
Normal file
25
scripts/lib-e2k.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
declare -A E2K_CROSS_COMPILER_URL E2K_CROSS_COMPILER_PATH E2K_PACKAGES_URLS
|
||||
|
||||
# NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
|
||||
# NOTE NOTE
|
||||
# NOTE The cross-compiler is officially distributed on dev.mcst.ru website. NOTE
|
||||
# NOTE setwd.ws is OpenE2K's unofficial mirror for Elbrus dev community. NOTE
|
||||
# NOTE Do NOT hammer down the server with your CI/CD, AI and other bullshit! NOTE
|
||||
# NOTE Cache the archives on YOUR OWN INFRASTRUCTURE! NOTE
|
||||
# NOTE NOTE
|
||||
# NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
|
||||
E2K_CROSS_COMPILER_URL[e2k-4c]="https://setwd.ws/sp/1.27/1.27.21/cross-sp-rel-1.27.21.e2k-v3.5.10_64.tgz"
|
||||
E2K_CROSS_COMPILER_URL[e2k-1c]="https://setwd.ws/sp/1.27/1.27.21/cross-sp-rel-1.27.21.e2k-v4.1c%2B.5.10_64.tgz"
|
||||
E2K_CROSS_COMPILER_URL[e2k-8c]="https://setwd.ws/sp/1.27/1.27.21/cross-sp-rel-1.27.21.e2k-v4.5.10_64.tgz"
|
||||
E2K_CROSS_COMPILER_URL[e2k-8c2]="https://setwd.ws/sp/1.27/1.27.21/cross-sp-rel-1.27.21.e2k-v5.5.10_64.tgz"
|
||||
E2K_CROSS_COMPILER_URL[e2k-16c]="https://setwd.ws/sp/1.27/1.27.21/cross-sp-rel-1.27.21.e2k-v6.5.10-e16c_64.tgz"
|
||||
E2K_CROSS_COMPILER_URL[e2k-2c3]="https://setwd.ws/sp/1.27/1.27.21/cross-sp-rel-1.27.21.e2k-v6.5.10-e2c3_64.tgz"
|
||||
|
||||
# TODO: fill in the gaps
|
||||
E2K_CROSS_COMPILER_PATH[e2k-8c]="/opt/mcst/lcc-1.27.21.e2k-v4.5.10/"
|
||||
|
||||
# TODO: split by some character, as bash can't assign lists to array members
|
||||
E2K_PACKAGES_URLS[e2k-4c]="https://setwd.ws/osl/8.2/pool/main/e2k-4c/SDL2_2.30.0-vd8u4_e2k-4c.deb"
|
||||
E2K_PACKAGES_URLS[e2k-8c]="https://setwd.ws/osl/8.2/pool/main/e2k-8c/SDL2_2.30.0-vd8u4_e2k-8c.deb"
|
||||
E2K_PACKAGES_URLS[e2k-8c2]="https://setwd.ws/osl/8.2/pool/main/e2k-8c2/SDL2_2.30.0-vd8u4_e2k-8c2.deb"
|
||||
E2K_PACKAGES_URLS[e2k-16c]="https://setwd.ws/osl/8.2/pool/main/e2k-16c/SDL2_2.30.0-vd8u4_e2k-16c.deb"
|
||||
Reference in New Issue
Block a user