Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into lighthouse-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jørgen Lind committed Apr 14, 2011
2 parents 5f68933 + 662174b commit b56444d
Show file tree
Hide file tree
Showing 1,967 changed files with 194,789 additions and 97,571 deletions.
2 changes: 1 addition & 1 deletion .commit-template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# ---[ Fields ]-----------------[ uncomment and edit as applicable ]---|

#Task-number:
Reviewed-by: pending
#Reviewed-by:

# ==================================[ please wrap at 72 characters ]===|
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ examples/*/*/*
examples/*/*/*[.]app
!examples/declarative/*
!examples/tutorials/*
!examples/tutorials/*/*
!examples/ja_JP/*/*
demos/*/*
!demos/spectrum/*
Expand Down
41 changes: 23 additions & 18 deletions bin/createpackage.pl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
use File::Path;
# use CWD abs_bath, which is exported only on request
use Cwd 'abs_path';

use File::Copy;

sub Usage() {
print <<ENDUSAGESTRING;
Expand All @@ -84,6 +84,8 @@ ()
[-g|gcce-is-armv5] = Convert gcce platform to armv5.
[-d|dont-patch] = Skip automatic patching of capabilities and pkg file if default certificate
is used. Instead non-self-signable capabilities just cause warnings.
[-t|tmp-dir <path>] = Specifies temporary directory to be used for package creation.
Defaults to 'createpackage_tmp' under same directory as templatepkg.
Where parameters are as follows:
templatepkg = Name of .pkg file template
target = Either debug or release
Expand Down Expand Up @@ -130,6 +132,7 @@ ()
my $onlyUnsigned = "";
my $convertGcce = "";
my $dontPatchCaps = "";
my $tempPackageDir = "";

unless (GetOptions('i|install' => \$install,
'p|preprocess' => \$preprocessonly,
Expand All @@ -139,7 +142,8 @@ ()
's|stub' => \$stub,
'n|sisname=s' => \$signed_sis_name,
'g|gcce-is-armv5' => \$convertGcce,
'd|dont-patch' => \$dontPatchCaps,)) {
'd|dont-patch' => \$dontPatchCaps,
't|tmp-dir=s' => \$tempPackageDir,)) {
Usage();
}

Expand Down Expand Up @@ -190,18 +194,22 @@ ()
my $passphrase;
$passphrase = $ARGV[4] or $passphrase = "";

if ($tempPackageDir eq "") {
my ($templateVolume, $templatePath, $templateFileName) = File::Spec->splitpath($templatepkg);
$tempPackageDir = File::Spec->catpath($templateVolume, $templatePath."createpackage_tmp", "");
}

mkpath($tempPackageDir);

# Generate output pkg basename (i.e. file name without extension)
my $pkgoutputbasename = $templatepkg;
my $preservePkgOutput = "";
$pkgoutputbasename =~ s/_template/_$targetplatform/g;
$pkgoutputbasename =~ s/_installer\.pkg/_installer___temp\.pkg/g;
if ($pkgoutputbasename eq $templatepkg) {
$preservePkgOutput = "1";
}
$pkgoutputbasename =~ s/\.pkg//g;

# Store output file names to variables
my $pkgoutput = $pkgoutputbasename.".pkg";
my ($dummy1, $dummy2, $pkgoutput) = File::Spec->splitpath($pkgoutputbasename.".pkg");
$pkgoutput = $tempPackageDir."/".$pkgoutput;
my $sisoutputbasename;
if ($signed_sis_name eq "") {
$sisoutputbasename = $pkgoutputbasename;
Expand Down Expand Up @@ -300,9 +308,7 @@ ()
if (!$onlyUnsigned) {
unlink $signed_sis_name;
}
if (!$preservePkgOutput) {
unlink $pkgoutput;
}
unlink $pkgoutput;

# Preprocess PKG

Expand Down Expand Up @@ -334,6 +340,11 @@ ()
close OUTPUT;

if ($preprocessonly) {
# Copy preprocessed file from tmp dir to pkg file dir
my ($templateVolume, $templatePath, $templateFileName) = File::Spec->splitpath($templatepkg);
my ($dummy1, $dummy2, $copyFileName) = File::Spec->splitpath($pkgoutput);
my $copyTarget = File::Spec->catpath($templateVolume, $templatePath, $copyFileName);
copy($pkgoutput, $copyTarget) or die "Preprocessed pkg file '$pkgoutput' cannot be copied.";
exit;
}

Expand All @@ -354,7 +365,7 @@ ()
system ("$patch_capabilities -c $pkgoutput") and print ("Warning: Package check for self-signing viability failed. Installing the package on a device will most likely fail!\n\n");
} else {
print("Auto-patching self-signed package.\n");
system ("$patch_capabilities $pkgoutput") and die ("ERROR: Automatic patching failed");
system ("$patch_capabilities -t $tempPackageDir $pkgoutput") and die ("ERROR: Automatic patching failed");
}
}

Expand All @@ -377,9 +388,6 @@ ()
print ("\nUnsigned package creation failed!\n");
}

if (!$preservePkgOutput) {
unlink $pkgoutput;
}
print ("\n");
exit;
}
Expand All @@ -405,10 +413,7 @@ ()
print ("\tAdditionally signed the SIS with certificate: $row->[0]!\n");
}

# remove temporary pkg and unsigned sis
if (!$preservePkgOutput) {
unlink $pkgoutput;
}
# remove temporary unsigned sis
if (!$preserveUnsigned) {
unlink $unsigned_sis_name;
}
Expand Down
50 changes: 37 additions & 13 deletions bin/patch_capabilities.pl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

use File::Copy;
use File::Spec;
use File::Path;

sub Usage() {
print("This script can be used to set capabilities of all binaries\n");
Expand All @@ -63,11 +64,13 @@ ()
print(" symbian-sbsv2 platform, 'target-platform' is REQUIRED. ***\n\n");
print(" *** NOTE2: When patching gcce binaries built with symbian-sbsv2 toolchain,\n");
print(" armv5 must be specified as platform.\n");
print("\nUsage: patch_capabilities.pl [-c] pkg_filename [target-platform [capability list]]\n");
print("\nUsage: patch_capabilities.pl [-c|-t tmp_path] pkg_filename [target-platform [capability list]]\n");
print("\nE.g. patch_capabilities.pl myapp_template.pkg release-armv5 \"All -TCB\"\n");
print("\nThe parameter -c can be used to just check if package is compatible with self-signing\n");
print("without actually doing any patching.\n");
print("Explicit capability list cannot be used with -c parameter.\n");
print("\nThe parameter -t can be used to specify a dir under which the temporary files are created.\n");
print("Defaults to 'patch_capabilities_tmp' under the path to pkg file.\n");
exit();
}

Expand Down Expand Up @@ -101,13 +104,26 @@ ($)
my $pkgFileName = shift(@ARGV);
my $justCheck = "";
my $msgPrefix = "Patching:";
my $tempPatchPath = "";

if ($pkgFileName eq "-c") {
$pkgFileName = shift(@ARGV);
$justCheck = true;
$msgPrefix = "Warning:";
}

if ($pkgFileName eq "-t") {
$tempPatchPath = shift(@ARGV);
$pkgFileName = shift(@ARGV);
}

my ($pkgVolume, $pkgPath, $pkgPlainFileName) = File::Spec->splitpath($pkgFileName);
if ($tempPatchPath eq "") {
$tempPatchPath = File::Spec->catpath($pkgVolume, $pkgPath."patch_capabilities_tmp", "");
}

mkpath($tempPatchPath);

# These variables will only be set for template .pkg files.
my $target;
my $platform;
Expand Down Expand Up @@ -165,8 +181,9 @@ ($)

# Start with no binaries listed.
my @binaries = ();
my $binariesDelimeter = "///";

my $tempPkgFileName = $pkgFileName."_@@TEMP@@";
my $tempPkgFileName = $tempPatchPath."/__TEMP__".$pkgPlainFileName;

if (!$justCheck) {
unlink($tempPkgFileName);
Expand Down Expand Up @@ -216,19 +233,23 @@ ($)
$sourcePath =~ s/\$\(TARGET\)/$target/gm;
}

my ($dummy1, $dummy2, $binaryBaseName) = File::Spec->splitpath($sourcePath);

if ($justCheck) {
push (@binaries, $sourcePath);
push (@binaries, $binaryBaseName.$binariesDelimeter.$sourcePath);
} else {
# Change the source file name (but only if not already patched)
# Copy original files over to patching dir
# Patching dir will be flat to make it cleanable with QMAKE_CLEAN, so path
# will be collapsed into the file name to avoid name collisions in the rare
# case where custom pkg rules are used to install files with same names from
# different directories (probably using platform checks to choose only one of them.)
my $patchedSourcePath = $sourcePath;
if ($patchedSourcePath !~ m/_patched_caps/)
{
$newLine =~ s/(^.*)(\.dll|\.exe)(.*)(\.dll|\.exe)/$1_patched_caps$2$3$4/i;
$patchedSourcePath =~ s/(^.*)(\.dll|\.exe)/$1_patched_caps$2/i;
$patchedSourcePath =~ s/[\/\\:]/_/g;
$patchedSourcePath = "$tempPatchPath/$patchedSourcePath";
$newLine =~ s/^.*(\.dll|\.exe)(.*)(\.dll|\.exe)/\"$patchedSourcePath$2$3/i;

copy($sourcePath, $patchedSourcePath) or die "$sourcePath cannot be copied for patching.";
}
push (@binaries, $patchedSourcePath);
copy($sourcePath, $patchedSourcePath) or die "$sourcePath cannot be copied for patching.";
push (@binaries, $binaryBaseName.$binariesDelimeter.$patchedSourcePath);
}
}
}
Expand All @@ -250,10 +271,13 @@ ($)
my $baseCommandToExecute = "${epocToolsDir}elftran -vid 0x0 -capability \"%s\" ";

# Actually set the capabilities of the listed binaries.
foreach my $binaryPath(@binaries)
foreach my $binariesItem(@binaries)
{
$binariesItem =~ m|^(.*)$binariesDelimeter(.*)$|;
my $binaryBaseName = $1;
my $binaryPath = $2;

# Create the command line for setting the capabilities.
my ($binaryVolume, $binaryDirs, $binaryBaseName) = File::Spec->splitpath($binaryPath);
my $commandToExecute = $baseCommandToExecute;
my $executeNeeded = "";
if (@capabilitiesSpecified)
Expand Down
2 changes: 1 addition & 1 deletion config.profiles/harmattan/tests/create_tests_xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#############################################################################
##
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation ([email protected])
##
Expand Down
2 changes: 1 addition & 1 deletion config.profiles/harmattan/tests/maemo_tests.prf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#############################################################################
##
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation ([email protected])
##
Expand Down
6 changes: 0 additions & 6 deletions config.profiles/symbian/layers.sysdef.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
<module name="qtexamples">
<unit unitID="qtdo.qt.examples" mrp="" bldFile="&layer_real_source_path;/examples" name="qtexamples" proFile="examples.pro" qmakeArgs="-r" filter="qtexamples"/>
</module>
<module name="qttestsauto">
<unit unitID="qtdo.qt.testsauto" mrp="" bldFile="&layer_real_source_path;/tests/auto" name="qttestsauto" proFile="qtpauto.pro" qmakeArgs="-r" filter="qttestsauto"/>
</module>
<module name="qttestsbenchmarks">
<unit unitID="qtdo.qt.testsbenchmarks" mrp="" bldFile="&layer_real_source_path;/tests/benchmarks" name="qttestsbenchmarks" proFile="benchmarks.pro" qmakeArgs="-r" filter="qttestsbenchmarks"/>
</module>
</layer>
</systemModel>
</SystemDefinition>
52 changes: 34 additions & 18 deletions config.profiles/symbian/loc.prf
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
CONFIG += localize_deployment

qtPrepareTool(LRELEASE, lrelease)

loc.CONFIG = no_link
loc.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
loc.output = $${EPOCROOT}epoc32/data/z/resource/qt/translations/${QMAKE_FILE_BASE}.qm
loc.input = TRANSLATIONS
loc.variable_out = PRE_TARGETDEPS
isEmpty(SYMBIANTRANSLATIONSFILES): SYMBIANTRANSLATIONSFILES = $$symbianRemoveSpecialCharacters($$basename(TARGET))
isEmpty(SYMBIANTRANSLATIONS):exists($${EPOCROOT}epoc32/tools/qt/mkspecs/features/symbian/symbian_i18n.prf) {
load($${EPOCROOT}epoc32/tools/qt/mkspecs/features/symbian/symbian_i18n.prf)
}
isEmpty(SYMBIANTRANSLATIONDIR): SYMBIANTRANSLATIONDIR = $${EPOCROOT}epoc32/data/z/resource/qt/translations
isEmpty(SYMBIANWINSCWUDEBTRANSLATIONDIR): SYMBIANWINSCWUDEBTRANSLATIONDIR = $${EPOCROOT}epoc32/release/winscw/udeb/z/resource/qt/translations
isEmpty(SYMBIANWINSCWURELTRANSLATIONDIR): SYMBIANWINSCWURELTRANSLATIONDIR = $${EPOCROOT}epoc32/release/winscw/urel/z/resource/qt/translations

for(FILE, SYMBIANTRANSLATIONSFILES) {
for(LANGID, SYMBIANTRANSLATIONS) {
TRANSLATIONS += $${EPOCROOT}epoc32/include/platform/qt/translations/$${FILE}_$${LANGID}.ts
}
}

loc_winscwudeb.CONFIG = no_link
loc_winscwudeb.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
loc_winscwudeb.output = $${EPOCROOT}epoc32/release/winscw/udeb/z/resource/qt/translations/${QMAKE_FILE_BASE}.qm
loc_winscwudeb.input = TRANSLATIONS
loc_winscwudeb.variable_out = PRE_TARGETDEPS
contains(CONFIG, loc_source_string) {
LRELEASE_PARAMS = -qm
} else {
LRELEASE_PARAMS = -idbased -qm
}

loc.CONFIG = no_link target_predeps
loc.commands = $$LRELEASE ${QMAKE_FILE_IN} $$LRELEASE_PARAMS ${QMAKE_FILE_OUT}
loc.input = TRANSLATIONS
loc.output = $$SYMBIANTRANSLATIONDIR/${QMAKE_FILE_BASE}.qm
loc.variable_out = GENERATED_QM_FILES

loc_winscwurel.CONFIG = no_link
loc_winscwurel.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
loc_winscwurel.output = $${EPOCROOT}epoc32/release/winscw/urel/z/resource/qt/translations/${QMAKE_FILE_BASE}.qm
loc_winscwurel.input = TRANSLATIONS
loc_winscwurel.variable_out = PRE_TARGETDEPS
copy_qm_winscw_udeb.CONFIG = no_link target_predeps
copy_qm_winscw_udeb.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copy_qm_winscw_udeb.input = GENERATED_QM_FILES
copy_qm_winscw_udeb.output = $$SYMBIANWINSCWUDEBTRANSLATIONDIR/${QMAKE_FILE_BASE}.qm

QMAKE_EXTRA_COMPILERS += loc
QMAKE_EXTRA_COMPILERS += loc_winscwudeb
QMAKE_EXTRA_COMPILERS += loc_winscwurel
copy_qm_winscw_urel.CONFIG = $$copy_qm_winscw_udeb.CONFIG
copy_qm_winscw_urel.commands = $$copy_qm_winscw_udeb.commands
copy_qm_winscw_urel.input = $$copy_qm_winscw_udeb.input
copy_qm_winscw_urel.output = $$SYMBIANWINSCWURELTRANSLATIONDIR/${QMAKE_FILE_BASE}.qm

QMAKE_EXTRA_COMPILERS += loc copy_qm_winscw_udeb copy_qm_winscw_urel
14 changes: 0 additions & 14 deletions config.profiles/symbian/package_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,5 @@
<unit bldFile="examples" qt:proFile="examples.pro"/>
</component>
</collection>
<collection id="qt_tests" name="Qt Tests" level="app">
<component id="qttestsauto" name="Qt Automated Tests" introduced="^2" filter="s60,qttestsauto,test,build_as_app">
<meta rel="qttestsauto">
<group name="qtdemos"/>
</meta>
<unit bldFile="tests/auto" qt:proFile="qtpauto.pro"/>
</component>
<component id="qttestsbenchmarks" name="Qt Benchmarks Tests" introduced="^2" filter="s60,qttestsbenchmarks,test,build_as_app">
<meta rel="testbuild">
<group name="qttestsbenchmarks"/>
</meta>
<unit bldFile="tests/benchmarks" qt:proFile="benchmarks.pro"/>
</component>
</collection>
</package>
</SystemDefinition>
Loading

0 comments on commit b56444d

Please sign in to comment.