PKGBUILD uses --appimage-extract already. I fooled with it a bit and think this is workable. I'm running it now and it seems to be fine. Major issues are file/folder permissions, startup script, dependencies.
I set dirs to 755 and every file other than AppRun, pcloud to 644.
Script AppRun sets up the environment with LD_LIBRARY_PATH so we sym-link that to /usr/bin/pcloud. The appimage can create both a desktop and autostart icon which need to be modified. First, we trick AppRun into not creating a desktop icon then, update AutoLaunchLinux.js so that it statically points to /usr/bin/pcloud for the GUI AutoStart (Preferences -> Settings -> General -> Start pCloud Drive on system startup).
namcap just lists a bunch of additional dependencies based on the extracted image.
I write my own PKGBUILD for my own purposes. They aren't standards based, which means I break rules. This would just be a suggested method. Keep in mind, the extracted AppImage doubles the installation file system usage.
depends=(alsa-lib dbus-glib dbus-x11 fuse2 gtk3 hicolor-icon-theme libdbusmenu-gtk2 libindicator-gtk2 libxss nss zlib)
options=(!strip !emptydirs)
prepare() {
chmod +x "$_appimage"
./"$_appimage" --appimage-extract
find squashfs-root -type f -regextype posix-extended ! -iregex '.*/(AppRun|pcloud)' -exec chmod 644 "{}" +
find squashfs-root -type d -exec chmod 755 "{}" +
perl -pi -e 's|! -z \"\$DESKTOPINTEGRATION\"|1 = 1|gi' squashfs-root/AppRun
perl -pi -e "s|(appPath =) arg.appPath|\1 \"/usr/bin/$_shortname\"|gi" squashfs-root/resources/app/node_modules/auto-launch/dist/AutoLaunchLinux.js
rm -f squashfs-root/pcloud.png
}
package() {
install -dm 755 "$pkgdir"/usr/{bin,share/{applications,icons}}
cd "$srcdir"
mv squashfs-root/usr/share/icons/hicolor "$pkgdir"/usr/share/icons/
perl -pi -e "s|(Exec)=AppRun|\1=/usr/bin/$_shortname|gi ; s|(Name)=pcloud|\1=pCloud|gi" squashfs-root/"$_shortname".desktop
mv squashfs-root/"$_shortname".desktop "$pkgdir"/usr/share/applications/
mv squashfs-root "$pkgdir"/usr/share/"$pkgname"
ln -rsf "$pkgdir"/usr/share/"$pkgname"/AppRun "$pkgdir"/usr/bin/pcloud
}
Pinned Comments
Zenzio commented on 2022-08-13 06:44 (UTC) (edited on 2022-08-13 06:45 (UTC) by Zenzio)
@cirlo I contacted their support when I had trouble running pCloud in Sway with GDK_BACKEND=wayland (without ",x11"). Their response was: "Unfortunately, we are having troubles updating the app to the latest electron versions because of inside security libraries that we are using. Our devs know about this issue and electron version update is already planed."