Having Trouble recompiling sdl for unreal engine

From the UE source code, path: Engine/Source/ThirdParty/SDL2

is this build.sh

#!/bin/bash

## Unreal Engine 4 Build script for SDL2
## Copyright Epic Games, Inc. All Rights Reserved.

pushd "`dirname "$0"`/"

if [ -z "$TARGET_ARCH" ]; then
	TARGET_ARCH=x86_64-unknown-linux-gnu
fi

export VULKAN_SDK=`pwd`/../Vulkan
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:$PKG_CONFIG_PATH

BuildWithOptions()
{
	local StaticLibName=$1
	local BuildDir=$2
	local SdlDir=$3
	local SdlLibName=$4
	shift
	shift
	shift
	shift
	local Options=$@

	rm -rf $BuildDir
	mkdir -p $BuildDir
	pushd $BuildDir

	cmake $Options $SdlDir
	make -j 4
	mkdir -p $SdlDir/lib/Linux/$TARGET_ARCH/
	cp --remove-destination $StaticLibName $SdlDir/lib/Linux/$TARGET_ARCH/$SdlLibName
	popd
}

set -e
SDL_DIR=SDL-gui-backend
BUILD_DIR=build-$SDL_DIR

# build Debug with -fPIC so it's usable in any type of build
BuildWithOptions libSDL2d.a $BUILD_DIR-Debug ../$SDL_DIR libSDL2_fPIC_Debug.a -DCMAKE_BUILD_TYPE=Debug -DSDL_STATIC_PIC=ON -DVIDEO_MIR=OFF -DVIDEO_KMSDRM=OFF -DCMAKE_C_FLAGS=-gdwarf-4
#exit 0
BuildWithOptions libSDL2.a $BUILD_DIR-Release ../$SDL_DIR libSDL2.a -DCMAKE_BUILD_TYPE=Release -DVIDEO_MIR=OFF -DVIDEO_KMSDRM=OFF -DCMAKE_C_FLAGS=-gdwarf-4
BuildWithOptions libSDL2.a $BUILD_DIR-ReleasePIC ../$SDL_DIR libSDL2_fPIC.a -DCMAKE_BUILD_TYPE=Release -DSDL_STATIC_PIC=ON -DVIDEO_MIR=OFF -DVIDEO_KMSDRM=OFF -DCMAKE_C_FLAGS=-gdwarf-4
set +e

This thing just refuses to compile giving seemingly nonsensical errors (errors that looking up online didn’t yield any results)

Such as:

CMake Error: File /home/rabcor/Downloads/SDL2Unreal/UnrealEngine-5.4.2-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/sdl2.pc.in does not exist.
CMake Error at CMakeLists.txt:2906 (configure_file):
  configure_file Problem configuring file


CMake Error: File /home/rabcor/Downloads/SDL2Unreal/UnrealEngine-5.4.2-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/sdl2-config.in does not exist.
CMake Error at CMakeLists.txt:2908 (configure_file):
  configure_file Problem configuring file


CMake Error: File /home/rabcor/Downloads/SDL2Unreal/UnrealEngine-5.4.2-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/sdl2-config.in does not exist.
CMake Error at CMakeLists.txt:2910 (configure_file):
  configure_file Problem configuring file


CMake Error: File /home/rabcor/Downloads/SDL2Unreal/UnrealEngine-5.4.2-release/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/SDL2.spec.in does not exist.
CMake Error at CMakeLists.txt:2912 (configure_file):
  configure_file Problem configuring file

it seems like there are files that cmake is supposed to create that it does not actually create thus cannot find and fails to compile, any idea how i could fix this?