diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-11-15 21:42:20 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-11-17 18:35:41 +0100 |
commit | b50abf585c3dbf35030fb18463ef61ea1ff67d89 (patch) | |
tree | b836b5b94252e3015f55ffb157f9a0abd4b74b61 /buildtools | |
parent | a5c88dc0c6aa1cde7477844230437958081fdff8 (diff) | |
download | tdevelop-b50abf585c3dbf35030fb18463ef61ea1ff67d89.tar.gz tdevelop-b50abf585c3dbf35030fb18463ef61ea1ff67d89.zip |
Automatically update admin submodule and copy sustem libtool files before first build
Fix FTBFS in many TDE sample projects
Place TDE sample projects in a TDE category instead of a KDE category
(part of the original commit)
(cherry picked from commit 93907d7e7a2741818d4b5e1c3ea645f784f7347e)
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/autotools/Makefile.am | 2 | ||||
-rw-r--r-- | buildtools/autotools/autoprojectpart.cpp | 77 | ||||
-rw-r--r-- | buildtools/autotools/autoprojectpart.h | 3 | ||||
-rw-r--r-- | buildtools/autotools/kdevautoproject.rc | 1 |
4 files changed, 82 insertions, 1 deletions
diff --git a/buildtools/autotools/Makefile.am b/buildtools/autotools/Makefile.am index 5972b662..ee3dcec9 100644 --- a/buildtools/autotools/Makefile.am +++ b/buildtools/autotools/Makefile.am @@ -8,7 +8,7 @@ INCLUDES = -I$(top_srcdir)/buildtools/lib -I$(top_srcdir)/buildtools/lib/base \ kde_module_LTLIBRARIES = libkdevautoproject.la -libkdevautoproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevautoproject_la_LDFLAGS = $(all_libraries) $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KPARTS) $(KDE_PLUGIN) libkdevautoproject_la_LIBADD = \ $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la \ $(top_builddir)/buildtools/lib/parsers/autotools/libkdevautotoolsparser.la $(top_builddir)/buildtools/lib/widgets/libkdevbuildtoolswidgets.la \ diff --git a/buildtools/autotools/autoprojectpart.cpp b/buildtools/autotools/autoprojectpart.cpp index 7ab96d66..ab75b9aa 100644 --- a/buildtools/autotools/autoprojectpart.cpp +++ b/buildtools/autotools/autoprojectpart.cpp @@ -38,6 +38,7 @@ #include <kdialogbase.h> #include <kiconloader.h> #include <klocale.h> +#include <kstandarddirs.h> #include <kmessagebox.h> #include <kparts/part.h> #include <kdeversion.h> @@ -144,6 +145,13 @@ AutoProjectPart::AutoProjectPart(TQObject *parent, const char *name, const TQStr action->setWhatsThis(i18n("<b>Run automake && friends</b><p>Executes<br><b>make -f Makefile.cvs</b><br><b>./configure</b><br>commands from the project directory.")); action->setGroup("autotools"); + action = new KAction( i18n("Update admin module"), 0, + this, TQT_SLOT(slotUpdateAdminDirectory()), + actionCollection(), "build_updateadmin" ); + action->setToolTip(i18n("Update admin module")); + action->setWhatsThis(i18n("<b>Update admin module</b><p>Recreates the project admin directory using the version present on the local system.")); + action->setGroup("autotools"); + action = new KAction( i18n("Install"), 0, this, TQT_SLOT(slotInstall()), actionCollection(), "build_install" ); @@ -1019,9 +1027,78 @@ TQString AutoProjectPart::makefileCvsCommand() const dircmd += KProcess::quote(topsourceDirectory()); dircmd += " && "; + TQString admin_directory_update_command = updateAdminDirectoryCommand(); + TQString libtool_update_cmdline = makefileCopySystemLibtoolCommand(); + + if (admin_directory_update_command != "") { + return admin_directory_update_command + " && " + libtool_update_cmdline + " && " + dircmd + cmdline; + } + else { + if (libtool_update_cmdline != "") { + return libtool_update_cmdline + " && " + dircmd + cmdline; + } + else { + return dircmd + cmdline; + } + } +} + +TQString AutoProjectPart::makefileCopySystemLibtoolCommand() const +{ + TQString cmdline = "[ ! -f /usr/share/libtool/ltmain.sh ] || cp -f /usr/share/libtool/ltmain.sh admin/ltmain.sh &&" + "[ ! -f /usr/share/libtool/config/ltmain.sh ] || cp -f /usr/share/libtool/config/ltmain.sh admin/ltmain.sh &&" + "cp -f /usr/share/aclocal/libtool.m4 admin/libtool.m4.in"; + + int prio = DomUtil::readIntEntry(*projectDom(), "/kdevautoproject/make/prio"); + TQString nice; + kdDebug(9020) << "makefileCopySystemLibtoolCommand() nice = " << prio<< endl; + if (prio != 0) { + nice = TQString("nice -n%1 ").arg(prio); + } + + cmdline.prepend(nice); + cmdline.prepend(makeEnvironment()); + + TQString dircmd = "cd "; + dircmd += KProcess::quote(topsourceDirectory()); + dircmd += " && "; + return dircmd + cmdline; } +TQString AutoProjectPart::updateAdminDirectoryCommand() const +{ + TQString source; + TQString dest; + TQString option; + bool process; + + // Find the admin tarball + KStandardDirs dirs; + dirs.addResourceType("apptemplates", KStandardDirs::kde_default("data") + "kdevappwizard/template-common/"); + source = dirs.findResource("apptemplates", "admin.tar.gz"); + if (source != "") { + TQString cmdline = "rm -rf admin && tar -xzvf "; + cmdline.append(source); + TQString dircmd = "cd "; + dircmd += KProcess::quote(topsourceDirectory()); + dircmd += " && "; + return dircmd + cmdline; + } + else { + return TQString::null; + } +} + +void AutoProjectPart::slotUpdateAdminDirectory() +{ + TQString cmdline = updateAdminDirectoryCommand(); + if ( cmdline.isNull() ) + return; + + makeFrontend()->queueCommand(projectDirectory(), cmdline); +} + void AutoProjectPart::slotMakefilecvs() { TQString cmdline = makefileCvsCommand(); diff --git a/buildtools/autotools/autoprojectpart.h b/buildtools/autotools/autoprojectpart.h index 7c0585fc..7b18cfa6 100644 --- a/buildtools/autotools/autoprojectpart.h +++ b/buildtools/autotools/autoprojectpart.h @@ -104,6 +104,7 @@ private slots: void slotMakefilecvs(); void slotMakeMessages(); void slotConfigure(); + void slotUpdateAdminDirectory(); void slotExecute(); void slotExecute2(); void slotExecuteTargetAfterBuild( const TQString& command ); @@ -125,7 +126,9 @@ private: TQString makeEnvironment() const; void setWantautotools(); TQString makefileCvsCommand() const; + TQString makefileCopySystemLibtoolCommand() const; TQString configureCommand() const; + TQString updateAdminDirectoryCommand() const; TQMap<TQString, TQDateTime> m_timestamp; bool m_executeAfterBuild; diff --git a/buildtools/autotools/kdevautoproject.rc b/buildtools/autotools/kdevautoproject.rc index 89571c11..299ccd82 100644 --- a/buildtools/autotools/kdevautoproject.rc +++ b/buildtools/autotools/kdevautoproject.rc @@ -10,6 +10,7 @@ <Action name="build_buildactivetarget" /> <Action name="build_compilefile" /> <Action name="build_configure" /> + <Action name="build_updateadmin" /> <Action name="build_makefilecvs" /> <Action name="build_install" /> <Action name="build_install_kdesu" /> |