summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO44
-rw-r--r--PKGBUILD329
-rwxr-xr-x[-rw-r--r--]com.unrealengine.UE4Editor.desktop25
-rw-r--r--ue5editor.svg1
-rw-r--r--unreal-engine-5-pacman-cache.hook11
-rwxr-xr-xunreal-engine-5.sh46
-rw-r--r--use-arch-mono.patch10
-rw-r--r--use_system_clang.patch12
8 files changed, 375 insertions, 103 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 366a268a59de..b9f95b8a8f21 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,30 +1,54 @@
pkgbase = unreal-engine
pkgdesc = A 3D game engine by Epic Games which can be used non-commercially for free.
- pkgver = 4.24.1
- pkgrel = 6
+ pkgver = 5.4.1
+ pkgrel = 0
url = https://www.unrealengine.com/
arch = x86_64
+ arch = x86_64_v2
+ arch = x86_64_v3
+ arch = x86_64_v4
+ arch = aarch64
license = custom:UnrealEngine
- makedepends = mono
- makedepends = dos2unix
+ license = GPL3
makedepends = git
- depends = icu
+ makedepends = openssh
+ makedepends = sed
+ makedepends = grep
+ makedepends = glibc
+ makedepends = wget
+ depends = icu63
depends = sdl2
depends = python
+ depends = dotnet-runtime
+ depends = dotnet-sdk
+ depends = vulkan-icd-loader
depends = lld
depends = xdg-user-dirs
+ depends = dos2unix
+ depends = openssl
+ depends = steam
+ depends = coreutils
+ depends = findutils
optdepends = qt5-base: qmake build system for projects
optdepends = cmake: build system for projects
optdepends = qtcreator: IDE for projects
optdepends = codelite: IDE for projects
optdepends = kdevelop: IDE for projects
optdepends = clion: IDE for projects
- options = strip
+ optdepends = pacman-contrib: for the paccache cleaning hook
+ optdepends = fake-ms-fonts: Font support for "demo/free/sample/example/tutorial" projects
+ optdepends = ttf-ms-fonts: Font support for "demo/free/sample/example/tutorial" projects
+ options = !strip
options = staticlibs
+ source = unreal-engine-5.sh
source = com.unrealengine.UE4Editor.desktop
- source = use-arch-mono.patch
- sha256sums = fa4bd19ab53e91cc8b4ae6208452a7fe986a08047617213d6250b43e7a140bf3
- sha256sums = 90a112f72a498f50dafad4feeaf7c551fe4e19830610bcef634f8e23d3d283b3
+ source = use_system_clang.patch
+ source = unreal-engine-5-pacman-cache.hook
+ source = ue5editor.svg
+ sha256sums = 55a8ad79c2e502bc5919249b9d1804ad405795b36630ab2f23aeb99dd218e5f4
+ sha256sums = c04c03b2c5c933b7eb1af283d607934ad95fd57f44d62b83719061b555a85dca
+ sha256sums = b0a57db9a44d0001dc76ca8504d93e273af30093c6a993a5969d82b0ace54b98
+ sha256sums = 9386160a91594abeeaf4fe02fea562e7a4ead4c6f9a258c2a37b2e5f10e7deca
+ sha256sums = b00c398b63f15084c46f3963f62a45284ecd8dae9ba6f38a2c4af370bbfdab8d
pkgname = unreal-engine
-
diff --git a/PKGBUILD b/PKGBUILD
index 50401009d455..bba43295f8c5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,119 +1,296 @@
-# Maintainer: Dylan Ferris <dylan@psilly.com>
-# Maintainer: Michael Lojkovic <mikelojkovic@gmail.com>
+# Old Maintainer: Dylan Ferris <dylan@psilly.com>
+# Old Maintainer: Michael Lojkovic <mikelojkovic@gmail.com>
# Maintainer: Shatur95 <genaloner@gmail.com>
+# Co-Maintainer: Neko-san <nekoNexus at protonmail dot ch>
+# Contributor: shawarden
# The source is about 200 MiB, with an extra ~11 GiB of dependencies downloaded in Setup.sh, and may take several hours to compile.
-pkgname='unreal-engine'
-pkgver=4.24.3
-pkgrel=1
+# If you want additional options, there are switches below.
+pkgname=unreal-engine
+pkgver=5.4.1
+pkgrel=0
pkgdesc='A 3D game engine by Epic Games which can be used non-commercially for free.'
-arch=('x86_64')
-url='https://www.unrealengine.com/'
-makedepends=('mono' 'dos2unix' 'git')
-depends=('icu' 'sdl2' 'python' 'lld' 'xdg-user-dirs')
+arch=('x86_64' 'x86_64_v2' 'x86_64_v3' 'x86_64_v4' 'aarch64')
+url=https://www.unrealengine.com/
+makedepends=('git' 'openssh' 'sed' 'grep' 'glibc' 'wget')
+depends=('icu63' 'sdl2' 'python' 'dotnet-runtime' 'dotnet-sdk' 'vulkan-icd-loader' 'lld' 'xdg-user-dirs' 'dos2unix' 'openssl' 'steam' 'coreutils' 'findutils')
optdepends=('qt5-base: qmake build system for projects'
'cmake: build system for projects'
'qtcreator: IDE for projects'
'codelite: IDE for projects'
'kdevelop: IDE for projects'
- 'clion: IDE for projects')
-license=('custom:UnrealEngine')
-source=('com.unrealengine.UE4Editor.desktop'
- 'use-arch-mono.patch')
-sha256sums=('fa4bd19ab53e91cc8b4ae6208452a7fe986a08047617213d6250b43e7a140bf3'
- '90a112f72a498f50dafad4feeaf7c551fe4e19830610bcef634f8e23d3d283b3')
-options=(strip staticlibs) # Package is 3 Gib smaller with "strip" but it takes a long time and generates many warnings
+ 'clion: IDE for projects'
+ 'pacman-contrib: for the paccache cleaning hook'
+ 'fake-ms-fonts: Font support for "demo/free/sample/example/tutorial" projects'
+ 'ttf-ms-fonts: Font support for "demo/free/sample/example/tutorial" projects')
+license=('custom:UnrealEngine' 'GPL3')
+source=('unreal-engine-5.sh'
+ 'com.unrealengine.UE4Editor.desktop'
+ 'use_system_clang.patch'
+ 'unreal-engine-5-pacman-cache.hook'
+ 'ue5editor.svg')
+sha256sums=('55a8ad79c2e502bc5919249b9d1804ad405795b36630ab2f23aeb99dd218e5f4'
+ 'c04c03b2c5c933b7eb1af283d607934ad95fd57f44d62b83719061b555a85dca'
+ 'b0a57db9a44d0001dc76ca8504d93e273af30093c6a993a5969d82b0ace54b98'
+ '9386160a91594abeeaf4fe02fea562e7a4ead4c6f9a258c2a37b2e5f10e7deca'
+ 'b00c398b63f15084c46f3963f62a45284ecd8dae9ba6f38a2c4af370bbfdab8d')
+# Not sure if compiling Unreal with LTO is legal? Lot's of different proprietary software goes into Unreal
+options=('!strip' 'staticlibs') # Package is smaller with "strip" but it takes a long time and generates many warnings
+
+## Use this if you prefer opendoas; the benefit here is that doas won't time out on you if you wait too long to authenticate after compilation
+if [ -f /usr/bin/doas ] && [ -f /etc/doas.conf ]; then
+ PACMAN_AUTH=(doas)
+fi
+
+# Change this to true or 1 for a potentially smaller package size
+## Note: We can't guarantee that enabling this won't affect cross-distro compatibility given that Epic provides their own toolchain specifically
+## based on the claim that it helps with compatibility...
+## Though, you could just distribute your game as an AppImage if you decide to publish on a game store... :p
+_use_system_clang=false
+
+# Default engine installation directory. Can be useful if you do not have a lot of space on the default storage drive
+# DON'T put a "/" at the start of the path
+## Set this as an environment variable in /etc/makepkg.conf if you want predefined behavior
+if [ "${_ue5_install_dir}" == "" ]; then
+ export _ue5_install_dir="opt/${pkgname}"
+fi
+
+# Change this to true if you have a modern system and don't mind the extra packaging time (and size) to avoid compiling shaders on UE startup later; set to false by default for those with less robust systems
+## Set this as an environment variable in /etc/makepkg.conf if you want predefined behavior
+if [ "${_WithDDC}" != true ] && [ "${_WithDDC}" != false ]; then
+ export _WithDDC=false
+fi
+
+# Change this if you want an alternative non-default logo for UE5's desktop icon; the default logo is enabled by default
+## Set this as an environment variable in /etc/makepkg.conf if you want predefined behavior
+if [ "${USE_DEFAULT_UE_LOGO_AT_INSTALL}" != 1 ] && [ "${USE_DEFAULT_UE_LOGO_AT_INSTALL}" != 0 ]; then
+ export USE_DEFAULT_UE_LOGO_AT_INSTALL=1
+fi
+
+## An attempt to fix the NuGet SSL issue during the build -- didn't seem to work; users had to do this manually, so we'll rollback to an alternative
+#ln -s /etc/ssl /usr/lib/ssl
+#ln -s /etc/ssl /usr/lib64/ssl
+## ---
+export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
+
+## This is for detecting your CPU architecture automatically; set to false if you want to enforce your own makepkg.conf file
+## Disabled by default as a compromise for those bothered by having it force-enabled
+
+## Note: the resulting package will still be named containing "x86_64" unless the build was done with an "official" Arch distro for that architecture (like Arch ARM - [don't exactly advise using Arch ARM though])
+## or if you manage to trick your Arch installation to accept other architecture extensions by fiddling with the $CARCH variable and /etc/pacman.conf - this method has flaws, namely due to a bug:
+## it doesn't work with "makechrootpkg" - though, this PKGBUILD doesn't work in with this method anyway because of Github SSH Agent nonsense -- if this changes in the future, let us know
+
+# Valid values are false / disabled / default, auto, and native
+
+if [ "${arch_auto}" != true ] || [ "${arch_auto}" != false ] || [ "${arch_auto}" != disabled ] || [ "${arch_auto}" != native ]; then
+ arch_auto=false
+fi
+
+opt_level=""
+
+if [[ ${CFLAGS} =~ -O([0-9]+) ]]; then
+ opt_level="-O${BASH_REMATCH[1]}"
+else
+ opt_level="-O3"
+fi
+
+if [[ ${arch_auto} == auto ]]
+then
+ ## Architecture checks and compile flag adjustments - shellcheck throws a fit about the build function but it looks fine to me; checks for the highest available x64 support level and falls back to "native" if either not available
+ if [ "$(uname -m)" == "x86_64" ]; then
+ if [ "$(/lib/ld-linux-x86-64.so.2 --help | grep -w 'x86-64-v4' | cut -d ',' -f 1 | sed 's/^ //' | sed 's/ (/ - /')" == 'x86-64-v4 - supported' ]; then
+ export CFLAGS="${CFLAGS} -march=x86-64-v4 -mtune=x86-64-v4 ${opt_level} -pipe -fno-plt -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,relro,-z,now -w -Wformat -Werror=format-security -fpic -fpie -Wp,-D_FORTIFY_SOURCE=2"
+ export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
+ export LDFLAGS="-pie -Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
+ elif [ "$(/lib/ld-linux-x86-64.so.2 --help | grep -w 'x86-64-v3' | cut -d ',' -f 1 | sed 's/^ //' | sed 's/ (/ - /')" == 'x86-64-v3 - supported' ]; then
+ export CFLAGS="${CFLAGS} -march=x86-64-v3 -mtune=x86-64-v3 ${opt_level} -pipe -fno-plt -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,relro,-z,now -w -Wformat -Werror=format-security -fpic -fpie -Wp,-D_FORTIFY_SOURCE=2"
+ export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
+ export LDFLAGS="-pie -Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
+ elif [ "$(/lib/ld-linux-x86-64.so.2 --help | grep -w 'x86-64-v2' | cut -d ',' -f 1 | sed 's/^ //' | sed 's/ (/ - /')" == 'x86-64-v2 - supported' ]; then
+ export CFLAGS="${CFLAGS} -march=x86-64-v2 -mtune=x86-64-v2 ${opt_level} -pipe -fno-plt -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,relro,-z,now -w -Wformat -Werror=format-security -fpic -fpie -Wp,-D_FORTIFY_SOURCE=2"
+ export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
+ export LDFLAGS="-pie -Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
+ elif [ "$(/lib/ld-linux-x86-64.so.2 --help | grep 'x86_64' | grep 'supported' | cut -d ',' -f 1 | sed 's/^ //' | sed 's/ (/ - /' | grep -w '^x86_64 - supported')" == 'x86_64 - supported' ]; then
+ export CFLAGS="${CFLAGS} -march=x86-64 -mtune=x86-64 ${opt_level} -pipe -fno-plt -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,relro,-z,now -w -Wformat -Werror=format-security -fpic -fpie -Wp,-D_FORTIFY_SOURCE=2"
+ export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
+ export LDFLAGS="-pie -Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
+ fi
+ elif [ "$(uname -m)" == "aarch64" ]; then
+ export CFLAGS="${CFLAGS} -march=aarch64 -mtune=aarch64 ${opt_level} -pipe -fno-plt -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,relro,-z,now -w -Wformat -Werror=format-security -fPIC -fPIE -Wp,-D_FORTIFY_SOURCE=2"
+ export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
+ export LDFLAGS="-pie -Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
+ else
+ echo "Architecture '$(uname -m)' is not supported! Exiting."
+ return
+ fi
+elif [[ "${arch_auto}" == native ]]; then
+ export CFLAGS="${CFLAGS} -march=native -mtune=native ${opt_level} -pipe -fno-plt -fstack-clash-protection -fstack-protector-strong -fcf-protection -Wl,-z,relro,-z,now -w -Wformat -Werror=format-security -fPIC -fPIE -Wp,-D_FORTIFY_SOURCE=2"
+ export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
+ export LDFLAGS="-pie -Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
+fi
+
prepare() {
# Check access to the repository
- if ! git ls-remote git@github.com:EpicGames/UnrealEngine &>-
+ if ! git ls-remote git@github.com:EpicGames/UnrealEngine &>/dev/null
then
- error "You must register at unrealengine.com and link your github account to access this private repo. See the wiki for more info: https://wiki.archlinux.org/index.php/Unreal_Engine_4"
+ error 'You must register at unrealengine.com and link your github account to access this private repo. See the wiki for more info: https://wiki.archlinux.org/index.php/Unreal_Engine_4'
exit 1
fi
# Download Unreal Engine source or update if the folder exists
- if [ ! -d $pkgname ]
+ if [[ ! -d "${pkgname}" ]]
then
- git clone --depth=1 --branch=$pkgver-release git@github.com:EpicGames/UnrealEngine $pkgname
- cd $pkgname
+ #git clone --depth=1 --branch=ue5-main git@github.com:EpicGames/UnrealEngine "{$pkgname}"
+ git clone --depth=1 --branch=${pkgver}-release git@github.com:EpicGames/UnrealEngine "${pkgname}"
+ cd "${pkgname}" || return
else
- cd $pkgname
- rm -f .git/index.lock
- git fetch --depth=1 origin tag $pkgver-release
- git reset --hard $pkgver-release
+ cd "${pkgname}" || return
+ CURRENT_CLONED_VERSION="$(git describe --tags)"
+ if [ "${CURRENT_CLONED_VERSION}" != "${pkgver}-release" ]; then
+ cd ..
+ rm -rf "${pkgname}"
+ git clone --depth=1 --branch=${pkgver}-release git@github.com:EpicGames/UnrealEngine "${pkgname}"
+ cd "${pkgname}" || return
+ else
+ rm -f .git/index.lock
+ git fetch --depth=1 origin tag ${pkgver}-release
+ git reset --hard ${pkgver}-release
+ fi
fi
- patch Engine/Build/BatchFiles/Linux/SetupMono.sh $srcdir/use-arch-mono.patch # Use system mono
-
+ ## Apply custom patches if enabled
+ if [ "${_use_system_clang}" == true ]; then
+ patch -p1 -i "${srcdir}/use_system_clang.patch"
+ fi
+
# Qt Creator source code access
- if [ ! -d Engine/Plugins/Developer/QtCreatorSourceCodeAccess ]
+ if [[ ! -d Engine/Plugins/Developer/QtCreatorSourceCodeAccess ]]
then
- git -C Engine/Plugins/Developer clone --depth=1 git@github.com:fire/QtCreatorSourceCodeAccess
+ # https://github.com/fire-archive/QtCreatorSourceCodeAccess - See for usage
+ git -C Engine/Plugins/Developer clone --depth=1 https://github.com/fire-archive/QtCreatorSourceCodeAccess
fi
- export TERM=xterm
+ # For some reason, despite this file explicitly asking not to be removed, it was removed from the UE5 source; it has to be re-added or the build will fail
+ if [[ ! -f ${pkgname}/Engine/Source/ThirdParty/Linux/HaveLinuxDependencies ]]
+ then
+ mkdir -p "${srcdir}/${pkgname}/Engine/Source/ThirdParty/Linux/"
+ touch "${srcdir}/${pkgname}/Engine/Source/ThirdParty/Linux/HaveLinuxDependencies"
+ sed -i "1c\This file must have no extension so that GitDeps considers it a binary dependency - it will only be pulled by the Setup script if Linux is enabled. Please do not remove this file." "${srcdir}/${pkgname}/Engine/Source/ThirdParty/Linux/HaveLinuxDependencies"
+ fi
+
./Setup.sh
- ./GenerateProjectFiles.sh -makefile
}
build() {
- cd $pkgname
-
- # Build all targets from the "all" rule separately, because building multiple targets in parallel results in an error (but building one target with multiple threads is possible)
- make CrashReportClient-Linux-Shipping
- make CrashReportClientEditor-Linux-Shipping
- make ShaderCompileWorker
- make UnrealLightmass
- make UnrealFrontend
- make UE4Editor
- make UnrealInsights
+ cd "${pkgname}" || return
+
+ if [ "${_WithDDC}" == true ]; then
+ build='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:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false'
+ else
+ build='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:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false'
+ fi
+
+ if eval "${build}"; then
+ :
+ else
+ echo "Error: Build failed; try searching the output for suspicious messages." >&2
+ return;
+ fi
}
package() {
- # Install dir
- dir="opt/$pkgname"
# Desktop entry
- if [ "$dir" != "opt/$pkgname" ] # Set new path if dir changed
- then
- sed -i "5c\Path=/$dir/Engine/Binaries/Linux/" com.unrealengine.UE4Editor.desktop
+ if [ ! -f com.unrealengine.UE5Editor.desktop ] && [ -f com.unrealengine.UE4Editor.desktop ]; then
+ cp com.unrealengine.UE4Editor.desktop com.unrealengine.UE5Editor.desktop
fi
- install -Dm644 com.unrealengine.UE4Editor.desktop $pkgdir/usr/share/applications/com.unrealengine.UE4Editor.desktop
- cd $pkgname
+ sed -i "7c\Exec=/usr/bin/unreal-engine-5.sh %U" com.unrealengine.UE5Editor.desktop
+ sed -i "14c\Path=/usr/bin/" com.unrealengine.UE5Editor.desktop
+ sed -i 's/Unreal Engine 4 Editor/Unreal Engine 5 Editor/g' com.unrealengine.UE5Editor.desktop
+ sed -i 's/Icon=ue4editor/Icon=ue5editor/g' com.unrealengine.UE5Editor.desktop
+ install -Dm644 com.unrealengine.UE5Editor.desktop "${pkgdir}/usr/share/applications/com.unrealengine.UE5Editor.desktop"
+ chmod +x "${pkgdir}/usr/share/applications/com.unrealengine.UE5Editor.desktop"
+
+ ## Install a pacman hook to keep old builds from compounding cache by tens of GBs - 2 builds alone can reach at least 30 GBs in pacman's cache; having one only takes up about 15 GBs
+ install -Dm775 unreal-engine-5-pacman-cache.hook "${pkgdir}/etc/pacman.d/hooks/unreal-engine-5-pacman-cache.hook"
+
+ install -dm755 "${pkgdir}/usr/bin"
+ install -dm755 "${pkgdir}/usr/share/pixmaps/"
+ install -dm755 "${pkgdir}/usr/share/applications/"
# Icon for Desktop entry
- install -Dm644 Engine/Source/Programs/UnrealVS/Resources/Preview.png $pkgdir/usr/share/pixmaps/ue4editor.png
+ if [ "${USE_DEFAULT_UE_LOGO_AT_INSTALL}" == 1 ]; then
+ install -Dm644 ue5editor.svg "${pkgdir}/usr/share/pixmaps/ue5editor.svg"
+ else
+ mv ue5editor.svg ue5editor.svg.bak
+ wget --output-document "ue5editor.svg" "https://raw.githubusercontent.com/EliverLara/candy-icons/master/apps/scalable/ue4editor.svg"
+ install -Dm644 ue5editor.svg "${pkgdir}/usr/share/pixmaps/ue5editor.svg"
+ wget --output-document "LICENSE" "https://raw.githubusercontent.com/EliverLara/candy-icons/master/LICENSE"
+ mkdir -p "${pkgdir}/usr/share/UnrealEngine/EliverLara-candy-icons/"
+ install -Dm644 LICENSE "${pkgdir}/usr/share/UnrealEngine/EliverLara-candy-icons/"
+ rm ue5editor.svg
+ rm LICENSE
+ mv ue5editor.svg.bak ue5editor.svg
+ fi
# License
- install -Dm644 LICENSE.md $pkgdir/usr/share/licenses/UnrealEngine/LICENSE.md
+ install -Dm644 "${srcdir}/${pkgname}/LICENSE.md" "${pkgdir}/usr/share/licenses/UnrealEngine/LICENSE.md"
# Engine
- install -dma+rwX "$pkgdir/$dir/Engine"
- mv Engine/Binaries "$pkgdir/$dir/Engine/Binaries"
- mv Engine/Build "$pkgdir/$dir/Engine/Build"
- mv Engine/Config "$pkgdir/$dir/Engine/Config"
- mv Engine/Content "$pkgdir/$dir/Engine/Content"
- mv Engine/Documentation "$pkgdir/$dir/Engine/Documentation"
- mv Engine/Extras "$pkgdir/$dir/Engine/Extras"
- mv Engine/Plugins "$pkgdir/$dir/Engine/Plugins"
- mv Engine/Programs "$pkgdir/$dir/Engine/Programs"
- mv Engine/Shaders "$pkgdir/$dir/Engine/Shaders"
- mv Engine/Source "$pkgdir/$dir/Engine/Source"
-
- # Required folders
- install -d "$pkgdir/$dir/Engine/DerivedDataCache"
- install -d "$pkgdir/$dir/Engine/Intermediate"
- install -d "$pkgdir/$dir/Engine/Saved"
-
- # Content
- mv FeaturePacks "$pkgdir/$dir/FeaturePacks"
- mv Samples "$pkgdir/$dir/Samples"
- mv Templates "$pkgdir/$dir/Templates"
-
- # Build scripts, used by some plugins (CLion)
- install -Dm755 GenerateProjectFiles.sh "$pkgdir/$dir/GenerateProjectFiles.sh"
- install -Dm755 Setup.sh "$pkgdir/$dir/Setup.sh"
- install -Dm644 .ue4dependencies "$pkgdir/$dir/.ue4dependencies"
+ ## Set to all permissions to prevent the engine from breaking itself; more elegant solutions might exist - suggest them if they can be automated here
+ ## Also, correct me if I package this improperly; I added Win64 support for the build in hopes of supporting cross-compilation
+ install -dm777 "${pkgdir}/${_ue5_install_dir}/Engine"
+
+ # Copy LocalBuilds to pkg...
+ cp -flr "${srcdir}"/"${pkgname}"/LocalBuilds/Engine/Linux/* "${pkgdir}"/"${_ue5_install_dir}"/
+ if [ -f "${srcdir}"/"${pkgname}"/LocalBuilds/Engine/Linux/Engine/Binaries/Linux/UnrealEditor ]; then
+ # Can never be too careful with recursive rm...
+ rm -r "${srcdir}"/"${pkgname}"/LocalBuilds
+ fi
+
+ # Copy the rest of it to pkg... Should we be overwriting LocalBuilds?
+ cp -flr "${srcdir}"/"${pkgname}"/* "${pkgdir}"/"${_ue5_install_dir}"/
+ if [ -f "${srcdir}"/"${pkgname}"/Engine/Binaries/Linux/UnrealEditor ]; then
+ rm -r "${srcdir}"/"${pkgname:?}"/*
+ fi
+
+ # if [ -f "${srcdir}/${pkgname}/cpp.hint" ] && [ ! -d "${srcdir}/${pkgname}/cpp.hint" ]; then
+ # mv "${srcdir}/${pkgname}/cpp.hint" "${pkgdir}/${_ue5_install_dir}"
+ # elif [ -d "${srcdir}/${pkgname}/cpp.hint" ]; then
+ # mkdir -p "${pkgdir}/${_ue5_install_dir}/cpp.hint"
+ # mv "${srcdir}"/"${pkgname}"/cpp.hint/* "${pkgdir}/${_ue5_install_dir}/cpp.hint"
+ # fi
+ #
+ # if [ -f "${srcdir}/${pkgname}/GenerateProjectFiles.sh" ]; then
+ # install -Dm777 "${srcdir}/${pkgname}/GenerateProjectFiles.sh" "${pkgdir}/${_ue5_install_dir}"
+ # fi
+
+ chmod -R 777 "${pkgdir}/${_ue5_install_dir}"
+
+ if [ -x "$(find "${pkgdir}/${_ue5_install_dir}" -type f -iname 'xbuild')" ]; then
+ find "${pkgdir}/${_ue5_install_dir}" -type f -iname 'xbuild' -exec chmod +x "{}" \;
+ fi
+
+ if [ -x "$(find "${pkgdir}/${_ue5_install_dir}" -type f -iname 'mcs')" ]; then
+ find "${pkgdir}/${_ue5_install_dir}" -type f -iname 'mcs' -exec chmod +x "{}" \;
+ fi
+
+ ## Do this, in case the path doesn't exist for some reason
+ mkdir -p "${pkgdir}/${_ue5_install_dir}/Engine/Binaries/Android/"
+
+ # Launch script to initialize missing user folders for Unreal Engine
+ install -Dm755 ../unreal-engine-5.sh "${pkgdir}/usr/bin/"
+ chmod +x "${pkgdir}/usr/bin/unreal-engine-5.sh"
+ ln -s "${pkgdir}/usr/bin/unreal-engine-5.sh" "${pkgdir}/usr/bin/ue5"
+ ln -s "${pkgdir}/usr/bin/unreal-engine-5.sh" "${pkgdir}/usr/bin/UE5"
+ ln -s "${pkgdir}/usr/bin/unreal-engine-5.sh" "${pkgdir}/usr/bin/unreal-engine-5"
+ chmod 755 "${pkgdir}/usr/bin/ue5" "${pkgdir}/usr/bin/UE5" "${pkgdir}/usr/bin/unreal-engine-5"
+
+ # 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.UE5Editor.desktop" | cut -f 1 -d ' ')
+ sed -i "s|ChecksumPlaceholder|${DesktopFileChecksum}|" "${pkgdir}/usr/bin/unreal-engine-5.sh"
+ sed -i "s|InstalledLocationPlaceholder|/${_ue5_install_dir}/Engine/Binaries|" "${pkgdir}/usr/bin/unreal-engine-5.sh"
}
diff --git a/com.unrealengine.UE4Editor.desktop b/com.unrealengine.UE4Editor.desktop
index 7c07a174abbe..1c9c61c6d5f2 100644..100755
--- a/com.unrealengine.UE4Editor.desktop
+++ b/com.unrealengine.UE4Editor.desktop
@@ -1,11 +1,22 @@
+#!/usr/bin/env xdg-open
+
[Desktop Entry]
-Type=Application
-Name=Unreal Engine 4 Editor
+Categories=Development;
+Comment[en_US]=Create next-generation video games
Comment=Create next-generation video games
-Path=/opt/unreal-engine/Engine/Binaries/Linux/
-Exec=UE4Editor %F
-MimeType=text/x-uproject
+Exec=/opt/unreal-engine/Engine/Binaries/Linux/UE4Editor %F
+GenericName[en_US]=
+GenericName=
Icon=ue4editor
+MimeType=
+Name[en_US]=Unreal Engine 4 Editor
+Name=Unreal Engine 4 Editor
+Path=/opt/unreal-engine/Engine/Binaries/Linux/
+StartupNotify=true
Terminal=false
-Categories=Development;
-
+TerminalOptions=
+Type=Application
+X-DBUS-ServiceName=
+X-DBUS-StartupType=
+X-KDE-SubstituteUID=false
+X-KDE-Username=
diff --git a/ue5editor.svg b/ue5editor.svg
new file mode 100644
index 000000000000..a84b1b05c3b6
--- /dev/null
+++ b/ue5editor.svg
@@ -0,0 +1 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 336 336"><defs><style>.cls-1{fill:#fff;fill-rule:evenodd;}</style></defs><circle cx="168" cy="168" r="160.87" /><path class="cls-1" d="M264.11,191.3h0c-2.79,13.44-15.19,47.94-54.74,66.62l-15.88-17.86L166.69,267a98.9,98.9,0,0,1-78.22-40.12,38.53,38.53,0,0,0,8.76,1.65c4.39.08,9.14-1.53,9.14-8.9v-72.7a12,12,0,0,0-15.05-12C78.91,137.79,69,168.75,69,168.75a98.44,98.44,0,0,1,34.07-75.44,99.85,99.85,0,0,1,50.27-23.19c-13.55,7.72-21.16,20.31-21.16,30.87,0,17,10.24,14.94,13.27,12.44v98.12a15.6,15.6,0,0,0,2,3.45,14.49,14.49,0,0,0,11.85,6c10.25,0,23.55-11.7,23.55-11.7V129.88c0-8.08-6.09-17.84-12.19-21.19,0,0,11.29-2,20,4.67h0a74.63,74.63,0,0,1,5.21-5.73C216.2,87.68,235.35,82,251.3,79.16h0s-29,22.79-29,53.37c0,22.74.59,78.2.59,78.2C233.65,221.12,249.65,206.11,264.11,191.3Z"/><path class="cls-1" d="M168,6.26A161.74,161.74,0,1,0,329.74,168,161.74,161.74,0,0,0,168,6.26Zm0,317A155.27,155.27,0,1,1,323.27,168,155.27,155.27,0,0,1,168,323.27Z"/></svg>
diff --git a/unreal-engine-5-pacman-cache.hook b/unreal-engine-5-pacman-cache.hook
new file mode 100644
index 000000000000..a54e413a16fe
--- /dev/null
+++ b/unreal-engine-5-pacman-cache.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = unreal-engine
+
+[Action]
+Description = Leaving only one Unreal Engine 5 package in cache to save storage space...
+Depends = pacman-contrib
+When = PostTransaction
+Exec = /bin/sh -c '/usr/bin/paccache -rvk1 unreal-engine'
diff --git a/unreal-engine-5.sh b/unreal-engine-5.sh
new file mode 100755
index 000000000000..ae693fe2e165
--- /dev/null
+++ b/unreal-engine-5.sh
@@ -0,0 +1,46 @@
+#! /usr/bin/bash
+
+## I keep getting this question/comment, so I'll explain the reason for this here for those who feel compelled to ask again:
+# This file mainly exists to stop stubborn people who have a bad habit of running everything as root and to make sure specific paths exists to avoid arbitrary legacy compatibility issues.
+# It also assists with determining user-chosen custom install locations and ensuring the path to the editor binary path isn't entirely lost in the event 'UnrealEdior' is ever relocated to somewhere else for any arbitrary reason upstream decides.
+# If someone really wants to run Unreal with unmitigated admin privileges, any resulting damage is on YOU and not me.
+# You can still find the binary or modify this script/PKGBUILD yourself.
+# I am *not* going to troubleshoot short-sighted and insecure 'root everything' nonsense.
+# Additionally, I will remind you that "/opt" *is used by default* but the option is, again, ultimately up to the you where the installation resides.
+# This is the difference between handing someone you don't know a loaded "gun" versus handing it to them with the safety on.
+
+if [ "$(id -u)" -eq 0 ]; then
+ echo "ERROR: Run this as an unprivileged user; not as root."
+ return;
+fi
+
+if [ -d "${HOME}/.steam/bin" ] && [ ! -L "${HOME}/.steampath" ]; then
+ ln -s "${HOME}/.steam/bin" "${HOME}/.steampath"
+elif [ ! -d "${HOME}/.steam/bin" ] && [ ! -L "${HOME}/.steampath" ]; then
+ mkdir -p "${HOME}/.steam/bin"
+ ln -s "${HOME}/.steam/bin" "${HOME}/.steampath"
+fi
+
+if [ ! -d "${HOME}/.config/Epic/UnrealEngine/5.0/Intermediate/" ]; then
+ mkdir -p "${HOME}/.config/Epic/UnrealEngine/5.0/Intermediate/"
+fi
+
+if [ ! -d "${HOME}/.cnfig/Epic/UnrealEngine/5.0/Intermediate/" ]; then
+ mkdir -p "${HOME}/.cnfig/Epic/UnrealEngine/5.0/Intermediate/"
+fi
+
+if [ ! -f "${HOME}/.local/share/applications/com.unrealengine.UE5Editor.desktop" ]; then
+ cp /usr/share/applications/com.unrealengine.UE5Editor.desktop "${HOME}/.local/share/applications/com.unrealengine.UE5Editor.desktop"
+fi
+
+UE5desktopFileChecksum="$(sha256sum "${HOME}/.local/share/applications/com.unrealengine.UE5Editor.desktop" | cut -f 1 -d ' ')"
+
+if [ "${UE5desktopFileChecksum}" == "ChecksumPlaceholder" ]; then
+ UE5editorLocation="$(find InstalledLocationPlaceholder -type f -iname 'UnrealEditor')"
+ UE5editorPath="$(echo ${UE5editorLocation/UnrealEditor/})"
+
+ sed -i "7c\Exec=${UE5editorLocation} %F" "${HOME}/.local/share/applications/com.unrealengine.UE5Editor.desktop"
+ sed -i "14c\Path=${UE5editorPath}" "${HOME}/.local/share/applications/com.unrealengine.UE5Editor.desktop"
+fi
+
+gio launch "${HOME}/.local/share/applications/com.unrealengine.UE5Editor.desktop"
diff --git a/use-arch-mono.patch b/use-arch-mono.patch
deleted file mode 100644
index b1a256e1b112..000000000000
--- a/use-arch-mono.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- SetupMono-orig.sh 2019-09-05 18:59:40.953565669 -0500
-+++ SetupMono.sh 2019-09-05 19:05:21.203570187 -0500
-@@ -11,6 +11,7 @@
- bash FixDependencyFiles.sh
-
- IS_MONO_INSTALLED=0
-+UE_USE_SYSTEM_MONO=1
- MONO_VERSION_PATH=$(command -v mono) || true
- if [ "$UE_USE_SYSTEM_MONO" == "1" ] && [ ! $MONO_VERSION_PATH == "" ] && [ -f $MONO_VERSION_PATH ]; then
- # If Mono is installed, check if it's 5.0 or higher
diff --git a/use_system_clang.patch b/use_system_clang.patch
new file mode 100644
index 000000000000..5cd3a2d554ac
--- /dev/null
+++ b/use_system_clang.patch
@@ -0,0 +1,12 @@
+diff --git a/Engine/Source/Programs/UnrealBuildTool/Modes/GenerateClangDatabase.cs b/Engine/Source/Programs/UnrealBuildTool/Modes/GenerateClangDatabase.cs
+--- a/Engine/Source/Programs/UnrealBuildTool/Modes/GenerateClangDatabase.cs 2022-06-30 13:51:57.914058994 -0500
++++ b/Engine/Source/Programs/UnrealBuildTool/Modes/GenerateClangDatabase.cs 2022-06-30 13:53:46.038059502 -0500
+@@ -64,7 +64,7 @@
+ UEBuildTarget Target = UEBuildTarget.Create(TargetDescriptor, BuildConfiguration.bSkipRulesCompile, BuildConfiguration.bForceRulesCompile, BuildConfiguration.bUsePrecompiled);
+
+ // Find the location of the compiler
+- FileReference ClangPath = FindClangCompiler(Target);
++ FileReference ClangPath = new FileReference("/usr/bin/clang++");
+
+ // Convince each module to output its generated code include path
+ foreach (UEBuildBinary Binary in Target.Binaries)