Skip to content
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

Add optional including of eglfs platform plugins using ENABLE_EGLFS environment variable #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so
**Qt specific:**
- `$QMAKE=/path/to/my/qmake`: use another `qmake` binary to detect paths of plugins and other resources (usually doesn't need to be set manually, most Qt environments ship scripts changing `$PATH`)
- `$EXTRA_QT_PLUGINS=pluginA;pluginB`: Plugins to deploy even if not found automatically by linuxdeploy-plugin-qt
- `$ENABLE_EGLFS=1` Include available eglfs platform plugins

QML related:
- `$QML_SOURCES_PATHS`: directory containing the application's QML files — useful/needed if QML files are "baked" into the binaries. `$QT_INSTALL_QML` is prepended to this list internally.
Expand Down
19 changes: 17 additions & 2 deletions src/deployers/PlatformPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,23 @@ bool PlatformPluginsDeployer::deploy() {

ldLog() << "Deploying platform plugins" << std::endl;

if (!appDir.deployLibrary(qtPluginsPath / "platforms/libqxcb.so", appDir.path() / "usr/plugins/platforms/"))
return false;
if (getenv("ENABLE_EGLFS")){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code style violation.

if (!appDir.deployLibrary(qtPluginsPath / "platforms/libqxcb.so", appDir.path() / "usr/plugins/platforms/"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be refactored into a loop.

ldLog() << "No XCB platform plugin found, skipping" << std::endl;
if (!appDir.deployLibrary(qtPluginsPath / "platforms/libqeglfs.so", appDir.path() / "usr/plugins/platforms/"))
ldLog() << "No EGLFS platform plugin found, skipping" << std::endl;
if (!appDir.deployLibrary(qtPluginsPath / "egldeviceintegrations/libqeglfs-kms-integration.so", appDir.path() / "usr/plugins/egldeviceintegrations/"))
ldLog() << "No EGLFS KMS Integration plugin found, skipping" << std::endl;
if (!appDir.deployLibrary(qtPluginsPath / "egldeviceintegrations/libqeglfs-x11-integration.so", appDir.path() / "usr/plugins/egldeviceintegrations/"))
ldLog() << "No EGLFS X11 Integration plugin found, skipping" << std::endl;
if (!appDir.deployLibrary(qtPluginsPath / "egldeviceintegrations/libqeglfs-kms-egldevice-integration.so", appDir.path() / "usr/plugins/egldeviceintegrations/"))
ldLog() << "No EGLFS KMS EGLDEVICE Integration plugin found, skipping" << std::endl;
if (!appDir.deployLibrary(qtPluginsPath / "egldeviceintegrations/libqeglfs-kms-emu-integration.so", appDir.path() / "usr/plugins/egldeviceintegrations/"))
ldLog() << "No EGLFS EMU Integration plugin found, skipping" << std::endl;
} else {
if (!appDir.deployLibrary(qtPluginsPath / "platforms/libqxcb.so", appDir.path() / "usr/plugins/platforms/"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term "enable" implies that enabling the env var just adds additional files. But that's not true: it is more like "either egl or xcb". The name or at least the docs should reflect that. I think USE_ would be a better prefix in the current state.

Can xcb be deployed safely next to egl?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, by default they're both installed on Debian, you select the platform plugin with --plugin flag or an environment variable

return false;
}

for (bf::directory_iterator i(qtPluginsPath / "platforminputcontexts"); i != bf::directory_iterator(); ++i) {
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/platforminputcontexts/"))
Expand Down