From dd8e0df789ecf9e15f1711be90d1444700dc0350 Mon Sep 17 00:00:00 2001 From: 4fury Date: Sun, 28 Jun 2020 09:07:41 +0300 Subject: [PATCH 1/3] cppcheck: version bump with gui. --- programming/tool/cppcheck/actions.py | 27 +++++++++----- programming/tool/cppcheck/pspec.xml | 53 +++++++++++++++++++++++++--- 2 files changed, 68 insertions(+), 12 deletions(-) diff --git a/programming/tool/cppcheck/actions.py b/programming/tool/cppcheck/actions.py index 3d6659c8fb..342f16af11 100644 --- a/programming/tool/cppcheck/actions.py +++ b/programming/tool/cppcheck/actions.py @@ -4,21 +4,32 @@ # Licensed under the GNU General Public License, version 3. # See the file https://www.gnu.org/licenses/gpl-3.0.txt -from pisi.actionsapi import autotools +from pisi.actionsapi import shelltools +from pisi.actionsapi import cmaketools from pisi.actionsapi import pisitools from pisi.actionsapi import get -t = 'FILESDIR=/usr/share/cppcheck CFGDIR=/usr/share/cppcheck/cfg' +j = "-DHAVE_RULES=ON \ + -DBUILD_GUI=ON \ + -DWITH_QCHART=ON \ + -DENABLE_CHECK_INTERNAL=ON -L \ + " + +def setup(): + shelltools.makedirs("build") + shelltools.cd("build") + cmaketools.configure("-DUSE_Z3=OFF -DBUILD_TESTS=OFF %s" % j, sourceDir = '..') def build(): - pisitools.cxxflags.add("-DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function") - autotools.make("MATCHCOMPILER=yes %s HAVE_RULES=yes" % t) + shelltools.cd("build") + cmaketools.make() -def check(): - autotools.make("check %s" % t) +#def check(): +# cmaketools.make("test") def install(): - autotools.rawInstall("DESTDIR=%s %s" % (get.installDIR(), t)) + shelltools.cd("build") + cmaketools.rawInstall("DESTDIR=%s" % get.installDIR()) - pisitools.dodoc("AUTHORS", "COPYING", "readme*") + pisitools.dodoc("../AUTHORS", "../COPYING", "../readme*") diff --git a/programming/tool/cppcheck/pspec.xml b/programming/tool/cppcheck/pspec.xml index 319293ef68..bcc3fcb079 100644 --- a/programming/tool/cppcheck/pspec.xml +++ b/programming/tool/cppcheck/pspec.xml @@ -1,5 +1,5 @@ - + cppcheck @@ -15,25 +15,70 @@ Cppcheck is a static analysis tool for C/C++ code. It provides unique code analysis to detect bugs and focuses on detecting undefined behaviour and dangerous coding constructs. The goal is to detect only real errors in the code (i.e. have very few false positives). - https://github.com/danmar/cppcheck/archive/1.90.tar.gz + + https://github.com/danmar/cppcheck/archive/2.1.tar.gz + + cmake + python3 + + zlib-devel + qt5-linguist libpcre-devel + libxslt-devel + qt5-base-devel + tinyxml2-devel + qt5-charts-devel + + qm_install_path.patch + cppcheck + libgcc + libpcre + python3 + python3-Pygments - /usr/bin - /usr/share/cppcheck + /usr/bin/cppcheck + /usr/share + /usr/share/doc + + app:gui + cppcheck-gui + + cppcheck + + libgcc + libpcre + qt5-base + qt5-charts + + + /usr/bin/cppcheck-gui + /usr/share/applications + /usr/share/icons + /usr/share/Cppcheck/lang + + + + + 2020-06-27 + 2.1 + Ver. bump + fury + wascheme@tuta.io + 2020-04-16 1.90 From ec92528fab5cbf525d54efa8016282dd66eea85f Mon Sep 17 00:00:00 2001 From: 4fury Date: Sun, 28 Jun 2020 09:12:38 +0300 Subject: [PATCH 2/3] cppcheck: patch. --- .../tool/cppcheck/files/qm_install_path.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 programming/tool/cppcheck/files/qm_install_path.patch diff --git a/programming/tool/cppcheck/files/qm_install_path.patch b/programming/tool/cppcheck/files/qm_install_path.patch new file mode 100644 index 0000000000..b43d82cafe --- /dev/null +++ b/programming/tool/cppcheck/files/qm_install_path.patch @@ -0,0 +1,37 @@ +--- a/gui/CMakeLists.txt 2020-05-10 12:31:19.000000000 +0300 ++++ b/gui/CMakeLists.txt 2020-05-28 16:22:24.704402614 +0300 +@@ -37,7 +37,7 @@ + endif() + + install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) +- install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) ++ install(FILES ${qms} DESTINATION share/${PROJECT_NAME}/lang COMPONENT applications) + + install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + +--- a/gui/translationhandler.cpp 2020-05-28 16:29:27.334549404 +0300 ++++ b/gui/translationhandler.cpp 2020-05-28 16:27:15.183706532 +0300 +@@ -116,15 +116,16 @@ + if (datadir.isEmpty()) + datadir = appPath; + +- QString translationFile; +- if (QFile::exists(datadir + "/lang/" + mTranslations[index].mFilename + ".qm")) +- translationFile = datadir + "/lang/" + mTranslations[index].mFilename + ".qm"; ++// 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 if (QFile::exists(datadir + "/" + mTranslations[index].mFilename + ".qm")) ++// translationFile = datadir + "/" + mTranslations[index].mFilename + ".qm"; + +- else +- translationFile = appPath + "/" + mTranslations[index].mFilename + ".qm"; ++// else ++// translationFile = appPath + "/" + mTranslations[index].mFilename + ".qm"; ++ QString translationFile("/usr/share/Cppcheck/lang/" + mTranslations[index].mFilename + ".qm"); + + if (!mTranslator->load(translationFile) && !failure) { + //If it failed, lets check if the default file exists From d103c466cf9e0da4ee8bd5bbd4c8c5a3b37382e9 Mon Sep 17 00:00:00 2001 From: 4fury Date: Sun, 28 Jun 2020 09:22:45 +0300 Subject: [PATCH 3/3] unneed dep. --- programming/tool/cppcheck/pspec.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/programming/tool/cppcheck/pspec.xml b/programming/tool/cppcheck/pspec.xml index bcc3fcb079..5c306262cd 100644 --- a/programming/tool/cppcheck/pspec.xml +++ b/programming/tool/cppcheck/pspec.xml @@ -25,7 +25,6 @@ zlib-devel qt5-linguist libpcre-devel - libxslt-devel qt5-base-devel tinyxml2-devel qt5-charts-devel