[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2024-03-04 Thread Andreas Sturmlechner
commit: 1ea0e9a3ed747a8d800d1a1c25abdbd03e5b8275
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Mon Mar  4 16:06:48 2024 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Mon Mar  4 22:17:40 2024 +
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  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 ..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="
+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  = 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 ..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 
+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
+



[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2022-10-25 Thread Andreas Sturmlechner
commit: 6575b1a0d95279f9bbd058a4426cb7b3a396c4e2
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Tue Oct 25 17:55:33 2022 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Tue Oct 25 18:35:20 2022 +
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  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 ..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="
+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 
, 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 ,
+  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;
+ 

[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2022-06-14 Thread Andreas Sturmlechner
commit: 851a6bca2b859e267983e9d5b374d06521b32cc7
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Tue Jun 14 07:41:56 2022 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Tue Jun 14 07:43:47 2022 +
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  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..
--- 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="https://invent.kde.org/sdk/clazy/-/commit/b74c8729b7b71528c1528579435cda7fdb5d31b4
-
-From: Sergio Martins 
-Date: Thu, 2 Dec 2021 11:05:51 +
-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 , 
clang::FileID id, bool *in
- }
- 
- #if LLVM_VERSION_MAJOR >= 12
--inline clang::Lexer getLexer(clang::FileID id, 
llvm::Optional inputFile,
-- const clang::SourceManager , const 
clang::LangOptions )
--{
--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 , const 
clang::LangOptions )
--{
--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 , 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..
--- 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 
-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 

[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2021-12-14 Thread Sam James
commit: 4a53b08273b86eed76a989e647aecccfb485b2d4
Author: Sam James  gentoo  org>
AuthorDate: Tue Dec 14 08:22:09 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Dec 14 08:22:26 2021 +
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  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 ..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 
+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



[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2021-12-12 Thread Sam James
commit: af5f598a4e43dd87b224e4281b167773c3a5d74e
Author: Sam James  gentoo  org>
AuthorDate: Fri Dec 10 23:24:37 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Dec 13 00:11:29 2021 +
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  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="https://invent.kde.org/sdk/clazy/-/commit/b74c8729b7b71528c1528579435cda7fdb5d31b4
+
+From: Sergio Martins 
+Date: Thu, 2 Dec 2021 11:05:51 +
+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 , 
clang::FileID id, bool *in
+ }
+ 
+ #if LLVM_VERSION_MAJOR >= 12
+-inline clang::Lexer getLexer(clang::FileID id, 
llvm::Optional inputFile,
+- const clang::SourceManager , const 
clang::LangOptions )
+-{
+-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 , const 
clang::LangOptions )
+-{
+-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 , 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 ..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 
+Date: Thu, 2 Dec 2021 11:31:58 +
+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



[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2021-01-07 Thread Andreas Sturmlechner
commit: a478a7675801c0a67cf3ea519ed7f752e114837f
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Thu Jan  7 16:57:04 2021 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Thu Jan  7 17:30:19 2021 +
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  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..000
--- 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..000
--- 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 
-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)

[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2020-06-30 Thread Andreas Sturmlechner
commit: a6de9965d65b29942c78a8406ad57684aef0941b
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Tue Jun 30 10:37:38 2020 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Tue Jun 30 12:13:35 2020 +
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  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 000..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 000..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 
+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)
+-  

[gentoo-commits] repo/gentoo:master commit in: dev-util/clazy/, dev-util/clazy/files/

2020-04-09 Thread Andreas Sturmlechner
commit: 4a37476f9a524d498204ba6242ac358de3041653
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Thu Apr  9 18:57:20 2020 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Thu Apr  9 21:36:24 2020 +
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  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 000..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 
+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
+