2023-02-07 19:54:00 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. scripts/lib.sh
|
|
|
|
|
|
|
|
build_hlsdk()
|
|
|
|
{
|
2023-02-09 03:35:30 +01:00
|
|
|
echo "Building HLSDK: $1 branch..."
|
|
|
|
git checkout $1
|
2023-04-25 12:10:12 +02:00
|
|
|
|
|
|
|
# This is not our bug if HLSDK doesn't build with -Werrors enabled
|
|
|
|
./waf configure -T release --nswitch --disable-werror || die_configure
|
2023-02-09 03:35:30 +01:00
|
|
|
./waf build install --destdir=../pkgtemp/xash3d || die
|
2023-02-07 19:54:00 +01:00
|
|
|
}
|
|
|
|
|
2023-02-07 20:38:40 +01:00
|
|
|
echo "Setting up environment..."
|
|
|
|
|
|
|
|
# we can't actually download dkp-toolchain-vars even from here, so
|
|
|
|
export PORTLIBS_ROOT=${DEVKITPRO}/portlibs
|
|
|
|
export PATH=${DEVKITPRO}/tools/bin:${DEVKITPRO}/devkitA64/bin:$PATH
|
|
|
|
export TOOL_PREFIX=aarch64-none-elf-
|
|
|
|
export CC=${TOOL_PREFIX}gcc
|
|
|
|
export CXX=${TOOL_PREFIX}g++
|
|
|
|
export AR=${TOOL_PREFIX}gcc-ar
|
|
|
|
export RANLIB=${TOOL_PREFIX}gcc-ranlib
|
|
|
|
export PORTLIBS_PREFIX=${DEVKITPRO}/portlibs/switch
|
|
|
|
export PATH=$PORTLIBS_PREFIX/bin:$PATH
|
|
|
|
export ARCH="-march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec"
|
|
|
|
export CFLAGS="${ARCH} -O2 -ffunction-sections -fdata-sections"
|
|
|
|
export CXXFLAGS="${CFLAGS}"
|
|
|
|
export CPPFLAGS="-D__SWITCH__ -I${PORTLIBS_PREFIX}/include -isystem ${DEVKITPRO}/libnx/include"
|
|
|
|
export LDFLAGS="${ARCH} -L${PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/libnx/lib"
|
|
|
|
export LIBS="-lnx"
|
2023-02-07 20:00:49 +01:00
|
|
|
|
2023-02-07 20:14:11 +01:00
|
|
|
# forgive me father, for I have sinned
|
|
|
|
ln -s /usr/bin/python3 /usr/bin/python
|
2023-02-07 20:00:49 +01:00
|
|
|
|
2023-02-07 19:54:00 +01:00
|
|
|
echo "Building libsolder..."
|
|
|
|
|
2023-02-07 20:00:49 +01:00
|
|
|
make -C libsolder install || die
|
2023-02-07 19:54:00 +01:00
|
|
|
|
|
|
|
echo "Building engine..."
|
|
|
|
|
|
|
|
./waf configure -T release --nswitch || die_configure
|
2023-02-09 03:35:30 +01:00
|
|
|
./waf build install --destdir=pkgtemp/xash3d || die
|
2023-02-07 19:54:00 +01:00
|
|
|
|
|
|
|
echo "Building HLSDK..."
|
|
|
|
|
2023-03-27 03:30:21 +02:00
|
|
|
pushd hlsdk-portable || die
|
2023-02-09 03:35:30 +01:00
|
|
|
build_hlsdk mobile_hacks valve
|
2023-02-07 19:54:00 +01:00
|
|
|
build_hlsdk opfor gearbox
|
|
|
|
build_hlsdk bshift bshift
|
2023-02-07 20:35:24 +01:00
|
|
|
popd
|