aboutsummaryrefslogblamecommitdiffstats
path: root/community/cppcheck/APKBUILD
blob: 2bb48292d8ae7ec603dbae083138e8619c767b7e (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                 
                                                   
                
          
        
                                             
                                     
                                                        
                          
                                                                 
                                                                   
                                                                                          

                                         
                                
         

         



                                              
                                                                                     

              

                                
                                                                                                    

 
         
                               

 
           
                                                                                                                 
                                                                         


              
                                                                                      
                                               
 
                      




                                                              
                                     
                          
 
                      
                                     
                                                




                                                                 
                                                                                                                                                                 
                                                                                                                                                   

                                                                                                                                                                   
# Contributor: August Klein <amatcoder@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=cppcheck
pkgver=2.2
pkgrel=0
pkgdesc="Static analysis tool for C/C++ code"
url="http://cppcheck.sourceforge.net"
arch="all !s390x !aarch64 !mips !mips64" # limited by z3
license="GPL-3.0-or-later"
makedepends="docbook-xsl pcre-dev python3 qt5-qttools-dev z3-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
	disable-findFunction19-test.patch
	python3-htmlreport.patch
	"

build() {
	# HACK get python to mean what we want
	ln -s /usr/bin/python3 python
	export PATH="$(pwd):$PATH"

	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 FILESDIR=/usr/share/cppcheck
}

check() {
	make SRCDIR=build check
}

package() {
	make DESTDIR="$pkgdir" CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes FILESDIR=/usr/share/cppcheck 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 python3 py3-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="d766187a69d6aa839e072e3c0ed44009621ca8492504257288ca2f49774f705a1ebcf2957f0801ac6eab2ffbdd845e9237f1213f85c6d0fcdbf16b1e7c690327  cppcheck-2.2.tar.gz
013e3d1bb49602ac0bf39335d5b4df001aa98e1ad9689207063460edc30a4cd7b67f5e880bd0bcae0c03e5724a8bdd0cb5c8cafcb89a815dab24b2ead2923f36  set_datadir.patch
dd118f930aa509ee3d8b39d920f5de38b425657cc8a44520bb13b8f744aa4f2fe2bcd61141dbe1730f3202b70aecd3ef2531a04b8ebccdc5475cbe1a4dda38ab  disable-findFunction19-test.patch
346c5b41af809dfbff00b7ce66f8abc0e038d6272cf08bbefc4bfc6eaf32940815faca376609165de85072761271521c2a7a56aa7c59e88f65f7d9514b35aaff  python3-htmlreport.patch"