Skip to content

Commit d65cb3a

Browse files
committed
Rename EXTRA_QT_PLUGINS to EXTRA_QT_MODULES
Fixes: #121
1 parent babb58d commit d65cb3a

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so
5656

5757
**Qt specific:**
5858
- `$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`)
59-
- `$EXTRA_QT_PLUGINS=pluginA;pluginB`: Plugins to deploy even if not found automatically by linuxdeploy-plugin-qt
60-
- example: `EXTRA_QT_PLUGINS=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html)
59+
- `$EXTRA_QT_MODULES=pluginA;pluginB`: Modules to deploy even if not found automatically by linuxdeploy-plugin-qt
60+
- example: `EXTRA_QT_MODULES=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html)
6161
- `$EXTRA_PLATFORM_PLUGINS=platformA;platformB`: Platforms to deploy in addition to `libqxcb.so`. Platform must be available from `QT_INSTALL_PLUGINS/platforms`.
6262

6363
QML related:

Diff for: src/main.cpp

+20-11
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ int main(const int argc, const char *const *const argv) {
3737
args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"});
3838

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

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

202-
std::vector<std::string> extraPluginsFromEnv;
203-
const auto* const extraPluginsFromEnvData = getenv("EXTRA_QT_PLUGINS");
204-
if (extraPluginsFromEnvData != nullptr)
205-
extraPluginsFromEnv = linuxdeploy::util::split(std::string(extraPluginsFromEnvData), ';');
202+
std::vector<std::string> extraModulesFromEnv;
203+
const auto* const extraModulesFromEnvData = []() -> char* {
204+
auto* ret = getenv("EXTRA_QT_MODULES");
205+
if (ret == nullptr) {
206+
ret = getenv("EXTRA_QT_PLUGINS");
207+
if (ret) {
208+
ldLog() << std::endl << LD_WARNING << "Using deprecated EXTRA_QT_PLUGINS env var" << std::endl;
209+
}
210+
}
211+
return ret;
212+
}();
213+
if (extraModulesFromEnvData != nullptr)
214+
extraModulesFromEnv = linuxdeploy::util::split(std::string(extraModulesFromEnvData), ';');
206215

207-
for (const auto& pluginsList : {static_cast<std::vector<std::string>>(extraPlugins.Get()), extraPluginsFromEnv}) {
216+
for (const auto& modulesList : {static_cast<std::vector<std::string>>(extraModules.Get()), extraModulesFromEnv}) {
208217
std::copy_if(qtModules.begin(), qtModules.end(), std::back_inserter(extraQtModules),
209-
[&matchesQtModule, &libraryNames, &pluginsList](const QtModule &module) {
210-
return std::find_if(pluginsList.begin(), pluginsList.end(),
218+
[&matchesQtModule, &libraryNames, &modulesList](const QtModule &module) {
219+
return std::find_if(modulesList.begin(), modulesList.end(),
211220
[&matchesQtModule, &module](const std::string &libraryName) {
212221
return matchesQtModule(libraryName, module);
213-
}) != pluginsList.end();
222+
}) != modulesList.end();
214223
}
215224
);
216225
}

0 commit comments

Comments
 (0)