summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD113
1 files changed, 65 insertions, 48 deletions
diff --git a/PKGBUILD b/PKGBUILD
index c179c5f865a8..7a6161af10c0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,62 +1,79 @@
-# Contributor: Thomas Dziedzic < gostrc at gmail >
-# Contributor: Matthias matthiaskrgr Krüger < matthias · krueger _strange_curverd_character_ famsik · de >
-# Maintainer: aksr <aksr at t-com dot me>
-pkgname=cppcheck-git
-pkgver=1.80.382.gd18e8466a
+# Maintainer: éclairevoyant
+# Contributor: George Rawlinson <grawlinson at archlinux dot org>
+# Contributor: Jelle van der Waa <jelle at archlinux dot org>
+# Contributor: Stéphane Gaudreault <stephane at archlinux dot org>
+
+_pkgname=cppcheck
+pkgname="$_pkgname-git"
+pkgver=2.7.r1730.58dd92dd1
pkgrel=1
-pkgdesc='A tool for static C/C++ code analysis.'
-arch=('i686' 'x86_64')
-url='http://cppcheck.wiki.sourceforge.net'
+epoch=1
+pkgdesc='Tool for static C/C++ code analysis'
+arch=(i686 x86_64)
+url='https://cppcheck.sourceforge.io/'
license=('GPL3')
-provides=('cppcheck')
-conflicts=('cppcheck')
-makedepends=('git' 'docbook-xsl' 'qt5-tools' 'python')
-depends=('qt5-base' 'python-pygments' 'gcc-libs')
-optdeps=('qt5: to build and run cppcheck-gui')
-source=("$pkgname::git://github.com/danmar/cppcheck.git")
-md5sums=('SKIP')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+depends=(pcre python tinyxml2)
+makedepends=(clang cmake docbook-xsl git pandoc python-pygments qt5-base qt5-tools)
+optdepends=('qt5-tools: cppcheck-gui'
+ 'python-pygments: cppcheck-htmlreport'
+ 'clang: cppcheck-gui integration')
+source=("git+https://github.com/danmar/$_pkgname.git"
+ translations-location.patch)
+b2sums=('SKIP'
+ '8156920eacc630cb5eceb2387937b747c84c6325bef906717cfbad68c122bdd27965da1e8070a560a0bed3a7b7c59ff5f0e116bb1d035c4c42f430c927a75b1f')
+
+prepare() {
+ cd $_pkgname
+ patch -Np1 -i ../translations-location.patch
+}
pkgver() {
- cd "$srcdir/$pkgname"
- git describe --tags | sed -e 's/^cppcheck\-//' -e 's/-/./g'
+ git -C $_pkgname describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g'
}
build() {
- cd "$srcdir/$pkgname"
- LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes
- xsversion=$(pacman -Qi docbook-xsl | grep ^Version | sed -e 's/.*: //' -e 's/-[0-9]$//')
- make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-${xsversion}/manpages/docbook.xsl man
-
- cd gui
- lrelease-qt5 gui.pro
- qmake-qt5 HAVE_RULES=yes
- make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes
+ export CXXFLAGS+=" -DNDEBUG"
+
+ # 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
+
+ cmake \
+ -B build \
+ -S $_pkgname \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DUSE_MATCHCOMPILER=ON \
+ -DHAVE_RULES=ON \
+ -DBUILD_GUI=ON \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DBUILD_TESTS=ON \
+ -DFILESDIR=/usr/share/cppcheck \
+ -DUSE_BUNDLED_TINYXML2=OFF
+
+ cmake --build build
}
check() {
- cd "$srcdir/$pkgname"
- #LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes test
-
- mkdir -p make_check
- cd make_check
- cp -rp ../* . || true
- rm -r ./make_check
-
- make SRCDIR=build CFGDIR=./cfg HAVE_RULES=yes testrunner || make clean
- make SRCDIR=build CFGDIR=./cfg HAVE_RULES=yes testrunner
- ./testrunner || make clean
- make SRCDIR=build CFGDIR=./cfg HAVE_RULES=yes testrunner
- ./testrunner
+ cd build/bin
+ ./testrunner -g -q
}
package() {
- cd "$srcdir/$pkgname"
- LANG='en_US.UTF-8' make DESTDIR="${pkgdir}" CFGDIR=/usr/share/cppcheck/cfg SRCDIR=build HAVE_RULES=yes install
- install -Dpm 644 cppcheck.1 "${pkgdir}"/usr/share/man/man1/cppcheck.1
-
- mkdir -p ${pkgdir}/usr/share/{applications,cppcheck/cfg/lang}/
- install -Dm755 gui/cppcheck-gui "${pkgdir}"/usr/bin/cppcheck-gui
- install -D ./cfg/* -t "${pkgdir}"/usr/share/cppcheck/cfg
- install -D gui/*.qm -t "${pkgdir}"/usr/share/cppcheck/cfg/lang/
-}
+ DESTDIR="$pkgdir" cmake --install build
+
+ cd $_pkgname
+ install -vDm644 $_pkgname.1 -t "$pkgdir/usr/share/man/man1/"
+ install -vDm755 htmlreport/cppcheck-htmlreport -t "$pkgdir/usr/bin"
+
+ # 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/
+}