* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2020-04-09 21:37 Andreas Sturmlechner
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Sturmlechner @ 2020-04-09 21:37 UTC (permalink / raw
To: gentoo-commits
commit: 4a37476f9a524d498204ba6242ac358de3041653
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 9 18:57:20 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=4a37476f
dev-util/clazy: Allow to link against single clang-cpp lib
Bug: 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 | 5 ++-
dev-util/clazy/files/clazy-1.6-clang-cpp.patch | 60 ++++++++++++++++++++++++++
2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/dev-util/clazy/clazy-1.6-r1.ebuild b/dev-util/clazy/clazy-1.6-r1.ebuild
index 075782027ed..2627d7b7bec 100644
--- a/dev-util/clazy/clazy-1.6-r1.ebuild
+++ b/dev-util/clazy/clazy-1.6-r1.ebuild
@@ -21,7 +21,10 @@ DEPEND="${RDEPEND}"
DOCS=( README.md )
-PATCHES=( "${FILESDIR}/${P}-llvm-10.patch" )
+PATCHES=(
+ "${FILESDIR}/${P}-llvm-10.patch"
+ "${FILESDIR}/${P}-clang-cpp.patch"
+)
src_prepare() {
cmake_src_prepare
diff --git a/dev-util/clazy/files/clazy-1.6-clang-cpp.patch b/dev-util/clazy/files/clazy-1.6-clang-cpp.patch
new file mode 100644
index 00000000000..16b9af00ce3
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.6-clang-cpp.patch
@@ -0,0 +1,60 @@
+From 0e295e5a926496f5a5d46ea4feb1b285b084f5e0 Mon Sep 17 00:00:00 2001
+From: Christophe Giboudeaux <christophe@krop.fr>
+Date: Mon, 11 Nov 2019 10:31:49 +0100
+Subject: Check if clazy should be linked to clang-cpp
+
+Summary:
+According to [1], clang can now provide a single shared library instead of split
+ones.
+
+We have to check if this library exists and link to it if available.
+
+[1] https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html#build-system-changes
+
+Reviewers: smartins, kde-buildsystem
+
+Reviewed By: smartins
+
+Differential Revision: https://phabricator.kde.org/D25163
+---
+ CMakeLists.txt | 11 ++++++++---
+ cmake/FindClang.cmake | 1 +
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b7301ed..ce1f887 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -125,9 +125,14 @@ macro(link_to_llvm name is_standalone)
+ if(WIN32)
+ target_link_libraries(${name} version.lib)
+ endif()
+- target_link_libraries(${name} clangTooling)
+- target_link_libraries(${name} clangToolingCore)
+- target_link_libraries(${name} ${clang_tooling_refactoring_lib})
++ # clang >= 9.0 can provide a single shared library instead of split ones
++ if(CLANG_CLANG-CPP_LIB)
++ target_link_libraries(${name} clang-cpp)
++ else()
++ target_link_libraries(${name} clangTooling)
++ target_link_libraries(${name} clangToolingCore)
++ target_link_libraries(${name} ${clang_tooling_refactoring_lib})
++ endif()
+ endmacro()
+
+ macro(add_clang_plugin name)
+diff --git a/cmake/FindClang.cmake b/cmake/FindClang.cmake
+index 542172e..50e0829 100644
+--- a/cmake/FindClang.cmake
++++ b/cmake/FindClang.cmake
+@@ -62,6 +62,7 @@ if (LLVM_FOUND AND LLVM_LIBRARY_DIRS)
+ # note: On Windows there's 'libclang.dll' instead of 'clang.dll' -> search for 'libclang', too
+ find_library(CLANG_LIBCLANG_LIB NAMES clang libclang HINTS ${LLVM_LIBRARY_DIRS}) # LibClang: high-level C interface
+
++ FIND_AND_ADD_CLANG_LIB(clang-cpp)
+ FIND_AND_ADD_CLANG_LIB(clangFrontend)
+ FIND_AND_ADD_CLANG_LIB(clangDriver)
+ FIND_AND_ADD_CLANG_LIB(clangCodeGen)
+--
+cgit v1.1
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2020-06-30 12:13 Andreas Sturmlechner
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Sturmlechner @ 2020-06-30 12:13 UTC (permalink / raw
To: gentoo-commits
commit: a6de9965d65b29942c78a8406ad57684aef0941b
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 30 10:37:38 2020 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jun 30 12:13:35 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6de9965
dev-util/clazy: 1.7 version bump
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-util/clazy/Manifest | 1 +
dev-util/clazy/clazy-1.7.ebuild | 41 +++++++++++
.../clazy/files/clazy-1.7-gnuinstalldirs.patch | 82 ++++++++++++++++++++++
3 files changed, 124 insertions(+)
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index 85c2cfdf47b..f5bcd93ff3b 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -1 +1,2 @@
DIST clazy-1.6.tar.xz 364292 BLAKE2B 01da58e34d5a7cb1e812d10264cebe15e90369589535e07f2c9f4520971f2e95b2c70494e99e34f7077957ec1bf01352fa6a72a64f0572e8a5db422267ab727a SHA512 dc7cb9590bbc40a2ac51abe305b6520ebc1ff7128ff21b4f6111d18f14eb8c2ab66d907636a18c7508143b708e70ba69f9d6fad88ffce12dec981a9bdd0edcc0
+DIST clazy-1.7.tar.xz 371788 BLAKE2B 281acd0164cf76510e46883fff7269aa77e4b815d6d0ca5a54307165ff8f4355e095b82e0c41cdb0af391f4a15048a8d64b2a2a7b9dabc042b36ba1a380405cc SHA512 3dba993140f3d69aac8d9cf3fa49db990185928647193220b689773bbca70f9fd9ee7fc52022e6029b3c0c81800301a593bd79edee7e1fa6c5884782d390ced6
diff --git a/dev-util/clazy/clazy-1.7.ebuild b/dev-util/clazy/clazy-1.7.ebuild
new file mode 100644
index 00000000000..d2e60deaa67
--- /dev/null
+++ b/dev-util/clazy/clazy-1.7.ebuild
@@ -0,0 +1,41 @@
+# 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://kde.org/applications/development/org.kde.clazy"
+SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+
+LICENSE="LGPL-2+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="
+ >=sys-devel/clang-5.0:=
+ >=sys-devel/llvm-5.0:=
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-gnuinstalldirs.patch" )
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -e '/install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION/d' \
+ -i 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
+}
+
diff --git a/dev-util/clazy/files/clazy-1.7-gnuinstalldirs.patch b/dev-util/clazy/files/clazy-1.7-gnuinstalldirs.patch
new file mode 100644
index 00000000000..c58093a2db2
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.7-gnuinstalldirs.patch
@@ -0,0 +1,82 @@
+From 111c6971cd791f336eaaa8ef142c8212a7e65a3a Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Tue, 30 Jun 2020 12:56:56 +0200
+Subject: [PATCH] Use more GNUInstallDirs (doc, man)
+
+---
+ CMakeLists.txt | 21 ++++++++-------------
+ docs/man/CMakeLists.txt | 2 +-
+ 2 files changed, 9 insertions(+), 14 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c55103b..2532a8d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,7 +15,7 @@ endif()
+
+ include(FeatureSummary)
+ include(GenerateExportHeader)
+-include("GNUInstallDirs")
++include(GNUInstallDirs)
+
+ # Version setup
+ set(CLAZY_VERSION_MAJOR "1")
+@@ -184,8 +184,6 @@ if (NOT CLAZY_BUILD_WITH_CLANG)
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+
+- set(SHARE_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR} CACHE STRING "Share directory name")
+-
+ if(NOT WIN32)
+ if(APPLE)
+ find_program(READLINK_CMD greadlink)
+@@ -200,27 +198,24 @@ if (NOT CLAZY_BUILD_WITH_CLANG)
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/clazy.cmake ${CMAKE_BINARY_DIR}/clazy @ONLY)
+ install(PROGRAMS ${CMAKE_BINARY_DIR}/clazy DESTINATION bin)
+ else()
+- install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy.bat DESTINATION bin)
++ install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy.bat DESTINATION ${CMAKE_INSTALL_BINDIR})
+ if(MSVC)
+- install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy-cl.bat DESTINATION bin)
++ install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy-cl.bat DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+ endif()
+
+ # Install the explanation README's
+- set(DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/clazy)
+-
+ include(${CMAKE_CURRENT_LIST_DIR}/readmes.cmake)
+
+- install(FILES ${README_LEVEL0_FILES} DESTINATION ${DOC_INSTALL_DIR}/level0)
+- install(FILES ${README_LEVEL1_FILES} DESTINATION ${DOC_INSTALL_DIR}/level1)
+- install(FILES ${README_LEVEL2_FILES} DESTINATION ${DOC_INSTALL_DIR}/level2)
+- install(FILES ${README_manuallevel_FILES} DESTINATION ${DOC_INSTALL_DIR}/manuallevel)
++ install(FILES ${README_LEVEL0_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level0)
++ install(FILES ${README_LEVEL1_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level1)
++ install(FILES ${README_LEVEL2_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level2)
++ install(FILES ${README_manuallevel_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/manuallevel)
+
+ # Install more doc files
+- install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION ${DOC_INSTALL_DIR})
++ install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION ${CMAKE_INSTALL_DOCDIR})
+
+ # Build docs
+- set(MAN_INSTALL_DIR "${SHARE_INSTALL_DIR}/man/man1")
+ add_subdirectory(docs)
+
+ # rpath
+diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt
+index 5d86813..d9b3937 100644
+--- a/docs/man/CMakeLists.txt
++++ b/docs/man/CMakeLists.txt
+@@ -14,6 +14,6 @@ if(UNIX)
+ )
+ add_custom_target(man ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clazy.1)
+
+- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clazy.1 DESTINATION ${MAN_INSTALL_DIR})
++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clazy.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+ endif()
+ endif()
+--
+2.27.0
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2021-01-07 17:30 Andreas Sturmlechner
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Sturmlechner @ 2021-01-07 17:30 UTC (permalink / raw
To: gentoo-commits
commit: a478a7675801c0a67cf3ea519ed7f752e114837f
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 7 16:57:04 2021 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jan 7 17:30:19 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a478a767
dev-util/clazy: Drop 1.7-r1
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-util/clazy/Manifest | 1 -
dev-util/clazy/clazy-1.7-r1.ebuild | 43 ---
.../clazy/files/clazy-1.7-gnuinstalldirs.patch | 82 -----
dev-util/clazy/files/clazy-1.7-llvm11-1.patch | 343 ---------------------
dev-util/clazy/files/clazy-1.7-llvm11-2.patch | 28 --
5 files changed, 497 deletions(-)
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index fe8cc3259b0..6de4bbca805 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -1,2 +1 @@
-DIST clazy-1.7.tar.xz 371788 BLAKE2B 281acd0164cf76510e46883fff7269aa77e4b815d6d0ca5a54307165ff8f4355e095b82e0c41cdb0af391f4a15048a8d64b2a2a7b9dabc042b36ba1a380405cc SHA512 3dba993140f3d69aac8d9cf3fa49db990185928647193220b689773bbca70f9fd9ee7fc52022e6029b3c0c81800301a593bd79edee7e1fa6c5884782d390ced6
DIST clazy-1.8.tar.xz 392328 BLAKE2B 9ece9d279b2bd7e4c15ad35d9943636a107abd47cf0ed0b20db305b1684610fb84c6f9c7f606f159f0b5a48b881506796f0addf12246f2e9929a08225fcc5c74 SHA512 c43a393721a5235ddcd653f9c322e0a215f86add3b1ce42f849677c108cd21209693c6e8f225171db88032c75596722109ee01bc53db4af90fe7652f27c1eba5
diff --git a/dev-util/clazy/clazy-1.7-r1.ebuild b/dev-util/clazy/clazy-1.7-r1.ebuild
deleted file mode 100644
index ffa163aa4fa..00000000000
--- a/dev-util/clazy/clazy-1.7-r1.ebuild
+++ /dev/null
@@ -1,43 +0,0 @@
-# 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://apps.kde.org/en/clazy"
-SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
-
-LICENSE="LGPL-2+"
-SLOT="0"
-KEYWORDS="amd64 arm64 x86"
-IUSE=""
-
-RDEPEND="
- >=sys-devel/clang-5.0:=
- >=sys-devel/llvm-5.0:=
-"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
- "${FILESDIR}"/${P}-gnuinstalldirs.patch
- "${FILESDIR}"/${P}-llvm11-{1,2}.patch
-)
-
-src_prepare() {
- cmake_src_prepare
-
- sed -e '/install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION/d' \
- -i 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
-}
diff --git a/dev-util/clazy/files/clazy-1.7-gnuinstalldirs.patch b/dev-util/clazy/files/clazy-1.7-gnuinstalldirs.patch
deleted file mode 100644
index c58093a2db2..00000000000
--- a/dev-util/clazy/files/clazy-1.7-gnuinstalldirs.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 111c6971cd791f336eaaa8ef142c8212a7e65a3a Mon Sep 17 00:00:00 2001
-From: Andreas Sturmlechner <asturm@gentoo.org>
-Date: Tue, 30 Jun 2020 12:56:56 +0200
-Subject: [PATCH] Use more GNUInstallDirs (doc, man)
-
----
- CMakeLists.txt | 21 ++++++++-------------
- docs/man/CMakeLists.txt | 2 +-
- 2 files changed, 9 insertions(+), 14 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c55103b..2532a8d 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -15,7 +15,7 @@ endif()
-
- include(FeatureSummary)
- include(GenerateExportHeader)
--include("GNUInstallDirs")
-+include(GNUInstallDirs)
-
- # Version setup
- set(CLAZY_VERSION_MAJOR "1")
-@@ -184,8 +184,6 @@ if (NOT CLAZY_BUILD_WITH_CLANG)
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- )
-
-- set(SHARE_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR} CACHE STRING "Share directory name")
--
- if(NOT WIN32)
- if(APPLE)
- find_program(READLINK_CMD greadlink)
-@@ -200,27 +198,24 @@ if (NOT CLAZY_BUILD_WITH_CLANG)
- configure_file(${CMAKE_CURRENT_LIST_DIR}/clazy.cmake ${CMAKE_BINARY_DIR}/clazy @ONLY)
- install(PROGRAMS ${CMAKE_BINARY_DIR}/clazy DESTINATION bin)
- else()
-- install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy.bat DESTINATION bin)
-+ install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy.bat DESTINATION ${CMAKE_INSTALL_BINDIR})
- if(MSVC)
-- install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy-cl.bat DESTINATION bin)
-+ install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy-cl.bat DESTINATION ${CMAKE_INSTALL_BINDIR})
- endif()
- endif()
-
- # Install the explanation README's
-- set(DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/clazy)
--
- include(${CMAKE_CURRENT_LIST_DIR}/readmes.cmake)
-
-- install(FILES ${README_LEVEL0_FILES} DESTINATION ${DOC_INSTALL_DIR}/level0)
-- install(FILES ${README_LEVEL1_FILES} DESTINATION ${DOC_INSTALL_DIR}/level1)
-- install(FILES ${README_LEVEL2_FILES} DESTINATION ${DOC_INSTALL_DIR}/level2)
-- install(FILES ${README_manuallevel_FILES} DESTINATION ${DOC_INSTALL_DIR}/manuallevel)
-+ install(FILES ${README_LEVEL0_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level0)
-+ install(FILES ${README_LEVEL1_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level1)
-+ install(FILES ${README_LEVEL2_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/level2)
-+ install(FILES ${README_manuallevel_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/manuallevel)
-
- # Install more doc files
-- install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION ${DOC_INSTALL_DIR})
-+ install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION ${CMAKE_INSTALL_DOCDIR})
-
- # Build docs
-- set(MAN_INSTALL_DIR "${SHARE_INSTALL_DIR}/man/man1")
- add_subdirectory(docs)
-
- # rpath
-diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt
-index 5d86813..d9b3937 100644
---- a/docs/man/CMakeLists.txt
-+++ b/docs/man/CMakeLists.txt
-@@ -14,6 +14,6 @@ if(UNIX)
- )
- add_custom_target(man ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clazy.1)
-
-- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clazy.1 DESTINATION ${MAN_INSTALL_DIR})
-+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clazy.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
- endif()
- endif()
---
-2.27.0
-
diff --git a/dev-util/clazy/files/clazy-1.7-llvm11-1.patch b/dev-util/clazy/files/clazy-1.7-llvm11-1.patch
deleted file mode 100644
index 7b25b340a5c..00000000000
--- a/dev-util/clazy/files/clazy-1.7-llvm11-1.patch
+++ /dev/null
@@ -1,343 +0,0 @@
-From 30d6a2b64f5a05722fdc5d8e3754dbf13425cd62 Mon Sep 17 00:00:00 2001
-From: Egor Gabov <egor.gabov@waveaccess.ru>
-Date: Thu, 4 Jun 2020 17:10:21 +0300
-Subject: [PATCH] updated for compatibility with LLVM 10
-
-In LLVM 10 llvm::StringRef operator std::string() is marked as explicit.
-In this commit all implicit conversion from llvm::StringRef to
-std::string are changed by explicit.
-Also included header file clang/Basic/FileManager.h in src/MiniDumper
-because without this header, class clang::FileEntry in incomplete class
----
- src/FixItExporter.cpp | 5 +++--
- src/MiniAstDumper.cpp | 1 +
- src/Utils.cpp | 2 +-
- src/checkbase.cpp | 2 +-
- src/checks/detachingbase.cpp | 2 +-
- src/checks/level0/qenums.cpp | 2 +-
- src/checks/level0/qt-macros.cpp | 4 ++--
- src/checks/level0/unused-non-trivial-variable.cpp | 2 +-
- src/checks/level1/detaching-temporary.cpp | 2 +-
- src/checks/level1/non-pod-global-static.cpp | 2 +-
- src/checks/level1/qproperty-without-notify.cpp | 2 +-
- src/checks/level2/missing-typeinfo.cpp | 2 +-
- src/checks/level2/old-style-connect.cpp | 6 +++---
- src/checks/level2/rule-of-three.cpp | 2 +-
- src/checks/manuallevel/ifndef-define-typo.cpp | 6 +++---
- src/checks/manuallevel/qproperty-type-mismatch.cpp | 2 +-
- src/checks/manuallevel/qrequiredresult-candidates.cpp | 2 +-
- src/checks/manuallevel/qt-keywords.cpp | 4 ++--
- src/checks/manuallevel/reserve-candidates.cpp | 3 ++-
- 19 files changed, 28 insertions(+), 25 deletions(-)
-
-diff --git a/src/FixItExporter.cpp b/src/FixItExporter.cpp
-index f3af2e5..44240cf 100644
---- a/src/FixItExporter.cpp
-+++ b/src/FixItExporter.cpp
-@@ -68,7 +68,7 @@ void FixItExporter::BeginSourceFile(const LangOptions &LangOpts, const Preproces
-
- const auto id = SourceMgr.getMainFileID();
- const auto entry = SourceMgr.getFileEntryForID(id);
-- getTuDiag().MainSourceFile = entry->getName();
-+ getTuDiag().MainSourceFile = static_cast<std::string>(entry->getName());
- }
-
- bool FixItExporter::IncludeInDiagnosticCounts() const
-@@ -89,7 +89,8 @@ tooling::Diagnostic FixItExporter::ConvertDiagnostic(const Diagnostic &Info)
- // TODO: This returns an empty string: DiagEngine->getDiagnosticIDs()->getWarningOptionForDiag(Info.getID());
- // HACK: capture it at the end of the message: Message text [check-name]
-
-- std::string checkName = DiagEngine.getDiagnosticIDs()->getWarningOptionForDiag(Info.getID());
-+ std::string checkName =
-+ static_cast<std::string>(DiagEngine.getDiagnosticIDs()->getWarningOptionForDiag(Info.getID()));
- std::string messageText;
-
- if (checkName.empty()) {
-diff --git a/src/MiniAstDumper.cpp b/src/MiniAstDumper.cpp
-index 4766174..6124e6e 100644
---- a/src/MiniAstDumper.cpp
-+++ b/src/MiniAstDumper.cpp
-@@ -24,6 +24,7 @@
-
- #include <clang/Frontend/CompilerInstance.h>
- #include <clang/Frontend/FrontendPluginRegistry.h>
-+#include <clang/Basic/FileManager.h>
-
- using namespace clang;
- using namespace std;
-diff --git a/src/Utils.cpp b/src/Utils.cpp
-index 001ced9..b0812fe 100644
---- a/src/Utils.cpp
-+++ b/src/Utils.cpp
-@@ -878,7 +878,7 @@ string Utils::filenameForLoc(SourceLocation loc, const clang::SourceManager &sm)
- if (loc.isMacroID())
- loc = sm.getExpansionLoc(loc);
-
-- const string filename = sm.getFilename(loc);
-+ const string filename = static_cast<std::string>(sm.getFilename(loc));
- auto splitted = clazy::splitString(filename, '/');
- if (splitted.empty())
- return {};
-diff --git a/src/checkbase.cpp b/src/checkbase.cpp
-index 8b40e19..22a426c 100644
---- a/src/checkbase.cpp
-+++ b/src/checkbase.cpp
-@@ -188,7 +188,7 @@ bool CheckBase::shouldIgnoreFile(SourceLocation loc) const
- if (!loc.isValid())
- return true;
-
-- string filename = sm().getFilename(loc);
-+ string filename = static_cast<std::string>(sm().getFilename(loc));
-
- return clazy::any_of(m_filesToIgnore, [filename](const std::string &ignored) {
- return clazy::contains(filename, ignored);
-diff --git a/src/checks/detachingbase.cpp b/src/checks/detachingbase.cpp
-index 70311f4..1b094ee 100644
---- a/src/checks/detachingbase.cpp
-+++ b/src/checks/detachingbase.cpp
-@@ -57,7 +57,7 @@ bool DetachingBase::isDetachingMethod(CXXMethodDecl *method, DetachingMethodType
-
- const std::unordered_map<string, std::vector<StringRef>> &methodsByType = detachingMethodType == DetachingMethod ? clazy::detachingMethods()
- : clazy::detachingMethodsWithConstCounterParts();
-- auto it = methodsByType.find(className);
-+ auto it = methodsByType.find(static_cast<std::string>(className));
- if (it != methodsByType.cend()) {
- const auto &methods = it->second;
- if (clazy::contains(methods, clazy::name(method)))
-diff --git a/src/checks/level0/qenums.cpp b/src/checks/level0/qenums.cpp
-index 00075b5..db8910f 100644
---- a/src/checks/level0/qenums.cpp
-+++ b/src/checks/level0/qenums.cpp
-@@ -59,7 +59,7 @@ void QEnums::VisitMacroExpands(const Token &MacroNameTok, const SourceRange &ran
- // We simply check if :: is present because it's very cumbersome to to check for different classes when dealing with the pre-processor
-
- CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
-- string text = Lexer::getSourceText(crange, sm(), lo());
-+ string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
- if (clazy::contains(text, "::"))
- return;
- }
-diff --git a/src/checks/level0/qt-macros.cpp b/src/checks/level0/qt-macros.cpp
-index d3a587c..ab8e9f5 100644
---- a/src/checks/level0/qt-macros.cpp
-+++ b/src/checks/level0/qt-macros.cpp
-@@ -44,7 +44,7 @@ void QtMacros::VisitMacroDefined(const Token &MacroNameTok)
- return;
-
- IdentifierInfo *ii = MacroNameTok.getIdentifierInfo();
-- if (ii && clazy::startsWith(ii->getName(), "Q_OS_"))
-+ if (ii && clazy::startsWith(static_cast<std::string>(ii->getName()), "Q_OS_"))
- m_OSMacroExists = true;
- }
-
-@@ -58,7 +58,7 @@ void QtMacros::checkIfDef(const Token ¯oNameTok, SourceLocation Loc)
- if (preProcessorVisitor && preProcessorVisitor->qtVersion() < 51204 && ii->getName() == "Q_OS_WINDOWS") {
- // Q_OS_WINDOWS was introduced in 5.12.4
- emitWarning(Loc, "Q_OS_WINDOWS was only introduced in Qt 5.12.4, use Q_OS_WIN instead");
-- } else if (!m_OSMacroExists && clazy::startsWith(ii->getName(), "Q_OS_")) {
-+ } else if (!m_OSMacroExists && clazy::startsWith(static_cast<std::string>(ii->getName()), "Q_OS_")) {
- emitWarning(Loc, "Include qglobal.h before testing Q_OS_ macros");
- }
- }
-diff --git a/src/checks/level0/unused-non-trivial-variable.cpp b/src/checks/level0/unused-non-trivial-variable.cpp
-index 4e4b830..93815f2 100644
---- a/src/checks/level0/unused-non-trivial-variable.cpp
-+++ b/src/checks/level0/unused-non-trivial-variable.cpp
-@@ -91,7 +91,7 @@ bool UnusedNonTrivialVariable::isUninterestingType(const CXXRecordDecl *record)
- static const vector<StringRef> blacklistedTemplates = { "QScopedPointer", "QSetValueOnDestroy", "QScopedValueRollback" };
- StringRef className = clazy::name(record);
- for (StringRef templateName : blacklistedTemplates) {
-- if (clazy::startsWith(className, templateName))
-+ if (clazy::startsWith(static_cast<std::string>(className), static_cast<std::string>(templateName)))
- return true;
- }
-
-diff --git a/src/checks/level1/detaching-temporary.cpp b/src/checks/level1/detaching-temporary.cpp
-index fedfc81..60c7553 100644
---- a/src/checks/level1/detaching-temporary.cpp
-+++ b/src/checks/level1/detaching-temporary.cpp
-@@ -140,7 +140,7 @@ void DetachingTemporary::VisitStmt(clang::Stmt *stm)
- StringRef className = clazy::name(classDecl);
-
- const std::unordered_map<string, std::vector<StringRef>> &methodsByType = clazy::detachingMethods();
-- auto it = methodsByType.find(className);
-+ auto it = methodsByType.find(static_cast<std::string>(className));
- auto it2 = m_writeMethodsByType.find(className);
-
- std::vector<StringRef> allowedFunctions;
-diff --git a/src/checks/level1/non-pod-global-static.cpp b/src/checks/level1/non-pod-global-static.cpp
-index 5879bff..433b5c5 100644
---- a/src/checks/level1/non-pod-global-static.cpp
-+++ b/src/checks/level1/non-pod-global-static.cpp
-@@ -74,7 +74,7 @@ void NonPodGlobalStatic::VisitStmt(clang::Stmt *stm)
- const SourceLocation declStart = clazy::getLocStart(varDecl);
-
- if (declStart.isMacroID()) {
-- auto macroName = Lexer::getImmediateMacroName(declStart, sm(), lo());
-+ auto macroName = static_cast<std::string>(Lexer::getImmediateMacroName(declStart, sm(), lo()));
- if (clazy::startsWithAny(macroName, { "Q_IMPORT_PLUGIN", "Q_CONSTRUCTOR_FUNCTION", "Q_DESTRUCTOR_FUNCTION"})) // Don't warn on these
- return;
- }
-diff --git a/src/checks/level1/qproperty-without-notify.cpp b/src/checks/level1/qproperty-without-notify.cpp
-index e1d6db4..3af9fee 100644
---- a/src/checks/level1/qproperty-without-notify.cpp
-+++ b/src/checks/level1/qproperty-without-notify.cpp
-@@ -69,7 +69,7 @@ void QPropertyWithoutNotify::VisitMacroExpands(const clang::Token &MacroNameTok,
- return;
- CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
-
-- string text = Lexer::getSourceText(crange, sm(), lo());
-+ string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
- if (text.back() == ')')
- text.pop_back();
-
-diff --git a/src/checks/level2/missing-typeinfo.cpp b/src/checks/level2/missing-typeinfo.cpp
-index 98df2cd..03b44e0 100644
---- a/src/checks/level2/missing-typeinfo.cpp
-+++ b/src/checks/level2/missing-typeinfo.cpp
-@@ -74,7 +74,7 @@ void MissingTypeInfo::VisitDecl(clang::Decl *decl)
- if (sm().isInSystemHeader(clazy::getLocStart(record)))
- return;
-
-- std::string typeName = clazy::name(record);
-+ std::string typeName = static_cast<std::string>(clazy::name(record));
- if (typeName == "QPair") // QPair doesn't use Q_DECLARE_TYPEINFO, but rather a explicit QTypeInfo.
- return;
-
-diff --git a/src/checks/level2/old-style-connect.cpp b/src/checks/level2/old-style-connect.cpp
-index 0fe68c1..396cb70 100644
---- a/src/checks/level2/old-style-connect.cpp
-+++ b/src/checks/level2/old-style-connect.cpp
-@@ -274,7 +274,7 @@ void OldStyleConnect::VisitMacroExpands(const Token ¯oNameTok, const SourceR
- return;
-
- auto charRange = Lexer::getAsCharRange(range, sm(), lo());
-- const string text = Lexer::getSourceText(charRange, sm(), lo());
-+ const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
-
- static regex rx(R"(Q_PRIVATE_SLOT\s*\((.*)\s*,\s*.*\s+(.*)\(.*)");
- smatch match;
-@@ -293,7 +293,7 @@ string OldStyleConnect::signalOrSlotNameFromMacro(SourceLocation macroLoc)
- CharSourceRange expansionRange = clazy::getImmediateExpansionRange(macroLoc, sm());
- SourceRange range = SourceRange(expansionRange.getBegin(), expansionRange.getEnd());
- auto charRange = Lexer::getAsCharRange(range, sm(), lo());
-- const string text = Lexer::getSourceText(charRange, sm(), lo());
-+ const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
-
- static regex rx(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
-
-@@ -315,7 +315,7 @@ bool OldStyleConnect::isSignalOrSlot(SourceLocation loc, string ¯oName) cons
- if (!loc.isMacroID() || loc.isInvalid())
- return false;
-
-- macroName = Lexer::getImmediateMacroName(loc, sm(), lo());
-+ macroName = static_cast<std::string>(Lexer::getImmediateMacroName(loc, sm(), lo()));
- return macroName == "SIGNAL" || macroName == "SLOT";
- }
-
-diff --git a/src/checks/level2/rule-of-three.cpp b/src/checks/level2/rule-of-three.cpp
-index 8db55d5..7583fcc 100644
---- a/src/checks/level2/rule-of-three.cpp
-+++ b/src/checks/level2/rule-of-three.cpp
-@@ -140,7 +140,7 @@ void RuleOfThree::VisitDecl(clang::Decl *decl)
-
- const string className = record->getNameAsString();
- const string classQualifiedName = record->getQualifiedNameAsString();
-- const string filename = sm().getFilename(recordStart);
-+ const string filename = static_cast<std::string>(sm().getFilename(recordStart));
- if (clazy::endsWith(className, "Private") && clazy::endsWithAny(filename, { ".cpp", ".cxx", "_p.h" }))
- return; // Lots of RAII classes fall into this category. And even Private (d-pointer) classes, warning in that case would just be noise
-
-diff --git a/src/checks/manuallevel/ifndef-define-typo.cpp b/src/checks/manuallevel/ifndef-define-typo.cpp
-index edb6cdf..e9c50a4 100644
---- a/src/checks/manuallevel/ifndef-define-typo.cpp
-+++ b/src/checks/manuallevel/ifndef-define-typo.cpp
-@@ -44,7 +44,7 @@ void IfndefDefineTypo::VisitMacroDefined(const Token ¯oNameTok)
- {
- if (!m_lastIfndef.empty()) {
- if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo()) {
-- maybeWarn(ii->getName(), macroNameTok.getLocation());
-+ maybeWarn(static_cast<std::string>(ii->getName()), macroNameTok.getLocation());
- }
- }
- }
-@@ -53,7 +53,7 @@ void IfndefDefineTypo::VisitDefined(const Token ¯oNameTok, const SourceRange
- {
- if (!m_lastIfndef.empty()) {
- if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo()) {
-- maybeWarn(ii->getName(), macroNameTok.getLocation());
-+ maybeWarn(static_cast<std::string>(ii->getName()), macroNameTok.getLocation());
- }
- }
- }
-@@ -66,7 +66,7 @@ void IfndefDefineTypo::VisitIfdef(SourceLocation, const Token &)
- void IfndefDefineTypo::VisitIfndef(SourceLocation, const Token ¯oNameTok)
- {
- if (IdentifierInfo *ii = macroNameTok.getIdentifierInfo())
-- m_lastIfndef = ii->getName();
-+ m_lastIfndef = static_cast<std::string>(ii->getName());
- }
-
- void IfndefDefineTypo::VisitIf(SourceLocation, SourceRange, PPCallbacks::ConditionValueKind)
-diff --git a/src/checks/manuallevel/qproperty-type-mismatch.cpp b/src/checks/manuallevel/qproperty-type-mismatch.cpp
-index f91159c..952d9f1 100644
---- a/src/checks/manuallevel/qproperty-type-mismatch.cpp
-+++ b/src/checks/manuallevel/qproperty-type-mismatch.cpp
-@@ -237,7 +237,7 @@ void QPropertyTypeMismatch::VisitMacroExpands(const clang::Token &MacroNameTok,
-
- CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
-
-- string text = Lexer::getSourceText(crange, sm(), lo());
-+ string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
- if (!text.empty() && text.back() == ')')
- text.pop_back();
-
-diff --git a/src/checks/manuallevel/qrequiredresult-candidates.cpp b/src/checks/manuallevel/qrequiredresult-candidates.cpp
-index 912dbaa..6375bd7 100644
---- a/src/checks/manuallevel/qrequiredresult-candidates.cpp
-+++ b/src/checks/manuallevel/qrequiredresult-candidates.cpp
-@@ -65,7 +65,7 @@ void QRequiredResultCandidates::VisitDecl(clang::Decl *decl)
-
-
- if (returnClass == classDecl) {
-- const std::string methodName = clazy::name(method);
-+ const std::string methodName = static_cast<std::string>(clazy::name(method));
- if (methodName.empty()) // fixes assert
- return;
-
-diff --git a/src/checks/manuallevel/qt-keywords.cpp b/src/checks/manuallevel/qt-keywords.cpp
-index e792e95..b60752c 100644
---- a/src/checks/manuallevel/qt-keywords.cpp
-+++ b/src/checks/manuallevel/qt-keywords.cpp
-@@ -59,12 +59,12 @@ void QtKeywords::VisitMacroExpands(const Token ¯oNameTok, const SourceRange
- }
-
- static const vector<StringRef> keywords = { "foreach", "signals", "slots", "emit" };
-- std::string name = ii->getName();
-+ std::string name = static_cast<std::string>(ii->getName());
- if (!clazy::contains(keywords, name))
- return;
-
- // Make sure the macro is Qt's. It must be defined in Qt's headers, not 3rdparty
-- std::string qtheader = sm().getFilename(sm().getSpellingLoc(minfo->getDefinitionLoc()));
-+ std::string qtheader = static_cast<std::string>(sm().getFilename(sm().getSpellingLoc(minfo->getDefinitionLoc())));
- if (!clazy::endsWith(qtheader, "qglobal.h") && !clazy::endsWith(qtheader, "qobjectdefs.h"))
- return;
-
-diff --git a/src/checks/manuallevel/reserve-candidates.cpp b/src/checks/manuallevel/reserve-candidates.cpp
-index 389cac5..92e4491 100644
---- a/src/checks/manuallevel/reserve-candidates.cpp
-+++ b/src/checks/manuallevel/reserve-candidates.cpp
-@@ -78,7 +78,8 @@ static bool isCandidateMethod(CXXMethodDecl *methodDecl)
- if (!classDecl)
- return false;
-
-- if (!clazy::equalsAny(clazy::name(methodDecl), { "append", "push_back", "push", "operator<<", "operator+=" }))
-+ if (!clazy::equalsAny(static_cast<std::string>(clazy::name(methodDecl)),
-+ { "append", "push_back", "push", "operator<<", "operator+=" }))
- return false;
-
- if (!clazy::isAReserveClass(classDecl))
---
-GitLab
-
diff --git a/dev-util/clazy/files/clazy-1.7-llvm11-2.patch b/dev-util/clazy/files/clazy-1.7-llvm11-2.patch
deleted file mode 100644
index 4556f257bf3..00000000000
--- a/dev-util/clazy/files/clazy-1.7-llvm11-2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 25aa102cc49def9573ffbed88155589cd60a2e8f Mon Sep 17 00:00:00 2001
-From: Egor Gabov <egor.gabov@waveaccess.ru>
-Date: Fri, 5 Jun 2020 16:52:53 +0300
-Subject: [PATCH] updated for compatibility with LLVM 10 (clazy-standalone)
-
-In LLVM 10 llvm::StringRef operator std::string() is marked as explicit.
-In this commit all implicit conversion from llvm::StringRef to
-std::string are changed by explicit.
----
- src/checks/manuallevel/jnisignatures.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/checks/manuallevel/jnisignatures.cpp b/src/checks/manuallevel/jnisignatures.cpp
-index 81e61d4..5d4fe20 100644
---- a/src/checks/manuallevel/jnisignatures.cpp
-+++ b/src/checks/manuallevel/jnisignatures.cpp
-@@ -103,7 +103,7 @@ void JniSignatures::checkFunctionCall(Stmt *stm)
- return;
- }
-
-- const std::string name = clazy::name(funDecl);
-+ const std::string name = static_cast<std::string>(clazy::name(funDecl));
-
- if (name == "callObjectMethod" || name == "callMethod") {
- checkArgAt(callExpr, 0, methodNameRegex, "Invalid method name");
---
-GitLab
-
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2021-12-13 0:11 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2021-12-13 0:11 UTC (permalink / raw
To: gentoo-commits
commit: af5f598a4e43dd87b224e4281b167773c3a5d74e
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 10 23:24:37 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec 13 00:11:29 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af5f598a
dev-util/clazy: use llvm.eclass to declare compatibility and build patch
- We need to use llvm.eclass to ensure we don't use too new of
a version of LLVM and Clang.
We're now using the llvm.eclass mechanisms to enforce the same
versions of Clang and LLVM.
- Throw in a build patch from upstream
(upstream commit b74c8729b7b71528c1528579435cda7fdb5d31b4) which
was necessary for me.
Bug: https://bugs.gentoo.org/811723
Bug: https://bugs.gentoo.org/823726
Closes: https://bugs.gentoo.org/824986
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../{clazy-1.10.ebuild => clazy-1.10-r1.ebuild} | 25 ++++++------
dev-util/clazy/files/clazy-1.10-gcc-build.patch | 44 ++++++++++++++++++++++
dev-util/clazy/files/clazy-1.10-use-c++17.patch | 20 ++++++++++
3 files changed, 78 insertions(+), 11 deletions(-)
diff --git a/dev-util/clazy/clazy-1.10.ebuild b/dev-util/clazy/clazy-1.10-r1.ebuild
similarity index 63%
rename from dev-util/clazy/clazy-1.10.ebuild
rename to dev-util/clazy/clazy-1.10-r1.ebuild
index 160c50c5c641..d8369600c480 100644
--- a/dev-util/clazy/clazy-1.10.ebuild
+++ b/dev-util/clazy/clazy-1.10-r1.ebuild
@@ -3,7 +3,8 @@
EAPI=7
-inherit cmake
+LLVM_MAX_SLOT=12
+inherit cmake llvm
DESCRIPTION="Compiler plugin which allows clang to understand Qt semantics"
HOMEPAGE="https://apps.kde.org/clazy"
@@ -14,12 +15,18 @@ SLOT="0"
KEYWORDS="~amd64 arm64 ~x86"
IUSE=""
-RDEPEND="
- >=sys-devel/clang-8.0:=
- >=sys-devel/llvm-8.0:=
-"
+RDEPEND="<sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):="
DEPEND="${RDEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc-build.patch
+ "${FILESDIR}"/${P}-use-c++17.patch
+)
+
+llvm_check_deps() {
+ has_version "sys-devel/clang:${LLVM_SLOT}" && has_version "sys-devel/llvm:${LLVM_SLOT}"
+}
+
src_prepare() {
cmake_src_prepare
@@ -28,12 +35,8 @@ src_prepare() {
}
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-})"
+ export LLVM_ROOT="$(get_llvm_prefix -d ${LLVM_MAX_SLOT})"
+
cmake_src_configure
}
diff --git a/dev-util/clazy/files/clazy-1.10-gcc-build.patch b/dev-util/clazy/files/clazy-1.10-gcc-build.patch
new file mode 100644
index 000000000000..647c254b644d
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.10-gcc-build.patch
@@ -0,0 +1,44 @@
+https://invent.kde.org/sdk/clazy/-/commit/b74c8729b7b71528c1528579435cda7fdb5d31b4
+
+From: Sergio Martins <smartins@kde.org>
+Date: Thu, 2 Dec 2021 11:05:51 +0000
+Subject: [PATCH] Fix build with some newer gcc complaining about deleted Lexer
+
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -117,17 +117,13 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ }
+
+ #if LLVM_VERSION_MAJOR >= 12
+-inline clang::Lexer getLexer(clang::FileID id, llvm::Optional<llvm::MemoryBufferRef> inputFile,
+- const clang::SourceManager &sm, const clang::LangOptions &lo)
+-{
+- return clang::Lexer(id, inputFile.getValue(), sm, lo);
+-}
++
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.getValue(), sm, lo)
++
+ #else
+-inline clang::Lexer getLexer(clang::FileID id, const llvm::MemoryBuffer *inputFile,
+- const clang::SourceManager &sm, const clang::LangOptions &lo)
+-{
+- return clang::Lexer(id, inputFile, sm, lo);
+-}
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.getValue(), sm, lo)
+ #endif
+
+ inline bool isFinal(const clang::CXXRecordDecl *record)
+--- a/src/SuppressionManager.cpp
++++ b/src/SuppressionManager.cpp
+@@ -91,7 +91,7 @@ void SuppressionManager::parseFile(FileID id, const SourceManager &sm, const cla
+ return;
+ }
+
+- auto lexer = clazy::getLexer(id, buffer, sm, lo);
++ auto lexer = GET_LEXER(id, buffer, sm, lo);
+ lexer.SetCommentRetentionState(true);
+
+ Token token;
+GitLab
diff --git a/dev-util/clazy/files/clazy-1.10-use-c++17.patch b/dev-util/clazy/files/clazy-1.10-use-c++17.patch
new file mode 100644
index 000000000000..73bd52aef0e4
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.10-use-c++17.patch
@@ -0,0 +1,20 @@
+https://invent.kde.org/sdk/clazy/-/commit/b0d831a6716229d18f2677c5d356b37f36d4dfd6
+
+From: Sergio Martins <smartins@kde.org>
+Date: Thu, 2 Dec 2021 11:31:58 +0000
+Subject: [PATCH] cmake: Require c++17
+
+Fixes build with newer compiler which were nagging about not
+finding std::filesystem
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -69,7 +69,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++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")
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -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")
+GitLab
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2021-12-14 8:22 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2021-12-14 8:22 UTC (permalink / raw
To: gentoo-commits
commit: 4a53b08273b86eed76a989e647aecccfb485b2d4
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 14 08:22:09 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 14 08:22:26 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a53b082
dev-util/clazy: fix build with LLVM < 12
Upstream commit: 0ee1ed9ff1bd4cf2a49e1232696747f1898e2987
Closes: https://bugs.gentoo.org/829134
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-util/clazy/clazy-1.10-r2.ebuild | 1 +
.../files/clazy-1.10-llvm-earlier-than-12.patch | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/dev-util/clazy/clazy-1.10-r2.ebuild b/dev-util/clazy/clazy-1.10-r2.ebuild
index f482a18606ed..bcb85e9d4148 100644
--- a/dev-util/clazy/clazy-1.10-r2.ebuild
+++ b/dev-util/clazy/clazy-1.10-r2.ebuild
@@ -24,6 +24,7 @@ BDEPEND="test? ( ${PYTHON_DEPS} )"
PATCHES=(
"${FILESDIR}"/${P}-gcc-build.patch
"${FILESDIR}"/${P}-use-c++17.patch
+ "${FILESDIR}"/${P}-llvm-earlier-than-12.patch
)
llvm_check_deps() {
diff --git a/dev-util/clazy/files/clazy-1.10-llvm-earlier-than-12.patch b/dev-util/clazy/files/clazy-1.10-llvm-earlier-than-12.patch
new file mode 100644
index 000000000000..714d196b5fd9
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.10-llvm-earlier-than-12.patch
@@ -0,0 +1,20 @@
+https://bugs.gentoo.org/829134
+https://invent.kde.org/sdk/clazy/-/commit/0ee1ed9ff1bd4cf2a49e1232696747f1898e2987.patch
+
+From: Allen Winter <allen.winter@kdab.com>
+Date: Sat, 11 Dec 2021 14:57:52 -0500
+Subject: [PATCH] src/SourceCompatibilityHelpers.h - fix compile with LLVM<12
+
+fix the GET_LEXER macro for LLVM versions less than 12
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -123,7 +123,7 @@ clang::Lexer(id, inputFile.getValue(), sm, lo)
+
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+-clang::Lexer(id, inputFile.getValue(), sm, lo)
++clang::Lexer(id, inputFile, sm, lo)
+ #endif
+
+ inline bool isFinal(const clang::CXXRecordDecl *record)
+GitLab
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2022-06-14 7:44 Andreas Sturmlechner
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Sturmlechner @ 2022-06-14 7:44 UTC (permalink / raw
To: gentoo-commits
commit: 851a6bca2b859e267983e9d5b374d06521b32cc7
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 14 07:41:56 2022 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jun 14 07:43:47 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=851a6bca
dev-util/clazy: Drop 1.10-r2
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-util/clazy/Manifest | 1 -
dev-util/clazy/clazy-1.10-r2.ebuild | 57 ----------------------
dev-util/clazy/files/clazy-1.10-gcc-build.patch | 44 -----------------
.../files/clazy-1.10-llvm-earlier-than-12.patch | 20 --------
dev-util/clazy/files/clazy-1.10-use-c++17.patch | 20 --------
5 files changed, 142 deletions(-)
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index 73763eea9f2e..a764da1ab127 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -1,2 +1 @@
-DIST clazy-1.10.tar.xz 398920 BLAKE2B 1cdc160de21363c7dc9c93ea7e780412a4971b18e97c7ec6e06f1c7450c56e0fbbdb7592d6b92ae53e4c161f6d9abca205984f83b68646f04ea11d63e3c45fa6 SHA512 59dd8c6903bcc239dfc356804cab265597a771de3858a6add4877149e0e7875b3c9ddae9aeec889c9102fb9ec6b0125bb8a786344e47872b01ba87425ba021eb
DIST clazy-1.11.tar.xz 404088 BLAKE2B 1a69fe07ef81a0efe3c9db9129083247d60943592967f705d62d3859039cec250673eecc06184f70d134cbab85708d957b0a085beff8b3e46325a69547e005b7 SHA512 6a7c162392dd30aea29669275cea814d6daccf7931b8cdb20997f9bbff5619832d5461a6d0f854ecbc4726e52b6937c4f9cb8651087ffe73676c04239a38ca2b
diff --git a/dev-util/clazy/clazy-1.10-r2.ebuild b/dev-util/clazy/clazy-1.10-r2.ebuild
deleted file mode 100644
index 077cb9c6224d..000000000000
--- a/dev-util/clazy/clazy-1.10-r2.ebuild
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-LLVM_MAX_SLOT=13
-PYTHON_COMPAT=( python3_{8,9,10} )
-inherit cmake llvm python-any-r1
-
-DESCRIPTION="Compiler plugin which allows clang to understand Qt semantics"
-HOMEPAGE="https://apps.kde.org/clazy"
-SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
-
-LICENSE="LGPL-2+"
-SLOT="0"
-KEYWORDS="amd64 arm64 x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="<sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):="
-DEPEND="${RDEPEND}"
-BDEPEND="test? ( ${PYTHON_DEPS} )"
-
-PATCHES=(
- "${FILESDIR}"/${P}-gcc-build.patch
- "${FILESDIR}"/${P}-use-c++17.patch
- "${FILESDIR}"/${P}-llvm-earlier-than-12.patch
-)
-
-llvm_check_deps() {
- has_version "sys-devel/clang:${LLVM_SLOT}" && has_version "sys-devel/llvm:${LLVM_SLOT}"
-}
-
-pkg_setup() {
- use test && python-any-r1_pkg_setup
-
- llvm_pkg_setup
-}
-
-src_prepare() {
- cmake_src_prepare
-
- sed -e '/install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION/d' \
- -i CMakeLists.txt || die
-}
-
-src_configure() {
- export LLVM_ROOT="$(get_llvm_prefix -d ${LLVM_MAX_SLOT})"
-
- cmake_src_configure
-}
-
-src_test() {
- # Run tests against built copy, not installed
- # bug #811723
- PATH="${BUILD_DIR}/bin:${PATH}" LD_LIBRARY_PATH="${BUILD_DIR}/lib" cmake_src_test
-}
diff --git a/dev-util/clazy/files/clazy-1.10-gcc-build.patch b/dev-util/clazy/files/clazy-1.10-gcc-build.patch
deleted file mode 100644
index 647c254b644d..000000000000
--- a/dev-util/clazy/files/clazy-1.10-gcc-build.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-https://invent.kde.org/sdk/clazy/-/commit/b74c8729b7b71528c1528579435cda7fdb5d31b4
-
-From: Sergio Martins <smartins@kde.org>
-Date: Thu, 2 Dec 2021 11:05:51 +0000
-Subject: [PATCH] Fix build with some newer gcc complaining about deleted Lexer
-
---- a/src/SourceCompatibilityHelpers.h
-+++ b/src/SourceCompatibilityHelpers.h
-@@ -117,17 +117,13 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
- }
-
- #if LLVM_VERSION_MAJOR >= 12
--inline clang::Lexer getLexer(clang::FileID id, llvm::Optional<llvm::MemoryBufferRef> inputFile,
-- const clang::SourceManager &sm, const clang::LangOptions &lo)
--{
-- return clang::Lexer(id, inputFile.getValue(), sm, lo);
--}
-+
-+#define GET_LEXER(id, inputFile, sm, lo) \
-+clang::Lexer(id, inputFile.getValue(), sm, lo)
-+
- #else
--inline clang::Lexer getLexer(clang::FileID id, const llvm::MemoryBuffer *inputFile,
-- const clang::SourceManager &sm, const clang::LangOptions &lo)
--{
-- return clang::Lexer(id, inputFile, sm, lo);
--}
-+#define GET_LEXER(id, inputFile, sm, lo) \
-+clang::Lexer(id, inputFile.getValue(), sm, lo)
- #endif
-
- inline bool isFinal(const clang::CXXRecordDecl *record)
---- a/src/SuppressionManager.cpp
-+++ b/src/SuppressionManager.cpp
-@@ -91,7 +91,7 @@ void SuppressionManager::parseFile(FileID id, const SourceManager &sm, const cla
- return;
- }
-
-- auto lexer = clazy::getLexer(id, buffer, sm, lo);
-+ auto lexer = GET_LEXER(id, buffer, sm, lo);
- lexer.SetCommentRetentionState(true);
-
- Token token;
-GitLab
diff --git a/dev-util/clazy/files/clazy-1.10-llvm-earlier-than-12.patch b/dev-util/clazy/files/clazy-1.10-llvm-earlier-than-12.patch
deleted file mode 100644
index 714d196b5fd9..000000000000
--- a/dev-util/clazy/files/clazy-1.10-llvm-earlier-than-12.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-https://bugs.gentoo.org/829134
-https://invent.kde.org/sdk/clazy/-/commit/0ee1ed9ff1bd4cf2a49e1232696747f1898e2987.patch
-
-From: Allen Winter <allen.winter@kdab.com>
-Date: Sat, 11 Dec 2021 14:57:52 -0500
-Subject: [PATCH] src/SourceCompatibilityHelpers.h - fix compile with LLVM<12
-
-fix the GET_LEXER macro for LLVM versions less than 12
---- a/src/SourceCompatibilityHelpers.h
-+++ b/src/SourceCompatibilityHelpers.h
-@@ -123,7 +123,7 @@ clang::Lexer(id, inputFile.getValue(), sm, lo)
-
- #else
- #define GET_LEXER(id, inputFile, sm, lo) \
--clang::Lexer(id, inputFile.getValue(), sm, lo)
-+clang::Lexer(id, inputFile, sm, lo)
- #endif
-
- inline bool isFinal(const clang::CXXRecordDecl *record)
-GitLab
diff --git a/dev-util/clazy/files/clazy-1.10-use-c++17.patch b/dev-util/clazy/files/clazy-1.10-use-c++17.patch
deleted file mode 100644
index 73bd52aef0e4..000000000000
--- a/dev-util/clazy/files/clazy-1.10-use-c++17.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-https://invent.kde.org/sdk/clazy/-/commit/b0d831a6716229d18f2677c5d356b37f36d4dfd6
-
-From: Sergio Martins <smartins@kde.org>
-Date: Thu, 2 Dec 2021 11:31:58 +0000
-Subject: [PATCH] cmake: Require c++17
-
-Fixes build with newer compiler which were nagging about not
-finding std::filesystem
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -69,7 +69,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++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")
-+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -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")
-GitLab
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2022-10-25 18:36 Andreas Sturmlechner
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Sturmlechner @ 2022-10-25 18:36 UTC (permalink / raw
To: gentoo-commits
commit: 6575b1a0d95279f9bbd058a4426cb7b3a396c4e2
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 25 17:55:33 2022 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 18:35:20 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6575b1a0
dev-util/clazy: Support python3_11, LLVM-15
Tests pass.
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-util/clazy/clazy-1.11-r2.ebuild | 56 ++++++
dev-util/clazy/files/clazy-1.11-fix-llvm-15.patch | 223 +++++++++++++++++++++
.../clazy/files/clazy-1.11-fix-regex-detect.patch | 25 +++
3 files changed, 304 insertions(+)
diff --git a/dev-util/clazy/clazy-1.11-r2.ebuild b/dev-util/clazy/clazy-1.11-r2.ebuild
new file mode 100644
index 000000000000..331c221f4408
--- /dev/null
+++ b/dev-util/clazy/clazy-1.11-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=15
+PYTHON_COMPAT=( python3_{8..11} )
+inherit cmake llvm python-any-r1
+
+DESCRIPTION="Compiler plugin which allows clang to understand Qt semantics"
+HOMEPAGE="https://apps.kde.org/clazy"
+SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+
+LICENSE="LGPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="<sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):="
+DEPEND="${RDEPEND}"
+BDEPEND="test? ( ${PYTHON_DEPS} )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-fix-regex-detect.patch"
+ "${FILESDIR}/${P}-fix-llvm-15.patch"
+)
+
+llvm_check_deps() {
+ has_version "sys-devel/clang:${LLVM_SLOT}" && has_version "sys-devel/llvm:${LLVM_SLOT}"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+
+ llvm_pkg_setup
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -e '/install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION/d' \
+ -i CMakeLists.txt || die
+}
+
+src_configure() {
+ export LLVM_ROOT="$(get_llvm_prefix -d ${LLVM_MAX_SLOT})"
+
+ cmake_src_configure
+}
+
+src_test() {
+ # Run tests against built copy, not installed
+ # bug #811723
+ PATH="${BUILD_DIR}/bin:${PATH}" LD_LIBRARY_PATH="${BUILD_DIR}/lib" cmake_src_test
+}
diff --git a/dev-util/clazy/files/clazy-1.11-fix-llvm-15.patch b/dev-util/clazy/files/clazy-1.11-fix-llvm-15.patch
new file mode 100644
index 000000000000..b98e4b1c2fee
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.11-fix-llvm-15.patch
@@ -0,0 +1,223 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt | 6 ++++++
+ src/PreProcessorVisitor.cpp | 2 +-
+ src/PreProcessorVisitor.h | 2 +-
+ src/SourceCompatibilityHelpers.h | 15 +++++++++++++++
+ src/Utils.cpp | 3 ++-
+ src/checkbase.cpp | 4 ++--
+ src/checkbase.h | 4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp | 2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h | 2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp | 2 +-
+ src/checks/manuallevel/qt6-header-fixes.h | 2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+ set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++ set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+ if (CLAZY_LINK_CLANG_DYLIB)
+ target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+
+ target_link_libraries(${name} ${clang_lib})
+ endforeach()
++ target_link_libraries(${name} ${clang_support_lib})
+ target_link_libraries(${name} clangTooling)
+ target_link_libraries(${name} clangToolingCore)
+ target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+ clangFrontendTool
+ clangRewrite
+ clangSerialization
++ ${clang_support_lib}
+ clangTooling
+ clangStaticAnalyzerCheckers
+ clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+ clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+- const clang::FileEntry *, clang::StringRef, clang::StringRef,
++ clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+ const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+ if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ protected:
+ clang::SourceRange range, const clang::MacroArgs *) override;
+ void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+ clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+- const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++ clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+ const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+ std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++ return lt->isOrdinary();
++#else
++ return lt->isAscii();
++#endif
++}
++
+ }
+
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+ // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+- return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++ return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token ¯oNameTok, const M
+ }
+
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+- clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++ clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+ clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+ check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+- clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++ clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+ clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+ // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ public:
+ void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+ void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+ void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+- clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++ clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+ clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+ CheckBase *const check;
+@@ -151,7 +151,7 @@ protected:
+ virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+ virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+ virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+- clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++ clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+ clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+
+ void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+- clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++ clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+ clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+ auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ public:
+ explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+ void VisitDecl(clang::Decl *decl) override;
+ void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+- clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++ clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+ clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ bool m_including_qcontainerfwd = false;
+ std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+- clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++ clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+ clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+ if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+ explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+ void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+- clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++ clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+ clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+
+ };
+--
+GitLab
+
diff --git a/dev-util/clazy/files/clazy-1.11-fix-regex-detect.patch b/dev-util/clazy/files/clazy-1.11-fix-regex-detect.patch
new file mode 100644
index 000000000000..a60206365ea1
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.11-fix-regex-detect.patch
@@ -0,0 +1,25 @@
+From 336b54f28250938cc2a8d7bb78e638e79b6467d5 Mon Sep 17 00:00:00 2001
+From: Hannah von Reth <vonreth@kde.org>
+Date: Fri, 8 Jul 2022 11:19:22 +0000
+Subject: [PATCH] Fix regex detection
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 434a57c9..3c780b0d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -81,7 +81,7 @@ endif()
+
+ # Look for std::regex support
+ message("Looking for std::regex support...")
+-try_run(REGEX_RUN_RESULT COMPILE_RESULT ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/.cmake_has_regex_test.cpp)
++try_run(REGEX_RUN_RESULT COMPILE_RESULT ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/.cmake_has_regex_test.cpp CXX_STANDARD 17 CXX_STANDARD_REQUIRED true)
+
+ if(NOT REGEX_RUN_RESULT EQUAL 0)
+ message("Using boost::regex instead of std::regex")
+--
+GitLab
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2024-03-04 22:18 Andreas Sturmlechner
0 siblings, 0 replies; 10+ messages in thread
From: Andreas Sturmlechner @ 2024-03-04 22:18 UTC (permalink / raw
To: gentoo-commits
commit: 1ea0e9a3ed747a8d800d1a1c25abdbd03e5b8275
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 4 16:06:48 2024 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Mar 4 22:17:40 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ea0e9a3
dev-util/clazy: Add yet another patch to support LLVM-17
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-util/clazy/clazy-1.11-r4.ebuild | 57 ++++++++++++++++++++++
dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch | 38 +++++++++++++++
.../clazy/files/clazy-1.11-jobs-for-tests.patch | 41 ++++++++++++++++
3 files changed, 136 insertions(+)
diff --git a/dev-util/clazy/clazy-1.11-r4.ebuild b/dev-util/clazy/clazy-1.11-r4.ebuild
new file mode 100644
index 000000000000..81393e677b0e
--- /dev/null
+++ b/dev-util/clazy/clazy-1.11-r4.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=17
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake llvm python-any-r1
+
+DESCRIPTION="Compiler plugin which allows clang to understand Qt semantics"
+HOMEPAGE="https://apps.kde.org/clazy"
+SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+
+LICENSE="LGPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="<sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):="
+DEPEND="${RDEPEND}"
+BDEPEND="test? ( ${PYTHON_DEPS} )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-regex-detect.patch
+ "${FILESDIR}"/${P}-fix-llvm-{15,16,17}.patch
+ "${FILESDIR}"/${P}-jobs-for-tests.patch
+)
+
+llvm_check_deps() {
+ has_version "sys-devel/clang:${LLVM_SLOT}" && has_version "sys-devel/llvm:${LLVM_SLOT}"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+
+ llvm_pkg_setup
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -e '/install(FILES README.md COPYING-LGPL2.txt checks.json DESTINATION/d' \
+ -i CMakeLists.txt || die
+}
+
+src_configure() {
+ export LLVM_ROOT="$(get_llvm_prefix -d ${LLVM_MAX_SLOT})"
+
+ cmake_src_configure
+}
+
+src_test() {
+ # Run tests against built copy, not installed
+ # bug #811723
+ PATH="${BUILD_DIR}/bin:${PATH}" LD_LIBRARY_PATH="${BUILD_DIR}/lib" cmake_src_test
+}
diff --git a/dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch b/dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch
new file mode 100644
index 000000000000..6550b63a3506
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch
@@ -0,0 +1,38 @@
+From a9aabd821d8be7932c954e1cdd8d4e10f38f8785 Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@gmail.com>
+Date: Mon, 14 Aug 2023 18:16:01 +0200
+Subject: [PATCH] Fix compilation with LLVM 17.0.0 (rc2)
+
+Change-Id: I9d3fc86185c1e7c86145da043e1982d2979b36e9
+---
+ .../manuallevel/unexpected-flag-enumerator-value.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp
++++ b/src/checks/manuallevel/unexpected-flag-enumerator-value.cpp
+@@ -61,8 +61,13 @@ static bool isIntentionallyNotPowerOf2(E
+ if (val.isMask() && val.countTrailingOnes() >= MinOnesToQualifyAsMask)
+ return true;
+
++#if LLVM_VERSION_MAJOR >= 17
++ if (val.isShiftedMask() && val.popcount() >= MinOnesToQualifyAsMask)
++ return true;
++#else
+ if (val.isShiftedMask() && val.countPopulation() >= MinOnesToQualifyAsMask)
+ return true;
++#endif
+
+ if (clazy::contains_lower(en->getName(), "mask"))
+ return true;
+@@ -158,7 +163,11 @@ void UnexpectedFlagEnumeratorValue::Visi
+
+ for (EnumConstantDecl* enumerator : enumerators) {
+ const auto &initVal = enumerator->getInitVal();
++#if LLVM_VERSION_MAJOR >= 17
++ if (!initVal.isPowerOf2() && !initVal.isZero() && !initVal.isNegative()) {
++#else
+ if (!initVal.isPowerOf2() && !initVal.isNullValue() && !initVal.isNegative()) {
++#endif
+ if (isIntentionallyNotPowerOf2(enumerator))
+ continue;
+ const auto value = enumerator->getInitVal().getLimitedValue();
diff --git a/dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch b/dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch
new file mode 100644
index 000000000000..372aed3ca09a
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch
@@ -0,0 +1,41 @@
+From ab8993c9e10e09cb24210f76bb5e67f01bb37a9e Mon Sep 17 00:00:00 2001
+From: Pino Toscano <pino@kde.org>
+Date: Thu, 17 Nov 2022 19:09:47 +0100
+Subject: [PATCH] tests: add -j/--jobs option for run_tests.py
+
+This way it is possible to customize the number of parallel jobs to
+spawn for the tests, instead of unconditionally using all available
+CPUs. This can be helpful to run the tests without overloading the
+system.
+
+The default is still the number of available CPUs, so there is no
+behaviour change by default.
+---
+ tests/run_tests.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/run_tests.py b/tests/run_tests.py
+index bf4967d1..ea03ab4c 100755
+--- a/tests/run_tests.py
++++ b/tests/run_tests.py
+@@ -443,6 +443,8 @@ parser.add_argument("--dump-ast", action='store_true',
+ help='Dump a unit-test AST to file')
+ parser.add_argument(
+ "--exclude", help='Comma separated list of checks to ignore')
++parser.add_argument("-j", "--jobs", type=int, default=multiprocessing.cpu_count(),
++ help='Parallel jobs to run (defaults to %(default)s)')
+ parser.add_argument("check_names", nargs='*',
+ help="The name of the check whose unit-tests will be run. Defaults to running all checks.")
+ args = parser.parse_args()
+@@ -460,7 +462,7 @@ _verbose = args.verbose
+ _no_standalone = args.no_standalone
+ _no_fixits = args.no_fixits
+ _only_standalone = args.only_standalone
+-_num_threads = multiprocessing.cpu_count()
++_num_threads = args.jobs
+ _lock = threading.Lock()
+ _was_successful = True
+ _qt5_installation = find_qt_installation(
+--
+2.35.1
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2024-11-10 17:59 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2024-11-10 17:59 UTC (permalink / raw
To: gentoo-commits
commit: 8a50bc5c4107f462921239170c3ff535a8f0a83d
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Sun Nov 10 17:31:12 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 10 17:43:37 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a50bc5c
dev-util/clazy: fix tests
Fiddle with the code to allow testing under gentoo.
- Fix logic that incorrectly adds paths that only work with not installed
builds.
- Use `CMAKE_INSTALL_LIBDIR` from `GNUInstallDirs` to avoid looking up libs with
wrong ABI.
- Install `clazy-standalone` in to the same directory as the corresponding
`clang` binary so it can find headers.
- Skip tests if their dependencies are not satifsfied.
- Don't test qt5, even if installed, so we can ignore the dependencies.
Closes: https://bugs.gentoo.org/811723
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-util/clazy/clazy-1.12.ebuild | 44 +++++++++++++++++--
dev-util/clazy/files/clazy-1.12-INCLUDE_DIRS.patch | 42 ++++++++++++++++++
dev-util/clazy/files/clazy-1.12-LIBRARY_DIRS.patch | 33 ++++++++++++++
.../clazy-1.12-standalone-install-location.patch | 50 ++++++++++++++++++++++
4 files changed, 166 insertions(+), 3 deletions(-)
diff --git a/dev-util/clazy/clazy-1.12.ebuild b/dev-util/clazy/clazy-1.12.ebuild
index b5e819706f76..33919d1d9024 100644
--- a/dev-util/clazy/clazy-1.12.ebuild
+++ b/dev-util/clazy/clazy-1.12.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-LLVM_COMPAT=( 15 16 17 18 )
+LLVM_COMPAT=( {15..18} )
PYTHON_COMPAT=( python3_{10..13} )
inherit cmake llvm-r1 python-any-r1
@@ -30,6 +30,10 @@ PATCHES=(
"${FILESDIR}"/${P}-llvm-18.patch
# Pending: https://invent.kde.org/sdk/clazy/-/merge_requests/131
"${FILESDIR}"/${P}-clang-16-no-src-root.patch
+
+ "${FILESDIR}"/${P}-LIBRARY_DIRS.patch
+ "${FILESDIR}"/${P}-INCLUDE_DIRS.patch
+ "${FILESDIR}"/${P}-standalone-install-location.patch
)
pkg_setup() {
@@ -45,13 +49,47 @@ src_prepare() {
}
src_configure() {
- export LLVM_ROOT="$(get_llvm_prefix -d)"
+ local -x LLVM_ROOT="$(get_llvm_prefix -d)"
+
+ export CI_JOB_NAME_SLUG="qt6"
cmake_src_configure
}
src_test() {
+ # clazy-standalone wants to be installed in the directory of the clang binary,
+ # so it can find the llvm/clang via relative paths.
+ # Requires the standalone-install-location.patch.
+ # Setup the directories and symlink the system include dir for that.
+ local -x LLVM_ROOT="$(get_llvm_prefix -d)"
+ local -x CLANG_ROOT="${LLVM_ROOT//llvm/clang}"
+ mkdir -p "${BUILD_DIR}${CLANG_ROOT}" || die
+
+ ln -s "${CLANG_ROOT}/include" "${BUILD_DIR}${CLANG_ROOT}/include" || die
+
# Run tests against built copy, not installed
# bug #811723
- PATH="${BUILD_DIR}/bin:${PATH}" LD_LIBRARY_PATH="${BUILD_DIR}/lib" cmake_src_test
+ local -x PATH="${BUILD_DIR}/${LLVM_ROOT}/bin:${BUILD_DIR}/bin:${PATH}"
+ local -x LD_LIBRARY_PATH="${BUILD_DIR}/lib"
+
+ # NOTE or DEPEND on "test? ( dev-qt/qtscxml:6[qml] )"
+ local -x CMAKE_SKIP_TESTS=()
+
+ if ! has_version dev-qt/qtscxml:6; then
+ CMAKE_SKIP_TESTS+=(
+ # cannot find -lQt6StateMachine: No such file or directory
+ "old-style-connect"
+ )
+ fi
+
+ if ! has_version dev-qt/qtdeclarative:6; then
+ CMAKE_SKIP_TESTS+=(
+ # lowercase-qml-type-name/main.cpp:3:10: fatal error: 'QtQml/QQmlEngine' file not found
+ "lowercase-qml-type-name"
+ # no-module-include/main.cpp:5:10: fatal error: 'QtQml/QtQml' file not found
+ "no-module-include"
+ )
+ fi
+
+ cmake_src_test
}
diff --git a/dev-util/clazy/files/clazy-1.12-INCLUDE_DIRS.patch b/dev-util/clazy/files/clazy-1.12-INCLUDE_DIRS.patch
new file mode 100644
index 000000000000..23641828804f
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.12-INCLUDE_DIRS.patch
@@ -0,0 +1,42 @@
+From 6e17217d7b77a27bdf77da2c20044e89f112e9b1 Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Sun, 10 Nov 2024 17:19:56 +0100
+Subject: do not inject include dirs with installed llvm
+
+`string(FIND returns` returns `-1` on failure not `FALSE`.
+If `_llvmSourceRoot` is equal to to first directory in `LLVM_INCLUDE_DIRS`
+this would include non-existant directories.
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+diff --git a/cmake/FindClang.cmake b/cmake/FindClang.cmake
+index b4f0b0a..eda8bb5 100644
+--- a/cmake/FindClang.cmake
++++ b/cmake/FindClang.cmake
+@@ -95,8 +95,7 @@ if(CLANG_FOUND)
+ OUTPUT_VARIABLE _llvmSourceRoot
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+- string(FIND "${LLVM_INCLUDE_DIRS}" "${_llvmSourceRoot}" _llvmIsInstalled)
+- if (NOT _llvmIsInstalled)
++ if(NOT "${_llvmSourceRoot}" IN_LIST LLVM_INCLUDE_DIRS)
+ message(STATUS "Detected that llvm-config comes from a build-tree, adding more include directories for Clang")
+ list(APPEND CLANG_INCLUDE_DIRS
+ "${LLVM_INSTALL_PREFIX}/tools/clang/include" # build dir
+diff --git a/cmake/FindLLVM.cmake b/cmake/FindLLVM.cmake
+index c625eeb..1e1e902 100644
+--- a/cmake/FindLLVM.cmake
++++ b/cmake/FindLLVM.cmake
+@@ -140,8 +140,7 @@ if (LLVM_FOUND)
+ OUTPUT_VARIABLE _llvmSourceRoot
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+- string(FIND "${LLVM_INCLUDE_DIRS}" "${_llvmSourceRoot}" _llvmIsInstalled)
+- if (NOT _llvmIsInstalled)
++ if(NOT "${_llvmSourceRoot}" IN_LIST LLVM_INCLUDE_DIRS)
+ list(APPEND LLVM_INCLUDE_DIRS "${LLVM_INSTALL_PREFIX}/include")
+ endif()
+ endif()
+--
+2.47.0
+
diff --git a/dev-util/clazy/files/clazy-1.12-LIBRARY_DIRS.patch b/dev-util/clazy/files/clazy-1.12-LIBRARY_DIRS.patch
new file mode 100644
index 000000000000..44d59ce9c3f9
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.12-LIBRARY_DIRS.patch
@@ -0,0 +1,33 @@
+From d04f0203febdeac38c4b085babb1183747c2edfb Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Sun, 10 Nov 2024 17:19:20 +0100
+Subject: do not inject lib dirs with installed llvm
+
+Including `${LLVM_INSTALL_PREFIX}/lib` in the `LINK_DIRECTORIES` only works,
+when lib is the correct LIBDIR for the current arch.
+Normally you would use `CMAKE_INSTALL_LIBDIR`, unless you know better.
+
+As a bonus we avoid duplicates.
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4215e49..9f77fb3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -106,7 +106,11 @@ include(ClazySources.cmake)
+
+ include_directories(${CMAKE_BINARY_DIR})
+ include_directories(${CLANG_INCLUDE_DIRS} ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/src)
+-link_directories("${LLVM_INSTALL_PREFIX}/lib" ${LLVM_LIBRARY_DIRS})
++link_directories(${LLVM_LIBRARY_DIRS})
++
++if(NOT "${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" IN_LIST LLVM_LIBRARY_DIRS)
++ link_directories("${LLVM_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
++endif()
+
+ set(clang_tooling_refactoring_lib clangToolingRefactoring)
+
+--
+2.47.0
+
diff --git a/dev-util/clazy/files/clazy-1.12-standalone-install-location.patch b/dev-util/clazy/files/clazy-1.12-standalone-install-location.patch
new file mode 100644
index 000000000000..76ff787a1bea
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.12-standalone-install-location.patch
@@ -0,0 +1,50 @@
+From 3912afc2e9cec14299e9866014a709a55a07be2e Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Sun, 10 Nov 2024 17:20:42 +0100
+Subject: Install clazy-standalone so relative path look-up works
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+fatal error: ‘stddef.h’ file not found, while using clazy-standalone Be sure the
+clazy-standalone binary is located in the same folder as the
+clang binary.
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9f77fb3..c67065e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,6 +199,12 @@ endmacro()
+
+ set(SYMBOL_FILE Lazy.exports)
+
++execute_process(
++ COMMAND ${LLVM_CONFIG_EXECUTABLE} --bindir
++ OUTPUT_VARIABLE LLVM_BIN_DIR
++ OUTPUT_STRIP_TRAILING_WHITESPACE
++)
++
+ if (NOT CLAZY_BUILD_WITH_CLANG)
+ set(CLAZY_MINI_AST_DUMPER_SRCS src/MiniAstDumper.cpp)
+ add_clang_plugin(ClazyPlugin ${CLAZY_PLUGIN_SRCS} ${CLAZY_MINI_AST_DUMPER_SRCS})
+@@ -315,9 +321,14 @@ else()
+
+ target_link_libraries(clazy-standalone clazyPlugin)
+
+- install(TARGETS clazy-standalone DESTINATION bin PERMISSIONS OWNER_WRITE OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)
++ install(TARGETS clazy-standalone DESTINATION ${LLVM_BIN_DIR} PERMISSIONS OWNER_WRITE OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE)
++
+ endif()
+
++set_target_properties(clazy-standalone PROPERTIES
++ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${LLVM_BIN_DIR}"
++)
++
+ function(to_raw_string_literal input_string output_string)
+ if (MSVC)
+ # Work around "C2026: string too big, trailing characters truncated"
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/
@ 2024-11-10 21:43 Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2024-11-10 21:43 UTC (permalink / raw
To: gentoo-commits
commit: b33a4a865fb21ae991014499c19df4905fe6db24
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Sun Nov 10 21:27:48 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 10 21:43:19 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b33a4a86
dev-util/clazy: move clazy script
Putting the clazy script into CMAKE_RUNTIME_OUTPUT_DIRECTORY gets it covered by
the already set PATH.
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-util/clazy/clazy-1.12.ebuild | 5 +++--
.../files/clazy-1.12-clazy-install-location.patch | 25 ++++++++++++++++++++++
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/dev-util/clazy/clazy-1.12.ebuild b/dev-util/clazy/clazy-1.12.ebuild
index bcf6a9d8df19..a2e4a824b8d5 100644
--- a/dev-util/clazy/clazy-1.12.ebuild
+++ b/dev-util/clazy/clazy-1.12.ebuild
@@ -43,6 +43,7 @@ PATCHES=(
"${FILESDIR}"/${P}-LIBRARY_DIRS.patch
"${FILESDIR}"/${P}-INCLUDE_DIRS.patch
"${FILESDIR}"/${P}-standalone-install-location.patch
+ "${FILESDIR}"/${P}-clazy-install-location.patch
)
pkg_setup() {
@@ -78,10 +79,10 @@ src_test() {
# Run tests against built copy, not installed
# bug #811723
- local -x PATH="${BUILD_DIR}/${LLVM_ROOT}/bin:${BUILD_DIR}/bin:${BUILD_DIR}:${PATH}"
+ local -x PATH="${BUILD_DIR}/${LLVM_ROOT}/bin:${BUILD_DIR}/bin:${PATH}"
local -x LD_LIBRARY_PATH="${BUILD_DIR}/lib"
- chmod +x "${BUILD_DIR}"/clazy || die
+ chmod +x "${BUILD_DIR}/bin/clazy" || die
cmake_src_test
}
diff --git a/dev-util/clazy/files/clazy-1.12-clazy-install-location.patch b/dev-util/clazy/files/clazy-1.12-clazy-install-location.patch
new file mode 100644
index 000000000000..651dcf282b08
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.12-clazy-install-location.patch
@@ -0,0 +1,25 @@
+From b5600e28b0720a9a43d20717e79ba26dae6b9359 Mon Sep 17 00:00:00 2001
+From: Paul Zander <negril.nx+gentoo@gmail.com>
+Date: Sun, 10 Nov 2024 22:22:07 +0100
+Subject: [PATCH] move clazy script to CMAKE_RUNTIME_OUTPUT_DIRECTORY
+
+Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 765083c..c7c1cea 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -229,8 +229,8 @@ if (NOT CLAZY_BUILD_WITH_CLANG)
+ endif()
+ file(RELATIVE_PATH BIN_RELATIVE_LIBDIR "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}")
+ file(RELATIVE_PATH BIN_RELATIVE_SHAREDIR "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_FULL_DATAROOTDIR}")
+- configure_file(${CMAKE_CURRENT_LIST_DIR}/clazy.cmake ${CMAKE_BINARY_DIR}/clazy @ONLY)
+- install(PROGRAMS ${CMAKE_BINARY_DIR}/clazy DESTINATION bin)
++ configure_file(${CMAKE_CURRENT_LIST_DIR}/clazy.cmake ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/clazy @ONLY)
++ install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/clazy DESTINATION bin)
+ else()
+ install(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/clazy.bat DESTINATION ${CMAKE_INSTALL_BINDIR})
+ if(MSVC)
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-11-10 21:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-14 8:22 [gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-11-10 21:43 Sam James
2024-11-10 17:59 Sam James
2024-03-04 22:18 Andreas Sturmlechner
2022-10-25 18:36 Andreas Sturmlechner
2022-06-14 7:44 Andreas Sturmlechner
2021-12-13 0:11 Sam James
2021-01-07 17:30 Andreas Sturmlechner
2020-06-30 12:13 Andreas Sturmlechner
2020-04-09 21:37 Andreas Sturmlechner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox