diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 205 |
1 files changed, 84 insertions, 121 deletions
@@ -1,157 +1,120 @@ # Maintainer: Dylan Ferris <dylan@psilly.com> +# Maintainer: Michael Lojkovic <mikelojkovic@gmail.com> +# Maintainer: Shatur95 <genaloner@gmail.com> -# 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 - -# The source is over 8 GiB, with an extra 3 GiB of dependencies downloaded in build(), and may take several hours to compile. - +# 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' -install="$pkgname.install" -pkgver=4.23.1 -# shellcheck disable=SC2034 -{ - pkgrel=1 - 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=('clang' 'mono' 'dos2unix' 'cmake' 'git') - depends=('icu' 'sdl2' 'python' 'lld' 'xdg-user-dirs') - license=('custom:UnrealEngine') - - source=( - "git+ssh://git@github.com/EpicGames/UnrealEngine.git#tag=$pkgver-release" - 'UE4Editor.desktop' - 'recompile-version-selector.patch' - 'Makefile' - 'ignore-clang50-install.patch' - 'use-arch-mono.patch' - 'allow-unsupported-clang.patch' - 'remove-sysctl-include.patch' - 'add-editorstyle-dependency.patch' - ) - - sha256sums=( - 'SKIP' - '46871ed662a3c97698be609d27da280d9000ec97183f1fa6592986f9910a2118' - '1dd876fa48c6fb4fcd4ccbdb8ed4ceccfa294685911e91be58bbc5e95726c279' - '9654226ef3318389aa8fe15f3d4d14e7ac2113520ee5ebf2899d42273a2a6fb0' - '71a7304deebb00234c323eed9a73cdbd022099ba65f62fc90e78069eceed1f5d' - '6b30adf71eeabaf1b2b669aa56c9deba145a4fe7bdd2e77f44b0cb7423162bc0' - 'bc4837ead8c89b7e4df2a14aedd62d23f47e7fca08c3f429a267ec4c3b3412d3' - '2672d6d5faf6b855fc2bfd56d215b4fd2a00fd9791ad9d484b6446194867b67d' - '8efbf29ab755bb4fe4c4a423ffb22668dd0e66c7cbc3fc05033ba350b451cfd5' - ) - - # Package is 3 Gib smaller with "strip" but it takes a long time and generates many warnings - options=(strip staticlibs) -} +pkgver=4.24.1 +pkgrel=1 +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') +optdepends=('clion: 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 prepare() { - export TERM=xterm - # shellcheck disable=SC2154 - - ue4src="$srcdir/UnrealEngine/Engine/Source" - - patch "$srcdir/UnrealEngine/Engine/Build/BatchFiles/Linux/Setup.sh" ignore-clang50-install.patch - patch "$srcdir/UnrealEngine/Engine/Build/BatchFiles/Linux/SetupMono.sh" use-arch-mono.patch - patch "$srcdir/UnrealEngine/Setup.sh" recompile-version-selector.patch - patch "$srcdir/UnrealEngine/Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs" allow-unsupported-clang.patch - patch "$srcdir/UnrealEngine/Engine/Source/Runtime/Core/Public/Unix/UnixSystemIncludes.h" remove-sysctl-include.patch - patch "$srcdir/UnrealEngine/Engine/Source/Runtime/Launch/Launch.Build.cs" add-editorstyle-dependency.patch - - cp "$srcdir/Makefile" "$srcdir/UnrealEngine/Makefile" - - # Source Code Accessors - - # CodeLite (Fully integrated) - # cd $srcdir/UnrealEngine/Engine/Config/Linux && sed -i '10c\PreferredAccessor=CodeLiteSourceCodeAccessor' LinuxEngine.ini - - # Qt Creator - # cd $srcdir/UnrealEngine/Engine/Plugins/Developer && git clone https://github.com/fire/QtCreatorSourceCodeAccess - # cd $srcdir/UnrealEngine/Engine/Config/Linux && sed -i '10c\PreferredAccessor=QtCreatorSourceCodeAccessor' LinuxEngine.ini - - # VIM or EMACS - # cd $srcdir/UnrealEngine/Engine/Plugins/Developer && git clone https://github.com/fire/SensibleEditorSourceCodeAccess - # cd $srcdir/UnrealEngine/Engine/Config/Linux && sed -i '10c\PreferredAccessor=SensibleEditorSourceCodeAccessor' LinuxEngine.ini - - # shellcheck disable=SC2164 - cd "$srcdir/UnrealEngine" + # Check access to the repository + if ! git ls-remote git@github.com:EpicGames/UnrealEngine &>- + 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 - # clean up old builds before building a new version - #git clean -xdf + # Download Unreal Engine source or update if the folder exists + if [ ! -d $pkgname ] + then + git clone --depth=1 --branch=$pkgver-release git@github.com:EpicGames/UnrealEngine $pkgname + cd $pkgname + else + cd $pkgname + rm -f .git/index.lock + git fetch --depth=1 origin tag $pkgver-release + git reset --hard $pkgver-release + fi + + patch Engine/Build/BatchFiles/Linux/SetupMono.sh $srcdir/use-arch-mono.patch # Use system mono + + # 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 - # TODO check if setup files already exist. Check if file edited recently - echo "Running setup" + export TERM=xterm ./Setup.sh - - echo "Generating project files" ./GenerateProjectFiles.sh -makefile } build() { - # shellcheck disable=SC2164 - cd "$srcdir/UnrealEngine" - - # this should work instead of "git clean", but something leftover causes crashes - #make ARGS=-clean - - # -j1 to force one make job; the first time fails if there are multiple jobs - make -j1 + 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 } package() { - # install dir - dir="opt/$pkgname" + # Install dir +# dir="opt/$pkgname" + dir="/mnt/Files/Programs/Linux/$pkgname" - # install .desktop - if [ "$dir" != "opt/$pkgname" ] # set new path if dir changed + # Desktop entry + if [ "$dir" != "opt/$pkgname" ] # Set new path if dir changed then - sed -i "5c\Path=/$dir/Engine/Binaries/Linux/" UE4Editor.desktop - sed -i "6c\Exec=\'/$dir/Engine/Binaries/Linux/UE4Editor\' %F" UE4Editor.desktop + sed -i "5c\Path=/$dir/Engine/Binaries/Linux/" com.unrealengine.UE4Editor.desktop fi - # shellcheck disable=SC2154 - install -Dm644 UE4Editor.desktop "$pkgdir/usr/share/applications/UE4Editor.desktop" - - # shellcheck disable=SC2164 - cd "$srcdir/UnrealEngine" - - # license - install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/UnrealEngine/LICENSE.md" - - # fix "could not chmod +x" warning when compiling c++ project - chmod a+x Engine/Binaries/DotNET/IOS/IPhonePackager.exe - - # icon for .desktop file - install -Dm644 Engine/Source/Programs/UnrealVS/Resources/Preview.png "$pkgdir/usr/share/pixmaps/UE4Editor.png" - - # engine + install -Dm644 com.unrealengine.UE4Editor.desktop $pkgdir/usr/share/applications/com.unrealengine.UE4Editor.desktop + + cd $pkgname + + # Icon for Desktop entry + install -Dm644 Engine/Source/Programs/UnrealVS/Resources/Preview.png $pkgdir/usr/share/pixmaps/ue4editor.png + + # License + install -Dm644 LICENSE.md $pkgdir/usr/share/licenses/UnrealEngine/LICENSE.md + + # Engine install -d "$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" - install -d "$pkgdir/$dir/Engine/DerivedDataCache" # editor needs this mv Engine/Documentation "$pkgdir/$dir/Engine/Documentation" mv Engine/Extras "$pkgdir/$dir/Engine/Extras" - install -d "$pkgdir/$dir/Engine/Intermediate" # editor needs this, but not the contents mv Engine/Plugins "$pkgdir/$dir/Engine/Plugins" mv Engine/Programs "$pkgdir/$dir/Engine/Programs" - mv Engine/Saved "$pkgdir/$dir/Engine/Saved" mv Engine/Shaders "$pkgdir/$dir/Engine/Shaders" - mv Engine/Source "$pkgdir/$dir/Engine/Source" # the source cannot be redistributed, but seems to be needed to compile c++ projects - - # these folders needs to be writable, otherwise there is a segmentation fault when starting the editor - chmod -R a+rwX "$pkgdir/$dir/Engine" - - # content + 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) + # 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" } - -# vim:set ts=2 sw=2 et: |