Skip to content

Instantly share code, notes, and snippets.

@simonfxr
Created September 12, 2019 20:02
Show Gist options
  • Save simonfxr/a8790010d7165ca367008feb513116a2 to your computer and use it in GitHub Desktop.
Save simonfxr/a8790010d7165ca367008feb513116a2 to your computer and use it in GitHub Desktop.
cppcheck-git PKGBUILD patch
diff --git a/PKGBUILD b/PKGBUILD
index c179c5f..d34bee7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# 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
+pkgver=1.89.80.ga4ca6dfee
pkgrel=1
pkgdesc='A tool for static C/C++ code analysis.'
arch=('i686' 'x86_64')
@@ -16,25 +16,42 @@ optdeps=('qt5: to build and run cppcheck-gui')
source=("$pkgname::git://github.com/danmar/cppcheck.git")
md5sums=('SKIP')
+__CXXFLAGS="$CXXFLAGS"
+
pkgver() {
cd "$srcdir/$pkgname"
git describe --tags | sed -e 's/^cppcheck\-//' -e 's/-/./g'
}
+__setup() {
+ export CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function -fpic ${__CXXFLAGS}"
+ export CXXFLAGS
+ export CFLAGS="$CXXFLAGS"
+ export LC_ALL="en_US.UTF-8"
+ # Redundant, but keep apps happy directly checking $LANG"
+ export LANG="en_US.UTF-8"
+ export HAVE_RULES=yes
+ export MATCHCOMPILER=yes
+ export FILESDIR=/usr/share/cppcheck
+}
+
build() {
cd "$srcdir/$pkgname"
- LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes
+ __setup
+
+ make
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
+ make
}
check() {
cd "$srcdir/$pkgname"
+ __setup
#LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes test
mkdir -p make_check
@@ -51,7 +68,8 @@ check() {
package() {
cd "$srcdir/$pkgname"
- LANG='en_US.UTF-8' make DESTDIR="${pkgdir}" CFGDIR=/usr/share/cppcheck/cfg SRCDIR=build HAVE_RULES=yes install
+ __setup
+ make DESTDIR="${pkgdir}" install
install -Dpm 644 cppcheck.1 "${pkgdir}"/usr/share/man/man1/cppcheck.1
mkdir -p ${pkgdir}/usr/share/{applications,cppcheck/cfg/lang}/
@@ -59,4 +77,3 @@ package() {
install -D ./cfg/* -t "${pkgdir}"/usr/share/cppcheck/cfg
install -D gui/*.qm -t "${pkgdir}"/usr/share/cppcheck/cfg/lang/
}
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment