From fe154753801ca7d4ebe6312d639d385a8849e389 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Dec 12 2013 10:01:01 +0000 Subject: Fix ninja builder --- diff --git a/kdevelop-4.5.0-no-rpath.patch b/kdevelop-4.5.0-no-rpath.patch index f1b642c..a6718d1 100644 --- a/kdevelop-4.5.0-no-rpath.patch +++ b/kdevelop-4.5.0-no-rpath.patch @@ -8,4 +8,3 @@ +# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) find_package(KDevPlatform ${KDEVPLATFORM_VERSION} REQUIRED) - \ No newline at end of file diff --git a/kdevelop-4.6.0-ninja-builder.patch b/kdevelop-4.6.0-ninja-builder.patch new file mode 100644 index 0000000..f1ab12d --- /dev/null +++ b/kdevelop-4.6.0-ninja-builder.patch @@ -0,0 +1,71 @@ +diff --git a/projectbuilders/ninjabuilder/kdevninjabuilderplugin.cpp b/projectbuilders/ninjabuilder/kdevninjabuilderplugin.cpp +index 909d146..dc28408 100644 +--- a/projectbuilders/ninjabuilder/kdevninjabuilderplugin.cpp ++++ b/projectbuilders/ninjabuilder/kdevninjabuilderplugin.cpp +@@ -20,7 +20,6 @@ + #include "ninjajob.h" + #include + #include +-#include + #include + #include + #include +@@ -43,7 +42,7 @@ KDevNinjaBuilderPlugin::KDevNinjaBuilderPlugin(QObject* parent, const QVariantLi + + bool KDevNinjaBuilderPlugin::hasError() const + { +- return KStandardDirs::findExe("ninja").isEmpty(); ++ return NinjaJob::ninjaBinary().isEmpty(); + } + + static QStringList targetsInFolder(KDevelop::ProjectFolderItem* item) +diff --git a/projectbuilders/ninjabuilder/ninjajob.cpp b/projectbuilders/ninjabuilder/ninjajob.cpp +index 9efa57c..acb5d07 100644 +--- a/projectbuilders/ninjabuilder/ninjajob.cpp ++++ b/projectbuilders/ninjabuilder/ninjajob.cpp +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -44,7 +45,7 @@ NinjaJob::NinjaJob(KDevelop::ProjectBaseItem* item, const QStringList& arguments + setFilteringStrategy( KDevelop::OutputModel::CompilerFilter ); + setProperties( NeedWorkingDirectory | PortableMessages | DisplayStderr | IsBuilderHint | PostProcessOutput ); + +- *this << "ninja"; ++ *this << ninjaBinary(); + *this << arguments; + + QStringList targets; +@@ -68,6 +69,15 @@ void NinjaJob::setIsInstalling( bool isInstalling ) + m_isInstalling = isInstalling; + } + ++QString NinjaJob::ninjaBinary() ++{ ++ QString path = KStandardDirs::findExe("ninja-build"); ++ if (path.isEmpty()) { ++ path = KStandardDirs::findExe("ninja"); ++ } ++ return path; ++} ++ + KUrl NinjaJob::workingDirectory() const + { + KDevelop::ProjectBaseItem* it = item(); +diff --git a/projectbuilders/ninjabuilder/ninjajob.h b/projectbuilders/ninjabuilder/ninjajob.h +index 0bd1725..1186c06 100644 +--- a/projectbuilders/ninjabuilder/ninjajob.h ++++ b/projectbuilders/ninjabuilder/ninjajob.h +@@ -39,6 +39,7 @@ class NinjaJob : public KDevelop::OutputExecuteJob + public: + NinjaJob( KDevelop::ProjectBaseItem* item, const QStringList& arguments, const QByteArray& signal, QObject* parent ); + void setIsInstalling( bool isInstalling ); ++ static QString ninjaBinary(); + + virtual KUrl workingDirectory() const; + virtual QStringList privilegedExecutionCommand() const; + diff --git a/kdevelop.spec b/kdevelop.spec index a34391b..fcd64e1 100644 --- a/kdevelop.spec +++ b/kdevelop.spec @@ -5,7 +5,7 @@ Name: kdevelop Summary: Integrated Development Environment for C++/C Epoch: 9 Version: 4.6.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 URL: http://www.kdevelop.org/ @@ -15,6 +15,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # remove set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) line Patch0: kdevelop-4.5.0-no-rpath.patch +# fix ninja builder +Patch1: kdevelop-4.6.0-ninja-builder.patch # upstreamable patches @@ -89,6 +91,7 @@ Requires: okteta >= 4.10.1 %prep %setup -q -n kdevelop-%{version} %patch0 -p1 -b .no-rpath +%patch1 -p1 -b .ninja-build %build mkdir -p %{_target_platform} @@ -162,6 +165,9 @@ update-mime-database %{_kde4_datadir}/mime &> /dev/null %changelog +* Thu Dec 12 2013 Jan Grulich - 9:4.6.0-2 +- Fix ninja builder (bz#1040801) + * Sun Dec 08 2013 Jan Grulich - 9:4.6.0-1 - Update to 4.6.0