-
Notifications
You must be signed in to change notification settings - Fork 40
Allow to deploy specific platform plugins #89
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,50 @@ | ||
// library headers | ||
#include <linuxdeploy/core/log.h> | ||
#include <boost/filesystem.hpp> | ||
|
||
// local headers | ||
#include "PlatformPluginsDeployer.h" | ||
#include "linuxdeploy/util/util.h" | ||
|
||
using namespace linuxdeploy::plugin::qt; | ||
using namespace linuxdeploy::core::log; | ||
|
||
namespace bf = boost::filesystem; | ||
|
||
PlatformPluginsDeployer::PlatformPluginsDeployer(std::string moduleName, | ||
core::appdir::AppDir& appDir, | ||
bf::path qtPluginsPath, | ||
bf::path qtLibexecsPath, | ||
bf::path installLibsPath, | ||
bf::path qtTranslationsPath, | ||
bf::path qtDataPath): | ||
BasicPluginsDeployer(std::move(moduleName), | ||
appDir, | ||
std::move(qtPluginsPath), | ||
std::move(qtLibexecsPath), | ||
std::move(installLibsPath), | ||
std::move(qtTranslationsPath), | ||
std::move(qtDataPath)) { | ||
// check if the platform plugins are set in env | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure whether it's a great idea to implement a custom constructor. Of course, software design wise, that's probably the way to go, given that we need to create that list below. However, it adds a fair amount of boilerplate code that will have to be maintained. What do you think about moving the evaluation of the environment variable into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't seem like |
||
const auto* const platformPluginsFromEnvData = getenv("PLATFORM_PLUGINS"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As said above, I'd rather enforce the deployment of |
||
if (platformPluginsFromEnvData != nullptr) | ||
platformToDeploy = linuxdeploy::util::split(std::string(platformPluginsFromEnvData), ';'); | ||
else { | ||
// default to libqxcb if nothing is provided | ||
platformToDeploy.emplace_back("libqxcb.so"); | ||
} | ||
} | ||
|
||
bool PlatformPluginsDeployer::deploy() { | ||
// calling the default code is optional, but it won't hurt for now | ||
if (!BasicPluginsDeployer::deploy()) | ||
return false; | ||
|
||
ldLog() << "Deploying platform plugins" << std::endl; | ||
for (auto& platform : platformToDeploy) { | ||
if (!appDir.deployLibrary(qtPluginsPath / "platforms" / platform, appDir.path() / "usr/plugins/platforms/")) | ||
return false; | ||
} | ||
|
||
if (!appDir.deployLibrary(qtPluginsPath / "platforms/libqxcb.so", appDir.path() / "usr/plugins/platforms/")) | ||
return false; | ||
|
||
for (bf::directory_iterator i(qtPluginsPath / "platforminputcontexts"); i != bf::directory_iterator(); ++i) { | ||
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/platforminputcontexts/")) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name should be plural, I suppose that's a typo.
I'd also rather not have people manually add
libqxcb
but deploy it by default. Therefore, the name should be$EXTRA_PLATFORM_PLUGINS
.