summaryrefslogtreecommitdiff
path: root/dev-util/cppcheck/cppcheck-1.86.ebuild
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-util/cppcheck/cppcheck-1.86.ebuild
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-util/cppcheck/cppcheck-1.86.ebuild')
-rw-r--r--dev-util/cppcheck/cppcheck-1.86.ebuild113
1 files changed, 113 insertions, 0 deletions
diff --git a/dev-util/cppcheck/cppcheck-1.86.ebuild b/dev-util/cppcheck/cppcheck-1.86.ebuild
new file mode 100644
index 000000000000..03e138c82501
--- /dev/null
+++ b/dev-util/cppcheck/cppcheck-1.86.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_6 )
+inherit distutils-r1 qmake-utils toolchain-funcs
+
+DESCRIPTION="Static analyzer of C/C++ code"
+HOMEPAGE="https://github.com/danmar/cppcheck"
+SRC_URI="https://github.com/danmar/cppcheck/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="amd64 ~arm arm64 hppa ~ppc64 sparc x86"
+IUSE="htmlreport pcre qt5"
+
+RDEPEND="
+ dev-libs/tinyxml2:=
+ htmlreport? ( dev-python/pygments[${PYTHON_USEDEP}] )
+ pcre? ( dev-libs/libpcre )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtprintsupport:5
+ )
+"
+DEPEND="${RDEPEND}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ virtual/pkgconfig
+"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.75-tinyxml2.patch
+ "${FILESDIR}"/${PN}-1.85-ldflags.patch
+)
+
+src_prepare() {
+ default
+
+ rm -r externals/tinyxml || die
+}
+
+src_configure() {
+ tc-export CXX PKG_CONFIG
+ export LIBS="$(${PKG_CONFIG} --libs tinyxml2)"
+
+ emake dmake
+ ./dmake || die
+
+ if use pcre ; then
+ sed -e '/HAVE_RULES=/s:=no:=yes:' \
+ -i Makefile || die
+ fi
+
+ if use qt5 ; then
+ pushd gui || die
+ eqmake5
+ popd || die
+ fi
+}
+
+src_compile() {
+ emake ${PN} man \
+ CFGDIR="${EROOT}/usr/share/${PN}/cfg" \
+ DB2MAN="${EROOT}/usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl"
+
+ if use qt5 ; then
+ pushd gui || die
+ emake
+ popd || die
+ fi
+
+ if use htmlreport ; then
+ pushd htmlreport || die
+ distutils-r1_src_compile
+ popd || die
+ fi
+}
+
+src_test() {
+ # safe final version
+ mv -v ${PN}{,.final} || die
+ mv -v lib/library.o{,.final} || die
+ mv -v cli/cppcheckexecutor.o{,.final} || die
+ #trigger recompile with CFGDIR inside ${S}
+ emake check CFGDIR="${S}/cfg"
+ # restore
+ mv -v ${PN}{.final,} || die
+ mv -v lib/library.o{.final,} || die
+ mv -v cli/cppcheckexecutor.o{.final,} || die
+}
+
+src_install() {
+ # it's not autotools-based, so "${ED}" here, not "${D}", bug 531760
+ emake install DESTDIR="${ED}"
+
+ insinto "/usr/share/${PN}/cfg"
+ doins cfg/*.cfg
+ if use qt5 ; then
+ dobin gui/${PN}-gui
+ dodoc gui/{projectfile.txt,gui.${PN}}
+ fi
+ if use htmlreport ; then
+ pushd htmlreport || die
+ distutils-r1_src_install
+ popd || die
+ find "${D}" -name "*.egg-info" -delete
+ else
+ rm "${ED}/usr/bin/cppcheck-htmlreport" || die
+ fi
+ doman ${PN}.1
+ dodoc -r triage
+}