public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/files/, dev-util/clazy/
Date: Thu,  9 Apr 2020 21:37:15 +0000 (UTC)	[thread overview]
Message-ID: <1586468184.014cfb8ff4491f6122312b8f2ba11eda28427af5.asturm@gentoo> (raw)

commit:     014cfb8ff4491f6122312b8f2ba11eda28427af5
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  9 15:58:13 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Apr  9 21:36:24 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=014cfb8f

dev-util/clazy: Fix build with >=sys-devel/clang-10

Closes: https://bugs.gentoo.org/711642
Package-Manager: Portage-2.3.98, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-util/clazy/clazy-1.6-r1.ebuild           | 50 +++++++++++++++++++
 dev-util/clazy/files/clazy-1.6-llvm-10.patch | 75 ++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)

diff --git a/dev-util/clazy/clazy-1.6-r1.ebuild b/dev-util/clazy/clazy-1.6-r1.ebuild
new file mode 100644
index 00000000000..075782027ed
--- /dev/null
+++ b/dev-util/clazy/clazy-1.6-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+DESCRIPTION="Compiler plugin which allows clang to understand Qt semantics"
+HOMEPAGE="https://cgit.kde.org/clazy.git/tree/README.md"
+SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+
+LICENSE="LGPL-2+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="
+	>=sys-devel/llvm-3.8:=
+"
+DEPEND="${RDEPEND}"
+
+DOCS=( README.md )
+
+PATCHES=( "${FILESDIR}/${P}-llvm-10.patch" )
+
+src_prepare() {
+	cmake_src_prepare
+
+	sed -e '/install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION/d' \
+		-i CMakeLists.txt || die
+
+	sed -e 's|${MAN_INSTALL_DIR}|share/man/man1|' \
+		-i docs/man/CMakeLists.txt || die
+}
+
+src_configure() {
+	# this package requires both llvm and clang of the same version.
+	# clang pulls in the equivalent llvm version, but not vice versa.
+	# so, we must find llvm based on the installed clang version.
+	# bug #681568
+	local clang_version=$(best_version "sys-devel/clang")
+	export LLVM_ROOT="/usr/lib/llvm/$(ver_cut 1 ${clang_version##sys-devel/clang-})"
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+	mv "${D}"/usr/share/doc/clazy/* "${D}"/usr/share/doc/${PF} || die
+	rmdir "${D}"/usr/share/doc/clazy || die
+}

diff --git a/dev-util/clazy/files/clazy-1.6-llvm-10.patch b/dev-util/clazy/files/clazy-1.6-llvm-10.patch
new file mode 100644
index 00000000000..f00695f5211
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.6-llvm-10.patch
@@ -0,0 +1,75 @@
+From df41bd29433937111edca3654a7beb11ec765029 Mon Sep 17 00:00:00 2001
+From: Johannes Ziegenbalg <Johannes.Ziegenbalg@tu-dresden.de>
+Date: Fri, 27 Mar 2020 14:18:32 +0100
+Subject: Fix build issues using llvm 10.0.0
+
+---
+ CMakeLists.txt                    |  2 +-
+ src/ClazyStandaloneMain.cpp       | 10 ++++++++++
+ src/checks/level0/qstring-ref.cpp |  4 ++++
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f1463cf..a30813f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -53,7 +53,7 @@ if(MSVC)
+   # disable trigger-happy warnings from Clang/LLVM headers
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244 /wd4291 /wd4800 /wd4141 /wd4146 /wd4251")
+ elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti")
++  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti")
+ endif()
+ 
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
+diff --git a/src/ClazyStandaloneMain.cpp b/src/ClazyStandaloneMain.cpp
+index aada189..6baae32 100644
+--- a/src/ClazyStandaloneMain.cpp
++++ b/src/ClazyStandaloneMain.cpp
+@@ -93,7 +93,11 @@ public:
+     {
+     }
+ 
++#if LLVM_VERSION_MAJOR >= 10
++    std::unique_ptr<FrontendAction> create() override
++#else
+     FrontendAction *create() override
++#endif
+     {
+         ClazyContext::ClazyOptions options = ClazyContext::ClazyOption_None;
+ 
+@@ -116,9 +120,15 @@ public:
+             options |= ClazyContext::ClazyOption_IgnoreIncludedFiles;
+ 
+         // TODO: We need to agregate the fixes with previous run
++#if LLVM_VERSION_MAJOR >= 10
++        return std::make_unique<ClazyStandaloneASTAction>(s_checks.getValue(), s_headerFilter.getValue(),
++                                                          s_ignoreDirs.getValue(), s_exportFixes.getValue(),
++                                                          m_paths, options);
++#else
+         return new ClazyStandaloneASTAction(s_checks.getValue(), s_headerFilter.getValue(),
+                                             s_ignoreDirs.getValue(), s_exportFixes.getValue(),
+                                             m_paths, options);
++#endif
+     }
+     std::vector<std::string> m_paths;
+ };
+diff --git a/src/checks/level0/qstring-ref.cpp b/src/checks/level0/qstring-ref.cpp
+index d1d8a4e..ec9e890 100644
+--- a/src/checks/level0/qstring-ref.cpp
++++ b/src/checks/level0/qstring-ref.cpp
+@@ -117,7 +117,11 @@ static bool containsChild(Stmt *s, Stmt *target)
+         return true;
+ 
+     if (auto mte = dyn_cast<MaterializeTemporaryExpr>(s)) {
++#if LLVM_VERSION_MAJOR >= 10
++        return containsChild(mte->getSubExpr(), target);
++#else
+         return containsChild(mte->getTemporary(), target);
++#endif
+     } else if (auto ice = dyn_cast<ImplicitCastExpr>(s)) {
+         return containsChild(ice->getSubExpr(), target);
+     } else if (auto bte = dyn_cast<CXXBindTemporaryExpr>(s)) {
+-- 
+cgit v1.1
+


             reply	other threads:[~2020-04-09 21:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 21:37 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-22 16:06 [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/files/, dev-util/clazy/ Andreas Sturmlechner
2020-10-26 13:56 Andreas Sturmlechner
2021-05-01 21:24 Andreas Sturmlechner
2022-01-19 13:54 Andreas Sturmlechner
2024-09-21 13:34 Andreas Sturmlechner
2024-12-11 21:41 Andreas Sturmlechner
2025-01-27 22:29 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1586468184.014cfb8ff4491f6122312b8f2ba11eda28427af5.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox