Skip to content

Commit ee23002

Browse files
committed
deployers: Add WaylandShellIntegrationPluginsDeployer
In order to effectively use the Wayland platform, you must provide shell integration plugins. Introduce a deployer for these, and a new environment variable, EXTRA_WAYLAND_SHELL_INTEGRATION_PLUGINS to specify them.
1 parent 028899c commit ee23002

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

src/deployers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(CLASSES
2222
TextToSpeechPluginsDeployer
2323
TlsBackendsDeployer
2424
WaylandcompositorPluginsDeployer
25+
WaylandShellIntegrationPluginsDeployer
2526
)
2627

2728
# TODO: CMake <= 3.7 (at least!) doesn't allow for using OBJECT libraries with target_link_libraries
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// system headers
2+
#include <filesystem>
3+
4+
// library headers
5+
#include <linuxdeploy/core/log.h>
6+
#include <linuxdeploy/util/util.h>
7+
8+
// local headers
9+
#include "WaylandShellIntegrationPluginsDeployer.h"
10+
11+
using namespace linuxdeploy::plugin::qt;
12+
using namespace linuxdeploy::core::log;
13+
14+
namespace fs = std::filesystem;
15+
16+
bool WaylandShellIntegrationPluginsDeployer::deploy() {
17+
// calling the default code is optional, but it won't hurt for now
18+
if (!BasicPluginsDeployer::deploy())
19+
return false;
20+
21+
ldLog() << "Deploying Wayland Shell Integration plugins" << std::endl;
22+
23+
// always deploy default platform
24+
if (!appDir.deployLibrary(qtPluginsPath / "wayland-shell-integration/libxdg-shell.so", appDir.path() / "usr/plugins/wayland-shell-integration/"))
25+
return false;
26+
27+
// deploy Wayland Shell Integration platform plugins, if any
28+
const auto* const platformPluginsFromEnvData = getenv("EXTRA_WAYLAND_SHELL_INTEGRATION_PLUGINS");
29+
if (platformPluginsFromEnvData != nullptr) {
30+
for (const auto& platformToDeploy : linuxdeploy::util::split(std::string(platformPluginsFromEnvData), ';')) {
31+
ldLog() << "Deploying extra Wayland Shell Integration plugin: " << platformToDeploy << std::endl;
32+
if (!appDir.deployLibrary(qtPluginsPath / "wayland-shell-integration" / platformToDeploy, appDir.path() / "usr/plugins/wayland-shell-integration/"))
33+
return false;
34+
}
35+
}
36+
37+
return true;
38+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
#include "BasicPluginsDeployer.h"
4+
5+
namespace linuxdeploy {
6+
namespace plugin {
7+
namespace qt {
8+
class WaylandShellIntegrationPluginsDeployer : public BasicPluginsDeployer {
9+
public:
10+
// we can just use the base class's constructor
11+
using BasicPluginsDeployer::BasicPluginsDeployer;
12+
13+
bool deploy() override;
14+
};
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)