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.
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:
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.