From 93907d7e7a2741818d4b5e1c3ea645f784f7347e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Nov 2012 21:42:20 -0600 Subject: 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 --- buildtools/autotools/CMakeLists.txt | 2 +- buildtools/autotools/Makefile.am | 4 +- buildtools/autotools/autoprojectpart.cpp | 77 +++++++++++++++++++++ buildtools/autotools/autoprojectpart.h | 3 + buildtools/autotools/kdevautoproject.rc | 1 + buildtools/autotools/kdevkdeautoproject.desktop | 92 ------------------------- buildtools/autotools/kdevtdeautoproject.desktop | 92 +++++++++++++++++++++++++ 7 files changed, 176 insertions(+), 95 deletions(-) delete mode 100644 buildtools/autotools/kdevkdeautoproject.desktop create mode 100644 buildtools/autotools/kdevtdeautoproject.desktop (limited to 'buildtools') diff --git a/buildtools/autotools/CMakeLists.txt b/buildtools/autotools/CMakeLists.txt index f6212da7..d4e68654 100644 --- a/buildtools/autotools/CMakeLists.txt +++ b/buildtools/autotools/CMakeLists.txt @@ -32,7 +32,7 @@ link_directories( ##### other data ################################ -install( FILES kdevautoproject.desktop kdevkdeautoproject.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) +install( FILES kdevautoproject.desktop kdevtdeautoproject.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) install( FILES kdevautoproject.rc DESTINATION ${DATA_INSTALL_DIR}/kdevautoproject ) diff --git a/buildtools/autotools/Makefile.am b/buildtools/autotools/Makefile.am index eeebdfa2..8a21dc09 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_TDECORE) $(LIB_TDEUI) $(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 \ @@ -30,7 +30,7 @@ libkdevautoproject_la_SOURCES = autoprojectpart.cpp autoprojectwidget.cpp \ METASOURCES = AUTO servicedir = $(kde_servicesdir) -service_DATA = kdevautoproject.desktop kdevkdeautoproject.desktop +service_DATA = kdevautoproject.desktop kdevtdeautoproject.desktop rcdir = $(kde_datadir)/kdevautoproject rc_DATA = kdevautoproject.rc diff --git a/buildtools/autotools/autoprojectpart.cpp b/buildtools/autotools/autoprojectpart.cpp index 5e282acf..21df4fd8 100644 --- a/buildtools/autotools/autoprojectpart.cpp +++ b/buildtools/autotools/autoprojectpart.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -144,6 +145,13 @@ AutoProjectPart::AutoProjectPart(TQObject *parent, const char *name, const TQStr action->setWhatsThis(i18n("Run automake && friends

Executes
make -f Makefile.cvs
./configure
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("Update admin module

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 91f57b62..63da2fd9 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 m_timestamp; bool m_executeAfterBuild; diff --git a/buildtools/autotools/kdevautoproject.rc b/buildtools/autotools/kdevautoproject.rc index eceff675..5d213e3e 100644 --- a/buildtools/autotools/kdevautoproject.rc +++ b/buildtools/autotools/kdevautoproject.rc @@ -10,6 +10,7 @@ + diff --git a/buildtools/autotools/kdevkdeautoproject.desktop b/buildtools/autotools/kdevkdeautoproject.desktop deleted file mode 100644 index b9b6abd8..00000000 --- a/buildtools/autotools/kdevkdeautoproject.desktop +++ /dev/null @@ -1,92 +0,0 @@ -[Desktop Entry] -Type=Service -Exec=blubb -Comment=TDE Automake Project -Comment[br]=Raktres TDE Automake -Comment[ca]=Projecte Automake per al TDE -Comment[da]=TDE Automake-projekt -Comment[de]=TDE-Automake-Projekt für TDevelop -Comment[el]=Έργο TDE Automake -Comment[es]=Proyecto de Automake de TDE -Comment[et]=TDE automake'i projekt -Comment[eu]=TDE automake proiektua -Comment[fa]=پروژۀ TDE Automake -Comment[fr]=Projet Automake pour TDE -Comment[ga]=Tionscadal Automake TDE -Comment[gl]=Proxecto Automake de TDE -Comment[hi]=केडीई ऑटोमेक परियोजना -Comment[hu]=TDE Automake-projekt -Comment[is]=TDE Automake verkefni -Comment[it]=Progetto TDE per automake -Comment[ja]=TDE Automake プロジェクト -Comment[ms]=Projek Automake TDE -Comment[nds]=Automake-Projekt vun TDE -Comment[ne]=केडीई स्वत: निर्माण परियोजना -Comment[nl]=TDE Automake-project -Comment[pt]=Projecto Automake do TDE -Comment[pt_BR]=Projeto Automake do TDE -Comment[ru]=Проект TDE Automake -Comment[sk]=TDE Automake projekt -Comment[sl]=Projekt TDE Automake -Comment[sr]=TDE-ов Automake пројекат -Comment[sr@Latn]=TDE-ov Automake projekat -Comment[sv]=TDE Automake-projekt -Comment[ta]=TDE ஆட்டோமேக் பிராஜக்ட் -Comment[tg]=Лоиҳаи TDE Automake -Comment[tr]=TDE Automake Projesi -Comment[zh_CN]=TDE Automake 工程 -Comment[zh_TW]=TDE Automake 專案 -Name=KDevTDEAutoProject -Name[da]=TDevelop TDE Automake-projekt -Name[de]=TDE-Automake-Projekt (TDevelop) -Name[hi]=के-डेव-केडीई-ऑटो-परियोजना -Name[nds]=Automake-Projekt (TDE/TDevelop) -Name[ne]=केडीई विकास केडीई स्वत: परियोजना -Name[pl]=KDevProjektTDEAuto -Name[pt_BR]=KDevTDEAutoProjeto -Name[sk]=KDevAutoProjekt -Name[sv]=TDevelop TDE-autoprojekt -Name[ta]=கெடெவ்ஆட்டோ பிராஜக்ட் -Name[tg]=Лоиҳаи худкори KDevTDEAuto -Name[zh_TW]=TDevelop TDE Automake 專案 -GenericName=TDE Automake Project -GenericName[br]=Raktres TDE Automake -GenericName[ca]=Projecte Automake per al TDE -GenericName[cs]=TDE Automake projekt -GenericName[da]=TDE Automake-projekt -GenericName[de]=TDE-Automake-Projekt -GenericName[el]=Έργο TDE Automake -GenericName[es]=Proyecto de Automake de TDE -GenericName[et]=TDE automake'i projekt -GenericName[eu]=TDE automake proiektua -GenericName[fa]=پروژۀ TDE Automake -GenericName[fr]=Projet avec Automake pour TDE -GenericName[ga]=Tionscadal Automake TDE -GenericName[gl]=Proxecto Automake de TDE -GenericName[hi]=केडीई ऑटोमेक परियोजना -GenericName[hu]=TDE Automake-projekt -GenericName[it]=Progetto TDE Automake -GenericName[ja]=TDE Automake プロジェクト -GenericName[ms]=Projek Automake TDE -GenericName[nds]=Automake-Projekt vun TDE -GenericName[ne]=केडीई स्वत: निर्माण परियोजना -GenericName[nl]=TDE Automake-project -GenericName[pl]=Projekt: TDE Automake -GenericName[pt]=Projecto TDE com Automake -GenericName[pt_BR]=Projeto Automake do TDE -GenericName[ru]=Проект TDE Automake -GenericName[sk]=TDE Automake projekt -GenericName[sl]=Projekt TDE Automake -GenericName[sr]=TDE-ов Automake пројекат -GenericName[sr@Latn]=TDE-ov Automake projekat -GenericName[sv]=TDE Automake-projekt -GenericName[ta]=TDE ஆட்டோமேக் பிராஜக்ட் -GenericName[tg]=Лоиҳаи TDE Automake -GenericName[tr]=TDE Automake Projesi -GenericName[zh_CN]=TDE Automake 工程 -GenericName[zh_TW]=TDE Automake 專案 -ServiceTypes=TDevelop/Project -Icon=make -X-TDE-Library=libkdevautoproject -X-TDevelop-Version=5 -X-TDevelop-Args=kde diff --git a/buildtools/autotools/kdevtdeautoproject.desktop b/buildtools/autotools/kdevtdeautoproject.desktop new file mode 100644 index 00000000..b9b6abd8 --- /dev/null +++ b/buildtools/autotools/kdevtdeautoproject.desktop @@ -0,0 +1,92 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=TDE Automake Project +Comment[br]=Raktres TDE Automake +Comment[ca]=Projecte Automake per al TDE +Comment[da]=TDE Automake-projekt +Comment[de]=TDE-Automake-Projekt für TDevelop +Comment[el]=Έργο TDE Automake +Comment[es]=Proyecto de Automake de TDE +Comment[et]=TDE automake'i projekt +Comment[eu]=TDE automake proiektua +Comment[fa]=پروژۀ TDE Automake +Comment[fr]=Projet Automake pour TDE +Comment[ga]=Tionscadal Automake TDE +Comment[gl]=Proxecto Automake de TDE +Comment[hi]=केडीई ऑटोमेक परियोजना +Comment[hu]=TDE Automake-projekt +Comment[is]=TDE Automake verkefni +Comment[it]=Progetto TDE per automake +Comment[ja]=TDE Automake プロジェクト +Comment[ms]=Projek Automake TDE +Comment[nds]=Automake-Projekt vun TDE +Comment[ne]=केडीई स्वत: निर्माण परियोजना +Comment[nl]=TDE Automake-project +Comment[pt]=Projecto Automake do TDE +Comment[pt_BR]=Projeto Automake do TDE +Comment[ru]=Проект TDE Automake +Comment[sk]=TDE Automake projekt +Comment[sl]=Projekt TDE Automake +Comment[sr]=TDE-ов Automake пројекат +Comment[sr@Latn]=TDE-ov Automake projekat +Comment[sv]=TDE Automake-projekt +Comment[ta]=TDE ஆட்டோமேக் பிராஜக்ட் +Comment[tg]=Лоиҳаи TDE Automake +Comment[tr]=TDE Automake Projesi +Comment[zh_CN]=TDE Automake 工程 +Comment[zh_TW]=TDE Automake 專案 +Name=KDevTDEAutoProject +Name[da]=TDevelop TDE Automake-projekt +Name[de]=TDE-Automake-Projekt (TDevelop) +Name[hi]=के-डेव-केडीई-ऑटो-परियोजना +Name[nds]=Automake-Projekt (TDE/TDevelop) +Name[ne]=केडीई विकास केडीई स्वत: परियोजना +Name[pl]=KDevProjektTDEAuto +Name[pt_BR]=KDevTDEAutoProjeto +Name[sk]=KDevAutoProjekt +Name[sv]=TDevelop TDE-autoprojekt +Name[ta]=கெடெவ்ஆட்டோ பிராஜக்ட் +Name[tg]=Лоиҳаи худкори KDevTDEAuto +Name[zh_TW]=TDevelop TDE Automake 專案 +GenericName=TDE Automake Project +GenericName[br]=Raktres TDE Automake +GenericName[ca]=Projecte Automake per al TDE +GenericName[cs]=TDE Automake projekt +GenericName[da]=TDE Automake-projekt +GenericName[de]=TDE-Automake-Projekt +GenericName[el]=Έργο TDE Automake +GenericName[es]=Proyecto de Automake de TDE +GenericName[et]=TDE automake'i projekt +GenericName[eu]=TDE automake proiektua +GenericName[fa]=پروژۀ TDE Automake +GenericName[fr]=Projet avec Automake pour TDE +GenericName[ga]=Tionscadal Automake TDE +GenericName[gl]=Proxecto Automake de TDE +GenericName[hi]=केडीई ऑटोमेक परियोजना +GenericName[hu]=TDE Automake-projekt +GenericName[it]=Progetto TDE Automake +GenericName[ja]=TDE Automake プロジェクト +GenericName[ms]=Projek Automake TDE +GenericName[nds]=Automake-Projekt vun TDE +GenericName[ne]=केडीई स्वत: निर्माण परियोजना +GenericName[nl]=TDE Automake-project +GenericName[pl]=Projekt: TDE Automake +GenericName[pt]=Projecto TDE com Automake +GenericName[pt_BR]=Projeto Automake do TDE +GenericName[ru]=Проект TDE Automake +GenericName[sk]=TDE Automake projekt +GenericName[sl]=Projekt TDE Automake +GenericName[sr]=TDE-ов Automake пројекат +GenericName[sr@Latn]=TDE-ov Automake projekat +GenericName[sv]=TDE Automake-projekt +GenericName[ta]=TDE ஆட்டோமேக் பிராஜக்ட் +GenericName[tg]=Лоиҳаи TDE Automake +GenericName[tr]=TDE Automake Projesi +GenericName[zh_CN]=TDE Automake 工程 +GenericName[zh_TW]=TDE Automake 專案 +ServiceTypes=TDevelop/Project +Icon=make +X-TDE-Library=libkdevautoproject +X-TDevelop-Version=5 +X-TDevelop-Args=kde -- cgit v1.2.3