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: Tue, 23 Nov 2021 20:57:24
Message-Id: 1637701025.4de40c03a6832bc5cfc95637ca4d26fe81ff1da7.sam@gentoo
1 commit: 4de40c03a6832bc5cfc95637ca4d26fe81ff1da7
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 23 20:56:24 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 23 20:57:05 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4de40c03
7
8 dev-util/cppcheck: add 2.6.2
9
10 Fixes build with glibc-2.34.
11
12 Also:
13 - Use BDEPEND
14 - Run tests
15 - Don't use bundled tinyxml2
16 - Don't recompile in src_install (and don't call CXX directly within it)
17
18 Closes: https://bugs.gentoo.org/822114
19 Closes: https://bugs.gentoo.org/806312
20 Closes: https://bugs.gentoo.org/803014
21 Closes: https://bugs.gentoo.org/802279
22 Closes: https://bugs.gentoo.org/796638
23 Closes: https://bugs.gentoo.org/729090
24 Signed-off-by: Sam James <sam <AT> gentoo.org>
25
26 dev-util/cppcheck/Manifest | 1 +
27 dev-util/cppcheck/cppcheck-2.6.2.ebuild | 87 +++++++++++++++++++++++++++++++++
28 2 files changed, 88 insertions(+)
29
30 diff --git a/dev-util/cppcheck/Manifest b/dev-util/cppcheck/Manifest
31 index 5de50914c64f..5c54697dc489 100644
32 --- a/dev-util/cppcheck/Manifest
33 +++ b/dev-util/cppcheck/Manifest
34 @@ -1 +1,2 @@
35 DIST cppcheck-2.4.1.tar.gz 3761646 BLAKE2B 4c791088621f989e2529c92de38a73676fc3394e8cac72822596f7a75594283d0983693d693aa903a3ffb80bc0e1e20e71b55db5682d4d01c135ed77b2fc2e3c SHA512 8fb1ed5faa0071fc69405b7eb5b41e9f94b77d097158ea0d4f5e4da8a5087b9d1ab7bf37f8dc73d00096d3d2494aeb431af8029f0d4f1e2085f5b9b72bdc2d09
36 +DIST cppcheck-2.6.2.tar.gz 3880239 BLAKE2B 63abba752ed0e4bef1bf7be4eb3f1a0dfcd1bab286db41e7fd787969674f59354f1c2a0b4477bb1d0cc7ca71306bc6a3375cebade1c60416a21010f7b313d20c SHA512 f1b1b0d6d46712147984bf907519eaaef04b41f02979d371d836aa8668fbdaa0f18b503a76d809abcedf9a0e7b7666be910714ca411d289aa921d0204585f47f
37
38 diff --git a/dev-util/cppcheck/cppcheck-2.6.2.ebuild b/dev-util/cppcheck/cppcheck-2.6.2.ebuild
39 new file mode 100644
40 index 000000000000..70fe05ebbf69
41 --- /dev/null
42 +++ b/dev-util/cppcheck/cppcheck-2.6.2.ebuild
43 @@ -0,0 +1,87 @@
44 +# Copyright 1999-2021 Gentoo Authors
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +EAPI=7
48 +
49 +PYTHON_COMPAT=( python3_{8..10} )
50 +DISTUTILS_USE_SETUPTOOLS=no
51 +inherit distutils-r1 cmake toolchain-funcs
52 +
53 +DESCRIPTION="Static analyzer of C/C++ code"
54 +HOMEPAGE="https://github.com/danmar/cppcheck"
55 +SRC_URI="https://github.com/danmar/cppcheck/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
56 +
57 +LICENSE="GPL-3+"
58 +SLOT="0"
59 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc64 ~sparc ~x86"
60 +IUSE="htmlreport pcre qt5 test +z3"
61 +RESTRICT="!test? ( test )"
62 +
63 +RDEPEND="
64 + dev-libs/tinyxml2:=
65 + htmlreport? ( dev-python/pygments[${PYTHON_USEDEP}] )
66 + pcre? ( dev-libs/libpcre )
67 + qt5? (
68 + dev-qt/qtcore:5
69 + dev-qt/qtgui:5
70 + dev-qt/qthelp
71 + dev-qt/qtprintsupport:5
72 + )
73 + z3? ( sci-mathematics/z3 )
74 +"
75 +DEPEND="${RDEPEND}"
76 +BDEPEND="
77 + app-text/docbook-xsl-stylesheets
78 + dev-libs/libxslt
79 + virtual/pkgconfig
80 + qt5? ( dev-qt/linguist-tools:5 )
81 +"
82 +
83 +src_prepare() {
84 + cmake_src_prepare
85 +}
86 +
87 +src_configure() {
88 + local mycmakeargs=(
89 + -DHAVE_RULES="$(usex pcre)"
90 + -DBUILD_GUI="$(usex qt5)"
91 + -DUSE_Z3="$(usex z3)"
92 + -DFILESDIR="${EPREFIX}/usr/share/${PN}/"
93 + -DENABLE_OSS_FUZZ=OFF
94 + -DUSE_BUNDLED_TINYXML2=OFF
95 + -DBUILD_TESTS="$(usex test)"
96 + )
97 +
98 + cmake_src_configure
99 +}
100 +
101 +src_compile() {
102 + cmake_src_compile
103 +
104 + if use htmlreport ; then
105 + pushd htmlreport || die
106 + distutils-r1_src_compile
107 + popd || die
108 + fi
109 +}
110 +
111 +src_install() {
112 + cmake_src_install
113 +
114 + insinto "/usr/share/${PN}/cfg"
115 + doins cfg/*.cfg
116 +
117 + if use qt5 ; then
118 + dobin "${WORKDIR}/${P}_build/bin/${PN}-gui"
119 + dodoc gui/{projectfile.txt,gui.${PN}}
120 + fi
121 +
122 + if use htmlreport ; then
123 + pushd htmlreport || die
124 + distutils-r1_src_install
125 + popd || die
126 + find "${ED}" -name "*.egg-info" -delete || die
127 + fi
128 +
129 + dodoc -r tools/triage
130 +}