appimage: Fix deployment of Okular and its plugins
* src/appimage/AppRun: Export QT_PLUGIN_PATH. * src/appimage/build-appimage.sh: Copy the KDE plugins to APPDIR/usr/lib/plugins instead of APPDIR/usr/plugins. Remove obsolete and incomplete manual copying of Okular's plugins and dependencies. Make patchelf verbose. Remove loop over files directly in APPDIR/usr/lib/plugins. Add loop over files 3 subdirectories below APPDIR/usr/lib/plugins. Fix and adjust the rpath of the plugins.
linuxdeploy deploys the dependencies of everything below APPDIR/usr/lib
(and APPDIR/usr/bin) to APPDIR. By copying the KDE plugins to
APPDIR/usr/lib/plugins we get linuxdeploy to copy all dependencies of
those plugins so that we don't have to take care of this ourselves.
In particular, this fixes the deployment of Okular to the AppImage
which was missing some new dependencies. Additionally, the rpath that we
set for the plugins had one "../" too many which broke loading of the
Okular part because it failed to find the libraries burned into the
AppImage and instead tried to load the incompatible system libraries.
There are no plugins directly in APPDIR/usr/plugins, but there's one
in APPDIR/usr/plugins/kf6/kauth/helper.
- GnuPG-bug-id: T7509