Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/cppcheck/, dev-util/cppcheck/files/
Date: Mon, 31 May 2021 04:03:59
Message-Id: 1622433577.cd42cd0ed94bf92cf0719487596755402cc6c32a.tamiko@gentoo
1 commit: cd42cd0ed94bf92cf0719487596755402cc6c32a
2 Author: Luke Peterson <hazelnusse <AT> gmail <DOT> com>
3 AuthorDate: Tue May 18 18:10:25 2021 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Mon May 31 03:59:37 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd42cd0e
7
8 dev-util/cppcheck: Add version 2.4.1
9
10 Closes: https://bugs.gentoo.org/786633
11 Closes: https://github.com/gentoo/gentoo/pull/20874
12 Signed-off-by: Dale Lukas Peterson <hazelnusse <AT> gmail.com>
13 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
14
15 dev-util/cppcheck/Manifest | 1 +
16 dev-util/cppcheck/cppcheck-2.4.1.ebuild | 84 ++++++++++++++++++++++
17 .../cppcheck/files/cppcheck-2.4.1-limits.patch | 12 ++++
18 3 files changed, 97 insertions(+)
19
20 diff --git a/dev-util/cppcheck/Manifest b/dev-util/cppcheck/Manifest
21 index 51d80e257e3..c78e131f430 100644
22 --- a/dev-util/cppcheck/Manifest
23 +++ b/dev-util/cppcheck/Manifest
24 @@ -1,2 +1,3 @@
25 DIST cppcheck-1.88.tar.gz 2364053 BLAKE2B b688974ff83019422cc5b2ec575d9838bdff4ada17d71fb3d436f07eea50429490c222659163b845667d98c0ec186b3288464827894e379fd017dd0c3fea645f SHA512 fa4ede0665546341af0ba3dae09a00b6efae09ec7838c616c580be01ff6902594d61168a059539779be0c78e1708d2bd9c8e7987dd0bb67dc8fa332a10d1de6a
26 DIST cppcheck-2.2.tar.gz 3561406 BLAKE2B e436de4bec5412a18f013c8557a966c28c14edcd07fbb80eb53a897848d15f32afc180798ea1a074742f896b15d4020755c104b87dc8f82252121b58a92b92dc SHA512 d766187a69d6aa839e072e3c0ed44009621ca8492504257288ca2f49774f705a1ebcf2957f0801ac6eab2ffbdd845e9237f1213f85c6d0fcdbf16b1e7c690327
27 +DIST cppcheck-2.4.1.tar.gz 3761646 BLAKE2B 4c791088621f989e2529c92de38a73676fc3394e8cac72822596f7a75594283d0983693d693aa903a3ffb80bc0e1e20e71b55db5682d4d01c135ed77b2fc2e3c SHA512 8fb1ed5faa0071fc69405b7eb5b41e9f94b77d097158ea0d4f5e4da8a5087b9d1ab7bf37f8dc73d00096d3d2494aeb431af8029f0d4f1e2085f5b9b72bdc2d09
28
29 diff --git a/dev-util/cppcheck/cppcheck-2.4.1.ebuild b/dev-util/cppcheck/cppcheck-2.4.1.ebuild
30 new file mode 100644
31 index 00000000000..8ee6ca9778e
32 --- /dev/null
33 +++ b/dev-util/cppcheck/cppcheck-2.4.1.ebuild
34 @@ -0,0 +1,84 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +PYTHON_COMPAT=( python{3_7,3_8,3_9} )
40 +inherit distutils-r1 toolchain-funcs cmake
41 +
42 +DESCRIPTION="Static analyzer of C/C++ code"
43 +HOMEPAGE="https://github.com/danmar/cppcheck"
44 +SRC_URI="https://github.com/danmar/cppcheck/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
45 +
46 +LICENSE="GPL-3+"
47 +SLOT="0"
48 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc64 ~sparc ~x86"
49 +IUSE="htmlreport pcre qt5 +z3"
50 +
51 +RDEPEND="
52 + htmlreport? ( dev-python/pygments[${PYTHON_USEDEP}] )
53 + pcre? ( dev-libs/libpcre )
54 + qt5? (
55 + dev-qt/qtcore:5
56 + dev-qt/qtgui:5
57 + dev-qt/qthelp
58 + dev-qt/qtprintsupport:5
59 + )
60 +"
61 +DEPEND="${RDEPEND}
62 + app-text/docbook-xsl-stylesheets
63 + dev-libs/libxslt
64 + virtual/pkgconfig
65 + z3? ( sci-mathematics/z3 )
66 +"
67 +PATCHES=(
68 + "${FILESDIR}"/${PN}-2.4.1-limits.patch
69 +)
70 +
71 +src_prepare() {
72 + cmake_src_prepare
73 +}
74 +
75 +src_configure() {
76 +
77 + local mycmakeargs=(
78 + -DHAVE_RULES="$(usex pcre)"
79 + -DBUILD_GUI="$(usex qt5)"
80 + -DUSE_Z3="$(usex z3)"
81 + -DFILESDIR="${EROOT}/usr/share/${PN}/"
82 + -DENABLE_OSS_FUZZ=OFF
83 + )
84 + cmake_src_configure
85 +}
86 +
87 +src_compile() {
88 + cmake_src_compile
89 +
90 + if use htmlreport ; then
91 + pushd htmlreport || die
92 + distutils-r1_src_compile
93 + popd || die
94 + fi
95 +}
96 +
97 +src_install() {
98 + # it's not autotools-based, so "${ED}" here, not "${D}", bug 531760
99 + emake install DESTDIR="${ED}" \
100 + FILESDIR="${EROOT}/usr/share/${PN}/"
101 +
102 + insinto "/usr/share/${PN}/cfg"
103 + doins cfg/*.cfg
104 + if use qt5 ; then
105 + dobin "${WORKDIR}/${P}_build/bin/${PN}-gui"
106 + dodoc gui/{projectfile.txt,gui.${PN}}
107 + fi
108 + if use htmlreport ; then
109 + pushd htmlreport || die
110 + distutils-r1_src_install
111 + popd || die
112 + find "${D}" -name "*.egg-info" -delete
113 + else
114 + rm "${ED}/usr/bin/cppcheck-htmlreport" || die
115 + fi
116 +
117 + dodoc -r tools/triage
118 +}
119
120 diff --git a/dev-util/cppcheck/files/cppcheck-2.4.1-limits.patch b/dev-util/cppcheck/files/cppcheck-2.4.1-limits.patch
121 new file mode 100644
122 index 00000000000..8b8db9cb8a4
123 --- /dev/null
124 +++ b/dev-util/cppcheck/files/cppcheck-2.4.1-limits.patch
125 @@ -0,0 +1,12 @@
126 +diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp
127 +index d59789236..3604d517f 100644
128 +--- a/lib/symboldatabase.cpp
129 ++++ b/lib/symboldatabase.cpp
130 +@@ -35,6 +35,7 @@
131 + #include <cassert>
132 + #include <climits>
133 + #include <cstring>
134 ++#include <limits>
135 + #include <iomanip>
136 + #include <iostream>
137 + #include <unordered_map>