diff options
author | Neko-san | 2023-01-30 17:49:00 -0600 |
---|---|---|
committer | Neko-san | 2023-01-30 17:49:00 -0600 |
commit | 7bb0e2ea1b8421f4216b30a0d0d22713d9de58fe (patch) | |
tree | 202a5a9d08237b34f2da03700d19f2cc039c1f0e | |
parent | 70af870a90e7e6cbcd2f7633df7f51459161252a (diff) | |
download | aur-7bb0e2ea1b8421f4216b30a0d0d22713d9de58fe.tar.gz |
Added error-handling for the build() function to ensure an exit if the UE build script fails, corrected some sed usage, and corrected an edge-case in the launch script.
-rw-r--r-- | PKGBUILD | 28 | ||||
-rwxr-xr-x | unreal-engine-4.sh | 2 |
2 files changed, 21 insertions, 9 deletions
@@ -158,12 +158,24 @@ prepare() { build() { cd ${pkgname} || return - ## See "https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/DeployingTheEngine/UsinganInstalledBuild/#installedbuildscriptoptions" for reference - if [[ ${_WithDDC} == true ]]; then - Engine/Build/BatchFiles/RunUAT.sh BuildGraph -target="Make Installed Build Linux" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=true -set:HostPlatformOnly=false -set:WithLinux=true -set:WithWin64=true -set:WithWin32=false -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLumin=false - else - Engine/Build/BatchFiles/RunUAT.sh BuildGraph -target="Make Installed Build Linux" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=false -set:HostPlatformOnly=false -set:WithLinux=true -set:WithWin64=true -set:WithWin32=false -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLumin=false - fi + + while true; do + ## See "https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/DeployingTheEngine/UsinganInstalledBuild/#installedbuildscriptoptions" for reference + if [[ ${_WithDDC} == true ]]; then + Engine/Build/BatchFiles/RunUAT.sh BuildGraph -target="Make Installed Build Linux" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=true -set:HostPlatformOnly=false -set:WithLinux=true -set:WithWin64=true -set:WithWin32=false -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLumin=false + else + Engine/Build/BatchFiles/RunUAT.sh BuildGraph -target="Make Installed Build Linux" -script=Engine/Build/InstalledEngineBuild.xml -set:WithDDC=false -set:HostPlatformOnly=false -set:WithLinux=true -set:WithWin64=true -set:WithWin32=false -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithLumin=false + fi + + exit_status=$? + + if [ ${exit_status} -eq 0 ]; then + break + else + echo "Error: Build failed; try searching the output for suspicious messages." >&2 + exit ${exit_status} + fi + done } package() { @@ -206,6 +218,6 @@ package() { # Configuring the launch script to detect when it has been run for the first time # Note: Requires that there isn't already a UE5 desktop entry in "${HOME}/local/share/applications/" - delete yours if you have one there before installing this DesktopFileChecksum=$(sha256sum "${pkgdir}/usr/share/applications/com.unrealengine.UE4Editor.desktop" | cut -f 1 -d ' ') - sed -i "s/ChecksumPlaceholder/${DesktopFileChecksum}/" "${pkgdir}/usr/share/applications/com.unrealengine.UE4Editor.desktop" - sed -i "s/InstalledLocationPlaceholder/${_install_dir}/" "${pkgdir}/usr/share/applications/com.unrealengine.UE4Editor.desktop" + sed -i "s|ChecksumPlaceholder|${DesktopFileChecksum}|" "${pkgdir}/usr/share/applications/com.unrealengine.UE4Editor.desktop" + sed -i "s|InstalledLocationPlaceholder|${_install_dir}|" "${pkgdir}/usr/share/applications/com.unrealengine.UE4Editor.desktop" } diff --git a/unreal-engine-4.sh b/unreal-engine-4.sh index 9c69511f337d..15be7e0caf62 100755 --- a/unreal-engine-4.sh +++ b/unreal-engine-4.sh @@ -36,4 +36,4 @@ if [ "${UE4desktopFileChecksum}" == "ChecksumPlaceholder" ]; then sed -i "14c\Path=${UE4editorPath}" "${HOME}/local/share/applications/com.unrealengine.UE4Editor.desktop" fi -xdg-open "${HOME}/local/share/applications/com.unrealengine.UE4Editor.desktop" +gio launch "${HOME}/local/share/applications/com.unrealengine.UE4Editor.desktop" |