summaryrefslogtreecommitdiff
path: root/dev-util/clazy
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-11-10 21:02:07 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-11-10 21:02:07 +0000
commit0ca3f86640e2f1f361da895b997c43bac22090a1 (patch)
tree029b42e7b1425ce16f4299635e5caad713501ead /dev-util/clazy
parentbe94ae04eee564451203d45977c2ef7c7ace1580 (diff)
gentoo auto-resync : 10:11:2024 - 21:02:06
Diffstat (limited to 'dev-util/clazy')
-rw-r--r--dev-util/clazy/Manifest5
-rw-r--r--dev-util/clazy/clazy-1.12.ebuild55
-rw-r--r--dev-util/clazy/files/clazy-1.12-INCLUDE_DIRS.patch42
-rw-r--r--dev-util/clazy/files/clazy-1.12-LIBRARY_DIRS.patch33
-rw-r--r--dev-util/clazy/files/clazy-1.12-standalone-install-location.patch50
5 files changed, 179 insertions, 6 deletions
diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest
index 2cf6afaa8f8e..8ec4eccf7653 100644
--- a/dev-util/clazy/Manifest
+++ b/dev-util/clazy/Manifest
@@ -3,12 +3,15 @@ AUX clazy-1.11-fix-llvm-16.patch 3418 BLAKE2B bee024e761008e6d1bf14f4ac285fecab7
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
+AUX clazy-1.12-INCLUDE_DIRS.patch 1615 BLAKE2B 2e1d0898d12fe58f11e4286d56085a6b608e338ec0095c642e7b551d84269ca8d1e244f7dc88c95d3b264434b3724e0999fe9396525ae83c4e3f9740ab3163cb SHA512 86305b07f6099d135a1a397bd20b7dba5f51d3b9971cd63886306077b873d410b108baad2c9b21e2470a0bfaa66e2fe1a40ff37162713bdfea43fb259ed83e56
+AUX clazy-1.12-LIBRARY_DIRS.patch 1161 BLAKE2B 6210b53e9219042c79605f84598dd9e34bd2b0ebb99987ca6a34ab53e76553befdbe413d53bf213a5e095b2939c40e6664cb7ae9ef135a1f56bb117c79c0cd57 SHA512 804abd9e01b6f4e36849e062dae8b36863abc0710a2c245aa7043a3295bded0bbcbee4fcec64a9c63ae2973f520a5c1f79d81322c4c68f41e1b3d1840e619bf2
AUX clazy-1.12-clang-16-no-src-root.patch 2167 BLAKE2B 84f2cd26abea61998f4e78cb325126bd61b539924bbb1140793b888db8c80b891afb21700472a8d44d0c37e6da613350be570802ceffcd342463854bcd45af6f SHA512 da93e8320184f832c20f390d9b77a9829972cb9d95ca801d072efc41fc88fd584fc423a000c40621f86040fe5a9d3468382f390a7b525b4677a1e7163004d466
AUX clazy-1.12-fix-tests-Qt-detect-1.patch 3388 BLAKE2B 4aace0f453e84a3e00651eda4a30dc1b84032789d22a7cedd1eee7338d5f52f49f03e0e92a1220de187ad90e9a3cf9ab14c8f5e1f57559d8a385f3bd705a771b SHA512 926a8fbfd7134b9e1b553273e39817cb35d5e6b5d29ed43b77b5eedef9faa6d9cde7441923d5bf6eaf2b19b2d7c7a97b23ae866ff1b8b5e3a02754a2234183f6
AUX clazy-1.12-fix-tests-Qt-detect-2.patch 5164 BLAKE2B 7ce4d58f5ca52df4ce229c7892cec13754e557000e755f7f3954b7810aacad3e5d001e0ea90422191c5869b954387cb22baff2e485666e9f0ef2803819587a4c SHA512 3b84aa5f407402a4abef33090f2efc60cc8dca47f0f2324c61f825b674023080ec9c4d693aed451642c80dd38759ef8bca942faff6dad7d6bc79aa1be4515a14
AUX clazy-1.12-llvm-18.patch 1532 BLAKE2B 6527759799a8e99db6c996177f2f4ed9b1fd5f2327b2a950db6138c2bc4dd6c0b8f2d06bc45668836b8a6fc406df0973f9b3f5218361f2d401b7180cb824e308 SHA512 b0666907bb4d023e605b2b8ce4fd9addaa477e87a811d38bdb68c03bdf4a45d52fabb191e300cf3f877eb32189e23b23046c702c11e50527b474d79e4695c2de
+AUX clazy-1.12-standalone-install-location.patch 1728 BLAKE2B 9ef38ca69289f767219b7556675f147861725a70a7b94c6c94bbef004c70d714cf08a7e19a0c0ef0d5b6cce812e34fad7072c1de788494a640bc4a536689fd6f SHA512 8b36af55e818658a16108ce92479605a354f56415331d75c0eaf188e998203aa57900bdfca9e69c80d637b2f13424ecd50eafd32b49df86347431e34c3bef562
DIST clazy-1.11.tar.xz 404088 BLAKE2B 1a69fe07ef81a0efe3c9db9129083247d60943592967f705d62d3859039cec250673eecc06184f70d134cbab85708d957b0a085beff8b3e46325a69547e005b7 SHA512 6a7c162392dd30aea29669275cea814d6daccf7931b8cdb20997f9bbff5619832d5461a6d0f854ecbc4726e52b6937c4f9cb8651087ffe73676c04239a38ca2b
DIST clazy-1.12.tar.xz 427740 BLAKE2B ad2c78a506132b5fd6b3c22a7e9794c38ddd71242cde6f760e48d0250f6215629007d45303f4b35fdc7717865b8221ab1c2f3c6889a44ea1809e112845f16463 SHA512 7a2b4a753098f15936a4731c82c660c1cd4d81949279435e87f00f7f72bef3e32cb574c8991c0707798581278e9fbcae34d354c1e6b77a15a5e26166d658fa9e
EBUILD clazy-1.11-r4.ebuild 1312 BLAKE2B 5ff282ba38629cdd15ea65c1837d798563ac6ef396f771c6d91058c3e0f82ffab4e69b2ca7842afc96514b89b49c23f4aac291d6c186bdc285510500e87e063f SHA512 7c6e9aee3960b00e778455fd9832b41d845beaff25e1fb9c0959168598c3162a93c3592164533ea9183d782b5ebcfa54a4ffbab28544e69318628d0e62cd460f
-EBUILD clazy-1.12.ebuild 1339 BLAKE2B 5722f7d78da41318a8623c6a8252718ed8d9419e254a28e6ee1bb5ce0a5c8e2ffbf5ce20446be29a85f0f4b6ba03ba80c3536a7e28e2a43ab1bc7fb9806a3821 SHA512 726222bfc835c0ada17db5f8f7a1df0aeb59bf4b3f3a6c009e14f62e0ddb50ba02fc2b0782baabf332fd43d7c01c4c73e9c9758b3287abc1f329f3e11ad00973
+EBUILD clazy-1.12.ebuild 2646 BLAKE2B 7d98300ecd1cd198da1f304c1dd839e0dbc8f144673bf8b20d2d60f8ff70d18cff2be608f2a5db8bb9fafe4cde3cd663763cbaaa3397d1cf25957215e68df734 SHA512 29da74cce8fac24adf2c1a4529dc2e6d4079d43ee75b0cc036f5838fa181cae5de50416e6c5412b11a1661126a110b869309a537b1d4a4439b740ab8a22454d1
MISC metadata.xml 318 BLAKE2B 922a5e32e706b2976c5f359a14194d268d3f499398576c80ce5fad8c0fcea0fbf048de4480a80a6a1889c88b8b6c14147654a3ab4d5ffbcc258c2290da63f6d1 SHA512 614cb8dda7ad2088e5d6ef39b449bb4be0ac72cd0231c320188d76d1816dce6490c5114bb4798112c4b11d99d30a9e82ff8fcf08ffa8c049589682a5e38208f6
diff --git a/dev-util/clazy/clazy-1.12.ebuild b/dev-util/clazy/clazy-1.12.ebuild
index b5e819706f76..a04372e51041 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
@@ -13,7 +13,7 @@ SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
LICENSE="LGPL-2+"
SLOT="0"
-# KEYWORDS="~amd64 ~arm64 ~x86"
+KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
@@ -22,7 +22,12 @@ RDEPEND="
$(llvm_gen_dep 'sys-devel/llvm:${LLVM_SLOT}')
"
DEPEND="${RDEPEND}"
-BDEPEND="test? ( ${PYTHON_DEPS} )"
+BDEPEND="
+ test? (
+ ${PYTHON_DEPS}
+ dev-qt/qtnetworkauth:6
+ )
+"
PATCHES=(
# git master
@@ -30,6 +35,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 +54,49 @@ 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:${BUILD_DIR}:${PATH}"
+ local -x LD_LIBRARY_PATH="${BUILD_DIR}/lib"
+
+ # NOTE or DEPEND on "test? ( dev-qt/qtscxml:6[qml] )"
+ local -x CMAKE_SKIP_TESTS=()
+
+ chmod +x "${BUILD_DIR}"/clazy || die
+
+ 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
+