Skip to content

Commit

Permalink
added waylandcompositor plugin deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
SushiTee authored and TheAssassin committed Apr 25, 2024
1 parent 52d9a4c commit 756fa6b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
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;
};
}
}
}

0 comments on commit 756fa6b

Please sign in to comment.