Add patch to fix Clang plugin build
This commit is contained in:
20
.SRCINFO
20
.SRCINFO
@@ -1,19 +1,21 @@
|
||||
pkgbase = qtcreator-git
|
||||
pkgdesc = Lightweight, cross-platform integrated development environment
|
||||
pkgver = v4.5.0.r629.ge1ad7a1784
|
||||
pkgver = v4.9.0.rc1.r328.ged87b74a59
|
||||
pkgrel = 1
|
||||
url = https://www.qt.io/ide/
|
||||
arch = i686
|
||||
url = https://www.qt.io
|
||||
arch = x86_64
|
||||
license = GPL
|
||||
license = LGPL
|
||||
makedepends = git
|
||||
makedepends = llvm
|
||||
makedepends = mesa
|
||||
makedepends = python
|
||||
depends = clang
|
||||
depends = qt5-declarative
|
||||
depends = clazy
|
||||
depends = qt5-quickcontrols
|
||||
depends = qt5-quickcontrols2
|
||||
depends = qt5-script
|
||||
depends = qt5-svg
|
||||
depends = qt5-tools
|
||||
depends = qt5-webengine
|
||||
optdepends = bzr: bazaar support
|
||||
optdepends = cmake: cmake project support
|
||||
optdepends = cvs: cvs support
|
||||
@@ -33,8 +35,10 @@ pkgbase = qtcreator-git
|
||||
options = docs
|
||||
source = git+https://code.qt.io/qt-creator/qt-creator.git
|
||||
source = git+https://code.qt.io/qbs/qbs.git
|
||||
md5sums = SKIP
|
||||
md5sums = SKIP
|
||||
source = qtcreator-clang-plugins.patch
|
||||
sha256sums = SKIP
|
||||
sha256sums = SKIP
|
||||
sha256sums = 955e2ec0de1ea0fd2994d04dfb9a04e74513e4f3fe189e76dd4a256fd9c864eb
|
||||
|
||||
pkgname = qtcreator-git
|
||||
|
||||
|
47
PKGBUILD
47
PKGBUILD
@@ -8,15 +8,15 @@
|
||||
# Contributor: Tobias Hunger <tobias dot hunger at gmail dot com>
|
||||
|
||||
pkgname=qtcreator-git
|
||||
pkgver=v4.5.0.r629.ge1ad7a1784
|
||||
pkgver=v4.9.0.rc1.r328.ged87b74a59
|
||||
pkgrel=1
|
||||
pkgdesc='Lightweight, cross-platform integrated development environment'
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://www.qt.io/ide/'
|
||||
license=('GPL')
|
||||
depends=('clang' 'qt5-declarative' 'qt5-script' 'qt5-svg' 'qt5-tools')
|
||||
makedepends=('git' 'llvm' 'mesa')
|
||||
options=('docs')
|
||||
arch=('x86_64')
|
||||
url='https://www.qt.io'
|
||||
license=(LGPL)
|
||||
depends=(clang clazy qt5-quickcontrols qt5-quickcontrols2 qt5-script qt5-tools qt5-webengine)
|
||||
makedepends=(git llvm mesa python)
|
||||
options=(docs)
|
||||
optdepends=('bzr: bazaar support'
|
||||
'cmake: cmake project support'
|
||||
'cvs: cvs support'
|
||||
@@ -29,35 +29,44 @@ optdepends=('bzr: bazaar support'
|
||||
'subversion: subversion support'
|
||||
'valgrind: analyze support'
|
||||
'x11-ssh-askpass: ssh support')
|
||||
provides=('qtcreator' 'qbs')
|
||||
conflicts=('qtcreator' 'qbs')
|
||||
provides=(qtcreator qbs)
|
||||
conflicts=(qtcreator qbs)
|
||||
source=('git+https://code.qt.io/qt-creator/qt-creator.git'
|
||||
'git+https://code.qt.io/qbs/qbs.git')
|
||||
md5sums=('SKIP'
|
||||
'SKIP')
|
||||
'git+https://code.qt.io/qbs/qbs.git'
|
||||
'qtcreator-clang-plugins.patch')
|
||||
sha256sums=('SKIP'
|
||||
'SKIP'
|
||||
'955e2ec0de1ea0fd2994d04dfb9a04e74513e4f3fe189e76dd4a256fd9c864eb')
|
||||
|
||||
pkgver() {
|
||||
cd qt-creator
|
||||
|
||||
git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
|
||||
}
|
||||
|
||||
prepare() {
|
||||
[[ -d build ]] && rm -r build
|
||||
mkdir build
|
||||
mkdir -p build
|
||||
|
||||
cd qt-creator
|
||||
|
||||
# fix hardcoded libexec path
|
||||
sed -e 's|libexec\/qtcreator|lib\/qtcreator|g' -i qt-creator/qtcreator.pri
|
||||
sed -e 's|libexec\/qtcreator|lib\/qtcreator|g' -i qtcreator.pri
|
||||
|
||||
# Load analyzer plugins on demand, since upstream clang doesn't link to all plugins
|
||||
# see http://code.qt.io/cgit/clang/clang.git/commit/?id=7f349701d3ea0c47be3a43e265699dddd3fd55cf
|
||||
# and https://bugs.archlinux.org/task/59492
|
||||
patch -p1 -i ../qtcreator-clang-plugins.patch
|
||||
|
||||
# Do *NOT* use system Qbs: qt creator master is *NOT* compatible with any released Qbs!
|
||||
( cd qt-creator/src/shared && rm -rf qbs && ln -s ../../../qbs qbs )
|
||||
( cd src/shared && rm -rf qbs && ln -s ../../../qbs qbs )
|
||||
}
|
||||
|
||||
build() {
|
||||
cd build
|
||||
|
||||
QTC_FORCE_CLANG_LIBTOOLING=1 \
|
||||
qmake LLVM_INSTALL_DIR=/usr CONFIG+=journald QMAKE_CFLAGS_ISYSTEM=-I \
|
||||
"$srcdir"/qt-creator/qtcreator.pro
|
||||
qmake LLVM_INSTALL_DIR=/usr CONFIG+=journald QMAKE_CFLAGS_ISYSTEM=-I \
|
||||
"${srcdir}/qt-creator/qtcreator.pro"
|
||||
|
||||
make
|
||||
make docs
|
||||
}
|
||||
|
47
qtcreator-clang-plugins.patch
Normal file
47
qtcreator-clang-plugins.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
|
||||
index 706c5101a3..0f7af62dba 100644
|
||||
--- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
|
||||
+++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp
|
||||
@@ -511,6 +511,7 @@ private:
|
||||
if (tidyMode == Mode::Disabled)
|
||||
return;
|
||||
|
||||
+ m_options.append(CppTools::XclangArgs({"-load", "libclangTidyPlugin.so"}));
|
||||
m_options.append(CppTools::XclangArgs({"-add-plugin", "clang-tidy"}));
|
||||
|
||||
if (tidyMode == Mode::File)
|
||||
@@ -526,8 +527,8 @@ private:
|
||||
if (checks.isEmpty())
|
||||
return;
|
||||
|
||||
- m_options.append(CppTools::XclangArgs({"-add-plugin",
|
||||
- "clang-lazy",
|
||||
+ m_options.append(CppTools::XclangArgs({"-load", "ClazyPlugin.so",
|
||||
+ "-add-plugin", "clazy",
|
||||
"-plugin-arg-clang-lazy",
|
||||
"enable-all-fixits",
|
||||
"-plugin-arg-clang-lazy",
|
||||
diff --git a/src/plugins/clangtools/clangtidyclazyrunner.cpp b/src/plugins/clangtools/clangtidyclazyrunner.cpp
|
||||
index a580704243..42c4319240 100644
|
||||
--- a/src/plugins/clangtools/clangtidyclazyrunner.cpp
|
||||
+++ b/src/plugins/clangtools/clangtidyclazyrunner.cpp
|
||||
@@ -76,6 +76,7 @@ QStringList ClangTidyClazyRunner::constructCommandLineArguments(const QStringLis
|
||||
|
||||
const ClangDiagnosticConfig::TidyMode tidyMode = m_diagnosticConfig.clangTidyMode();
|
||||
if (tidyMode != ClangDiagnosticConfig::TidyMode::Disabled) {
|
||||
+ arguments << XclangArgs({"-load", "libclangTidyPlugin.so"});
|
||||
arguments << XclangArgs({"-add-plugin", "clang-tidy"});
|
||||
if (tidyMode != ClangDiagnosticConfig::TidyMode::File) {
|
||||
const QString tidyChecks = m_diagnosticConfig.clangTidyChecks();
|
||||
@@ -85,8 +86,9 @@ QStringList ClangTidyClazyRunner::constructCommandLineArguments(const QStringLis
|
||||
|
||||
const QString clazyChecks = m_diagnosticConfig.clazyChecks();
|
||||
if (!clazyChecks.isEmpty()) {
|
||||
- arguments << XclangArgs({"-add-plugin",
|
||||
- "clang-lazy",
|
||||
+ arguments << XclangArgs({"-load", "ClazyPlugin.so",
|
||||
+ "-add-plugin",
|
||||
+ "clazy",
|
||||
"-plugin-arg-clang-lazy",
|
||||
"enable-all-fixits",
|
||||
"-plugin-arg-clang-lazy",
|
Reference in New Issue
Block a user