community/cppcheck to 2.7.3-1

This commit is contained in:
Kevin Mihelich 2022-03-22 01:09:38 +00:00
parent 209f189a57
commit 23098b93fa
2 changed files with 36 additions and 14 deletions

View file

@ -6,7 +6,7 @@
# - remove makedepend on pandoc, don't generate manuals # - remove makedepend on pandoc, don't generate manuals
pkgname=cppcheck pkgname=cppcheck
pkgver=2.7 pkgver=2.7.3
pkgrel=1 pkgrel=1
pkgdesc="A tool for static C/C++ code analysis" pkgdesc="A tool for static C/C++ code analysis"
arch=('x86_64') arch=('x86_64')
@ -31,24 +31,33 @@ optdepends=(
'clang: for cppcheck-gui integration' 'clang: for cppcheck-gui integration'
) )
options=('debug') options=('debug')
_commit='6ba6567ad897d56741159f8af90fc354ae050e61' _commit='97bf53515b8ec8db6f6f12ea15db4786e26afbc8'
source=( source=(
"$pkgname::git+https://github.com/danmar/cppcheck.git#commit=$_commit" "$pkgname::git+https://github.com/danmar/cppcheck.git#commit=$_commit"
'translations-location.patch' 'translations-location.patch'
'find-tinyxml2.patch'
) )
sha512sums=('SKIP' sha512sums=('SKIP'
'd3528834d719017ec3a0e08005a293089b556622928defa1b37f940e62cb01165dcbd741e6d5e989c0156fb8789f7e63702af8b2390738648b2300a92f4ab0ae') 'd3528834d719017ec3a0e08005a293089b556622928defa1b37f940e62cb01165dcbd741e6d5e989c0156fb8789f7e63702af8b2390738648b2300a92f4ab0ae'
'09b03952ea98f56ed750f3e4443dd148a8aafc68072235537c7db09aca83a11a9f28e7a573b0d63d2a1bf1b57886fd540be060d933bcec9b38d09a09426ae5ff')
b2sums=('SKIP' b2sums=('SKIP'
'8156920eacc630cb5eceb2387937b747c84c6325bef906717cfbad68c122bdd27965da1e8070a560a0bed3a7b7c59ff5f0e116bb1d035c4c42f430c927a75b1f') '8156920eacc630cb5eceb2387937b747c84c6325bef906717cfbad68c122bdd27965da1e8070a560a0bed3a7b7c59ff5f0e116bb1d035c4c42f430c927a75b1f'
'51585895a91142fecac88e49c9c182897441ee8033638927b0cbd1c66e5345096d0b03f296a2a8ff8622ef5959b73963617e46be231c8e9a6fbc563571db7ba5')
pkgver() { pkgver() {
cd "$pkgname" cd "$pkgname"
git describe --tags git describe --tags
} }
prepare() { prepare() {
cd "$pkgname" cd "$pkgname"
# fix location of translations
patch -p1 -i ../translations-location.patch patch -p1 -i ../translations-location.patch
# fix undefined reference to tinyxml2
patch -p1 -i ../find-tinyxml2.patch
} }
build() { build() {
@ -67,21 +76,21 @@ build() {
-S "$pkgname" \ -S "$pkgname" \
-DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_MATCHCOMPILER=yes \ -DUSE_MATCHCOMPILER=ON \
-DHAVE_RULES=yes \ -DHAVE_RULES=ON \
-DBUILD_GUI=yes \ -DBUILD_GUI=ON \
-DBUILD_SHARED_LIBS=no \ -DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTS=no \ -DBUILD_TESTS=ON \
-DFILESDIR=/usr/share/cppcheck \ -DFILESDIR=/usr/share/cppcheck \
-DUSE_BUNDLED_TINYXML2=no -DUSE_BUNDLED_TINYXML2=OFF
cmake --build build cmake --build build
} }
#check() { check() {
# cd build/bin cd build/bin
# ./testrunner -g -q ./testrunner -g -q
#} }
package() { package() {
DESTDIR="$pkgdir" cmake --install build DESTDIR="$pkgdir" cmake --install build

View file

@ -0,0 +1,13 @@
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -48,7 +48,9 @@ endif()
if (NOT USE_BUNDLED_TINYXML2)
find_package(tinyxml2 QUIET)
- if (NOT tinyxml2_FOUND)
+ if (tinyxml2_FOUND)
+ set(tinyxml2_LIBRARIES "tinyxml2")
+ else()
find_library(tinyxml2_LIBRARIES tinyxml2)
if (NOT tinyxml2_LIBRARIES)
message(FATAL_ERROR "tinyxml2 has not been found")