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

added waylandcompositor plugin deployer #157

Merged
merged 1 commit into from
Apr 25, 2024
Merged
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 src/deployers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(CLASSES
PrintSupportPluginsDeployer
TextToSpeechPluginsDeployer
TlsBackendsDeployer
WaylandcompositorPluginsDeployer
)

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

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

if (moduleName == "waylandcompositor") {
return {getInstance<WaylandcompositorPluginsDeployer>(moduleName)};
}

// fallback
return {getInstance<BasicPluginsDeployer>(moduleName)};
}
38 changes: 38 additions & 0 deletions src/deployers/WaylandcompositorPluginsDeployer.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>

// local headers
#include "WaylandcompositorPluginsDeployer.h"

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

namespace fs = std::filesystem;

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

ldLog() << "Deploying waylandcompositor plugin" << std::endl;

for (fs::directory_iterator i(qtPluginsPath / "wayland-decoration-client"); i != fs::directory_iterator(); ++i) {
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-decoration-client/"))
return false;
}

for (fs::directory_iterator i(qtPluginsPath / "wayland-graphics-integration-client"); i != fs::directory_iterator(); ++i) {
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-graphics-integration-client/"))
return false;
}

for (fs::directory_iterator i(qtPluginsPath / "wayland-shell-integration"); i != fs::directory_iterator(); ++i) {
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-shell-integration/"))
return false;
}

return true;
}
17 changes: 17 additions & 0 deletions src/deployers/WaylandcompositorPluginsDeployer.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 WaylandcompositorPluginsDeployer : public BasicPluginsDeployer {
public:
// we can just use the base class's constructor
using BasicPluginsDeployer::BasicPluginsDeployer;

bool deploy() override;
};
}
}
}