probonopd / linuxdeployqt

Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications
Other
2.22k stars 414 forks source link

linuxdeployqt doesn't deploy plugins for Qt 6 by default #532

Open ilya-fedin opened 2 years ago

ilya-fedin commented 2 years ago

There's Qt version specified in libraries names, so the following logic just doesn't work: https://github.com/probonopd/linuxdeployqt/blob/master/tools/linuxdeployqt/shared.cpp#L1227

It would be also helpful to deploy tls plugins automatically with libQt6Network.

probonopd commented 2 years ago

Qt 6 can only be considered to be supported once it can run on all still-supported Linux distributions (especially, LTS). This is because the intent of this tool is to produce AppImages that run on all still-supported Linux distributions (especially, LTS).

ilya-fedin commented 2 years ago

Qt 6.2 builds just fine on Ubuntu 18.04

probonopd commented 2 years ago

That's good to know. There are just no build yet for it yet? (At least not at https://launchpad.net/~beineri, anyway.)

probonopd commented 2 years ago

If you'd like, please consider sending a Pull Request to not hardcode the 5 in libQt5....

ilya-fedin commented 2 years ago

There are just no build yet for it yet?

I build it myself when building the AppImage. I would say it's the only healthy way to build Qt applications for maximum compatibility. With some patches it's still possible to build Qt on CentOS 7 and run on Ubuntu 14.04+ (without patches it would run on CentOS 7, but not on Ubuntu 14.04 - CentOS 7 has some packages of newer version and it's necessary to comment out use of new APIs)

If you'd like, please consider sending a Pull Request to not hardcode the 5 in libQt5....

Maybe.. Right now I just added the plugins with -extra-plugins.

probonopd commented 2 years ago

Maybe.. Right now I just added the plugins with -extra-plugins.

I don't think this will give you the desired result in all cases, as it may fail to deploy the Qt plugins (as well as their dependencies) needed by some Qt libraries. I think such AppImages may fail to run on systems that don't have (the same version of) Qt 6 installed.

ilya-fedin commented 2 years ago

I don't think this will give you the desired result in all cases, as it may fail to deploy the Qt plugins (as well as their dependencies) needed by some Qt libraries.

Maybe I missing something, but the handling of this option seem to be the same: https://github.com/probonopd/linuxdeployqt/blob/aeafcd28e2159e999a39765658616afd17784d7a/tools/linuxdeployqt/shared.cpp#L1403-L1429

probonopd commented 2 years ago

Yes, but which plugins should be deployed? E.g., if an application needs libQt6Svg.so and it gets deployed, then the plugin iconengines/libqsvgicon.so also needs to be deployed or else it will not work.

Just as an example. There are more.

https://github.com/probonopd/linuxdeployqt/blob/aeafcd28e2159e999a39765658616afd17784d7a/tools/linuxdeployqt/shared.cpp#L1294-L1298

ilya-fedin commented 2 years ago

Yes, but which plugins should be deployed? E.g., if an application needs libQt6Svg.so and it gets deployed, then the plugin iconengines/libqsvgicon.so also needs to be deployed or else it will not work.

Well, it's wrong. libqsvgicon is needed whenever QtGui is used. Qt applications rarely depend on QtSvg while svg icon support is almost always needed for the UI (unless the UI is completely custom, system icons aren't used and custom icons aren't in svg format). So I always had iconengies defined in extra-plugins.

ilya-fedin commented 2 years ago

Here's the API commonly used to load svg icons: https://doc.qt.io/QT-5/qicon.html. As you can see, it's a part of QtGui, not QtSvg. libqsvgicon is a part of QtSvg module, but is needed whenever QIcon might be used, so whenever QtGui is deployed.

probonopd commented 2 years ago

Maybe this wasn't the best example. But there are other such cases, see the code in shared.cpp.

ilya-fedin commented 2 years ago

Well, I have everything in the lists and even more (qt6ct, kvantum, qt6gtk2)