Skip to content

Commit 230cdb3

Browse files
committed
Add support for texttospeech plugins deployment
Closes #70.
1 parent c370ffa commit 230cdb3

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

src/deployers/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ set(CLASSES
1717
Qt3DPluginsDeployer
1818
GamepadPluginsDeployer
1919
PrintSupportPluginsDeployer
20+
TextToSpeechPluginsDeployer
2021
)
2122

2223
# TODO: CMake <= 3.7 (at least!) doesn't allow for using OBJECT libraries with target_link_libraries

src/deployers/PluginsDeployerFactory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "Qt3DPluginsDeployer.h"
1212
#include "SqlPluginsDeployer.h"
1313
#include "SvgPluginsDeployer.h"
14+
#include "TextToSpeechPluginsDeployer.h"
1415
#include "WebEnginePluginsDeployer.h"
1516
#include "XcbglIntegrationPluginsDeployer.h"
1617

@@ -79,6 +80,10 @@ std::vector<std::shared_ptr<PluginsDeployer>> PluginsDeployerFactory::getDeploye
7980
return {getInstance<PrintSupportPluginsDeployer>(moduleName)};
8081
}
8182

83+
if (moduleName == "texttospeech") {
84+
return {getInstance<TextToSpeechPluginsDeployer>(moduleName)};
85+
}
86+
8287
// fallback
8388
return {getInstance<BasicPluginsDeployer>(moduleName)};
8489
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// library headers
2+
#include <linuxdeploy/core/log.h>
3+
#include <boost/filesystem.hpp>
4+
5+
// local headers
6+
#include "TextToSpeechPluginsDeployer.h"
7+
8+
using namespace linuxdeploy::plugin::qt;
9+
using namespace linuxdeploy::core::log;
10+
11+
namespace bf = boost::filesystem;
12+
13+
bool TextToSpeechPluginsDeployer::deploy() {
14+
// calling the default code is optional, but it won't hurt for now
15+
if (!BasicPluginsDeployer::deploy())
16+
return false;
17+
18+
const std::string pluginsName = "texttospeech";
19+
20+
ldLog() << "Deploying" << pluginsName << "plugins" << std::endl;
21+
22+
for (bf::directory_iterator i(qtPluginsPath / pluginsName); i != bf::directory_iterator(); ++i) {
23+
if (i->path().extension() == ".debug") {
24+
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
25+
continue;
26+
}
27+
28+
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/" / pluginsName))
29+
return false;
30+
}
31+
32+
return true;
33+
}
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 TextToSpeechPluginsDeployer : 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)