diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index e80c4b19..8acc1eb4 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -37,6 +37,9 @@ jobs: - os: ubuntu-20.04 targetos: nswitch targetarch: arm64 + - os: ubuntu-20.04 + targetos: psvita + targetarch: armv7hf - os: windows-latest targetos: win32 targetarch: amd64 diff --git a/scripts/gha/build_psvita.sh b/scripts/gha/build_psvita.sh new file mode 100644 index 00000000..d3d192cc --- /dev/null +++ b/scripts/gha/build_psvita.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +. scripts/lib.sh + +build_hlsdk() +{ + echo "Building HLSDK: $1 branch..." + git checkout $1 + ./waf configure -T release --psvita || die_configure + ./waf build install --destdir=../pkgtemp/xash3d || die + ./waf clean +} + +export VITASDK=/usr/local/vitasdk +export PATH=$VITASDK/bin:$PATH + +cd "$BUILDDIR" || die + +rm -rf artifacts build pkgtemp + +mkdir -p pkgtemp/xash3d/{valve,gearbox,bshift}/{dlls,cl_dlls} || die +mkdir -p artifacts/ || die + +echo "Building vitaGL..." + +make -C vitaGL NO_TEX_COMBINER=1 HAVE_UNFLIPPED_FBOS=1 HAVE_PTHREAD=1 SINGLE_THREADED_GC=1 MATH_SPEEDHACK=1 DRAW_SPEEDHACK=1 HAVE_CUSTOM_HEAP=1 -j2 install || die + +echo "Building vrtld..." + +make -C vita-rtld -j2 install || die + +echo "Building SDL..." + +pushd SDL +cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DVIDEO_VITA_VGL=ON || die_configure +cmake --build build -- -j2 || die +cmake --install build || die +popd + +echo "Building engine..." + +./waf configure -T release --nswitch || die_configure +./waf build install --destdir=pkgtemp/xash3d || die + +echo "Building HLSDK..." + +# TODO: replace with hlsdk-portable and the correct branch names when PRs are merged +pushd hlsdk-xash3d +build_hlsdk vita-mobile_hacks valve +build_hlsdk vita-opfor gearbox +# bshift will fall back to mobile_hacks +popd + +echo "Generating default config files..." + +pushd pkgtemp/xash3d/valve + +touch config.cfg +echo 'unbindall' >> config.cfg +echo 'bind A_BUTTON "+use"' >> config.cfg +echo 'bind B_BUTTON "+jump"' >> config.cfg +echo 'bind X_BUTTON "+reload"' >> config.cfg +echo 'bind Y_BUTTON "+duck"' >> config.cfg +echo 'bind L1_BUTTON "+attack2"' >> config.cfg +echo 'bind R1_BUTTON "+attack"' >> config.cfg +echo 'bind START "escape"' >> config.cfg +echo 'bind DPAD_UP "lastinv"' >> config.cfg +echo 'bind DPAD_DOWN "impulse 100"' >> config.cfg +echo 'bind DPAD_LEFT "invprev"' >> config.cfg +echo 'bind DPAD_RIGHT "invnext"' >> config.cfg +echo 'gl_vsync "1"' >> config.cfg +echo 'sv_autosave "0"' >> config.cfg +echo 'voice_enable "0"' >> config.cfg + +touch video.cfg +echo 'fullscreen "1"' >> video.cfg +echo 'width "960"' >> video.cfg +echo 'height "544"' >> video.cfg +echo 'r_refdll "gl"' >> video.cfg + +touch opengl.cfg +echo 'gl_nosort "1"' >> opengl.cfg + +cp *.cfg ../gearbox/ +cp *.cfg ../bshift/ + +popd + +echo "Packaging artifacts..." + +pushd pkgtemp +7z a -t7z ../artifacts/xash3d-fwgs-psvita.7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -r xash3d/ +popd diff --git a/scripts/gha/deps_psvita.sh b/scripts/gha/deps_psvita.sh new file mode 100644 index 00000000..3bcf11bd --- /dev/null +++ b/scripts/gha/deps_psvita.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +cd $GITHUB_WORKSPACE + +echo "Downloading vitasdk..." + +export VITASDK=/usr/local/vitasdk + +git clone https://github.com/vitasdk/vdpm.git || exit 1 +pushd vdpm +./bootstrap-vitasdk.sh || exit 1 +./install-all.sh || exit 1 +popd + +echo "Downloading vitaGL..." + +git clone https://github.com/Rinnegatamante/vitaGL.git || exit 1 + +echo "Downloading vitaGL fork of SDL2..." + +git clone https://github.com/Northfear/SDL.git || exit 1 + +echo "Downloading vita-rtld..." + +git clone https://github.com/fgsfdsfgs/vita-rtld.git || exit 1 + +echo "Downloading HLSDK..." + +rm -rf hlsdk-xash3d hlsdk-portable +# TODO: change to FWGS/hlsdk-portable.git when changes are merged in +git clone --recursive https://github.com/fgsfdsfgs/hlsdk-xash3d || exit 1