git-svn-id: svn://db.shs.com.ru/pip@990 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -33,18 +33,24 @@ void usage() {
|
||||
piCout << "You can specify any file or directory as <file>.";
|
||||
piCout << "In case of directory it will be scan recursively.";
|
||||
piCout << "";
|
||||
piCout << "If QtCore dependency found, copy all basic Qt plugins,";
|
||||
piCout << "<styles> and <platforms>";
|
||||
piCout << "If some Qt dependency found, copy corresponding Qt plugins.";
|
||||
piCout << "Styles and platforms selected by -S and -P flags,";
|
||||
piCout << "any other plugins described by --qt-plugins flag in next format:";
|
||||
piCout << "\"[*=;]<plugins>=<regexp>,<regexp>;<plugins>=<regexp>,<regexp>\", e.g.";
|
||||
piCout << "\"sqldrivers=lite,mysql;geoservices=;position=nmea\".";
|
||||
piCout << "If no regexp specified for plugins, nothing will be copied.";
|
||||
piCout << "Default regexp set by \"*=<regexp>\".";
|
||||
piCout << "\"*=\" disable optional plugins.";
|
||||
piCout << "";
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"deploy_tool [-hvfC] [--dependencies [--prefix <text>]] "
|
||||
"[-p <qt_plugins>] [-s <search_path>] [-S <styles>] [-l <ldd>] "
|
||||
"[-D <dpkg>] [-L <readelf> | -W <objdump> | -M <otool>] "
|
||||
"[-d <depth>] [-q <qtdir>] [-a <add_libs>] [-S <styles>] "
|
||||
"[-P <platforms>] [--sql <drivers>] -o <out_path> <file> [<file2> ...]\"" << NewLine;
|
||||
"[-P <platforms>] [--qt-plugins <d>] -o <out_path> <file> [<file2> ...]\"" << NewLine;
|
||||
piCout << Green << Bold << "Details:";
|
||||
piCout << Bold << "Debug control";
|
||||
piCout << "-h " << Green << "- display this message and exit";
|
||||
piCout << "-v " << Green << "- be verbose";
|
||||
piCout << "-h, --help " << Green << "- display this message and exit";
|
||||
piCout << "-v, --verbose " << Green << "- be verbose";
|
||||
piCout << "";
|
||||
piCout << Bold << "Processing control";
|
||||
piCout << "-f, --fake " << Green << "- don`t copy, only print";
|
||||
@@ -55,21 +61,23 @@ void usage() {
|
||||
piCout << "-M <otool> " << Green << "- \"otool\" path, overrides \"ldd\"";
|
||||
piCout << "-D <dpkg> " << Green << "- \"dpkg\" path, default \"/usr/bin/dpkg\"";
|
||||
piCout << "-d <depth> " << Green << "- maximum dependepcies depth, default 5";
|
||||
piCout << "-q <qtdir> " << Green << "- path where Qt root dir, default takes from \"qmake -v\"";
|
||||
piCout << "-C, --Conf " << Green << "- make \"qt.conf\"";
|
||||
//piCout << "-Q, --Qt-force " << Green << "- force add Qt root dir, default takes from \"qmake -v\"";
|
||||
piCout << "";
|
||||
piCout << Bold << "Qt control";
|
||||
piCout << "-q <qtdir> " << Green << "- path where Qt root dir, default takes from \"qmake -v\"";
|
||||
//piCout << "-C, --Conf " << Green << "- make \"qt.conf\"";
|
||||
piCout << "-S <styles> " << Green << "- set Qt styles (e.g. \"oxygen,breeze\"), default \"*\"";
|
||||
piCout << "-P <platforms> " << Green << "- set Qt platforms (e.g. \"win,mini\"), default by host system";
|
||||
piCout << "--qt-plugins <d> " << Green << "- set Qt plugins description";
|
||||
piCout << "";
|
||||
piCout << Bold << "Output control";
|
||||
piCout << "-o <out_path> " << Green << "- path for libraries copy to";
|
||||
piCout << "-p <qt_plugins> " << Green << "- path for Qt plugins, default \"<out_path>/plugins\"";
|
||||
piCout << "-p <qt_plugins> " << Green << "- path for Qt plugins, default \"<out_path>/plugins\"";
|
||||
piCout << "--dependencies " << Green << "- search dependencies by <dpkg>, print them and copy missing libraries";
|
||||
piCout << "--prefix <text> " << Green << "- print <text> before dependencies";
|
||||
piCout << "";
|
||||
piCout << Bold << "Input control";
|
||||
piCout << "<file> ... " << Green << "- executable to process";
|
||||
piCout << "-S <styles> " << Green << "- set Qt styles (e.g. \"oxygen,breeze\"), default \"*\"";
|
||||
piCout << "-P <platforms> " << Green << "- set Qt platforms (e.g. \"win,mini\"), default by host system";
|
||||
piCout << "--sql <drivers> " << Green << "- set Qt sql drivers (e.g. \"sqlite\"), default \"*\"";
|
||||
piCout << "-a <add_libs> " << Green << "- additional libs, separated by \";\". Libraries will be searched in <search_path>";
|
||||
}
|
||||
|
||||
@@ -100,6 +108,7 @@ bool fake = false, is_ldd = true, is_deps = false, need_qt = false;
|
||||
PIString ldd, readelf, objdump, otool, dpkg, out_dir, qt_dir, out_plugins_dir;
|
||||
PIStringList styles, lib_dirs, add_libs, platforms, sqldrivers;
|
||||
PISet<PIString> all_libs, miss_libs, all_deps, frameworks, miss_frameworks, qt_plugins;
|
||||
PIMap<PIString, PIStringList> qt_filters;
|
||||
|
||||
|
||||
PIString findLib(const PIString & l) {
|
||||
@@ -298,10 +307,10 @@ void procQt() {
|
||||
qdir += "/plugins/";
|
||||
#endif
|
||||
piForeachC (PIString & plugin, pdirs) {
|
||||
PIStringList filters("*");
|
||||
if (plugin == "platforms") filters = platforms;
|
||||
PIStringList filters = qt_filters[plugin];
|
||||
/*if (plugin == "platforms") filters = platforms;
|
||||
if (plugin == "styles") filters = styles;
|
||||
if (plugin == "sqldrivers") filters = sqldrivers;
|
||||
if (plugin == "sqldrivers") filters = sqldrivers;*/
|
||||
piForeachC (PIString & f, filters) {
|
||||
copyWildcard(qdir + plugin + "/" + f, out_plugins_dir + plugin);
|
||||
PIVector<PIFile::FileInfo> copied = PIDir(out_plugins_dir + plugin).entries();
|
||||
@@ -346,7 +355,7 @@ int main(int argc, char * argv[]) {
|
||||
cli.addArgument("search_path", true);
|
||||
cli.addArgument("Styles", true);
|
||||
cli.addArgument("Platforms", true);
|
||||
cli.addArgument("sql", PIChar('\0'), true);
|
||||
cli.addArgument("qt-plugins", PIChar('\0'), true);
|
||||
cli.addArgument("ldd", true);
|
||||
cli.addArgument("Lreadelf", true);
|
||||
cli.addArgument("Wobjdump", true);
|
||||
@@ -398,17 +407,39 @@ int main(int argc, char * argv[]) {
|
||||
if (!out_dir.endsWith("/")) out_dir += "/";
|
||||
if (ldd.isEmpty()) ldd = "/usr/bin/ldd";
|
||||
|
||||
for (int i = 0; ; ++i) {
|
||||
if (qt_deps[i].lib.isEmpty()) break;
|
||||
qt_deps[i].plugins.forEach([&](const PIString & p){qt_filters[p] = PIStringList("*");});
|
||||
}
|
||||
if (!cli.argumentValue("Platforms").isEmpty())
|
||||
qplatforms = cli.argumentValue("Platforms");
|
||||
platforms = qplatforms.split(",");
|
||||
styles = cli.argumentValue("Styles").split(",");
|
||||
if (styles.isEmpty()) styles << "";
|
||||
sqldrivers = cli.argumentValue("sql").split(",");
|
||||
if (sqldrivers.isEmpty()) sqldrivers << "";
|
||||
PIStringList qpd = cli.argumentValue("qt-plugins").toLowerCase().split(";");
|
||||
piForeachC (PIString & qp, qpd) {
|
||||
int _i = qp.indexOf("=");
|
||||
if (_i < 0) continue;
|
||||
PIString pname = qp.left(_i).trim();
|
||||
PIString pfilt = qp.mid(_i + 1).trim();
|
||||
if (pname == "*") {
|
||||
for (int i = 0; ; ++i) {
|
||||
if (qt_deps[i].lib.isEmpty()) break;
|
||||
qt_deps[i].plugins.forEach([&](const PIString & p){qt_filters[p] = pfilt.split(",");});
|
||||
}
|
||||
} else
|
||||
qt_filters[pname] = pfilt.split(",");
|
||||
}
|
||||
qt_filters["platforms"] = platforms;
|
||||
qt_filters["styles" ] = styles ;
|
||||
|
||||
platforms .forEachInplace([](PIString i)->PIString{if (!i.startsWith("*")) i.prepend("*"); if (!i.endsWith("*")) i.append("*"); return i;});
|
||||
styles .forEachInplace([](PIString i)->PIString{if (!i.startsWith("*")) i.prepend("*"); if (!i.endsWith("*")) i.append("*"); return i;});
|
||||
sqldrivers.forEachInplace([](PIString i)->PIString{if (!i.startsWith("*")) i.prepend("*"); if (!i.endsWith("*")) i.append("*"); return i;});
|
||||
for (PIMap<PIString, PIStringList>::iterator it = qt_filters.begin(); it != qt_filters.end(); ++it)
|
||||
it.value().forEachInplace([](PIString i)->PIString{
|
||||
if (!i.startsWith("*")) i.prepend("*");
|
||||
if (!i.endsWith("*")) i.append("*");
|
||||
return i;
|
||||
});
|
||||
//PICout(PICoutManipulators::DefaultControls) << qt_filters;
|
||||
|
||||
if (!fake)
|
||||
PIDir(out_dir).make();
|
||||
|
||||
Reference in New Issue
Block a user