From 194765f03089a9f9d5f2b02eaacf111210fdb356 Mon Sep 17 00:00:00 2001 From: jyelon Date: Mon, 4 Nov 2024 17:26:38 -0500 Subject: [PATCH] More work on patch-both-repositories.py --- README.md | 17 +++++------ Source/Integration/TangibleManager.cpp | 3 ++ patch-both-repositories.py | 41 +++++++++++++++++++++----- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index a9f88eca..b351233d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ LINUX INSTRUCTIONS: +Warnings: + - Do NOT follow the installation instructions for Unreal! + - Follow these instructions instead. + Install important Software - install visual studio code. Usually: apt-get install code - install dotnet6. Usually: apt-get install dotnet6 @@ -12,23 +16,16 @@ Git Clone the UnrealEngine repository: some other fiddly credential management stuff I don't remember how to do. - Clone it into your home directory, $HOME/UnrealEngine - Check out the correct version: git checkout 5.3.1-release - - Run Setup.sh or Setup.bat - - You do NOT need to run GenerateProjectFiles.sh Git Clone the integration Repository - The repository is at https://gnaut.com/jyelon/integration.git - Clone it into your home directory, $HOME/integration -Apply patches: +Apply patches and build everything: - Change directory to $HOME/integration - - Patch the integration repository: python3 patch-integration.py - - Patch the UnrealEngine repository: python3 patch-unrealengine.py + - python3 build-everything.py + - Everything is now ready to go. -Compile Integration - - Change directory to $HOME/integration - - make - - Note: this will also compile the necessary Unreal Engine libraries. - Launch Integration in the Debugger - Change directory to $HOME/integration - Start the IDE: code Integration.code-workspace diff --git a/Source/Integration/TangibleManager.cpp b/Source/Integration/TangibleManager.cpp index f79a3d3f..4bb41966 100644 --- a/Source/Integration/TangibleManager.cpp +++ b/Source/Integration/TangibleManager.cpp @@ -21,6 +21,9 @@ UClass *UlxTangibleManager::GetTangibleClass(const FString &name) { if (name.IsEmpty()) { return nullptr; } + if (name == TEXT("unknown")) { + return nullptr; + } FString path(TEXT("/Game/Tangibles/")); path += name; diff --git a/patch-both-repositories.py b/patch-both-repositories.py index 4d514371..35287d14 100755 --- a/patch-both-repositories.py +++ b/patch-both-repositories.py @@ -18,7 +18,7 @@ # UNREALENGINE/Engine/Source/Runtime/Core/Private/Logging/LogMacros.cpp # -import sys, os, json +import sys, os, json, shutil from pathlib import Path # @@ -93,14 +93,13 @@ with open("Integration.uproject", "w") as rewritten: json.dump(UPROJECT, rewritten, indent=4) # -# Write the Makefile +# Run Setup.sh in UNREALENGINE # -writefile("Makefile", f""" -all: - (cd luprex ; make) - dotnet {UNREALENGINE}/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll IntegrationEditor Linux DebugGame -project="{INTEGRATION}/Integration.uproject" -waitmutex -""") +os.chdir(UNREALENGINE) +print("Running setup.sh...") +os.system("./Setup.sh") +os.chdir(INTEGRATION) # # Use UnrealBuildTool to generate a rough draft of Integration.code-workspace. @@ -156,7 +155,6 @@ LUPREXBUILDTASK["options"]["cwd"] = f"{INTEGRATION}/luprex" LLDBINIT=[ f"command script import {UNREALENGINE}/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py", 'target stop-hook add --one-liner "p ::UngrabAllInputImpl()"', - "breakpoint set --name UBreakPoint::OnLogError" ] for config in WORKSPACE["launch"]["configurations"]: @@ -182,3 +180,30 @@ WORKSPACE["launch"]["configurations"] = [x for x in WORKSPACE["launch"]["configu with open("Integration.code-workspace", "w") as rewritten: json.dump(WORKSPACE, rewritten, indent=4) +# +# Do an initial build of Luprex +# + +os.chdir(f"{INTEGRATION}/luprex") +print("Building luprex...") +os.system("make") +os.chdir(INTEGRATION) + +# +# Build ShaderCompileWorker +# + +os.chdir(UNREALENGINE) +print("Building ShaderCompileWorker...") +os.system("Engine/Build/BatchFiles/Linux/Build.sh ShaderCompileWorker Linux Shipping -waitmutex") +Path("Engine/Binaries/Linux/ShaderCompileWorker").unlink(missing_ok=True) +shutil.copyfile("Engine/Binaries/Linux/ShaderCompileWorker-Linux-Shipping", "Engine/Binaries/Linux/ShaderCompileWorker") +os.chdir(INTEGRATION) + +# +# Build Integration +# + +print("Building integration...") +os.system(f'dotnet {UNREALENGINE}/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.dll IntegrationEditor Linux DebugGame -project="{INTEGRATION}/Integration.uproject" -waitmutex') +