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

Wayland client support #183

Closed
Closed
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
2 changes: 2 additions & 0 deletions src/deployers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ set(CLASSES
TextToSpeechPluginsDeployer
TlsBackendsDeployer
WaylandcompositorPluginsDeployer
WaylandShellIntegrationPluginsDeployer
WaylandGraphicsIntegrationClientPluginsDeployer
)

# TODO: CMake <= 3.7 (at least!) doesn't allow for using OBJECT libraries with target_link_libraries
Expand Down
10 changes: 10 additions & 0 deletions src/deployers/PluginsDeployerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "XcbglIntegrationPluginsDeployer.h"
#include "TlsBackendsDeployer.h"
#include "WaylandcompositorPluginsDeployer.h"
#include "WaylandShellIntegrationPluginsDeployer.h"
#include "WaylandGraphicsIntegrationClientPluginsDeployer.h"

using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::appdir;
Expand Down Expand Up @@ -108,6 +110,14 @@ std::vector<std::shared_ptr<PluginsDeployer>> PluginsDeployerFactory::getDeploye
return {getInstance<WaylandcompositorPluginsDeployer>(moduleName)};
}

if (moduleName == "wayland-shell-integration") {
return {getInstance<WaylandShellIntegrationPluginsDeployer>(moduleName)};
}

if (moduleName == "wayland-graphics-integration-client") {
return {getInstance<WaylandGraphicsIntegrationClientPluginsDeployer>(moduleName)};
}

// fallback
return {getInstance<BasicPluginsDeployer>(moduleName)};
}
34 changes: 34 additions & 0 deletions src/deployers/WaylandGraphicsIntegrationClientPluginsDeployer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// system headers
#include <filesystem>

// library headers
#include <linuxdeploy/core/log.h>
#include <linuxdeploy/util/util.h>

// local headers
#include "WaylandGraphicsIntegrationClientPluginsDeployer.h"

using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::log;

namespace fs = std::filesystem;

bool WaylandGraphicsIntegrationClientPluginsDeployer::deploy() {
// calling the default code is optional, but it won't hurt for now
if (!BasicPluginsDeployer::deploy())
return false;

ldLog() << "Deploying Wayland Shell Integration plugins" << std::endl;

for (fs::directory_iterator i(qtPluginsPath / "wayland-graphics-integration-client"); i != fs::directory_iterator(); ++i) {
if (i->path().extension() == ".debug") {
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
continue;
}

if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-graphics-integration-client/"))
return false;
}

return true;
}
17 changes: 17 additions & 0 deletions src/deployers/WaylandGraphicsIntegrationClientPluginsDeployer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "BasicPluginsDeployer.h"

namespace linuxdeploy {
namespace plugin {
namespace qt {
class WaylandGraphicsIntegrationClientPluginsDeployer : public BasicPluginsDeployer {
public:
// we can just use the base class's constructor
using BasicPluginsDeployer::BasicPluginsDeployer;

bool deploy() override;
};
}
}
}
38 changes: 38 additions & 0 deletions src/deployers/WaylandShellIntegrationPluginsDeployer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// system headers
#include <filesystem>

// library headers
#include <linuxdeploy/core/log.h>
#include <linuxdeploy/util/util.h>

// local headers
#include "WaylandShellIntegrationPluginsDeployer.h"

using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::log;

namespace fs = std::filesystem;

bool WaylandShellIntegrationPluginsDeployer::deploy() {
// calling the default code is optional, but it won't hurt for now
if (!BasicPluginsDeployer::deploy())
return false;

ldLog() << "Deploying Wayland Shell Integration plugins" << std::endl;

// always deploy default platform
if (!appDir.deployLibrary(qtPluginsPath / "wayland-shell-integration/libxdg-shell.so", appDir.path() / "usr/plugins/wayland-shell-integration/"))
return false;

// deploy Wayland Shell Integration platform plugins, if any
const auto* const platformPluginsFromEnvData = getenv("EXTRA_WAYLAND_SHELL_INTEGRATION_PLUGINS");
if (platformPluginsFromEnvData != nullptr) {
for (const auto& platformToDeploy : linuxdeploy::util::split(std::string(platformPluginsFromEnvData), ';')) {
ldLog() << "Deploying extra Wayland Shell Integration plugin: " << platformToDeploy << std::endl;
if (!appDir.deployLibrary(qtPluginsPath / "wayland-shell-integration" / platformToDeploy, appDir.path() / "usr/plugins/wayland-shell-integration/"))
return false;
}
}

return true;
}
17 changes: 17 additions & 0 deletions src/deployers/WaylandShellIntegrationPluginsDeployer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "BasicPluginsDeployer.h"

namespace linuxdeploy {
namespace plugin {
namespace qt {
class WaylandShellIntegrationPluginsDeployer : public BasicPluginsDeployer {
public:
// we can just use the base class's constructor
using BasicPluginsDeployer::BasicPluginsDeployer;

bool deploy() override;
};
}
}
}
2 changes: 2 additions & 0 deletions src/qt-modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ static const std::vector<QtModule> Qt6Modules = {
{"test", "libQt6Test", "qtbase"},
{"uitools", "libQt6UiTools", ""},
{"waylandclient", "libQt6WaylandClient", ""},
{"wayland-shell-integration", "libQt6WlShellIntegration", ""},
{"wayland-graphics-integration-client", "", ""},
{"waylandcompositor", "libQt6WaylandCompositor", ""},
{"webenginecore", "libQt6WebEngineCore", ""},
{"webengine", "libQt6WebEngine", "qtwebengine"},
Expand Down