diff --git a/dev-util/clazy/Manifest b/dev-util/clazy/Manifest index b31e0db22cc06..fc1b1e0165202 100644 --- a/dev-util/clazy/Manifest +++ b/dev-util/clazy/Manifest @@ -1 +1,2 @@ DIST clazy-1.13.tar.xz 434648 BLAKE2B 2659bec375c9f30021cdd86c12ab4416dfb5250706c2f6254cbd848d07e3e4f220b2a74d23390f235939ad3e5390797ea4b5398948e129a07a66a5de2d33c997 SHA512 4044bddb9e60e227ff2ab7e40c32f087a621e00c985e1706a4f4e2ace20f96cc6e78f00781f7d59da5b066aa49370c645db506e41d955409c0e146771a59ee24 +DIST clazy-1.14.tar.xz 436764 BLAKE2B e4123df71591368017fec428095fa573aa74903861716dbe92386e948f7845453aac5fb8fe1fa2431ef42120363cf07935e155fdecbf3621b61e359a79c295ae SHA512 2732e22d56d3121de3639e24759cf47648fc3f5550cf232cbaf97c7efc92e0aacb01c8921326fb15beca3679907aa26a900147b2d3f318792c767e7237604e98 diff --git a/dev-util/clazy/clazy-1.14.ebuild b/dev-util/clazy/clazy-1.14.ebuild new file mode 100644 index 0000000000000..4451a4bd0091d --- /dev/null +++ b/dev-util/clazy/clazy-1.14.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( {15..20} ) +PYTHON_COMPAT=( python3_{10..13} ) +inherit cmake llvm-r1 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=" + $(llvm_gen_dep 'llvm-core/clang:${LLVM_SLOT}') + $(llvm_gen_dep 'llvm-core/llvm:${LLVM_SLOT}') +" +DEPEND="${RDEPEND}" +BDEPEND=" + test? ( + ${PYTHON_DEPS} + dev-qt/qtbase:6[network,xml] + dev-qt/qtmultimedia:6 + dev-qt/qtnetworkauth:6 + dev-qt/qtscxml:6[qml] + dev-qt/qtsvg:6 + ) +" + +PATCHES=( + # downstream patches + "${FILESDIR}"/${PN}-1.12-LIBRARY_DIRS.patch + "${FILESDIR}"/${PN}-1.12-INCLUDE_DIRS.patch + "${FILESDIR}"/${PN}-1.12-standalone-install-location.patch + "${FILESDIR}"/${PN}-1.12-clazy-install-location.patch +) + +pkg_setup() { + use test && python-any-r1_pkg_setup + llvm-r1_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() { + 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 + local -x PATH="${BUILD_DIR}/${LLVM_ROOT}/bin:${BUILD_DIR}/bin:${PATH}" + local -x LD_LIBRARY_PATH="${BUILD_DIR}/lib" + + chmod +x "${BUILD_DIR}/bin/clazy" || die + + cmake_src_test +}