summaryrefslogtreecommitdiff
path: root/dev-util/clazy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
commit93a93e9a3b53c1a73142a305ea1f8136846942ee (patch)
treeb9791a06ab3284e27b568412c59316c66240c682 /dev-util/clazy
parent2771f79232c273bc2a57d23bf335dd81ccf6af28 (diff)
gentoo resync : 22.12.2021
Diffstat (limited to 'dev-util/clazy')
-rw-r--r--dev-util/clazy/Manifest5
-rw-r--r--dev-util/clazy/clazy-1.10-r2.ebuild (renamed from dev-util/clazy/clazy-1.10.ebuild)39
-rw-r--r--dev-util/clazy/files/clazy-1.10-gcc-build.patch44
-rw-r--r--dev-util/clazy/files/clazy-1.10-llvm-earlier-than-12.patch20
-rw-r--r--dev-util/clazy/files/clazy-1.10-use-c++17.patch20
5 files changed, 114 insertions, 14 deletions
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index 8fe6c253a91a..aa07473e1594 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -1,7 +1,10 @@
+AUX clazy-1.10-gcc-build.patch 1571 BLAKE2B a6409a491fc142690fe34d15415a4bd0aa90052cfc900d45fa81fc679497cff979d4c9e63319f315a97f3395fad8f39b1aaea30bbff994ab7e0c6af4f8545be0 SHA512 1ecfa3d9899f685996933f3f1d476537e942f37cb4f28d46c87bb5c14575d403407beac4a091966225e00d495a9d5aaedaea88e313fdad1396e14e5adaf0c59d
+AUX clazy-1.10-llvm-earlier-than-12.patch 692 BLAKE2B 40b2920f7017031f99603cbeb5f823445309dbf3bd774cb59c70ef15f556f15835f49143ed884be36620adf61511075ce338c9517fcca8ad16af0a66815999d9 SHA512 56e5d9b44ab9661d4a1bf2e550f12a683d119bf6f784287f64971a76d50009a5fa85950f86307887428a8a929da05ea067b1c15a0fd9dd271e0a8655cc0c2a32
+AUX clazy-1.10-use-c++17.patch 1159 BLAKE2B e7ec20f4c879d13046499f308c732e966a9c75ae23ffd6657a61b8472974aadee947f5ac0ce4a246589d2c2e4f22f63db8ebb90b31df28cdc66b75e347df8661 SHA512 67d3ab6a87217e8ca5da68789d06b771cda6ccae8fd69d36ca60f6b68edfeb87078ed169844a10943340789e5452a470f3040d854f38a3ad003f7e688835977d
AUX clazy-1.9-llvm12.patch 3056 BLAKE2B 7c090b17a3a598075fdcaec04df4efc0fb6c2a8d496cc8a9bc3b345eb8bc8f59c6aa4a8d7036c6c6717c5da05d5acd22544a86e0c711cb5f94e3433ffd871351 SHA512 42775ac235092241419315e4282dd7cd5953b55db0b58826ce50ae4a4520833e6575a17d6ace9ea559240bc29d033ad1b16af1f5fb5aed7f751a03e07650e7a5
AUX clazy-1.9-llvm13.patch 1098 BLAKE2B 6933e7f9e159e4e4d10bcacf67a7f384ca1782d84606e2cde85e4f2bc5007f25e1fef96129de366c9be013ef2f602f7e34a4388576b404c0a913625de99992bf SHA512 a8d4c59236b9329ad1a0db4fc3a21eebc16faa19888c21f6fdf53a3d242dfc955f0902ba95e38f1f0666524d926611b353925e4519e60cca7d6e5d69a3f107f4
DIST clazy-1.10.tar.xz 398920 BLAKE2B 1cdc160de21363c7dc9c93ea7e780412a4971b18e97c7ec6e06f1c7450c56e0fbbdb7592d6b92ae53e4c161f6d9abca205984f83b68646f04ea11d63e3c45fa6 SHA512 59dd8c6903bcc239dfc356804cab265597a771de3858a6add4877149e0e7875b3c9ddae9aeec889c9102fb9ec6b0125bb8a786344e47872b01ba87425ba021eb
DIST clazy-1.9.tar.xz 394856 BLAKE2B 641ca46a31475cf7bd03ba921e390cb2712362dc97b960a519e05c47049927f805d3ef6f1c756b96d3483e8f4b75e2dc41a2419a462ed2e45cbd08c88c07f933 SHA512 2e8bec44a027366263de23c50d14192e310fd38fa2b369afb21413da9cb78da9882b2153daf1784c4c9076cc62e2867b5211c75ff9a1eabcb583e405f20f5912
-EBUILD clazy-1.10.ebuild 1145 BLAKE2B 5a3a15546ed60b967f430fdc877ba639c9cc5dfa3fc06cdf2146ebeb0dc8e0f38a3093c30063000d37ffe479fef5c2cc1035acf7c4f74909327722a2d5187634 SHA512 9579e8dbda318f019ee1216cc79659cc668cd022b77d7c53f305e6d108af24ce129ff3cca1bdf05d159f9c4067bcfddc0737fa05f82e94201af1387744ba5b83
+EBUILD clazy-1.10-r2.ebuild 1302 BLAKE2B 0df22a8367cfd50acd840237d26b0b1716515bbf02e6bf7cb267cfc86192e1603dde0ed000dc30f0d4d96f27467280a013669207780cad37759810247800af15 SHA512 df2f27b443ecf45387d3ec350a66f2f5e2f4ba4606bbe9cc121cbbbdacf9d34c10d116127c6a6d7661c8699cd4286311a1a01da4f3105db45631d09327bfde1f
EBUILD clazy-1.9.ebuild 1048 BLAKE2B 19aab05c1a0ea51e60164834cd1d18c22537a35224258d5e37bee821b384efa90bbfe98b38362ebed62c667c8ec3e0947cd1ea5ebb2517f1d8ca4f621a135859 SHA512 5a1adc300ca1fd975e07b97b4fb5bce068c2b99afbbdb5701df327060bea1f2afbb77d00bb2ba5d9be795c84641ee235ab076c1a83f1075ad0ecddce260705dd
MISC metadata.xml 318 BLAKE2B 922a5e32e706b2976c5f359a14194d268d3f499398576c80ce5fad8c0fcea0fbf048de4480a80a6a1889c88b8b6c14147654a3ab4d5ffbcc258c2290da63f6d1 SHA512 614cb8dda7ad2088e5d6ef39b449bb4be0ac72cd0231c320188d76d1816dce6490c5114bb4798112c4b11d99d30a9e82ff8fcf08ffa8c049589682a5e38208f6
diff --git a/dev-util/clazy/clazy-1.10.ebuild b/dev-util/clazy/clazy-1.10-r2.ebuild
index 160c50c5c641..bcb85e9d4148 100644
--- a/dev-util/clazy/clazy-1.10.ebuild
+++ b/dev-util/clazy/clazy-1.10-r2.ebuild
@@ -3,7 +3,9 @@
EAPI=7
-inherit cmake
+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"
@@ -11,14 +13,29 @@ SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
LICENSE="LGPL-2+"
SLOT="0"
-KEYWORDS="~amd64 arm64 ~x86"
-IUSE=""
+KEYWORDS="amd64 arm64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
-RDEPEND="
- >=sys-devel/clang-8.0:=
- >=sys-devel/llvm-8.0:=
-"
+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
@@ -28,12 +45,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-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
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