2022-01-18 03:51:48 +00:00
|
|
|
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
|
|
|
|
# Contributor: Jelle van der Waa <jelle@archlinux.org>
|
2020-06-07 16:34:44 +00:00
|
|
|
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
|
2020-02-26 04:34:21 +00:00
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - remove makedepend on pandoc, don't generate manuals
|
|
|
|
|
|
|
|
pkgname=cppcheck
|
2022-03-22 01:09:38 +00:00
|
|
|
pkgver=2.7.3
|
2022-01-18 03:51:48 +00:00
|
|
|
pkgrel=1
|
2020-02-26 04:34:21 +00:00
|
|
|
pkgdesc="A tool for static C/C++ code analysis"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="http://cppcheck.sourceforge.net/"
|
|
|
|
license=('GPL')
|
2022-01-18 03:51:48 +00:00
|
|
|
depends=(
|
|
|
|
'python-pygments'
|
|
|
|
'tinyxml2'
|
|
|
|
)
|
|
|
|
makedepends=(
|
|
|
|
'git'
|
|
|
|
'docbook-xsl'
|
|
|
|
'qt5-tools'
|
|
|
|
'qt5-base'
|
|
|
|
'python'
|
|
|
|
'cmake'
|
|
|
|
'clang'
|
|
|
|
)
|
|
|
|
optdepends=(
|
|
|
|
'qt5-tools: run cppcheck-gui'
|
|
|
|
'python-pygments: cppcheck-htmlreport'
|
|
|
|
'clang: for cppcheck-gui integration'
|
|
|
|
)
|
2022-02-05 21:01:40 +00:00
|
|
|
options=('debug')
|
2022-03-22 01:09:38 +00:00
|
|
|
_commit='97bf53515b8ec8db6f6f12ea15db4786e26afbc8'
|
2022-01-18 03:51:48 +00:00
|
|
|
source=(
|
|
|
|
"$pkgname::git+https://github.com/danmar/cppcheck.git#commit=$_commit"
|
|
|
|
'translations-location.patch'
|
2022-03-22 01:09:38 +00:00
|
|
|
'find-tinyxml2.patch'
|
2022-01-18 03:51:48 +00:00
|
|
|
)
|
|
|
|
sha512sums=('SKIP'
|
2022-03-22 01:09:38 +00:00
|
|
|
'd3528834d719017ec3a0e08005a293089b556622928defa1b37f940e62cb01165dcbd741e6d5e989c0156fb8789f7e63702af8b2390738648b2300a92f4ab0ae'
|
|
|
|
'09b03952ea98f56ed750f3e4443dd148a8aafc68072235537c7db09aca83a11a9f28e7a573b0d63d2a1bf1b57886fd540be060d933bcec9b38d09a09426ae5ff')
|
2022-01-18 03:51:48 +00:00
|
|
|
b2sums=('SKIP'
|
2022-03-22 01:09:38 +00:00
|
|
|
'8156920eacc630cb5eceb2387937b747c84c6325bef906717cfbad68c122bdd27965da1e8070a560a0bed3a7b7c59ff5f0e116bb1d035c4c42f430c927a75b1f'
|
|
|
|
'51585895a91142fecac88e49c9c182897441ee8033638927b0cbd1c66e5345096d0b03f296a2a8ff8622ef5959b73963617e46be231c8e9a6fbc563571db7ba5')
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
pkgver() {
|
|
|
|
cd "$pkgname"
|
2022-03-22 01:09:38 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
git describe --tags
|
|
|
|
}
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
prepare() {
|
|
|
|
cd "$pkgname"
|
2022-03-22 01:09:38 +00:00
|
|
|
|
|
|
|
# fix location of translations
|
2022-01-18 03:51:48 +00:00
|
|
|
patch -p1 -i ../translations-location.patch
|
2022-03-22 01:09:38 +00:00
|
|
|
|
|
|
|
# fix undefined reference to tinyxml2
|
|
|
|
patch -p1 -i ../find-tinyxml2.patch
|
2020-02-26 04:34:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2022-01-18 03:51:48 +00:00
|
|
|
export CXXFLAGS+=" -DNDEBUG"
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
# Manuals
|
|
|
|
pushd "$pkgname"
|
|
|
|
xsversion=$(pacman -Qi docbook-xsl | grep ^Version | sed -e 's/.*: //' -e 's/-[0-9]$//')
|
|
|
|
make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-${xsversion}-nons/manpages/docbook.xsl man
|
|
|
|
#pandoc man/manual.md -o man/manual.html -s --number-sections --toc
|
|
|
|
#pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-sections --toc
|
|
|
|
popd
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-S "$pkgname" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2022-02-05 21:01:40 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2022-03-22 01:09:38 +00:00
|
|
|
-DUSE_MATCHCOMPILER=ON \
|
|
|
|
-DHAVE_RULES=ON \
|
|
|
|
-DBUILD_GUI=ON \
|
|
|
|
-DBUILD_SHARED_LIBS=OFF \
|
|
|
|
-DBUILD_TESTS=ON \
|
2022-01-18 03:51:48 +00:00
|
|
|
-DFILESDIR=/usr/share/cppcheck \
|
2022-03-22 01:09:38 +00:00
|
|
|
-DUSE_BUNDLED_TINYXML2=OFF
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
cmake --build build
|
2020-02-26 04:34:21 +00:00
|
|
|
}
|
|
|
|
|
2022-03-22 01:09:38 +00:00
|
|
|
check() {
|
|
|
|
cd build/bin
|
|
|
|
./testrunner -g -q
|
|
|
|
}
|
2020-02-26 04:34:21 +00:00
|
|
|
|
|
|
|
package() {
|
2022-01-18 03:51:48 +00:00
|
|
|
DESTDIR="$pkgdir" cmake --install build
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
cd "$pkgname"
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
install -vDm644 -t "$pkgdir/usr/share/man/man1" cppcheck.1
|
|
|
|
install -vDm755 -t "$pkgdir/usr/bin" htmlreport/cppcheck-htmlreport
|
2020-02-26 04:34:21 +00:00
|
|
|
|
2022-01-18 03:51:48 +00:00
|
|
|
# Fix location of language files
|
|
|
|
install -d "${pkgdir}"/usr/share/cppcheck/cfg/lang
|
|
|
|
mv "${pkgdir}"/usr/bin/cppcheck_*.qm "${pkgdir}"/usr/share/cppcheck/cfg/lang/
|
2020-02-26 04:34:21 +00:00
|
|
|
}
|