linuxdeployqt icon indicating copy to clipboard operation
linuxdeployqt copied to clipboard

Limit only to qt libraries.

Open mmjvox opened this issue 4 years ago • 3 comments

How to limit it only to qt libraries and skip other dependencies? How to use it without patching dependencies?

mmjvox avatar Oct 12 '21 07:10 mmjvox

Hello @mmjvox, if you want this behavior, do not use -bundle-non-qt-libs and do not use -appimage.

AppImages require dependencies to be bundled, because they are meant to run on most mainstream Linux distributions without requiring the manual installation of dependencies that don't already come with the default installation out of the box.

May I ask what is your use case and why you don't want other dependencies to be bundled?

probonopd avatar Oct 12 '21 17:10 probonopd

Thank you for reply. I always use it without -bundle-non-qt-libs but there are dependencies from my desktop environments in the libraries that aren't need in other environments. for example when i deploy on KDE i see plasma dependencies in the package or when i deploy on gnome i see some unused GTK dependencies or unused multimedia codecs or ... that i never used them in my program. Although this eliminates the need for prerequisites, but it creates strange bugs, especially graphic bugs.

I think I know the reason of this: Suppose you write a code that can do its task from both paths A and B. So you must add A.so and B.so as a dependency in your program. If you want your program choose one of the paths due to the existence of files A.so or B.so , maybe load the existing dependency with something like dlopen in runtime and then choose one of the paths. So when you looking at the list of the dependencies of your compiled program with something like ldd both of A.so and B.so are in the list, but this doesn't mean that your program should have both of them at starting.

Therefore some of Qt's dependencies will be needed only in special circumstances. for example when it will run on kde it need to use plasma libraries and it is better to don't add plasma libraries to package, Because it can select related dependencies on gnome or xfce or ... on runtime. It doesn't work well, when we force it to use them. I think linuxdeployqt Collects all of libraries are in the dependencies list and repeat this for dependencies of each dependency and so on, until it reaches the end of it all. That's why it also collects desktop environment libraries.

I use Qt's official builds for deploy, I think they are built with the best conditions and minimum of dependencies. Many times I had to find Qt's dependencies manually from official Qt installation. then I added other important dependencies to the package manually and then create an Appimage from that. The packages are working on each distributions with complete desktop environment. My purpose in Deploy is not to guarantee running in places like i3 or icewm or somethings like that. Because the person who uses it, has the ability to solve the problems himself.

If linuxdeployqt can collect libraries that only are in Qt's official installation path and skip others in other path, It will be more efficient for purposes similar to my goal.

mmjvox avatar Oct 16 '21 07:10 mmjvox

Can you give concrete examples @mmjvox?

For example when i deploy on KDE i see plasma dependencies in the package or when i deploy on gnome i see some unused GTK dependencies or unused multimedia codecs or ... that i never used them in my program.

probonopd avatar Oct 16 '21 09:10 probonopd