aboutsummaryrefslogtreecommitdiffstats
path: root/community/cppcheck/APKBUILD
blob: df53ffbb9c04b64763f1b7d0b7a38cb6e18f053e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=cppcheck
pkgver=1.83
pkgrel=0
pkgdesc="Static analysis tool for C/C++ code"
url="http://cppcheck.sourceforge.net"
arch="all"
license="GPL-3.0-or-later"
depends=""
makedepends="docbook-xsl pcre-dev qt5-qttools-dev"
subpackages="$pkgname-doc $pkgname-htmlreport::noarch $pkgname-gui"
source="$pkgname-$pkgver.tar.gz::https://github.com/danmar/cppcheck/archive/$pkgver.tar.gz
	set_datadir.patch"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-*/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
}

check() {
	cd "$builddir"
	make SRCDIR=build check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes install
	install -Dm644 cppcheck.1 "$pkgdir"/usr/share/man/man1/cppcheck.1
}

htmlreport() {
	pkgdesc="Utility to generate a html report of a XML file produced by cppcheck"
	depends="$pkgname py-pygments"

	cd "$builddir"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/$subpkgname "$subpkgdir"/usr/bin/
}

gui() {
	pkgdesc="Qt gui for cppcheck"
	depends="$pkgname"

	cd "$builddir"
	mkdir -p "$subpkgdir"/usr/bin
	mv gui/$subpkgname "$subpkgdir"/usr/bin/

	mkdir -p "$subpkgdir"/usr/share/cppcheck/lang/
	mv gui/cppcheck*.qm "$subpkgdir"/usr/share/cppcheck/lang/
}

sha512sums="5b8ac1f2682876e5c91899397bcc2fdcd4d1efff759cedf9480d0a055b5cee28d1ab3a02ba742847a05262ad22153058caded94d9287af8f5816178897941909  cppcheck-1.83.tar.gz
013e3d1bb49602ac0bf39335d5b4df001aa98e1ad9689207063460edc30a4cd7b67f5e880bd0bcae0c03e5724a8bdd0cb5c8cafcb89a815dab24b2ead2923f36  set_datadir.patch"