Advertisement
Goodevil95

Unreal Engine 4.24

Dec 22nd, 2019
5,512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.65 KB | None | 0 0
  1. # Maintainer: Dylan Ferris <dylan@psilly.com>
  2. # The source is about 200 MiB, with an extra 11 GiB of dependencies downloaded in prepare(), and may take several hours to compile.
  3. pkgname='unreal-engine'
  4. pkgver=4.24.1
  5. pkgrel=1
  6. pkgdesc='A 3D game engine by Epic Games which can be used non-commercially for free.'
  7. arch=('x86_64')
  8. url='https://www.unrealengine.com/'
  9. makedepends=('mono' 'dos2unix' 'git')
  10. depends=('icu' 'sdl2' 'python' 'lld' 'xdg-user-dirs')
  11. license=('custom:UnrealEngine')
  12. source=('com.unrealengine.UE4Editor.desktop'
  13.         'use-arch-mono.patch')
  14. sha256sums=('fa4bd19ab53e91cc8b4ae6208452a7fe986a08047617213d6250b43e7a140bf3'
  15.             '6b30adf71eeabaf1b2b669aa56c9deba145a4fe7bdd2e77f44b0cb7423162bc0')
  16. options=(strip staticlibs) # Package is 3 Gib smaller with "strip" but it takes a long time and generates many warnings
  17.  
  18. prepare() {
  19.   # Check access to the repository
  20.   if ! git ls-remote git@github.com:EpicGames/UnrealEngine &>-
  21.   then
  22.     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"
  23.     exit 1
  24.   fi
  25.  
  26.   # Download Unreal Engine source or update if the folder exists
  27.   if [ ! -d $pkgname ]
  28.   then
  29.     git clone --depth=1 --branch=$pkgver-release git@github.com:EpicGames/UnrealEngine $pkgname
  30.     cd $pkgname
  31.   else
  32.     cd $pkgname
  33.     git fetch --depth=1 origin tag $pkgver-release
  34.     git reset --hard $pkgver-release
  35.   fi
  36.  
  37.   patch Engine/Build/BatchFiles/Linux/SetupMono.sh $srcdir/use-arch-mono.patch
  38.    
  39.   export TERM=xterm
  40.   ./Setup.sh
  41.   ./GenerateProjectFiles.sh -makefile
  42. }
  43.  
  44. build() {
  45.   cd $pkgname
  46.   make -j1
  47. }
  48.  
  49. package() {
  50.   # Install dir
  51.   dir="opt/$pkgname"
  52.  
  53.   # Desktop entry
  54.   if [ "$dir" != "opt/$pkgname" ] # set new path if dir changed
  55.   then
  56.     sed -i "5c\Path=/$dir/Engine/Binaries/Linux/" com.unrealengine.UE4Editor.desktop
  57.   fi
  58.   install -Dm644 com.unrealengine.UE4Editor.desktop $pkgdir/usr/share/applications/com.unrealengine.UE4Editor.desktop
  59.  
  60.   cd $pkgname
  61.  
  62.   # Icon for Desktop entry
  63.   install -Dm644 Engine/Source/Programs/UnrealVS/Resources/Preview.png $pkgdir/usr/share/pixmaps/ue4editor.png
  64.  
  65.   # License
  66.   install -Dm644 LICENSE.md $pkgdir/usr/share/licenses/UnrealEngine/LICENSE.md
  67.  
  68.   # Fix "could not chmod +x" warning when compiling c++ project
  69.   chmod a+x Engine/Binaries/DotNET/IOS/IPhonePackager.exe
  70.  
  71.   # Engine
  72.   install -d "$pkgdir/$dir/Engine"
  73.   mv Engine/Binaries "$pkgdir/$dir/Engine/Binaries"
  74.   mv Engine/Build "$pkgdir/$dir/Engine/Build"
  75.   mv Engine/Config "$pkgdir/$dir/Engine/Config"
  76.   mv Engine/Content "$pkgdir/$dir/Engine/Content"
  77.   install -d "$pkgdir/$dir/Engine/DerivedDataCache" # Editor needs this
  78.   mv Engine/Documentation "$pkgdir/$dir/Engine/Documentation"
  79.   mv Engine/Extras "$pkgdir/$dir/Engine/Extras"
  80.   install -d "$pkgdir/$dir/Engine/Intermediate" # Editor needs this, but not the contents
  81.   mv Engine/Plugins "$pkgdir/$dir/Engine/Plugins"
  82.   mv Engine/Programs "$pkgdir/$dir/Engine/Programs"
  83.   mv Engine/Saved "$pkgdir/$dir/Engine/Saved"
  84.   mv Engine/Shaders "$pkgdir/$dir/Engine/Shaders"
  85.   mv Engine/Source "$pkgdir/$dir/Engine/Source" # The source cannot be redistributed, but seems to be needed to compile C++ projects
  86.  
  87.   # Content
  88.   mv FeaturePacks "$pkgdir/$dir/FeaturePacks"
  89.   mv Samples "$pkgdir/$dir/Samples"
  90.   mv Templates "$pkgdir/$dir/Templates"
  91.  
  92.   # Build scripts, used by some plugins (CLion)
  93.   install -Dm755 GenerateProjectFiles.sh "$pkgdir/$dir/GenerateProjectFiles.sh"
  94.   install -Dm755 Setup.sh "$pkgdir/$dir/Setup.sh"
  95.   install -Dm644 .ue4dependencies "$pkgdir/$dir/.ue4dependencies"
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement