Package Details: unreal-engine 5.4.4-0

Git Clone URL: https://aur.archlinux.org/unreal-engine.git (read-only, click to copy)
Package Base: unreal-engine
Description: A 3D game engine by Epic Games which can be used non-commercially for free.
Upstream URL: https://www.unrealengine.com/
Keywords: 3D engine game ue5 Unreal
Licenses: GPL3, custom:UnrealEngine
Submitter: acerix
Maintainer: Shatur (Neko-san)
Last Packager: Neko-san
Votes: 75
Popularity: 0.23
First Submitted: 2016-05-01 18:37 (UTC)
Last Updated: 2024-09-04 18:39 (UTC)

Required by (1)

Sources (6)

Pinned Comments

Neko-san commented on 2022-11-01 02:32 (UTC) (edited on 2023-06-25 01:19 (UTC) by Neko-san)

@juancarlospaco this is easily done on your own system, not in a PKGBUILD, given that building packages runs as root:

sudo groupadd unrealengine-users
sudo usermod -aG unrealengine-users (your-username)
sudo chown -R root:unrealengine-users /opt/unreal-engine
sudo chmod -R 775 /opt/unreal-engine

Permission issues like this are already mentioned on the UE Arch wiki page: https://wiki.archlinux.org/title/Unreal_Engine_4#Installing_from_the_AUR

This is a user system problem; I already did what I could without needing users to do the above by giving the 777 permissions. If it still gives you trouble, you'll have to use the example to solve it or change the install location to somewhere you have user permissions by default (as I cannot do this for you).

zerophase commented on 2021-05-27 08:15 (UTC) (edited on 2021-05-30 08:41 (UTC) by zerophase)

Will update to 5.0 when it is released.

Latest Comments

« First ‹ Previous 1 .. 20 21 22 23 24 25 26 27 28 29 30 .. 81 Next › Last »

doskanoness commented on 2022-07-01 04:52 (UTC)

I get this error:

Target arch set to: x86_64-unknown-linux-gnu
Building ThirdParty libraries

If you don't see SUCCESS message in the end, then building did not finish properly.
In that case, take a look into /home/doskanoness/.cache/yay/unreal-engine/src/unreal-engine/Engine/Build/BatchFiles/Linux/BuildThirdParty.log for details.

No third party libs needed to be built locally

**********  SUCCESS ****************
Setup successful.
==> Sources are ready.
==> Making package: unreal-engine 5.0.2-3 (Fri 01 Jul 2022 04:13:00 AM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...

Running AutomationTool...

Fixing inconsistent case in filenames.
Setting up Mono
Setting up bundled DotNet SDK 
Rebuilding: AutomationTool assembly not found
/home/doskanoness/.cache/yay/unreal-engine/src/unreal-engine/Engine/Binaries/ThirdParty/DotNet/Linux/sdk/3.1.401/NuGet.targets(255,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/doskanoness/.cache/yay/unreal-engine/src/unreal-engine/Engine/Source/Programs/AutomationTool/AutomationTool.csproj]
/home/doskanoness/.cache/yay/unreal-engine/src/unreal-engine/Engine/Binaries/ThirdParty/DotNet/Linux/sdk/3.1.401/NuGet.targets(255,5): error :   The SSL connection could not be established, see inner exception. [/home/doskanoness/.cache/yay/unreal-engine/src/unreal-engine/Engine/Source/Programs/AutomationTool/AutomationTool.csproj]
/home/doskanoness/.cache/yay/unreal-engine/src/unreal-engine/Engine/Binaries/ThirdParty/DotNet/Linux/sdk/3.1.401/NuGet.targets(255,5): error :   The remote certificate is invalid according to the validation procedure. [/home/doskanoness/.cache/yay/unreal-engine/src/unreal-engine/Engine/Source/Programs/AutomationTool/AutomationTool.csproj]
Compilation failed
RunUAT ERROR: AutomationTool failed to compile.
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: unreal-engine

Neko-san commented on 2022-06-29 19:57 (UTC)

@Shatur I'd be willing to look after it, if you don't mind?

Neko-san commented on 2022-06-29 06:41 (UTC)

Actually, he just told me he ironically didn't have an AUR account, so he deferred to myself instead

Neko-san commented on 2022-06-29 06:18 (UTC)

@Shatur That's why I made a switch for it Lol, but I'll get back to that in a minute

I know a dude that wouldn't mind, I've actually been talking to him about this for quite some time; I'll hit him up

As for the switch I mentioned, we can leave it off by default, but I figured there would only be theoretical performance gains by doing so

Shatur commented on 2022-06-29 06:14 (UTC)

I am currently unable to maintain this package. Is there anyone who wants to join? PKGBUILD from @Neko-san looks fine, but I don't like altering flags and would prefer to keep minimal changes (even remove all old patches for UE4).

Neko-san commented on 2022-06-25 00:26 (UTC) (edited on 2022-06-25 03:33 (UTC) by Neko-san)

Here's an update for the dotnet issues and some other things.

# Past Maintainer: Dylan Ferris <dylan@psilly.com>
# Past Maintainer: Michael Lojkovic <mikelojkovic@gmail.com>
# Past Maintainer: Shatur95 <genaloner@gmail.com>
# Contributor: Neko-san <aur@mycat.anonaddy.me>

# The source is about 200 MiB, with an extra ~11 GiB of dependencies downloaded in Setup.sh, and may take several hours to compile.
# If you want to turn on additional patches there are switches below.
pkgname=unreal-engine
pkgver=5.0
pkgrel=2
pkgdesc='A 3D game engine by Epic Games which can be used non-commercially for free.'
arch=('x86_64' 'x86_64_v2' 'x86_64_v3' 'x86_64_v4')
url=https://www.unrealengine.com/
makedepends=('git' 'openssh')
depends=('icu63' 'sdl2' 'python' 'lld' 'xdg-user-dirs' 'dos2unix')
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'
        'ccache_executor.patch'
        'stop_mono_clone.patch')
sha256sums=('15e9f9d8dc8bd8513f6a5eca990e2aab21fd38724ad57d213b06a6610a951d58'
            '33982486f7fafac35a33dfa37c85cfba8543aa78b5fe13c395d9cccf691ef4b3'
            'aa9eb83c9f58c539d3cd43e919a4ebd6714c0aa2d32eb9b320049cf04dd01587')
            #'960c5a100e0c3732f3c73fb645d3989d39acf4576d74615bbef38ebeee008b90')
# Not sure if compiling Unreal with LTO is legal? Lot's of different proprietary software goes into Unreal
options=('!strip' 'staticlibs' '!lto') # Package is 3 Gib 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

## This is for detecting your CPU architecture automatically; set to false if you want to enforce your own makepkg.conf file

## 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 - [I don't 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 with this method anyway because of Github SSH Agent nonsense

arch_auto=true

if [[ ${arch_auto} == true ]]
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 test "$(/lib/ld-linux-x86-64.so.2 --help | grep -w '^  x86-64-v4' | cut -d ',' -f 1)" == '  x86-64-v4 (supported'; then
    export CFLAGS="-march=x86-64-v4 -mtune=x86-64-v4 -O3 -pipe -fno-plt -fexceptions -Wall \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
    export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
    export LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
  elif test "$(/lib/ld-linux-x86-64.so.2 --help | grep -w '^  x86-64-v3' | cut -d ',' -f 1)" == '  x86-64-v3 (supported'; then
    export CFLAGS="-march=x86-64-v3 -mtune=x86-64-v3 -O3 -pipe -fno-plt -fexceptions -Wall \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
    export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
    export LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
  elif test "$(/lib/ld-linux-x86-64.so.2 --help | grep -w '^  x86-64-v2' | cut -d ',' -f 1)" == '  x86-64-v2 (supported'; then
    export CFLAGS="-march=x86-64-v2 -mtune=x86-64-v2 -O3 -pipe -fno-plt -fexceptions -Wall \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
    export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
    export LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
  elif test "$(/lib/ld-linux-x86-64.so.2 --help | grep -w '^  x86_64 (AT_PLATFORM; supported' | cut -d ',' -f 1)" == '  x86_64 (AT_PLATFORM; supported'; then
    export CFLAGS="-march=x86-64 -mtune=x86-64 -O3 -pipe -fno-plt -fexceptions -Wall \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
    export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
    export LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
  else
    export CFLAGS="-march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wall \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
    export CXXFLAGS="${CFLAGS} -Wp,-D_GLIBCXX_ASSERTIONS"
    export LDFLAGS="-Wl,-O3,--sort-common,--as-needed,-z,relro,-z,now"
  fi
fi

# Default engine installation directory. Can be useful if you do not have a lot of space on the default storage drive
_install_dir="opt/${pkgname}"

## These patches are leftover from previous maintainers; they're disabled in this PKGBUILD by default due to originally having been for UE4. Consider these experimental and outdated.

#_ccache_support=false # Patches for ccache. More optimizations might be needed.
#_system_mono=false # Uses System mono for unreal. Must set UE_USE_SYSTEM_MONO in your environment for it to work after install.


if [[ ${_ccache_support} == true ]]
then
  depends+=(ccache)
fi

if [[ ${_system_mono} == true ]]
then
  depends+=(mono mono-msbuild)
fi

pkgver() {
  cd "${srcdir}/${_pkgname}"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}


prepare() {
  # Check access to the repository
  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'
    exit 1
  fi

  # Download Unreal Engine source or update if the folder exists
  if [[ ! -d ${pkgname} ]]
  then
    #git clone --depth=1 --branch=ue5-main git@github.com:EpicGames/UnrealEngine {$pkgname}
    git clone --depth=1 --branch=release git@github.com:EpicGames/UnrealEngine ${pkgname}
    cd ${pkgname}
  else
    cd ${pkgname}
    rm -f .git/index.lock
    git fetch --depth=1 origin tag @{upstream}
    git reset --hard @{upstream}
  fi


  # Apply custom patches
  #patch -p1 -i "$srcdir/clang_path_fix.patch" # Replace Windows specific search with the correct path (used for -mode=GenerateClangDatabase in UBT)
  if [[ ${_system_mono} == true ]]
  then
    export UE_USE_SYSTEM_MONO=1
    patch -p1 -i "$srcdir/stop_mono_clone.patch"
  fi
  if [[ ${_ccache_support} == true ]]
  then
    patch -p1 -i "$srcdir/ccache_executor.patch"
  fi

  # Qt Creator source code access
  if [[ ! -d Engine/Plugins/Developer/QtCreatorSourceCodeAccess ]]
  then
    git -C Engine/Plugins/Developer clone --depth=1 git@github.com:fire/QtCreatorSourceCodeAccess
  fi

  # 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 ${pkgname}/Engine/Source/ThirdParty/Linux/
    touch ${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." ${pkgname}/Engine/Source/ThirdParty/Linux/HaveLinuxDependencies
  fi

  ./Setup.sh
}

build() {
  cd ${pkgname}
  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 -set:WithHTML5=false
}

package() {

# Desktop entry
if [[ -f com.unrealengine.UE4Editor.desktop ]] || [[ -f com.unrealengine.UE5Editor.desktop ]] && [[ "${_install_dir}" != "opt/${pkgname}" ]] 
then
  sed -i "5c\Path=/${_install_dir}/Engine/Binaries/Linux/" com.unrealengine.UE4Editor.desktop
  sed -i "6c\Exec=/${_install_dir}/Engine/Binaries/Linux/UnrealEditor %F" com.unrealengine.UE4Editor.desktop
  sed -i 's/Unreal Engine 4 Editor/Unreal Engine 5 Editor/g' com.unrealengine.UE4Editor.desktop
  sed -i 's/Icon=ue4editor/Icon=ue5editor/g' com.unrealengine.UE4Editor.desktop
  if [[ -f com.unrealengine.UE4Editor.desktop ]]
  then
    mv com.unrealengine.UE4Editor.desktop com.unrealengine.UE5Editor.desktop
  fi
  install -Dm775 com.unrealengine.UE5Editor.desktop "${pkgdir}/usr/share/applications/com.unrealengine.UE5Editor.desktop"
else
  if [[ -f com.unrealengine.UE4Editor.desktop ]] || [[ -f com.unrealengine.UE5Editor.desktop ]] && [[ "${_install_dir}" == "opt/${pkgname}" ]]
  then
    sed -i "5c\Path=/opt/${pkgname}/Engine/Binaries/Linux/" com.unrealengine.UE4Editor.desktop
    sed -i "6c\Exec=/opt/${pkgname}/Engine/Binaries/Linux/UnrealEditor %F" com.unrealengine.UE4Editor.desktop
    sed -i 's/Unreal Engine 4 Editor/Unreal Engine 5 Editor/g' com.unrealengine.UE4Editor.desktop
    sed -i 's/Icon=ue4editor/Icon=ue5editor/g' com.unrealengine.UE4Editor.desktop
    if [[ -f com.unrealengine.UE4Editor.desktop ]]
    then
      mv com.unrealengine.UE4Editor.desktop com.unrealengine.UE5Editor.desktop
    fi
    install -Dm775 com.unrealengine.UE5Editor.desktop "${pkgdir}/usr/share/applications/com.unrealengine.UE5Editor.desktop"
  fi
fi

  cd ${pkgname}

  # Icon for Desktop entry
  install -Dm770 Engine/Source/Programs/UnrealVS/UnrealVS.2022/Resources/Preview.png "${pkgdir}/usr/share/pixmaps/ue5editor.png"

  # License
  install -Dm770 LICENSE.md "${pkgdir}/usr/share/licenses/UnrealEngine/LICENSE.md"

  # Engine
  ## 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}/${_install_dir}/Engine"
  mv LocalBuilds/Engine/Linux/* "${pkgdir}/${_install_dir}"
}

flakusha commented on 2022-06-18 18:23 (UTC) (edited on 2022-06-23 16:00 (UTC) by flakusha)

@Premik to build Android you have to set JAVA_HOME, NDK_ROOT (or NDKROOT, it's incostistent), ANDROID_HOME, ANDROID_NDK_HOME and ANDROID_SDK_ROOT environment variables. I believe 3 first of them are just fine, but multi-billion dollar companies fail to create tools that check environment and libraries availability before build, so you may have an error after several hours :)

I have had 56 Gb build in final, Linux + Android, Android project compilation is failing on Linux at the moment.

Edit: you need to set up JAVA_HOME, NDKROOT and ANDROID_HOME

OdinVex commented on 2022-06-18 11:43 (UTC)

@Premik, That memalloc issue might be relating to a memory leak or something. I've got an associate who ran UE5 on Linux with a 2 GB card just fine enough to build a simple Hello World. To limit memory for compilation, limit cores. The dotnet stuff is spot on, though. I've spent an entire three days updating my (cloned) projects from UE4 including plugins...disastrous setback for so long.

Premik commented on 2022-06-18 11:20 (UTC)

Was trying to build via the UAT with Android support: -set:WithAndroid=true. But I was getting some command-not-found error at the very end. While the command name in the error message was actually blank. So I ended using GenerateProjectFiles and make.

UE5 shifts old dotnet which doesn't recognize system certs on linux. More recent dotnet works fine. But the system_mono flag didn't work for me and the UAT still used the embedded one. So another workaround for the NuGet ssl errors would be to import the root anchors into the CurrentUser user storage:

 dotnet tool install --global dotnet-certificate-tool #Install 3rd party tool to import .Net certs
 trust extract --format=pem-directory --filter=ca-anchors /tmp/certs # Export anchors
 ls /tmp/certs/*.pem | xargs -n1 certificate-tool add --store-location CurrentUser --store-name Root  --cert #Import to local store 
 # New files should show up in the ~/.dotnet/corefx/cryptography/x509stores/root

At some stage the compilation really took nearly 32G memory. Triggering oom killer.

At the end I found out my rusty GPU with only 2G of ram is not enough to run UE5. Keeps crashing on GPU memory allocation errors. Was ok on UE4 but UE5 only supports Vulkan.

flakusha commented on 2022-06-18 06:13 (UTC) (edited on 2022-06-18 06:21 (UTC) by flakusha)

This package can now be adopted.

I had success building and running Neko-san version, but there are several issues with build:

  • ICU is not found -> install libicu50, it may be the candidate to makedeps (you can use DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1, but you will have to use it every time you run Engine)

  • nuget SSL connection may need you to make soft links (Arch and Manjaro solution from Nuget Github): ln -s /etc/ssl /usr/lib/ssl ln -s /etc/ssl /usr/lib64/ssl

  • Project build needs write permission to /opt... I just opted out to build with makepkg and unpack Engine to location available for user to write :) Not running UE as root, knowing it is still unstable