Commit a04997a6 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Replace manual copying to sysroot by "make install".

parent fcd6f6c8
......@@ -68,7 +68,7 @@ QStringList MaemoDeployStepFactory::availableCreationIds(BuildStepList *parent)
QStringList ids;
if (qobject_cast<AbstractQt4MaemoTarget *>(parent->target()))
ids << MaemoCopyToSysrootStep::Id;
ids << MaemoMakeInstallToSysrootStep::Id;
if (!qobject_cast<Qt4HarmattanTarget *>(parent->target()))
ids << MaemoUploadAndInstallTarPackageStep::Id;
if (qobject_cast<AbstractDebBasedQt4MaemoTarget *>(parent->target())) {
......@@ -104,6 +104,8 @@ QString MaemoDeployStepFactory::displayNameForId(const QString &id) const
return MaemoInstallRpmPackageToSysrootStep::DisplayName;
else if (id == MaemoCopyToSysrootStep::Id)
return MaemoCopyToSysrootStep::DisplayName;
else if (id == MaemoMakeInstallToSysrootStep::Id)
return MaemoMakeInstallToSysrootStep::DisplayName;
else if (id == MaemoDirectDeviceUploadStep::Id)
return MaemoDirectDeviceUploadStep::DisplayName;
return QString();
......@@ -124,6 +126,8 @@ BuildStep *MaemoDeployStepFactory::create(BuildStepList *parent, const QString &
return new MaemoInstallRpmPackageToSysrootStep(parent);
} else if (id == MaemoCopyToSysrootStep::Id) {
return new MaemoCopyToSysrootStep(parent);
} else if (id == MaemoMakeInstallToSysrootStep::Id) {
return new MaemoMakeInstallToSysrootStep(parent);
} else if (id == MaemoMountAndInstallDeployStep::Id
|| (id == OldMaemoDeployStepId && qobject_cast< const Qt4Maemo5Target *>(t))) {
return new MaemoMountAndInstallDeployStep(parent);
......@@ -193,6 +197,9 @@ BuildStep *MaemoDeployStepFactory::clone(BuildStepList *parent, BuildStep *produ
} else if (product->id() == MaemoCopyToSysrootStep::Id) {
return new MaemoCopyToSysrootStep(parent,
qobject_cast<MaemoCopyToSysrootStep *>(product));
} else if (product->id() == MaemoMakeInstallToSysrootStep::Id) {
return new MaemoMakeInstallToSysrootStep(parent,
qobject_cast<MaemoMakeInstallToSysrootStep *>(product));
} else if (product->id() == MaemoDirectDeviceUploadStep::Id) {
return new MaemoDirectDeviceUploadStep(parent,
qobject_cast<MaemoDirectDeviceUploadStep *>(product));
......
......@@ -330,6 +330,55 @@ const QString MaemoCopyToSysrootStep::Id
const QString MaemoCopyToSysrootStep::DisplayName
= tr("Copy files to sysroot");
MaemoMakeInstallToSysrootStep::MaemoMakeInstallToSysrootStep(BuildStepList *bsl)
: AbstractProcessStep(bsl, Id)
{
}
MaemoMakeInstallToSysrootStep::MaemoMakeInstallToSysrootStep(BuildStepList *bsl,
MaemoMakeInstallToSysrootStep *other)
: AbstractProcessStep(bsl, other)
{
}
bool MaemoMakeInstallToSysrootStep::init()
{
const Qt4BuildConfiguration * const bc
= qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
if (!bc) {
addOutput("Can't deploy: No active build dconfiguration.",
ErrorMessageOutput);
return false;
}
const QtVersion * const qtVersion = bc->qtVersion();
if (!qtVersion) {
addOutput("Can't deploy: Unusable build configuration.",
ErrorMessageOutput);
return false;
}
processParameters()->setCommand(MaemoGlobal::madCommand(qtVersion));
const QStringList args = QStringList() << QLatin1String("-t")
<< MaemoGlobal::targetName(qtVersion) << QLatin1String("make")
<< QLatin1String("install")
<< (QLatin1String("INSTALL_ROOT=") + qtVersion->systemRoot());
processParameters()->setArguments(args.join(QLatin1String(" ")));
processParameters()->setEnvironment(bc->environment());
processParameters()->setWorkingDirectory(bc->buildDirectory());
return true;
}
BuildStepConfigWidget *MaemoMakeInstallToSysrootStep::createConfigWidget()
{
return new MaemoCopyFilesToSysrootWidget;
}
const QString MaemoMakeInstallToSysrootStep::Id
= QLatin1String("MaemoMakeInstallToSysrootStep");
const QString MaemoMakeInstallToSysrootStep::DisplayName
= tr("Copy files to sysroot");
} // namespace Internal
} // namespace Qt4ProjectManager
......
......@@ -33,11 +33,12 @@
#ifndef MAEMOINSTALLTOSYSROOTSTEP_H
#define MAEMOINSTALLTOSYSROOTSTEP_H
#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/buildstep.h>
#include <QtCore/QStringList>
QT_FORWARD_DECLARE_CLASS(QProcess);
QT_FORWARD_DECLARE_CLASS(QProcess)
namespace Qt4ProjectManager {
namespace Internal {
......@@ -111,7 +112,22 @@ public:
static const QString Id;
static const QString DisplayName;
private:
};
class MaemoMakeInstallToSysrootStep : public ProjectExplorer::AbstractProcessStep
{
Q_OBJECT
public:
explicit MaemoMakeInstallToSysrootStep(ProjectExplorer::BuildStepList *bsl);
MaemoMakeInstallToSysrootStep(ProjectExplorer::BuildStepList *bsl,
MaemoMakeInstallToSysrootStep *other);
virtual bool immutable() const { return false; }
virtual bool init();
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
static const QString Id;
static const QString DisplayName;
};
} // namespace Internal
......
......@@ -156,7 +156,7 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent,
dc->setDefaultDisplayName(displayNameForId(id));
if (id == Qt4MaemoDeployConfiguration::FremantleWithoutPackagingId) {
dc->stepList()->insertStep(0, new MaemoCopyToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoMountAndCopyDeployStep(dc->stepList()));
} else if (id == Qt4MaemoDeployConfiguration::FremantleWithPackagingId) {
dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment