PKGBUILDs/extra/cppcheck/PKGBUILD

102 lines
3.1 KiB
Bash
Raw Normal View History

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>
2024-05-30 12:23:37 +00:00
# - remove makedepend on pandoc, don't generate manuals, don't install manuals we didn't generate
2020-02-26 04:34:21 +00:00
pkgname=cppcheck
2024-07-11 12:42:33 +00:00
pkgver=2.14.2
2024-05-30 12:23:37 +00:00
pkgrel=1
2022-05-22 12:47:49 +00:00
pkgdesc='A tool for static C/C++ code analysis'
2020-02-26 04:34:21 +00:00
arch=('x86_64')
2022-05-22 12:47:49 +00:00
url='http://cppcheck.sourceforge.net/'
2024-05-30 12:23:37 +00:00
license=('GPL-3.0-or-later')
2022-01-18 03:51:48 +00:00
depends=(
'python-pygments'
'tinyxml2'
2022-10-16 23:45:15 +00:00
'pcre'
2022-01-18 03:51:48 +00:00
)
makedepends=(
'git'
'docbook-xsl'
2023-09-16 07:25:31 +00:00
'qt6-tools'
'qt6-base'
'qt6-declarative'
2022-01-18 03:51:48 +00:00
'python'
'cmake'
'clang'
)
optdepends=(
2023-09-16 07:25:31 +00:00
'qt6-tools: run cppcheck-gui'
2022-01-18 03:51:48 +00:00
'python-pygments: cppcheck-htmlreport'
'clang: for cppcheck-gui integration'
)
source=(
2024-05-30 12:23:37 +00:00
"$pkgname::git+https://github.com/danmar/cppcheck.git#tag=$pkgver"
2022-01-18 03:51:48 +00:00
'translations-location.patch'
)
2024-07-11 12:42:33 +00:00
sha512sums=('6391d7ab4a2250db0a7b9d67234fa2e212777a3f9754c3f7eeaac3b0c4ca39bf12cda01265f84c704f7fa4a506f525bbea132c4770a5e93be7d70a89e8915a6d'
2023-07-03 13:37:35 +00:00
'd3528834d719017ec3a0e08005a293089b556622928defa1b37f940e62cb01165dcbd741e6d5e989c0156fb8789f7e63702af8b2390738648b2300a92f4ab0ae')
2024-07-11 12:42:33 +00:00
b2sums=('5e5be5c4260b65ca8dd98392118b81bf532c03177acf0a9af6be5225f2652e5b83bcc1f1d60155acedc2fa20c95851ea70160e372279f47de933396199688536'
2023-07-03 13:37:35 +00:00
'8156920eacc630cb5eceb2387937b747c84c6325bef906717cfbad68c122bdd27965da1e8070a560a0bed3a7b7c59ff5f0e116bb1d035c4c42f430c927a75b1f')
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
2023-06-27 10:37:08 +00:00
patch -p1 -i "$srcdir/translations-location.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
2024-05-30 12:23:37 +00:00
#pandoc man/writing-addons.md -o man/writing-addons.html -s --number-sections --toc
2022-01-18 03:51:48 +00:00
popd
2020-02-26 04:34:21 +00:00
2024-05-30 12:23:37 +00:00
cd "$pkgname"
2022-01-18 03:51:48 +00:00
cmake \
-B build \
2024-05-30 12:23:37 +00:00
-S . \
2023-09-16 07:25:31 +00:00
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D USE_MATCHCOMPILER=ON \
-D HAVE_RULES=ON \
-D BUILD_GUI=ON \
-D BUILD_SHARED_LIBS=OFF \
-D BUILD_TESTS=ON \
-D FILESDIR=/usr/share/cppcheck \
-D USE_BUNDLED_TINYXML2=OFF \
-D USE_QT6=ON
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() {
2024-05-30 12:23:37 +00:00
cd "$pkgname/build/bin"
2022-03-22 01:09:38 +00:00
./testrunner -g -q
}
2020-02-26 04:34:21 +00:00
package() {
2022-01-18 03:51:48 +00:00
cd "$pkgname"
2020-02-26 04:34:21 +00:00
2024-05-30 12:23:37 +00:00
DESTDIR="$pkgdir" cmake --install build
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
2024-05-30 12:23:37 +00:00
#install -vDm644 -t "$pkgdir/usr/share/doc/" man/manual.html
#install -vDm644 -t "$pkgdir/usr/share/doc/" man/reference-cfg-format.html
#install -vDm644 -t "$pkgdir/usr/share/doc/" man/writing-addons.html
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
}