Depending on how you feel about replacing the mv
s with cp
and rm
since mv
does not merge, if you replace the entire for
loop from L207 to L218 with...
# Copy LocalBuilds to pkg...
cp -flr "${srcdir}"/"${pkgname}"/LocalBuilds/Engine/Linux/* "${pkgdir}"/"${_install_dir}"/
if [ -f "${srcdir}"/"${pkgname}"/LocalBuilds/Engine/Linux/Engine/Binaries/Linux/UnrealEditor ]; then
# Can never be too careful with recursive rm...
rm -r "${srcdir}"/"${pkgname}"/LocalBuilds
fi
# Copy the rest of it to pkg... Should we be overwriting LocalBuilds?
cp -flr "${srcdir}"/"${pkgname}"/* "${pkgdir}"/"${_install_dir}"/
if [ -f "${srcdir}"/"${pkgname}"/Engine/Binaries/Linux/UnrealEditor ]; then
rm -r "${srcdir}"/"${pkgname}"/*
fi
...it produces a working install. Someone else will need to test it as my system is mine, yours is yours.
I have also tweaked L254 & L255 because they were sed
ing the .desktop file instead of the unreal-engine-5.sh
script. The user's .desktop should now work as expected instead of opening itself in an editor. Additionally on L255 the substitution needs to be more specific as there is a second UnrealEditor binary in .../Engine/Saved/...
which would break the script's search of the base install directory.
# Replaced .desktop file with launch script
sed -i "s/ChecksumPlaceholder/${DesktopFileChecksum}/" "${pkgdir}/usr/bin/unreal-engine-5.sh"
# Searching install_dir finds multiple binaries (in Saved) so limit the scope
sed -i "s|InstalledLocationPlaceholder|/${_install_dir}/Engine/Binaries|" "${pkgdir}/usr/bin/unreal-engine-5.sh"
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.