-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper way to deploy 3rdparty Qt Quick plugins #319
Comments
Why don't you copy in the files before launching linuxdeploy? Just use |
Fair point! :) |
Not at all. That's how it works, if your build system doesn't do the job correctly. Closing as resolved. |
My app uses CMake. Is it possible to do the job correctly with it? |
Make it install all your files using https://cmake.org/cmake/help/v3.12/command/install.html, and then follow the guide. |
qmlimportscanner is capable of receiving multiple
Maybe linuxdeployqt should be able to accept a list of QML import paths or at least use QML2_IMPORT_PATH env variable? https://github.com/probonopd/linuxdeployqt/blob/master/tools/linuxdeployqt/shared.cpp#L1561 |
You can pass in additional directories using one or more linuxdeployqt/tools/linuxdeployqt/shared.cpp Lines 1553 to 1559 in c6c6898
Does this solve it for you @IlyaBizyaev? |
No, unfortunately, it doesn't. Passing a path as a By default libraries that are needed to satisfy those imports are only searched in the Qt installation, qml subdirectory. You can specify additional search paths at runtime using the linuxdeployqt, however, only passes that qml subdirectory of the Qt installation (the default location), so one cannot specify custom locations for library search. As a hack one can create a link to the custom location from inside the Qt installation, but it is inconvenient if a distribution-provided Qt is used (requires root permissions) or there are multiple versions of this library. As a solution, linuxdeployqt could provide a flag like |
Thanks @IlyaBizyaev for the explanation. Let me understand this correctly: If a QML import needs a .so file as a dependency, then the path to the directory in which the .so file resides needs to be passed in using What is the scenario in which you woould need to pass in an What would we need to change to support the Can the whole thing be made in a way that it recognizes all needed paths automatically, without the user having to pass in arguments? I mean, if the application can run on the build system prior to running Would it be possible for you to send a PR with the requested changes? |
Yeah, that's right :)
The idea is not to replace Qt files, but to use a Qt Quick library that is neither part of Qt nor part of the application. Consider the following situation:
Not exactly. Qt Quick uses the idea of import paths, which basically are paths to the root directories of package installations, kind of like Java's CLASSPATH. E.g. if I have a Qt quick module imported like this:
and located in
and load For example, this is how Kirigami looks when built:
It can be run thanks to the
Without this definition, you get an error like this:
— which is explained by the fact that the QML module is not required at compilation, so paths don't get recorded. Qt searches for modules in their default locations, and on Linux it's ok and works for all sorts of packages.
From how I understand the code, a block like this: linuxdeployqt/tools/linuxdeployqt/main.cpp Lines 408 to 415 in c6c6898
will need to be added for -qmlimport , and then a loop like this:linuxdeployqt/tools/linuxdeployqt/shared.cpp Lines 1553 to 1559 in c6c6898
to add -importPath s to qmlimportscanner's call.
Yes it would, but will take me a while to build linuxdeployqt from source code. |
Thank you very much for your detailed explanation, I think I understand it now. Would highly welcome a PR. Again, thank you very much. |
Opened a pull request. |
...merged 👍 💯 |
Hello, could you please tell me how to apply these flags for my case? https://build.opensuse.org/package/view_file/home:trmdi:test/latte-dock/appimage.yml?expand=1 |
Please see
I have added it to the |
Hello! What is the recommended way to add custom Qt Quick plugins into the AppImage?
E.g. I use Kirigami, and my build script uses this trick:
It works, but requires to launch linuxdeployqt twice.
The text was updated successfully, but these errors were encountered: