From f79ff2adbeb5b0d309e278d4b6df5c7098daf5ff Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 29 Aug 2023 11:43:23 +0100 Subject: Add temporary cppcheck v2.10 --- dev-util/cppcheck/Manifest | 3 + dev-util/cppcheck/cppcheck-2.10.ebuild | 120 +++++++++++++++++++++++++++++++++ dev-util/cppcheck/metadata.xml | 18 +++++ 3 files changed, 141 insertions(+) create mode 100644 dev-util/cppcheck/Manifest create mode 100644 dev-util/cppcheck/cppcheck-2.10.ebuild create mode 100644 dev-util/cppcheck/metadata.xml diff --git a/dev-util/cppcheck/Manifest b/dev-util/cppcheck/Manifest new file mode 100644 index 0000000..f75b2ce --- /dev/null +++ b/dev-util/cppcheck/Manifest @@ -0,0 +1,3 @@ +DIST cppcheck-2.10.tar.gz 3442586 BLAKE2B 8eb409751d2ba470dd000b48b11be62497d9cb21d2640861b9e6f118848918a117a9f4d7155f5157578b9d0a1e24b049a0f80e905343c72c7aaefa40abef49f7 SHA512 1c737736a34f0c3412d43c95f07e47c10f64feb6d94bc4dde8a2468a3b3839468b31cfe94af30200fdd326e345ba6f4647c67e43705958885e24f8582abb9785 +EBUILD cppcheck-2.10.ebuild 2364 BLAKE2B 7ddc54c238e6f9db652d15090a21d639c06cc6f804da8db3d2c98d8066168e4d967962230b95405eb63547f2c069e9fdfdea05adef31b8e6ee7e49c08d041d1f SHA512 67344c96b62ef2434c3b5f5f75d8f72499104fe48530ae71016a89553fde5199da3e730e0e632f18afa706ee86b2021c95ccb8a23e595f81d952c70d07c16ddf +MISC metadata.xml 546 BLAKE2B d42258e8aad43867bf7b8d86f4688d76a70cfe285e203eb1938adb2b5167f2cb51e110ba5eb51954ebaf50a05d5d01605d577ff7b9528a1220f3ce0d69790984 SHA512 df3a8b62b1a8f1fcd8e4e78d3e44f20dc71fdf985251a5b1d7fbcc7fc2cdbc12428e3a7fe191640678cab7a046010578149f4176285ec1ca1538839cdf5a2070 diff --git a/dev-util/cppcheck/cppcheck-2.10.ebuild b/dev-util/cppcheck/cppcheck-2.10.ebuild new file mode 100644 index 0000000..d600a65 --- /dev/null +++ b/dev-util/cppcheck/cppcheck-2.10.ebuild @@ -0,0 +1,120 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Python is used both for htmlreport (USE flag) but also for various +# helper scripts in /usr/share/cppcheck. +DISTUTILS_OPTIONAL=1 +DISTUTILS_USE_PEP517=setuptools +DISTUTILS_SINGLE_IMPL=1 +PYTHON_COMPAT=( python3_{9..11} ) +inherit distutils-r1 cmake + +DESCRIPTION="Static analyzer of C/C++ code" +HOMEPAGE="https://github.com/danmar/cppcheck" +SRC_URI="https://github.com/danmar/cppcheck/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="amd64 ~arm arm64 ~hppa ~loong ~ppc64 ~riscv sparc x86" +IUSE="htmlreport pcre qt5 test" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +RDEPEND=" + ${PYTHON_DEPS} + dev-libs/tinyxml2:= + htmlreport? ( + $(python_gen_cond_dep ' + dev-python/pygments[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + ') + ) + pcre? ( dev-libs/libpcre ) + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qthelp:5 + dev-qt/qtprintsupport:5 + dev-qt/qtwidgets:5 + ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig + htmlreport? ( ${DISTUTILS_DEPS} ) + qt5? ( dev-qt/linguist-tools:5 ) + test? ( + htmlreport? ( + $(python_gen_cond_dep 'dev-python/unittest-or-fail[${PYTHON_USEDEP}]') + ) + ) +" + +src_prepare() { + cmake_src_prepare + + distutils-r1_src_prepare +} + +python_prepare_all() { + distutils-r1_python_prepare_all + + rm htmlreport/test_htmlreport.py || die +} + +src_configure() { + local mycmakeargs=( + -DHAVE_RULES="$(usex pcre)" + -DBUILD_GUI="$(usex qt5)" + -DFILESDIR="${EPREFIX}/usr/share/${PN}/" + -DENABLE_OSS_FUZZ=OFF + -DUSE_BUNDLED_TINYXML2=OFF + -DBUILD_TESTS="$(usex test)" + ) + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + + if use htmlreport ; then + pushd htmlreport || die + distutils-r1_src_compile + popd || die + fi +} + +python_install() { + if use htmlreport ; then + pushd htmlreport || die + distutils-r1_python_install + popd || die + fi +} + +python_install_all() { + distutils-r1_python_install_all + + python_fix_shebang "${ED}"/usr/share/cppcheck/* +} + +src_install() { + cmake_src_install + + insinto /usr/share/${PN}/cfg + doins cfg/*.cfg + + if use qt5 ; then + dobin "${WORKDIR}/${P}_build/bin/${PN}-gui" + dodoc gui/{projectfile.txt,gui.${PN}} + fi + + distutils-r1_src_install + + dodoc -r tools/triage +} diff --git a/dev-util/cppcheck/metadata.xml b/dev-util/cppcheck/metadata.xml new file mode 100644 index 0000000..4f9c4c8 --- /dev/null +++ b/dev-util/cppcheck/metadata.xml @@ -0,0 +1,18 @@ + + + + + tamiko@gentoo.org + Matthias Maier + + + install cppcheck-htmlreport + + Enable support for sci-mathematics/z3 backend + + + + danmar/cppcheck + cppcheck + + -- cgit v1.2.3