summaryrefslogtreecommitdiff
path: root/dev-util/clazy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-06-08 15:45:39 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-06-08 15:45:39 +0100
commitd5599da3055bf9b900513a61c3c6e4bdbb524503 (patch)
treeb64a792286dd490c9d4fc2c46bbbaa64804efc61 /dev-util/clazy
parentcfeee79886441e92c8ee094e45b9bcdc9c79137a (diff)
gentoo auto-resync : 08:06:2023 - 15:45:39
Diffstat (limited to 'dev-util/clazy')
-rw-r--r--dev-util/clazy/Manifest2
-rw-r--r--dev-util/clazy/clazy-1.11-r3.ebuild56
-rw-r--r--dev-util/clazy/files/clazy-1.11-fix-llvm-16.patch83
3 files changed, 141 insertions, 0 deletions
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index ddf3c13c994e..70f3576c0999 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -1,5 +1,7 @@
AUX clazy-1.11-fix-llvm-15.patch 12053 BLAKE2B d329cb3a93a7b9cf6256590e281c6f13955eb8a83a9c0ef17a8d5fe719ff1f09164aec56ea8a31391adb5a9490ce6a4e8336a32dc22f872182e5491d81b89e70 SHA512 285e73848d9fc7bf8eada208660cb8d42c245617205be9bae708e6f9e0d8b06ba814a305b33d641589f8a0ee17a71156cea2450fd2e7d5a342389eada5421e34
+AUX clazy-1.11-fix-llvm-16.patch 3418 BLAKE2B bee024e761008e6d1bf14f4ac285fecab7e1e5f6870d230128f6e5f3ef222a8bb75bdfa4c7e74f0249803e3c8ff915e46e94c4fa77ffd98ea71158095a76be1b SHA512 8a20746c71dab10d6c10c2d8dfc65da964cd5a52c1ac2194e3c6da1ff6430f9689288086f763d18cb496a1195492049450639bbfad5b621153f718e27e755b93
AUX clazy-1.11-fix-regex-detect.patch 859 BLAKE2B 6a953c3927dcc1a3aac5aab55c01eb1eaf977f40c96c26f57032608de8e0d709ae6bf67f5d04f991ee14ded80023a8faf19b9ea18f9a2e2dd9dc19b2831ff58c SHA512 8bd1ab72bf36620250a228f9cb45fe403853d16c5eec8704c6980405ffca71cfcea82f9587b3b3f748ab623ecee757cb8adc54c7a137c5070eb04e26d06fab36
DIST clazy-1.11.tar.xz 404088 BLAKE2B 1a69fe07ef81a0efe3c9db9129083247d60943592967f705d62d3859039cec250673eecc06184f70d134cbab85708d957b0a085beff8b3e46325a69547e005b7 SHA512 6a7c162392dd30aea29669275cea814d6daccf7931b8cdb20997f9bbff5619832d5461a6d0f854ecbc4726e52b6937c4f9cb8651087ffe73676c04239a38ca2b
EBUILD clazy-1.11-r2.ebuild 1262 BLAKE2B a2248b98d2e2ecbe31bfa1f4d214729ce32b5aae8cc3f1e34c7d539b5ee44b33e9d94c656008eb351d31894eaa772d2aa4902b0789216aed152f4b760cbe2b39 SHA512 66fc1adf2fe50dfbac91e9310b734a102797a881f1dbf4e78bb0fbcf8989b82c2dd60c47efa2d9b0711a540eefa93c1174e475e2a1062a3db3a7dfa9bdd21343
+EBUILD clazy-1.11-r3.ebuild 1271 BLAKE2B 760a866907064b8738df1440040333ce807a01cbc546d49ca91701e715666e10b3322fe555b5e9dd2b93b4f99ecd2af6b40897eb5a4bb65c56e9377824de5a9e SHA512 8a73b2ec153a7b9839ce85d407a141cf4af953810091f8c70340c53b4d6825cbe3438abb69beb5199ef55f10e51870b10e366e7bdfc49d51e235811c61298156
MISC metadata.xml 318 BLAKE2B 922a5e32e706b2976c5f359a14194d268d3f499398576c80ce5fad8c0fcea0fbf048de4480a80a6a1889c88b8b6c14147654a3ab4d5ffbcc258c2290da63f6d1 SHA512 614cb8dda7ad2088e5d6ef39b449bb4be0ac72cd0231c320188d76d1816dce6490c5114bb4798112c4b11d99d30a9e82ff8fcf08ffa8c049589682a5e38208f6
diff --git a/dev-util/clazy/clazy-1.11-r3.ebuild b/dev-util/clazy/clazy-1.11-r3.ebuild
new file mode 100644
index 000000000000..b6392f00d182
--- /dev/null
+++ b/dev-util/clazy/clazy-1.11-r3.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_MAX_SLOT=16
+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}.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-16.patch b/dev-util/clazy/files/clazy-1.11-fix-llvm-16.patch
new file mode 100644
index 000000000000..a5759060c112
--- /dev/null
+++ b/dev-util/clazy/files/clazy-1.11-fix-llvm-16.patch
@@ -0,0 +1,83 @@
+From a05ac7eb6f6198c3f478bd7b5b4bfc062a8d63cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ivan=20=C4=8Cuki=C4=87?= <ivan.cukic@kdab.com>
+Date: Tue, 7 Feb 2023 11:06:19 +0100
+Subject: [PATCH] Adapt to API changes in clang/llvm 16
+
+---
+ src/SourceCompatibilityHelpers.h | 17 ++++++++++++-----
+ src/checkbase.h | 1 +
+ src/checks/level0/lambda-in-connect.cpp | 2 +-
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index c1a23a4b..5e2dc606 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -107,7 +107,11 @@ inline clang::tooling::Replacements& DiagnosticFix(clang::tooling::Diagnostic &d
+
+ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *invalid)
+ {
+-#if LLVM_VERSION_MAJOR >= 12
++#if LLVM_VERSION_MAJOR >= 16
++ auto buffer = sm.getBufferOrNone(id);
++ *invalid = !buffer.has_value();
++ return buffer;
++#elif LLVM_VERSION_MAJOR >= 12
+ auto buffer = sm.getBufferOrNone(id);
+ *invalid = !buffer.hasValue();
+ return buffer;
+@@ -116,11 +120,12 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
+ #endif
+ }
+
+-#if LLVM_VERSION_MAJOR >= 12
+-
++#if LLVM_VERSION_MAJOR >= 16
++#define GET_LEXER(id, inputFile, sm, lo) \
++clang::Lexer(id, inputFile.value(), sm, lo)
++#elif LLVM_VERSION_MAJOR >= 12
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile.getValue(), sm, lo)
+-
+ #else
+ #define GET_LEXER(id, inputFile, sm, lo) \
+ clang::Lexer(id, inputFile, sm, lo)
+@@ -144,7 +149,9 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+
+-#if LLVM_VERSION_MAJOR >= 15
++#if LLVM_VERSION_MAJOR >= 16
++using OptionalFileEntryRef = clang::CustomizableOptional<clang::FileEntryRef>;
++#elif LLVM_VERSION_MAJOR >= 15
+ using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
+ #else
+ using OptionalFileEntryRef = const clang::FileEntry*;
+diff --git a/src/checkbase.h b/src/checkbase.h
+index 02f6a6bf..6a8c634b 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -93,6 +93,7 @@ public:
+ void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+ 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;
+ };
+diff --git a/src/checks/level0/lambda-in-connect.cpp b/src/checks/level0/lambda-in-connect.cpp
+index b0da926f..1ba1126f 100644
+--- a/src/checks/level0/lambda-in-connect.cpp
++++ b/src/checks/level0/lambda-in-connect.cpp
+@@ -71,7 +71,7 @@ void LambdaInConnect::VisitStmt(clang::Stmt *stmt)
+
+ for (auto capture : captures) {
+ if (capture.getCaptureKind() == clang::LCK_ByRef) {
+- VarDecl *declForCapture = capture.getCapturedVar();
++ auto *declForCapture = capture.getCapturedVar();
+ if (declForCapture && declForCapture != receiverDecl && clazy::isValueDeclInFunctionContext(declForCapture))
+ emitWarning(capture.getLocation(), "captured local variable by reference might go out of scope before lambda is called");
+ }
+--
+GitLab
+