probonopd / go-appimage

Go implementation of AppImage tools
MIT License
818 stars 71 forks source link

Support relocatable builds of Qt{5,6} #306

Open kevle opened 2 months ago

kevle commented 2 months ago

This PR resolves a problem that leads to corrupted Qt core library files, by detecting relocatable builds of Qt and only conditionally patching the shared library files.

See https://github.com/probonopd/go-appimage/pull/302#issuecomment-2340254664

probonopd commented 2 months ago

Thank you very much @kevle.

github-actions[bot] commented 2 months ago

Build for testing: artifacts Use at your own risk.

probonopd commented 2 months ago

Would be great if someone could test whether this build fixes the issue. Thank you very much!

kevle commented 1 month ago

From the looks of it, there is no way around loading libQtCore{5,6}.so and querying its configuration using QLibraryInfo::location ( Qt5 ) and QLibraryInfo::path ( Qt6 ) to properly handle all cases.

This might be possible by using SWIG to generate a wrapper to load libQt{5,6}Core.so. Sometimes the function qt_core_boilerplate appears to be exported with C-linkage, however this does not appear to be the case on my Fedora install.

I have not been able to find a reliable way to extract this meta information yet ( e.g. from embedded resource files ) any other way. This would be pretty bad news for cross-compilation though, I'm not looking forward to doing qemu shenanigans just to query some paths.