summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-05-14 16:59:11 +0100
committerShane Kearns <shane.kearns@accenture.com>2010-05-14 17:24:03 +0100
commit8fe40ca28e88d156b9a0ef9cc4c818a666499231 (patch)
treefffb720a6b08bc9d0cdf88347a2117f6a41ea231 /qmake
parent18af9ef6074c33f7416629007ef5d24a39a55cbe (diff)
Fix generation of stub sis files
Convert paths in DEPLOYMENT to the rom drive (z:) Filter out unwanted parts of the header (dependencies) Task-number: QTBUG-10118 Reviewed-by: Alessandro Portale
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp83
1 files changed, 69 insertions, 14 deletions
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index adbd009d36..ce796c3e75 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -142,6 +142,13 @@ void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str)
removeSpecialCharacters(str);
}
+QString romPath(const QString& path)
+{
+ if(path.length() > 2 && path[1] == ':')
+ return QLatin1String("z:") + path.mid(2);
+ return QLatin1String("z:") + path;
+}
+
void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocBuild)
{
QMakeProject *project = generator->project;
@@ -150,8 +157,8 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
pkgTarget = project->first("TARGET");
pkgTarget = generator->unescapeFilePath(pkgTarget);
pkgTarget = removePathSeparators(pkgTarget);
- QString pkgFilename = Option::output_dir + QLatin1Char('/') + QString("%1_template.%2")
- .arg(pkgTarget).arg("pkg");
+ QString pkgFilename = Option::output_dir + QLatin1Char('/') +
+ QString("%1_template.pkg").arg(pkgTarget);
QFile pkgFile(pkgFilename);
if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
@@ -159,8 +166,19 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
return;
}
+ QString stubPkgFileName = Option::output_dir + QLatin1Char('/') +
+ QString("%1_stub.pkg").arg(pkgTarget);
+
+ QFile stubPkgFile(stubPkgFileName);
+ if (!stubPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ PRINT_FILE_CREATE_ERROR(stubPkgFileName);
+ return;
+ }
+
generatedFiles << pkgFile.fileName();
QTextStream t(&pkgFile);
+ generatedFiles << stubPkgFile.fileName();
+ QTextStream ts(&stubPkgFile);
QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n");
if (installerSisHeader.isEmpty())
@@ -180,6 +198,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
";\n\n";
t << headerComment.arg(pkgFilename).arg(dateStr);
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
@@ -229,6 +248,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
t << languageRules.join("\n") << endl;
tw << languageRules.join("\n") << endl;
+ ts << languageRules.join("\n") << endl;
// name of application, UID and version
QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');
@@ -244,10 +264,14 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
tw << installerSisHeader << endl;
}
- if (headerRules.isEmpty())
+ if (headerRules.isEmpty()) {
t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);
- else
+ ts << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);
+ }
+ else {
t << headerRules.join("\n") << endl;
+ ts << headerRules.join("\n") << endl;
+ }
// Localized vendor name
QString vendorName;
@@ -262,22 +286,38 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
t << vendorName;
tw << vendorName;
+ ts << vendorName;
// 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";
t << comment;
tw << comment;
+ ts << comment;
foreach(QString item, rawPkgPreRules) {
- // Only regular pkg file should have package dependencies or pkg header if that is
- // defined using prerules.
- if (!item.startsWith("(") && !item.startsWith("#")) {
+ // 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;
+ }
+ // Only regular and stub should have pkg header if that is defined using prerules.
+ else if (!item.startsWith("#")) {
+ t << item << endl;
+ ts << item << endl;
+ }
+ else {
+ t << item << endl;
+ ts << item << endl;
tw << item << endl;
}
- t << item << endl;
}
t << endl;
+ ts << endl;
tw << endl;
}
@@ -319,41 +359,54 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
// deploy .exe file
t << "; Executable and default resource files" << endl;
QString exeFile = fixedTarget + ".exe";
- t << QString("\"%1/%2\" - \"%3\\%4\"")
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
.arg(destDirBin)
.arg(exeFile)
.arg(installPathBin)
.arg(exeFile) << endl;
+ ts << QString("\"\" - \"%1\\%2\"")
+ .arg(romPath(installPathBin))
+ .arg(exeFile) << endl;
// deploy rsc & reg_rsc file
if (!project->isActiveConfig("no_icon")) {
- t << QString("\"%1/%2\" - \"%3\\%4\"")
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
.arg(destDirResource)
.arg(fixedTarget + ".rsc")
.arg(installPathResource)
.arg(fixedTarget + ".rsc") << endl;
+ ts << QString("\"\" - \"%1\\%2\"")
+ .arg(romPath(installPathResource))
+ .arg(fixedTarget + ".rsc") << endl;
- t << QString("\"%1/%2\" - \"%3\\%4\"")
+ t << QString("\"%1/%2\" - \"%3\\%4\"")
.arg(destDirRegResource)
.arg(fixedTarget + "_reg.rsc")
.arg(installPathRegResource)
.arg(fixedTarget + "_reg.rsc") << endl;
+ ts << QString("\"\" - \"%1\\%2\"")
+ .arg(romPath(installPathRegResource))
+ .arg(fixedTarget + "_reg.rsc") << endl;
if (!iconFile.isEmpty()) {
if (epocBuild) {
- t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
+ t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")
.arg(epocRoot())
.arg(iconFile)
.arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
+ ts << QString("\"\" - \"%1\"")
+ .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl;
} else {
QDir mifIconDir(project->first("DESTDIR"));
QFileInfo mifIcon(mifIconDir.relativeFilePath(project->first("TARGET")));
QString mifIconFileName = mifIcon.fileName();
mifIconFileName.append(".mif");
- t << QString("\"%1/%2\" - \"!:%3\"")
+ t << QString("\"%1/%2\" - \"!:%3\"")
.arg(mifIcon.path())
.arg(mifIconFileName)
.arg(QDir::toNativeSeparators(iconFile)) << endl << endl;
+ ts << QString("\"\" - \"%1\"")
+ .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl;
}
}
}
@@ -389,9 +442,11 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB
}
}
- t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl;
+ t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl;
+ ts << QString("\"\" - \"%1\"").arg(romPath(to)) << endl;
}
t << endl;
+ 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;