void-packages/srcpkgs/cppcheck/template

54 lines
1.5 KiB
Bash

# Template file for 'cppcheck'
pkgname=cppcheck
version=2.15.0
revision=1
build_style=cmake
configure_args="
-DBUILD_GUI=ON
-DFILESDIR=/usr/share/cppcheck
-DHAVE_RULES=ON
-DUSE_BUNDLED_TINYXML2=OFF
-DUSE_MATCHCOMPILER=ON"
hostmakedepends="libxslt docbook-xsl python3 qt5-tools-devel"
makedepends="pcre-devel tinyxml2-devel qt5-devel qt5-tools-devel qt5-plugin-mysql
qt5-plugin-odbc qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds"
depends="python3"
short_desc="Static analysis of C/C++ code"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="http://cppcheck.sourceforge.net"
changelog="https://sourceforge.net/p/cppcheck/news/"
distfiles="https://github.com/danmar/cppcheck/archive/refs/tags/${version}.tar.gz"
checksum=98bcc40ac8062635b492fb096d7815376a176ae26749d6c708083f4637f7c0bb
export CXXFLAGS="-DNDEBUG"
if [ -n "$XBPS_CHECK_PKGS" ]; then
configure_args+=" -DBUILD_TESTS=ON"
fi
post_extract() {
if [ "$CROSS_BUILD" ]; then
vsed -e '/run-dmake/d' -i test/CMakeLists.txt -i cli/CMakeLists.txt
fi
}
post_install() {
make DB2MAN=/usr/share/xsl/docbook/manpages/docbook.xsl man
vman cppcheck.1
vmkdir usr/share/cppcheck/cfg/lang
mv "${DESTDIR}/usr/bin/cppcheck_"*.qm "${DESTDIR}/usr/share/cppcheck/cfg/lang/"
}
cppcheck-gui_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - Qt5 GUI"
pkg_install() {
vmove usr/bin/cppcheck-gui
vmove usr/share/cppcheck/cfg/lang
vmove usr/share/applications
vmove usr/share/icons
}
}