forked from linuxdeploy/linuxdeploy-plugin-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasicPluginsDeployer.cpp
56 lines (48 loc) · 2.46 KB
/
BasicPluginsDeployer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// system headers
#include <filesystem>
#include <utility>
// library headers
#include <linuxdeploy/core/log.h>
// local headers
#include "BasicPluginsDeployer.h"
using namespace linuxdeploy::core::log;
using namespace linuxdeploy::core::appdir;
using namespace linuxdeploy::plugin::qt;
namespace fs = std::filesystem;
BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName,
core::appdir::AppDir& appDir,
fs::path qtPluginsPath,
fs::path qtLibexecsPath,
fs::path installLibsPath,
fs::path qtTranslationsPath,
fs::path qtDataPath) : moduleName(std::move(moduleName)),
appDir(appDir),
qtPluginsPath(std::move(qtPluginsPath)),
qtLibexecsPath(std::move(qtLibexecsPath)),
qtInstallQmlPath(std::move(installLibsPath)),
qtTranslationsPath(std::move(qtTranslationsPath)),
qtDataPath(std::move(qtDataPath)) {}
bool BasicPluginsDeployer::deploy() {
// currently this is a no-op, but we might add more functionality later on, such as some kinds of default
// attempts to copy data based on the moduleName
return doDeploy();
}
bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vector<std::string>& plugins)
{
for (const auto &pluginName : plugins) {
ldLog() << "Deploying Qt" << pluginName << "plugins" << std::endl;
for (fs::directory_iterator i(qtPluginsPath / pluginName); i != fs::directory_iterator(); ++i) {
if (i->path().extension() == ".debug") {
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
continue;
}
// add a trailing slash, so pluginName is used as a destination directory, not a file.
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins" / pluginName / ""))
return false;
}
}
return true;
}
bool BasicPluginsDeployer::doDeploy() {
return true;
}