summaryrefslogtreecommitdiff
path: root/dev-util/clazy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-03-04 23:43:21 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-03-04 23:43:21 +0000
commita45eaba8b74340f1b166bb2ba96d61d41fc11fad (patch)
treea8e2641871efc53332f6cdbe36e9ede8d2770050 /dev-util/clazy
parentd0fafa709f2b77dc0e70c99118520000965e4b5a (diff)
gentoo auto-resync : 04:03:2024 - 23:43:21
Diffstat (limited to 'dev-util/clazy')
-rw-r--r--dev-util/clazy/Manifest3
-rw-r--r--dev-util/clazy/clazy-1.11-r4.ebuild57
-rw-r--r--dev-util/clazy/files/clazy-1.11-fix-llvm-17.patch38
-rw-r--r--dev-util/clazy/files/clazy-1.11-jobs-for-tests.patch41
4 files changed, 139 insertions, 0 deletions
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index 58cf50559a14..f52da517b51b 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -1,6 +1,9 @@
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-llvm-17.patch 1546 BLAKE2B fdc8a1387c6db82c993ec935bcbbe1e58f6e754f90efb65f9f8da2ab00e2240a9a7dcc287f3055a3a86e91f7dd8b6ddb8c1df9e7c4bfc9831f401fea14055c4f SHA512 90c60cc4d6b589ddba1a5b6b9bc077dd79a48894bcdce0cb99d51e768ee325b21cc83e56e57f1cfd1d4bb2c7e443d663c2dec55aca5e07df8db0ce19f0fa99c8
AUX clazy-1.11-fix-regex-detect.patch 859 BLAKE2B 6a953c3927dcc1a3aac5aab55c01eb1eaf977f40c96c26f57032608de8e0d709ae6bf67f5d04f991ee14ded80023a8faf19b9ea18f9a2e2dd9dc19b2831ff58c SHA512 8bd1ab72bf36620250a228f9cb45fe403853d16c5eec8704c6980405ffca71cfcea82f9587b3b3f748ab623ecee757cb8adc54c7a137c5070eb04e26d06fab36
+AUX clazy-1.11-jobs-for-tests.patch 1626 BLAKE2B 58d8c059fa631c2c534e6ec2c33268af88ef95e5ed7b1b3bb37d189d61bd998143a7fa5d38d40a925c6dd59592e0df30c22d42c04cb3f1bb5d915afad2b879e9 SHA512 1fd25f986d8ecf092fe3dcf73a61609f183e1d90d4926676cd8c4de34326a8ed7610a05dee5eafe91d4a5b830f4423c5b66be3f049a26b632e1e094f3f2ac446
DIST clazy-1.11.tar.xz 404088 BLAKE2B 1a69fe07ef81a0efe3c9db9129083247d60943592967f705d62d3859039cec250673eecc06184f70d134cbab85708d957b0a085beff8b3e46325a69547e005b7 SHA512 6a7c162392dd30aea29669275cea814d6daccf7931b8cdb20997f9bbff5619832d5461a6d0f854ecbc4726e52b6937c4f9cb8651087ffe73676c04239a38ca2b
EBUILD clazy-1.11-r3.ebuild 1268 BLAKE2B 66ddb23a35b12e6d07856046a259be728452b2cb8c9971f2d4a0b7b89d2c66df6a67897a354a6b7873e9582f6046bdb1e3c32fed57f8127411706279f6be98da SHA512 001bb79e990f315e8cbc7ee97f3081e5eaadc731a6bab17c1c78331aaf89353b70dc7e13e4917869c61eefd18f6d3e89c35043089d51c9d925bcb5990de52a1f
+EBUILD clazy-1.11-r4.ebuild 1315 BLAKE2B 9547aef3e9979dca31855ea38ff664f718b579c011a06b9ce4643ed3124301b6563ccd6b59bc73ffb010083980d5d6d49fff4404d613b5a6064159ac542908aa SHA512 c1cb9a1be34645dce14b2d5bac309e489a4926e98caa7d2fd180d6c3aa1f531bfbca9f38d52f14bee7111da5447c4068853e4ebb58bbf132e73cdec4a4e1d67d
MISC metadata.xml 318 BLAKE2B 922a5e32e706b2976c5f359a14194d268d3f499398576c80ce5fad8c0fcea0fbf048de4480a80a6a1889c88b8b6c14147654a3ab4d5ffbcc258c2290da63f6d1 SHA512 614cb8dda7ad2088e5d6ef39b449bb4be0ac72cd0231c320188d76d1816dce6490c5114bb4798112c4b11d99d30a9e82ff8fcf08ffa8c049589682a5e38208f6
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
+