From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1417265-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 88000158094
	for <garchives@archives.gentoo.org>; Sun, 10 Jul 2022 23:51:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id A899CE0D0A;
	Sun, 10 Jul 2022 23:51:03 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id EE513E0D0A
	for <gentoo-commits@lists.gentoo.org>; Sun, 10 Jul 2022 23:51:02 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 75B9534109E
	for <gentoo-commits@lists.gentoo.org>; Sun, 10 Jul 2022 23:51:01 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 8D8BF391
	for <gentoo-commits@lists.gentoo.org>; Sun, 10 Jul 2022 23:50:59 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1657497041.661b7b58a203bdcce713c25edd118dcd113f3427.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/cppcheck/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-util/cppcheck/cppcheck-2.8.1-r1.ebuild
X-VCS-Directories: dev-util/cppcheck/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 661b7b58a203bdcce713c25edd118dcd113f3427
X-VCS-Branch: master
Date: Sun, 10 Jul 2022 23:50:59 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 737aa068-17c3-4e95-b8ff-634cece052e3
X-Archives-Hash: 3391ebf16e45e0d0b1145b4ce7da6619

commit:     661b7b58a203bdcce713c25edd118dcd113f3427
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 23:45:56 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 23:50:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=661b7b58

dev-util/cppcheck: PEP517

Also, the Python tests I was referring to earlier are.. gone?

Bug: https://bugs.gentoo.org/826970
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/cppcheck/cppcheck-2.8.1-r1.ebuild | 118 +++++++++++++++++++++++++++++
 1 file changed, 118 insertions(+)

diff --git a/dev-util/cppcheck/cppcheck-2.8.1-r1.ebuild b/dev-util/cppcheck/cppcheck-2.8.1-r1.ebuild
new file mode 100644
index 000000000000..9ef2ad93ab6c
--- /dev/null
+++ b/dev-util/cppcheck/cppcheck-2.8.1-r1.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2022 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_{8..10} )
+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 ~ppc64 ~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
+		dev-qt/qtprintsupport:5
+	)
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	app-text/docbook-xsl-stylesheets
+	dev-libs/libxslt
+	virtual/pkgconfig
+	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
+}