diff options
author | Donald Carr | 2020-04-30 12:26:28 -0700 |
---|---|---|
committer | Donald Carr | 2020-04-30 12:37:31 -0700 |
commit | 16a63987d62f4516473cc6cfefc75cc8240d71a2 (patch) | |
tree | c95fe3a68b1962da9e06c0e097c5c8fc877a2647 | |
parent | aaf913812c45289b54b8e338b46694c98e4b3b69 (diff) | |
download | aur-16a63987d62f4516473cc6cfefc75cc8240d71a2.tar.gz |
Fix build against clang 10; rederive from standard Arch qt-creator recipe
Change-Id: Ic10fdafaac61db709422dc168c70d6c38fb4a25c
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 82 | ||||
-rw-r--r-- | qtcreator-clang-libs.patch | 24 | ||||
-rw-r--r-- | qtcreator-preload-plugins.patch | 13 |
4 files changed, 81 insertions, 45 deletions
@@ -9,6 +9,7 @@ pkgbase = qtcreator-prerelease makedepends = qbs makedepends = clang makedepends = qt5-base + makedepends = patchelf depends = python2-beautifulsoup4 depends = qt5-tools depends = qt5-declarative @@ -30,11 +31,13 @@ pkgbase = qtcreator-prerelease optdepends = bzr: bazaar support optdepends = valgrind: analyze support provides = qtcreator - provides = qbs conflicts = qtcreator - conflicts = qbs source = https://download.qt.io/official_releases/qtcreator/4.12/4.12.0/qt-creator-opensource-src-4.12.0.tar.xz + source = qtcreator-preload-plugins.patch + source = qtcreator-clang-libs.patch sha256sums = d76655799ad2af81fb15f85d412d74583659fb1b4cf27b758ad8aae73675948b + sha256sums = b40e222b30c355d1230160a4e933dbd161b8748125662e3bde312ea52296457a + sha256sums = 0f6d0dc41a87aae9ef371b1950f5b9d823db8b5685c6ac04a7a7ac133eb19a3f pkgname = qtcreator-prerelease @@ -22,8 +22,8 @@ pkgdesc='Qt Creator prerelease/latest' arch=('x86_64') url='http://qt.io/ide' license=('GPL') -provides=('qtcreator' 'qbs') -conflicts=('qtcreator' 'qbs') +provides=('qtcreator') +conflicts=('qtcreator') depends=('python2-beautifulsoup4' 'qt5-tools' 'qt5-declarative' 'qt5-script' 'qt5-quickcontrols' 'qt5-quickcontrols2' 'qt5-webengine' 'clang' 'llvm') install=qtcreator-prerelease.install optdepends=('qbs' @@ -37,59 +37,55 @@ optdepends=('qbs' 'mercurial: mercurial support' 'bzr: bazaar support' 'valgrind: analyze support') -makedepends=('qbs' 'clang' 'qt5-base') -source=("${_urlbase}/qtcreator/${_pkgvermajmin}/${_pkgver}/${_filename}.tar.xz") -sha256sums=('d76655799ad2af81fb15f85d412d74583659fb1b4cf27b758ad8aae73675948b') - -_qmake_cmd=qmake -_tmp_dir=$(mktemp -d) -_qbs_settings="--settings-dir ${_tmp_dir}" -_qbs_profile="sysqtprofile" -_qbs_args="profile:${_qbs_profile}" - -if [[ -z ${startdir} ]]; then - _building=false -fi +makedepends=('qbs' 'clang' 'qt5-base' 'patchelf') +source=("${_urlbase}/qtcreator/${_pkgvermajmin}/${_pkgver}/${_filename}.tar.xz" + qtcreator-preload-plugins.patch + qtcreator-clang-libs.patch) +sha256sums=('d76655799ad2af81fb15f85d412d74583659fb1b4cf27b758ad8aae73675948b' + 'b40e222b30c355d1230160a4e933dbd161b8748125662e3bde312ea52296457a' + '0f6d0dc41a87aae9ef371b1950f5b9d823db8b5685c6ac04a7a7ac133eb19a3f') prepare() { cd ${srcdir}/${_filename} - sed -i '/LLVM_INCLUDEPATH/d' src/tools/clangbackend/clangbackend.pro + + # fix hardcoded libexec path + sed -e 's|libexec\/qtcreator|lib\/qtcreator|g' -i qtcreator.pri + sed -e 's|libexec|lib|g' -i src/tools/tools.pro + # use system qbs + rm -r src/shared/qbs + # Preload analyzer plugins, 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-preload-plugins.patch + + # Fix build with clang 10 + patch -p1 -i ../qtcreator-clang-libs.patch } build() { - export PATH=${startdir}:$PATH - set -o nounset - local _src_dir=${srcdir}/${_filename} - [[ -d build ]] && rm -r build + cd ${srcdir}/${_filename} - cd ${_src_dir} - qmake -spec linux-clang - make + qmake \ + -r \ + -spec linux-clang \ + LLVM_INSTALL_DIR=/usr QBS_INSTALL_DIR=/usr \ + KSYNTAXHIGHLIGHTING_LIB_DIR=/usr/lib KSYNTAXHIGHLIGHTING_INCLUDE_DIR=/usr/include/KF5/KSyntaxHighlighting \ + CONFIG+=journald QMAKE_CFLAGS_ISYSTEM=-I \ + DEFINES+=QBS_ENABLE_PROJECT_FILE_UPDATES \ + ${srcdir}/${_filename}/qtcreator.pro - #qbs ${_qbs_settings} -d build -f ${src_dir} --all-products project.withAutotests:false profile:${_qbs_profile} config:release - set +o nounset + make + make docs } package() { - set -o nounset - local _src_dir=${srcdir}/${_filename} - local _pkg_dir=${pkgdir}/usr/ + cd ${srcdir}/${_filename} - #qbs install ${_qbs_settings} -d build -f ${_src_dir} --install-root ${_pkg_dir} --all-products project.withAutotests:false profile:${_qbs_profile} config:release - cd ${_src_dir} - INSTALL_ROOT=${_pkg_dir} make install + make INSTALL_ROOT="$pkgdir/usr/" install + make INSTALL_ROOT="$pkgdir/usr/" install_docs - # Workaround for FS#40583 - mv "${pkgdir}"/usr/bin/qtcreator "${pkgdir}"/usr/bin/qtcreator-bin - echo "#!/bin/sh" > "${pkgdir}"/usr/bin/qtcreator - echo "QT_LOGGING_TO_CONSOLE=1 qtcreator-bin \$@" >> "${pkgdir}"/usr/bin/qtcreator - chmod +x "${pkgdir}"/usr/bin/qtcreator + install -Dm644 "$srcdir"/qt-creator-opensource-src-$pkgver/LICENSE.GPL3-EXCEPT "$pkgdir"/usr/share/licenses/qtcreator/LICENSE.GPL3-EXCEPT - install -Dm644 ${srcdir}/${_filename}/LICENSE.GPL3-EXCEPT ${pkgdir}/usr/share/licenses/qtcreator/LICENSE.GPL3-EXCEPT - rm -Rf ${_tmp_dir} - set +o nounset +# Link clazy plugin explicitely + patchelf --add-needed ClazyPlugin.so "$pkgdir"/usr/lib/qtcreator/clangbackend } - -#if $_building; then -# qbs setup-qt ${_qbs_settings} /usr/bin/qmake ${_qbs_profile} -#fi diff --git a/qtcreator-clang-libs.patch b/qtcreator-clang-libs.patch new file mode 100644 index 000000000000..a0cc8c54738b --- /dev/null +++ b/qtcreator-clang-libs.patch @@ -0,0 +1,24 @@ +diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri +index 08838838bc..bee3779484 100644 +--- a/src/shared/clang/clang_installation.pri ++++ b/src/shared/clang/clang_installation.pri +@@ -131,9 +131,7 @@ defineReplace(extractWarnings) { + return($$result) + } + +-CLANGTOOLING_LIBS=-lclangTooling -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \ +- -lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \ +- -lclangASTMatchers -lclangToolingCore -lclangAST -lclangLex -lclangBasic ++CLANGTOOLING_LIBS=-lclang-cpp + win32:CLANGTOOLING_LIBS += -lversion + + BIN_EXTENSION = +@@ -207,7 +205,7 @@ isEmpty(LLVM_VERSION) { + isEmpty(QTC_CLANG_BUILDMODE_MISMATCH)|!equals(QTC_CLANG_BUILDMODE_MISMATCH, 1) { + CLANGFORMAT_MAIN_HEADER = $$LLVM_INCLUDEPATH/clang/Format/Format.h + exists($$CLANGFORMAT_MAIN_HEADER) { +- CLANGFORMAT_LIBS=-lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangLex -lclangBasic ++ CLANGFORMAT_LIBS=-lclang-cpp + ALL_CLANG_LIBS=-lclangFormat -lclangToolingInclusions -lclangTooling -lclangToolingCore \ + -lclangRewrite -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \ + -lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \ diff --git a/qtcreator-preload-plugins.patch b/qtcreator-preload-plugins.patch new file mode 100644 index 000000000000..d4ec515fe055 --- /dev/null +++ b/qtcreator-preload-plugins.patch @@ -0,0 +1,13 @@ +diff --git a/src/plugins/clangtools/clangtidyclazyrunner.cpp b/src/plugins/clangtools/clangtidyclazyrunner.cpp +index 166d1c94e0..de0b9cc67b 100644 +--- a/src/plugins/clangtools/clangtidyclazyrunner.cpp ++++ b/src/plugins/clangtools/clangtidyclazyrunner.cpp +@@ -67,7 +67,7 @@ static QStringList clazyPluginArguments(const ClangDiagnosticConfig diagnosticCo + QStringList arguments; + + if (diagnosticConfig.isClazyEnabled()) { +- arguments << XclangArgs({"-add-plugin", "clazy"}); ++ arguments << XclangArgs({"-load", "ClazyPlugin.so", "-add-plugin", "clazy"}); + if (!diagnosticConfig.clazyChecks().isEmpty()) + arguments << XclangArgs({"-plugin-arg-clazy", diagnosticConfig.clazyChecks()}); + } |