Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/cppcheck/
Date: Mon, 29 Aug 2022 19:06:27
Message-Id: 1661799939.677d08070a26e93f96194e15cf368232120b3182.sam@gentoo
1 commit: 677d08070a26e93f96194e15cf368232120b3182
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 29 19:04:23 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 29 19:05:39 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=677d0807
7
8 dev-util/cppcheck: add 2.9
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 dev-util/cppcheck/Manifest | 1 +
13 dev-util/cppcheck/cppcheck-2.9.ebuild | 120 ++++++++++++++++++++++++++++++++++
14 2 files changed, 121 insertions(+)
15
16 diff --git a/dev-util/cppcheck/Manifest b/dev-util/cppcheck/Manifest
17 index 5e11ee2b33d7..2f2dc68d633e 100644
18 --- a/dev-util/cppcheck/Manifest
19 +++ b/dev-util/cppcheck/Manifest
20 @@ -1,3 +1,4 @@
21 DIST cppcheck-2.6.3.tar.gz 3880340 BLAKE2B ef83538a0aa867dd0c0bd6165b41921335256ed0372a4990ad85151ab5e87a79bde7958be43887f07a4bbf372b9992339b75ddeae7ed8ea767b83c028dfc56db SHA512 e59b4b4659c2b4fa2c16dcb548f7ee3027555dddc289ef8b54fe186af0396b6f7caa23d91bf1142ece62908b56fe9f5ba013191817322815681994093310fb37
22 DIST cppcheck-2.8.1.tar.gz 3921391 BLAKE2B d61c4a8a3e88441f0a65090eddacaa34bda91ba50ce92e79c122525524368ade49d24f13f343a5a856a3014e904495e87db2d774146e871af1738d55f1a52728 SHA512 ff5a9955498101a2d061a431d0f8ed42267627b3cd029302871ee781a0e4039aa531dd47c2d44d1f3952b5e5bd3b65c9b32a10a9b1922ef466f440f8c4417e28
23 DIST cppcheck-2.8.2.tar.gz 3921806 BLAKE2B b48a3f4163fec491d8a7f9eb4957a140cd33b852d1778974c383ca5148aa252cee412b4616cbf49b622ee5b4ccddcb1aa60b217284f2c01c020df606a1e4fe5b SHA512 595645cede2d1b801127747cf19c66ebc73a97c4c3f5c9af1fbf865a995f9b7ab4027a16d73cf2aa638e51569be275a26b92909d548ddb40e185978a247fb5cd
24 +DIST cppcheck-2.9.tar.gz 3916529 BLAKE2B 5d75328e1fcd389376630502ad7427d3473392a9467e8731e6cd7c2c6349efccc05eddd7eca4cb361930661d2383a8d316e33bd3609b9333a710153d199e326d SHA512 69204a7ceac087470201482894e6422b99d0849f08641e80b2e341c9d164a1d2095e3a08a1fba2e9fa681783d07fe7277b30ea0cc0bf582431b5d13ab2f58c1f
25
26 diff --git a/dev-util/cppcheck/cppcheck-2.9.ebuild b/dev-util/cppcheck/cppcheck-2.9.ebuild
27 new file mode 100644
28 index 000000000000..0ab87ba97840
29 --- /dev/null
30 +++ b/dev-util/cppcheck/cppcheck-2.9.ebuild
31 @@ -0,0 +1,120 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +# Python is used both for htmlreport (USE flag) but also for various
38 +# helper scripts in /usr/share/cppcheck.
39 +DISTUTILS_OPTIONAL=1
40 +DISTUTILS_USE_PEP517=setuptools
41 +DISTUTILS_SINGLE_IMPL=1
42 +PYTHON_COMPAT=( python3_{8..10} )
43 +inherit distutils-r1 cmake
44 +
45 +DESCRIPTION="Static analyzer of C/C++ code"
46 +HOMEPAGE="https://github.com/danmar/cppcheck"
47 +SRC_URI="https://github.com/danmar/cppcheck/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
48 +
49 +LICENSE="GPL-3+"
50 +SLOT="0"
51 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc64 ~sparc ~x86"
52 +IUSE="htmlreport pcre qt5 test"
53 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
54 +RESTRICT="!test? ( test )"
55 +
56 +RDEPEND="
57 + ${PYTHON_DEPS}
58 + dev-libs/tinyxml2:=
59 + htmlreport? (
60 + $(python_gen_cond_dep '
61 + dev-python/pygments[${PYTHON_USEDEP}]
62 + dev-python/setuptools[${PYTHON_USEDEP}]
63 + ')
64 + )
65 + pcre? ( dev-libs/libpcre )
66 + qt5? (
67 + dev-qt/qtcore:5
68 + dev-qt/qtgui:5
69 + dev-qt/qthelp:5
70 + dev-qt/qtprintsupport:5
71 + dev-qt/qtwidgets:5
72 + )
73 +"
74 +DEPEND="${RDEPEND}"
75 +BDEPEND="
76 + app-text/docbook-xsl-stylesheets
77 + dev-libs/libxslt
78 + virtual/pkgconfig
79 + htmlreport? ( ${DISTUTILS_DEPS} )
80 + qt5? ( dev-qt/linguist-tools:5 )
81 + test? (
82 + htmlreport? (
83 + $(python_gen_cond_dep 'dev-python/unittest-or-fail[${PYTHON_USEDEP}]')
84 + )
85 + )
86 +"
87 +
88 +src_prepare() {
89 + cmake_src_prepare
90 +
91 + distutils-r1_src_prepare
92 +}
93 +
94 +python_prepare_all() {
95 + distutils-r1_python_prepare_all
96 +
97 + rm htmlreport/test_htmlreport.py || die
98 +}
99 +
100 +src_configure() {
101 + local mycmakeargs=(
102 + -DHAVE_RULES="$(usex pcre)"
103 + -DBUILD_GUI="$(usex qt5)"
104 + -DFILESDIR="${EPREFIX}/usr/share/${PN}/"
105 + -DENABLE_OSS_FUZZ=OFF
106 + -DUSE_BUNDLED_TINYXML2=OFF
107 + -DBUILD_TESTS="$(usex test)"
108 + )
109 +
110 + cmake_src_configure
111 +}
112 +
113 +src_compile() {
114 + cmake_src_compile
115 +
116 + if use htmlreport ; then
117 + pushd htmlreport || die
118 + distutils-r1_src_compile
119 + popd || die
120 + fi
121 +}
122 +
123 +python_install() {
124 + if use htmlreport ; then
125 + pushd htmlreport || die
126 + distutils-r1_python_install
127 + popd || die
128 + fi
129 +}
130 +
131 +python_install_all() {
132 + distutils-r1_python_install_all
133 +
134 + python_fix_shebang "${ED}"/usr/share/cppcheck/*
135 +}
136 +
137 +src_install() {
138 + cmake_src_install
139 +
140 + insinto /usr/share/${PN}/cfg
141 + doins cfg/*.cfg
142 +
143 + if use qt5 ; then
144 + dobin "${WORKDIR}/${P}_build/bin/${PN}-gui"
145 + dodoc gui/{projectfile.txt,gui.${PN}}
146 + fi
147 +
148 + distutils-r1_src_install
149 +
150 + dodoc -r tools/triage
151 +}