Skip to content

Commit

Permalink
Rename EXTRA_QT_PLUGINS to EXTRA_QT_MODULES
Browse files Browse the repository at this point in the history
Fixes: #121
  • Loading branch information
dantti committed Jun 12, 2024
1 parent babb58d commit 7f77ae6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so

**Qt specific:**
- `$QMAKE=/path/to/my/qmake`: use another `qmake` binary to detect paths of plugins and other resources (usually doesn't need to be set manually, most Qt environments ship scripts changing `$PATH`)
- `$EXTRA_QT_PLUGINS=pluginA;pluginB`: Plugins to deploy even if not found automatically by linuxdeploy-plugin-qt
- example: `EXTRA_QT_PLUGINS=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html)
- `$EXTRA_QT_MODULES=pluginA;pluginB`: Modules to deploy even if not found automatically by linuxdeploy-plugin-qt
- example: `EXTRA_QT_MODULES=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html)
- `$EXTRA_PLATFORM_PLUGINS=platformA;platformB`: Platforms to deploy in addition to `libqxcb.so`. Platform must be available from `QT_INSTALL_PLUGINS/platforms`.

QML related:
Expand Down
22 changes: 11 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ int main(const int argc, const char *const *const argv) {
args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"});

args::ValueFlag<fs::path> appDirPath(parser, "appdir path", "Path to an existing AppDir", {"appdir"});
args::ValueFlagList<std::string> extraPlugins(parser, "plugin",
"Extra Qt plugin to deploy (specified by name, filename or path)",
{'p', "extra-plugin"});
args::ValueFlagList<std::string> extraModules(parser, "module",
"Extra Qt module to deploy (specified by name, filename or path)",
{'m', "extra-module"});

args::Flag pluginType(parser, "", "Print plugin type and exit", {"plugin-type"});
args::Flag pluginApiVersion(parser, "", "Print plugin API version and exit", {"plugin-api-version"});
Expand Down Expand Up @@ -199,18 +199,18 @@ int main(const int argc, const char *const *const argv) {
}) != libraryNames.end();
});

std::vector<std::string> extraPluginsFromEnv;
const auto* const extraPluginsFromEnvData = getenv("EXTRA_QT_PLUGINS");
if (extraPluginsFromEnvData != nullptr)
extraPluginsFromEnv = linuxdeploy::util::split(std::string(extraPluginsFromEnvData), ';');
std::vector<std::string> extraModulesFromEnv;
const auto* const extraModulesFromEnvData = getenv("EXTRA_QT_MODULES") ? getenv("EXTRA_QT_MODULES") : getenv("EXTRA_QT_PLUGINS");
if (extraModulesFromEnvData != nullptr)
extraModulesFromEnv = linuxdeploy::util::split(std::string(extraModulesFromEnvData), ';');

for (const auto& pluginsList : {static_cast<std::vector<std::string>>(extraPlugins.Get()), extraPluginsFromEnv}) {
for (const auto& modulesList : {static_cast<std::vector<std::string>>(extraModules.Get()), extraModulesFromEnv}) {
std::copy_if(qtModules.begin(), qtModules.end(), std::back_inserter(extraQtModules),
[&matchesQtModule, &libraryNames, &pluginsList](const QtModule &module) {
return std::find_if(pluginsList.begin(), pluginsList.end(),
[&matchesQtModule, &libraryNames, &modulesList](const QtModule &module) {
return std::find_if(modulesList.begin(), modulesList.end(),
[&matchesQtModule, &module](const std::string &libraryName) {
return matchesQtModule(libraryName, module);
}) != pluginsList.end();
}) != modulesList.end();
}
);
}
Expand Down

0 comments on commit 7f77ae6

Please sign in to comment.