[arch-commits] Commit in cppcheck/trunk (PKGBUILD translations-location.patch)
Jelle van der Waa
jelle at archlinux.org
Wed Oct 2 11:58:16 UTC 2019
Date: Wednesday, October 2, 2019 @ 11:58:16
Author: jelle
Revision: 512415
upgpkg: cppcheck 1.89-1
Upstream update and split cppcheck-gui into an optdepends fixes FS#42725.
Added:
cppcheck/trunk/translations-location.patch
Modified:
cppcheck/trunk/PKGBUILD
-----------------------------+
PKGBUILD | 27 +++++++++++++++++++--------
translations-location.patch | 20 ++++++++++++++++++++
2 files changed, 39 insertions(+), 8 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2019-10-02 10:54:24 UTC (rev 512414)
+++ PKGBUILD 2019-10-02 11:58:16 UTC (rev 512415)
@@ -2,22 +2,30 @@
# Maintainer: Stéphane Gaudreault <stephane at archlinux.org>
pkgname=cppcheck
-pkgver=1.86
+pkgver=1.89
pkgrel=1
pkgdesc="A tool for static C/C++ code analysis"
arch=('x86_64')
url="http://cppcheck.sourceforge.net/"
license=('GPL')
-depends=('qt5-base' 'python-pygments')
-makedepends=('docbook-xsl' 'qt5-tools' 'python')
-source=($pkgname-$pkgver.tar.gz::https://github.com/danmar/cppcheck/archive/${pkgver}.tar.gz)
-sha1sums=('03d21f48252e2f8a6742c53c4a7e01d0f40c35aa')
+depends=('python-pygments')
+makedepends=('docbook-xsl' 'qt5-tools' 'qt5-base' 'python')
+optdepends=('qt5-base: run cppcheck-gui')
+source=($pkgname-$pkgver.tar.gz::https://github.com/danmar/cppcheck/archive/${pkgver}.tar.gz
+ translations-location.patch)
+sha1sums=('9114a99e629ac820f417e5a4e7c7af47cb90050f'
+ '03b0888438cf92ccdcbf307dbc3c35e65c91b844')
+prepare() {
+ cd "${pkgname}-${pkgver}"
+ patch -Np1 -i $srcdir/translations-location.patch
+}
+
build() {
cd "${pkgname}-${pkgver}"
export CXXFLAGS+=" -DNDEBUG"
# Unicode fix
- LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes
+ LANG='en_US.UTF-8' make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes USE_MATCHCOMPILER=yes
make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-1.79.2/manpages/docbook.xsl CFGDIR=/usr/share/cppcheck/cfg man
@@ -24,7 +32,7 @@
cd gui
lrelease gui.pro
qmake HAVE_RULES=yes
- make SRCDIR=build CFGDIR=/usr/share/cppcheck/cfg HAVE_RULES=yes
+ make CFGDIR=/usr/share/cppcheck/cfg USE_MATCHCOMPILER=yes HAVE_RULES=yes SRCDIR=build
}
check() {
@@ -35,7 +43,10 @@
package() {
cd "${pkgname}-${pkgver}"
- LANG='en_US.UTF-8' make DESTDIR=${pkgdir} CFGDIR=/usr/share/cppcheck/cfg SRCDIR=build HAVE_RULES=yes install
+ LANG='en_US.UTF-8' make DESTDIR="${pkgdir}" \
+ FILESDIR=/usr/share/cppcheck \
+ CFGDIR=/usr/share/cppcheck/cfg \
+ USE_MATCHCOMPILER=yes HAVE_RULES=yes install
install -D -p -m 644 cppcheck.1 "${pkgdir}"/usr/share/man/man1/cppcheck.1
Added: translations-location.patch
===================================================================
--- translations-location.patch (rev 0)
+++ translations-location.patch 2019-10-02 11:58:16 UTC (rev 512415)
@@ -0,0 +1,20 @@
+diff -aur cppcheck-1.89/gui/translationhandler.cpp cppcheck-1.89.new/gui/translationhandler.cpp
+--- cppcheck-1.89/gui/translationhandler.cpp 2019-09-01 15:01:12.000000000 +0200
++++ cppcheck-1.89.new/gui/translationhandler.cpp 2019-10-02 13:47:44.503900628 +0200
+@@ -116,15 +116,7 @@
+ if (datadir.isEmpty())
+ datadir = appPath;
+
+- QString translationFile;
+- if (QFile::exists(datadir + "/lang/" + mTranslations[index].mFilename + ".qm"))
+- translationFile = datadir + "/lang/" + mTranslations[index].mFilename + ".qm";
+-
+- else if (QFile::exists(datadir + "/" + mTranslations[index].mFilename + ".qm"))
+- translationFile = datadir + "/" + mTranslations[index].mFilename + ".qm";
+-
+- else
+- translationFile = appPath + "/" + mTranslations[index].mFilename + ".qm";
++ QString translationFile("/usr/share/cppcheck/cfg/lang/" + mTranslations[index].mFilename + ".qm");
+
+ if (!mTranslator->load(translationFile) && !failure) {
+ //If it failed, lets check if the default file exists
More information about the arch-commits
mailing list