desktop/cppcheck/PKGBUILD
2018-09-13 15:36:18 +02:00

54 lines
1.7 KiB
Bash

# Maintainer: Jelle van der Waa <jelle@archlinux.org>
# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
pkgname=cppcheck
pkgver=1.84
pkgrel=1
pkgdesc="A tool for static C/C++ code analysis"
arch=('x86_64')
url="http://cppcheck.sourceforge.net/"
license=('GPL')
depends=('qt5-base' 'python3-pygments')
makedepends=('docbook-xsl' 'qt5-tools' 'python3')
source=($pkgname-$pkgver.tar.gz::https://github.com/danmar/cppcheck/archive/${pkgver}.tar.gz)
sha1sums=('711a2d6b19612507df6ac44ed99d8e30f7464af9')
build() {
cd "${pkgname}-${pkgver}"
export CXXFLAGS+=" -DNDEBUG"
export PYTHON=/usr/bin/python3
# Unicode fix
LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes
make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-1.79.2/manpages/docbook.xsl CFGDIR=/usr/share/cppcheck/cfg man
cd gui
lrelease-qt5 gui.pro
qmake-qt5 HAVE_RULES=yes
make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes
}
check() {
cd "${pkgname}-${pkgver}"
#LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes test
}
package() {
cd "${pkgname}-${pkgver}"
LANG='en_US.UTF-8' make DESTDIR=${pkgdir} CFGDIR=/usr/share/cppcheck/cfg SRCDIR=build HAVE_RULES=yes install
install -D -p -m 644 cppcheck.1 "${pkgdir}"/usr/share/man/man1/cppcheck.1
# GUI
install -m755 gui/cppcheck-gui "${pkgdir}"/usr/bin
install -d "${pkgdir}/usr/share/applications/"
install -m644 gui/cppcheck-gui.desktop "${pkgdir}/usr/share/applications/"
install -d "${pkgdir}"/usr/share/cppcheck/cfg
install -D ./cfg/* -t "${pkgdir}"/usr/share/cppcheck/cfg
install -d "${pkgdir}"/usr/share/cppcheck/cfg/lang
install -D gui/*.qm -t "${pkgdir}"/usr/share/cppcheck/cfg/lang/
}