mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-03-19 00:21:40 +00:00
community/cppcheck to 2.6.3-1
This commit is contained in:
parent
8ff2511bcb
commit
cace3cc5e2
1 changed files with 68 additions and 44 deletions
|
@ -1,73 +1,97 @@
|
||||||
# Maintainer: Jelle van der Waa <jelle@archlinux.org>
|
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
|
||||||
|
# Contributor: Jelle van der Waa <jelle@archlinux.org>
|
||||||
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
|
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
|
||||||
|
|
||||||
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||||
# - remove makedepend on pandoc, don't generate manuals
|
# - remove makedepend on pandoc, don't generate manuals
|
||||||
|
|
||||||
pkgname=cppcheck
|
pkgname=cppcheck
|
||||||
pkgver=2.6
|
pkgver=2.6.3
|
||||||
pkgrel=2
|
pkgrel=1
|
||||||
pkgdesc="A tool for static C/C++ code analysis"
|
pkgdesc="A tool for static C/C++ code analysis"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="http://cppcheck.sourceforge.net/"
|
url="http://cppcheck.sourceforge.net/"
|
||||||
license=('GPL')
|
license=('GPL')
|
||||||
depends=('python-pygments' 'tinyxml2')
|
depends=(
|
||||||
makedepends=('docbook-xsl' 'qt5-tools' 'qt5-base' 'python' 'cmake' 'clang')
|
'python-pygments'
|
||||||
optdepends=('qt5-tools: run cppcheck-gui'
|
'tinyxml2'
|
||||||
'python-pygments: cppcheck-htmlreport'
|
)
|
||||||
'clang: for cppcheck-gui integration')
|
makedepends=(
|
||||||
source=($pkgname-$pkgver.tar.gz::https://github.com/danmar/cppcheck/archive/${pkgver}.tar.gz
|
'git'
|
||||||
translations-location.patch
|
'docbook-xsl'
|
||||||
https://github.com/danmar/cppcheck/commit/8d682884.patch)
|
'qt5-tools'
|
||||||
sha1sums=('bf7808d527f9f3543d301c6b0b31d308bf97dfa2'
|
'qt5-base'
|
||||||
'03b0888438cf92ccdcbf307dbc3c35e65c91b844'
|
'python'
|
||||||
'7846c2e482320c2f6f9352dc134fdf0ad39faec8')
|
'cmake'
|
||||||
|
'clang'
|
||||||
|
)
|
||||||
|
optdepends=(
|
||||||
|
'qt5-tools: run cppcheck-gui'
|
||||||
|
'python-pygments: cppcheck-htmlreport'
|
||||||
|
'clang: for cppcheck-gui integration'
|
||||||
|
)
|
||||||
|
_commit='3e518e64d0f1fb1e8b71f2d0e8c07d36e31d0ffc'
|
||||||
|
source=(
|
||||||
|
"$pkgname::git+https://github.com/danmar/cppcheck.git#commit=$_commit"
|
||||||
|
'translations-location.patch'
|
||||||
|
)
|
||||||
|
sha512sums=('SKIP'
|
||||||
|
'd3528834d719017ec3a0e08005a293089b556622928defa1b37f940e62cb01165dcbd741e6d5e989c0156fb8789f7e63702af8b2390738648b2300a92f4ab0ae')
|
||||||
|
b2sums=('SKIP'
|
||||||
|
'8156920eacc630cb5eceb2387937b747c84c6325bef906717cfbad68c122bdd27965da1e8070a560a0bed3a7b7c59ff5f0e116bb1d035c4c42f430c927a75b1f')
|
||||||
|
|
||||||
|
pkgver() {
|
||||||
|
cd "$pkgname"
|
||||||
|
git describe --tags
|
||||||
|
}
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cd "${pkgname}-${pkgver}"
|
cd "$pkgname"
|
||||||
patch -Np1 -i $srcdir/translations-location.patch
|
patch -p1 -i ../translations-location.patch
|
||||||
patch -p1 < ../8d682884.patch # Fix build with GCC 11
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${pkgname}-${pkgver}"
|
export CXXFLAGS+=" -DNDEBUG"
|
||||||
export CXXFLAGS+=" -DNDEBUG"
|
|
||||||
|
|
||||||
# Manuals
|
# Manuals
|
||||||
xsversion=$(pacman -Qi docbook-xsl | grep ^Version | sed -e 's/.*: //' -e 's/-[0-9]$//')
|
pushd "$pkgname"
|
||||||
make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-${xsversion}-nons/manpages/docbook.xsl man
|
xsversion=$(pacman -Qi docbook-xsl | grep ^Version | sed -e 's/.*: //' -e 's/-[0-9]$//')
|
||||||
#pandoc man/manual.md -o man/manual.html -s --number-sections --toc
|
make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-${xsversion}-nons/manpages/docbook.xsl man
|
||||||
#pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-sections --toc
|
#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
|
||||||
|
|
||||||
cd build
|
cmake \
|
||||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \
|
-B build \
|
||||||
-DUSE_MATCHCOMPILER=yes -DHAVE_RULES=yes \
|
-S "$pkgname" \
|
||||||
-DBUILD_GUI=yes -DBUILD_SHARED_LIBS:BOOL=OFF \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DBUILD_TESTS=yes -DFILESDIR=/usr/share/cppcheck \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DUSE_BUNDLED_TINYXML2=OFF \
|
-DUSE_MATCHCOMPILER=yes \
|
||||||
..
|
-DHAVE_RULES=yes \
|
||||||
|
-DBUILD_GUI=yes \
|
||||||
|
-DBUILD_SHARED_LIBS=no \
|
||||||
|
-DBUILD_TESTS=yes \
|
||||||
|
-DFILESDIR=/usr/share/cppcheck \
|
||||||
|
-DUSE_BUNDLED_TINYXML2=no
|
||||||
|
|
||||||
make
|
cmake --build build
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
cd "${pkgname}-${pkgver}/build/bin"
|
cd build/bin
|
||||||
./testrunner -g -q
|
./testrunner -g -q
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "${pkgname}-${pkgver}/build"
|
DESTDIR="$pkgdir" cmake --install build
|
||||||
make DESTDIR="${pkgdir}" install
|
|
||||||
|
|
||||||
cd ..
|
cd "$pkgname"
|
||||||
|
|
||||||
install -D -p -m 644 cppcheck.1 "${pkgdir}"/usr/share/man/man1/cppcheck.1
|
install -vDm644 -t "$pkgdir/usr/share/man/man1" cppcheck.1
|
||||||
install -D -p -m 755 htmlreport/cppcheck-htmlreport "${pkgdir}"/usr/bin/cppcheck-htmlreport
|
install -vDm755 -t "$pkgdir/usr/bin" htmlreport/cppcheck-htmlreport
|
||||||
|
|
||||||
# Fix location of language files
|
# Fix location of language files
|
||||||
install -d "${pkgdir}"/usr/share/cppcheck/cfg/lang
|
install -d "${pkgdir}"/usr/share/cppcheck/cfg/lang
|
||||||
mv "${pkgdir}"/usr/bin/cppcheck_*.qm "${pkgdir}"/usr/share/cppcheck/cfg/lang/
|
mv "${pkgdir}"/usr/bin/cppcheck_*.qm "${pkgdir}"/usr/share/cppcheck/cfg/lang/
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue