Package Details: unreal-engine 5.4.2-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: 74
Popularity: 0.97
First Submitted: 2016-05-01 18:37 (UTC)
Last Updated: 2024-06-17 03:29 (UTC)

Dependencies (28)

Required by (1)

Sources (5)

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 .. 9 10 11 12 13 14 15 16 17 18 19 .. 80 Next › Last »

shawarden commented on 2022-12-06 01:39 (UTC) (edited on 2022-12-06 01:41 (UTC) by shawarden)

Still need to prune ${dir}'s excessive expansion, but not from ${dir} itself:

for dir in "${srcdir}"/"${pkgname}"/*; do
  if [ -d "${dir}" ]; then
    # Prune leading path.
    dest=$(basename $dir)
    if [ "${dest}" == "LocalBuilds" ]; then
      if [ -d "${dir}"/Engine/Linux/ ]; then
        mv "${dir}"/Engine/Linux/* "${pkgdir}/${_install_dir}/"
      fi
    else
      mkdir -p "${pkgdir}/${_install_dir}/${dest}"
      mv "${dir}"/* "${pkgdir}/${_install_dir}/${dest}/"
    fi
  fi
done

Could also rename dir to source to remove any ambiguity.

I'm running it at the moment but it takes a few hours...

Neko-san commented on 2022-12-06 00:50 (UTC)

@shawarden You're right about me missing a bash blob there; I often personally make the mistake of assuming bash understands what I mean when I write lines like that and would explain why it's not doing what I expected

Going by that, I'm guessing ${dir} is interpreted as an entire path rather than a single folder name, which would explain why it appends the path to ${srcdir} and causes this weird home/user directory nonsense

That said, do you think this would be more in line with what's intended?

(I would test this myself but I need a new storage drive and I won't be able to install the drive to do this until later this week)

  for dir in "${srcdir}"/"${pkgname}"/*; do
    if [ -d "${dir}" ]; then
      if [ "${dir}" == "LocalBuilds" ]; then
        if [ -d "${srcdir}/${pkgname}"/LocalBuilds/Engine/Linux/ ]; then
          mv "${srcdir}/${pkgname}"/LocalBuilds/Engine/Linux/* "${pkgdir}/${_install_dir}/"
        fi
      else
        mkdir -p "${pkgdir}/${_install_dir}/${dir}"
        mv "${dir}"/* "${pkgdir}/${_install_dir}/${dir}"
      fi
    fi
  done

shawarden commented on 2022-12-06 00:17 (UTC) (edited on 2022-12-06 00:36 (UTC) by shawarden)

By git repo I was referring to Epic's https://github.com/EpicGames/UnrealEngine.git, in case there was any confusion.

Using AUR's repo and makepkg as juancarlospaco did:

❯ mkdir -p ~/Unreal/INSTALL
❯ cd ~/Unreal/INSTALL
❯ git clone https://aur.archlinux.org/unreal-engine.git
...
❯ cd unreal-engine
❯ makepkg
...
❯ tar -tf unreal-engine-5.1.0-23-x86_64.pkg.tar.zst | head -20
.BUILDINFO
.MTREE
.PKGINFO
etc/
etc/pacman.d/
etc/pacman.d/hooks/
etc/pacman.d/hooks/unreal-engine-5-pacman-cache.hook
opt/
opt/unreal-engine/
opt/unreal-engine/Engine/
opt/unreal-engine/Engine/Binaries/
opt/unreal-engine/Engine/Binaries/Android/
opt/unreal-engine/home/
opt/unreal-engine/home/USER/
opt/unreal-engine/home/USER/Unreal/
opt/unreal-engine/home/USER/Unreal/INSTALL/
opt/unreal-engine/home/USER/Unreal/INSTALL/unreal-engine/
opt/unreal-engine/home/USER/Unreal/INSTALL/unreal-engine/src/
opt/unreal-engine/home/USER/Unreal/INSTALL/unreal-engine/src/unreal-engine/
opt/unreal-engine/home/USER/Unreal/INSTALL/unreal-engine/src/unreal-engine/Default.uprojectdirs
❯ makepkg -si
...
❯ ls /opt/unreal-engine
Engine  home
❯ find /opt/unreal-engine \( -wholename "*Binaries*" -a -name UnrealEditor \)
/opt/unreal-engine/home/USER/Unreal/INSTALL/unreal-engine/src/unreal-engine/Engine/Binaries/Linux/UnrealEditor
/opt/unreal-engine/home/USER/Unreal/INSTALL/unreal-engine/src/unreal-engine/Engine/Saved/Engine/Binaries/Linux/UnrealEditor
/opt/unreal-engine/home/USER/Unreal/INSTALL/unreal-engine/src/unreal-engine/LocalBuilds/Engine/Linux/Engine/Binaries/Linux/UnrealEditor

Either L207's for loop has a typo or the package source ${dir} shouldn't be part of the final install path in L213's else statement since it still expands to the full path.

❯ for dir in /etc/pacman.d/; do echo $dir; done
/etc/pacman.d/
❯ for dir in /etc/pacman.d/*; do echo $dir; done
/etc/pacman.d/chaotic-mirrorlist
/etc/pacman.d/gnupg
/etc/pacman.d/hooks
/etc/pacman.d/hooks.bin
/etc/pacman.d/mirrorlist
/etc/pacman.d/mirrorlist.pacnew

Unless there's whitespace (or IFS tokens) in it, L207's for dir in /path/to/folder; do only has 1 iteration where dir is /path/to/folder.

Assume L207's for loop is written as intended, since ${dir} can only be ${srcdir}/${pkgname} and never LocalBuilds, the ${srcdir}/${pkgname} path is then being appended to ${_install_dir} which leads to the final install path being:

${pkgdir}/opt/${pkgname}/${srcdir}/${pkgname}

or

/opt/unreal-engine/PATH/TO/WHERE/SOMEONE/RAN/GIT/CLONE/unreal-engine/src/unreal-engine

If you instead want to cycle through the contents of ${srcdir}/${pkgname} you will need to add a /* on the end: for dir in ${srcdir}/${pkgname}/*; do

None of the iterations can have dir being LocalBuilds since it is the full path though so... maybe L209's if [ "${dir}" == "LocalBuilds" ]; then should be if [[ "${dir}" == *"LocalBuilds" ]]; then?

Either way dir is still expanding to /PATH/TO/WHERE/SOMEONE/RAN/GIT/CLONE/unreal-engine/src/unreal-engine which is where the files are, but not where they should be going.

Neko-san commented on 2022-12-04 04:42 (UTC) (edited on 2022-12-04 04:45 (UTC) by Neko-san)

$HOME is just a path name to your home folder

If you enter echo $HOME in your terminal, that's what you get; additionally, I never even call $HOME anywhere in the script at all. Search for it in the script, and you won't find it. That said, I've said this to people before to stop using AUR helpers like yay with this package, for consistency, but people don't listen.

I know that you keep saying it keeps including your home folder path but, at this point, the only advice I can give you is to stop building the package in your home folder and build it somewhere else (though I doubt at this point this nonsensical issue will stop) and to stop using yay to build this.

I'm going to pin what I keep saying about AUR helpers to this page at this point; yes, they're useful, but they can also be detrimental in some obtuse cases like this and I can't possibly diagnose obscene problems like these if no one's on the same page.

shawarden commented on 2022-12-04 04:26 (UTC)

Well maybe I'm misunderstanding what's happening with a file I did not edit at all. That's just how it's running on my system using yay -S unreal-engine and apparently juancarlospaco, however he runs it. How the exact same script runs on other systems is an unknown to me.

I traced, or at least TRIED to trace the logic that results in everything being installed to /opt/unreal-engine/home/USER/.cache/PACKAGEMANAGER/unreal-engine/...

The lack of / before opt is what causes mkdir -p "${pkgdir}/${_install_dir}/${dir}" to creates /opt/unreal-engine and then tacks the full build path onto the end, resulting in ""/"opt/unreal-engine"/"home/USERNAME/.cache/PACKAGEMANAGE/unreal-engine/..." Again, that's just what happens when that unedited script runs on my system.

If you don't know what $HOME represents then I think I'll just walk away and turn notifications off. Maybe stick to cloning the git repo directly since that works as expected.

Neko-san commented on 2022-12-04 03:03 (UTC)

207 - is supposed equate to $HOME/.cache/PACKAGEMANAGER/src/unreal-engine

214 - is supposed to create $HOME/.cache/PACKAGEMANAGER/pkg/opt/unreal-engine/<folder-I'm-creating>

What you said about line 215 is nonsensical, particularly, because $HOME is not referenced as a target in any values, at all, as a sub-directory of /opt/unreal-engine; in fact: the only thing I'm doing remotely different in packaging this at this curent moment, in the history of this package on the AUR, is using a for-do bash loop. The bash values you keep claiming are doing totally different have always been exactly as you see them and no one besides you and @juancarlospaco have ever stated otherwise in the entire history of this package. **Particularly** because I literally have it outlined on line 47 NOT to put a / BEFORE "opt"; it is factually impossible for what you are describing to be happening unless you ignored this explicit instruction.

241 - Don't report redundancies to me; I know full well that's supposed to be there. I put it there because someone told me it wasn't for them and that the engine needs it.

shawarden commented on 2022-12-03 05:53 (UTC)

@Neko-san I'm not a bash wizard by any means but the relevant logic looks like...

${srcdir} seems to be $HOME/.cache/PACKAGEMANAGER

${pkgdir} seems do be empty.

8 pkgname=unreal-engine

48 _install_dir="opt/${pkgname}"

207 for dir in ${srcdir}/${pkgname}; do would equate to dir=$HOME/.cache/PACKAGEMANAGER/unreal-engine

214 mkdir -p "${pkgdir}/${_install_dir}/${dir}" creates /opt/unreal-engine/$HOME/.cache/PACKAGEMANAGER/unreal-engine

215 mv "${dir}"/* "${pkgdir}/${_install_dir}/${dir}" would then be moving everything from $HOME/.cache/PACKAGEMANAGER/unreal-engine to /opt/unreal-engine/$HOME/.cache/PACKAGEMANAGER/unreal-engine

Changing 214 to mkdir -p "${pkgdir}/${_install_dir}" and 215 to mv "${dir}"/* "${pkgdir}/${_install_dir}" would put the contents of $HOME/.cache/PACKAGEMANAGER/unreal-engine into /opt/unreal-engine as expected.

241's mkdir -p "${pkgdir}/${_install_dir}/Engine/Binaries/Android/" seems a bit redundant.

Neko-san commented on 2022-12-02 23:33 (UTC) (edited on 2022-12-02 23:40 (UTC) by Neko-san)

@juancarlospaco Well, there's obviously something in that built package file, according to your pacman log, so there's definitely something in there

Open that package with an archive file manager and either tell me or show me what it looks like and if you can find it in there.

@shawarden That's a source folder, that's to be expected to some extent, but there's definitely a weird problem going on here that doesn't make sense to me with how mv is behaving on this line:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=unreal-engine&id=d1d51a3d54484c3a107efe901ecfbaf2e850942f#n207

The logic for this part makes sense to me, and no errors show up in https://shellcheck.net when I do this, but perhaps another person knowledgeable in Bash can help me see what I'm doing wrong here and how to correct it; if you guys can, try asking around about it, the more of us that ask and find out the faster I can implement the fix without playing Russian roulette for solutions

shawarden commented on 2022-12-02 22:31 (UTC)

Installing with paru and yay puts the binary UnrealEditor at /opt/unreal-engine/home/$USER/.cache/paru/unreal-engine/src/unreal-engine/Engine/Binaries/Linux or /opt/unreal-engine/home/$USER/.cache/yay/unreal-engine/src/unreal-engine/Engine/Binaries/Linux