summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/development/qmake-manual.qdoc31
-rw-r--r--doc/src/snippets/code/doc_src_qmake-manual.qdoc5
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp235
-rw-r--r--qmake/generators/symbian/symbiancommon.h11
4 files changed, 197 insertions, 85 deletions
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc
index d65967d..a520838 100644
--- a/doc/src/development/qmake-manual.qdoc
+++ b/doc/src/development/qmake-manual.qdoc
@@ -1394,12 +1394,16 @@
On the Symbian platform, generic PKG file content can also be specified with this
variable. You can use either \c pkg_prerules or \c pkg_postrules to
pass raw data to PKG file. The strings in \c pkg_prerules are added before
- package-body and \c pkg_postrules after. The strings defined in
- \c pkg_postrules or \c pkg_prerules are not parsed by qmake, so they
- should be in a format understood by Symbian package generation tools.
+ package-body and \c pkg_postrules after. \c pkg_prerules is used for
+ defining vendor information, dependencies, custom package headers, and the
+ like, while \c pkg_postrules is used for custom file deployment and
+ embedded sis directives.
+ The strings defined in \c pkg_postrules or \c pkg_prerules are not parsed
+ by qmake, so they should be in a format understood by Symbian package
+ generation tools.
Please consult the Symbian platform documentation for correct syntax.
- For example, to deploy DLL and add a new dependency:
+ For example, to deploy DLL and add a new dependency:
\snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 140
@@ -1415,13 +1419,28 @@
\o localized and unique vendor, for example \BR
%{"Vendor-EN", ..., "Vendor-FR"}
:"Unique vendor name"
- \endlist
+ \endlist
- If you decide to override any of these statements, you need to pay
+ If you decide to override any of these statements, you need to pay
attention that also other statements stay valid. For example if you
override languages statement, you must override also package-header
statement and all other statements which are language specific.
+ On the Symbian platform, three separate PKG files are generated:
+
+ \list
+ \o <app>_template.pkg - For application SIS file. Rules suffix: \c{.main}
+ \o <app>_installer.pkg - For smart installer SIS file. Rules suffix: \c{.installer}
+ \o <app>_stub.pkg - For ROM stubs. Rules suffix: \c{.stub}
+ \endlist
+
+ \c pkg_prerules and \c pkg_postrules given without rules suffix will
+ intelligently apply to each of these files, but rules can also be
+ targeted to only one of above files by appending listed rules suffix
+ to the variable name:
+
+ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 153
+
On the Symbian platform, the \c default_deployment item specifies
default platform and package dependencies. Those dependencies can be
selectively disabled if alternative dependencies need to be defined
diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
index 8c35c3f..379d081 100644
--- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc
+++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc
@@ -1009,3 +1009,8 @@ my_exports = \
"bar.h /epoc32/include/mylib/bar.h"
BLD_INF_RULES.prj_exports += my_exports
//! [152]
+
+//! [153]
+my_note.pkg_postrules.installer = "\"myinstallnote.txt\" - \"\", FILETEXT, TEXTCONTINUE"
+DEPLOYMENT += my_note
+//! [153]
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index 6fea8fd..3183e27 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -204,44 +204,71 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
tw << headerComment.arg(wrapperPkgFilename).arg(dateStr);
ts << headerComment.arg(stubPkgFileName).arg(dateStr);
- // Construct QStringList from pkg_prerules since we need search it before printed to file
- // Note: Though there can't be more than one language or header line, use stringlists
+ QStringList commonRawPreRules;
+ QStringList mainRawPreRules;
+ QStringList instRawPreRules;
+ QStringList stubRawPreRules;
+
+ // Though there can't be more than one language or header line, use stringlists
// in case user wants comments to go with the rules.
- QStringList rawPkgPreRules;
+ // Note that it makes no sense to have file specific language or header rules,
+ // except what is provided for installer header via "DEPLOYMENT.installer_header" variable,
+ // because stub and main headers should always match. Vendor rules are similarly limited to
+ // make code cleaner as it is unlikely anyone will want different vendor in different files.
QStringList languageRules;
QStringList headerRules;
- foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
- foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) {
- QStringList pkgrulesValue = project->values(pkgrulesItem);
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line mmp statements
- if (pkgrulesValue.isEmpty()) {
- if (pkgrulesItem.startsWith("&"))
- languageRules << pkgrulesItem;
- else if (pkgrulesItem.startsWith("#"))
- headerRules << pkgrulesItem;
- else
- rawPkgPreRules << pkgrulesItem;
- } else {
- if (containsStartWithItem('&', pkgrulesValue)) {
- foreach(QString pkgrule, pkgrulesValue) {
- languageRules << pkgrule;
- }
- } else if (containsStartWithItem('#', pkgrulesValue)) {
- foreach(QString pkgrule, pkgrulesValue) {
- headerRules << pkgrule;
- }
- } else {
- foreach(QString pkgrule, pkgrulesValue) {
- rawPkgPreRules << pkgrule;
- }
- }
- }
+ QStringList vendorRules;
+
+ QStringList commonRawPostRules;
+ QStringList mainRawPostRules;
+ QStringList instRawPostRules;
+ QStringList stubRawPostRules;
+
+ QStringList failList; // Used for detecting incorrect usage
+
+ QString emptySuffix;
+ QString mainSuffix(".main");
+ QString instSuffix(".installer");
+ QString stubSuffix(".stub");
+
+ foreach(QString item, project->values("DEPLOYMENT")) {
+ parsePreRules(item, emptySuffix, &commonRawPreRules, &languageRules, &headerRules, &vendorRules);
+ parsePreRules(item, mainSuffix, &mainRawPreRules, &failList, &failList, &failList);
+ parsePreRules(item, instSuffix, &instRawPreRules, &failList, &failList, &failList);
+ parsePreRules(item, stubSuffix, &stubRawPreRules, &failList, &failList, &failList);
+
+ parsePostRules(item, emptySuffix, &commonRawPostRules);
+ parsePostRules(item, mainSuffix, &mainRawPostRules);
+ parsePostRules(item, instSuffix, &instRawPostRules);
+ parsePostRules(item, stubSuffix, &stubRawPostRules);
+ }
+
+ if (!failList.isEmpty()) {
+ fprintf(stderr, "Warning: Custom language, header, or vendor definitions are not "
+ "supported by file specific pkg_prerules.* variables.\n"
+ "Use plain pkg_prerules and/or DEPLOYMENT.installer_header for customizing "
+ "these items.\n");
+ }
+
+ foreach(QString item, commonRawPreRules) {
+ if (item.startsWith("(")) {
+ // Only regular pkg file should have package dependencies
+ mainRawPreRules << item;
+ } else if (item.startsWith("[")) {
+ // stub pkg file should not have platform dependencies
+ mainRawPreRules << item;
+ instRawPreRules << item;
+ } else {
+ mainRawPreRules << item;
+ instRawPreRules << item;
+ stubRawPreRules << item;
}
}
- // Apply some defaults if specific data does not exist in PKG pre-rules
+ // Currently common postrules only go to main
+ mainRawPostRules << commonRawPostRules;
+ // Apply some defaults if specific data does not exist in PKG pre-rules
if (languageRules.isEmpty()) {
// language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS)
languageRules << "; Language\n&EN\n\n";
@@ -313,49 +340,38 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
ts << headerRules.join("\n") << endl;
}
- // Localized vendor name
- QString vendorName;
- if (!containsStartWithItem('%', rawPkgPreRules)) {
- vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n";
+ // Vendor name
+ if (!containsStartWithItem('%', vendorRules)) {
+ vendorRules << "; Default localized vendor name\n%{\"Vendor\"}\n\n";
}
-
- // Unique vendor name
- if (!containsStartWithItem(':', rawPkgPreRules)) {
- vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n";
+ if (!containsStartWithItem(':', vendorRules)) {
+ vendorRules << "; Default unique vendor name\n:\"Vendor\"\n\n";
}
- t << vendorName;
- tw << vendorName;
- ts << vendorName;
+ t << vendorRules.join("\n") << endl;
+ tw << vendorRules.join("\n") << endl;
+ ts << vendorRules.join("\n") << endl;
// PKG pre-rules - these are added before actual file installations i.e. SIS package body
- if (rawPkgPreRules.size()) {
- QString comment = "\n; Manual PKG pre-rules from PRO files\n";
+ QString comment = "\n; Manual PKG pre-rules from PRO files\n";
+
+ if (mainRawPreRules.size()) {
t << comment;
+ t << mainRawPreRules.join("\n") << endl;
+ }
+ if (instRawPreRules.size()) {
tw << comment;
+ tw << instRawPreRules.join("\n") << endl;
+ }
+ if (stubRawPreRules.size()) {
ts << comment;
-
- foreach(QString item, rawPkgPreRules) {
- // Only regular pkg file should have package dependencies
- if (item.startsWith("(")) {
- t << item << endl;
- }
- // stub pkg file should not have platform dependencies
- else if (item.startsWith("[")) {
- t << item << endl;
- tw << item << endl;
- }
- else {
- t << item << endl;
- ts << item << endl;
- tw << item << endl;
- }
- }
- t << endl;
- ts << endl;
- tw << endl;
+ ts << stubRawPreRules.join("\n") << endl;
}
+ t << endl;
+ tw << endl;
+ ts << endl;
+
// Begin Manufacturer block
if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {
QString manufacturerStr("IF ");
@@ -481,21 +497,19 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
ts << endl;
// PKG post-rules - these are added after actual file installations i.e. SIS package body
- t << "; Manual PKG post-rules from PRO files" << endl;
- foreach(QString deploymentItem, project->values("DEPLOYMENT")) {
- foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) {
- QStringList pkgrulesValue = project->values(pkgrulesItem);
- // If there is no stringlist defined for a rule, use rule name directly
- // This is convenience for defining single line statements
- if (pkgrulesValue.isEmpty()) {
- t << pkgrulesItem << endl;
- } else {
- foreach(QString pkgrule, pkgrulesValue) {
- t << pkgrule << endl;
- }
- }
- t << endl;
- }
+ comment = "; Manual PKG post-rules from PRO files\n";
+
+ if (mainRawPostRules.size()) {
+ t << comment;
+ t << mainRawPostRules.join("\n") << endl;
+ }
+ if (instRawPostRules.size()) {
+ tw << comment;
+ tw << instRawPostRules.join("\n") << endl;
+ }
+ if (stubRawPostRules.size()) {
+ ts << comment;
+ ts << stubRawPostRules.join("\n") << endl;
}
// Close Manufacturer block
@@ -1037,3 +1051,66 @@ void SymbianCommonGenerator::fillQt2S60LangMapTable()
qt2S60LangMapTable.insert("ny", "SC"); //Chewa //
}
+void SymbianCommonGenerator::parsePreRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList,
+ QStringList *languageRuleList,
+ QStringList *headerRuleList,
+ QStringList *vendorRuleList)
+{
+ QMakeProject *project = generator->project;
+ foreach(QString pkgrulesItem, project->values(deploymentVariable + ".pkg_prerules" + variableSuffix)) {
+ QStringList pkgrulesValue = project->values(pkgrulesItem);
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (pkgrulesValue.isEmpty()) {
+ if (pkgrulesItem.startsWith("&"))
+ *languageRuleList << pkgrulesItem;
+ else if (pkgrulesItem.startsWith("#"))
+ *headerRuleList << pkgrulesItem;
+ else if (pkgrulesItem.startsWith("%") || pkgrulesItem.startsWith(":"))
+ *vendorRuleList << pkgrulesItem;
+ else
+ *rawRuleList << pkgrulesItem;
+ } else {
+ if (containsStartWithItem('&', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *languageRuleList << pkgrule;
+ }
+ } else if (containsStartWithItem('#', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *headerRuleList << pkgrule;
+ }
+ } else if (containsStartWithItem('%', pkgrulesValue)
+ || containsStartWithItem(':', pkgrulesValue)) {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *vendorRuleList << pkgrule;
+ }
+ } else {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *rawRuleList << pkgrule;
+ }
+ }
+ }
+ }
+}
+
+void SymbianCommonGenerator::parsePostRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList)
+{
+ QMakeProject *project = generator->project;
+ foreach(QString pkgrulesItem, project->values(deploymentVariable + ".pkg_postrules" + variableSuffix)) {
+ QStringList pkgrulesValue = project->values(pkgrulesItem);
+ // If there is no stringlist defined for a rule, use rule name directly
+ // This is convenience for defining single line statements
+ if (pkgrulesValue.isEmpty()) {
+ *rawRuleList << pkgrulesItem;
+ } else {
+ foreach(QString pkgrule, pkgrulesValue) {
+ *rawRuleList << pkgrule;
+ }
+ }
+ }
+}
+
diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h
index dae1e4a..80f2079 100644
--- a/qmake/generators/symbian/symbiancommon.h
+++ b/qmake/generators/symbian/symbiancommon.h
@@ -86,6 +86,17 @@ protected:
QStringList symbianLangCodesFromTsFiles();
void fillQt2S60LangMapTable();
+ void parsePreRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList,
+ QStringList *languageRuleList,
+ QStringList *headerRuleList,
+ QStringList *vendorRuleList);
+ void parsePostRules(const QString &deploymentVariable,
+ const QString &variableSuffix,
+ QStringList *rawRuleList);
+
+
protected:
MakefileGenerator *generator;