diff --git a/2.6.3.tar.gz b/2.6.3.tar.gz new file mode 100644 index 0000000..9898b5e Binary files /dev/null and b/2.6.3.tar.gz differ diff --git a/bugfix-SIGSTKSZ-not-constant.patch b/bugfix-SIGSTKSZ-not-constant.patch deleted file mode 100644 index f953603..0000000 --- a/bugfix-SIGSTKSZ-not-constant.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -Nur cppcheck-1.83/cli/cppcheckexecutor.cpp cppcheck-1.83-new/cli/cppcheckexecutor.cpp ---- cppcheck-1.83/cli/cppcheckexecutor.cpp 2018-04-02 15:02:50.000000000 +0800 -+++ cppcheck-1.83-new/cli/cppcheckexecutor.cpp 2021-08-10 15:29:21.000000000 +0800 -@@ -295,7 +295,12 @@ - #endif - } - -+ -+#ifdef __USE_DYNAMIC_STACK_SIZE -+static const size_t MYSTACKSIZE = 16*1024+32768; // wild guess about a reasonable buffer -+#else - static const size_t MYSTACKSIZE = 16*1024+SIGSTKSZ; // wild guess about a reasonable buffer -+#endif - static char mytstack[MYSTACKSIZE]= {0}; // alternative stack for signal handler - static bool bStackBelowHeap=false; // lame attempt to locate heap vs. stack address space. See CppCheckExecutor::check_wrapper() - diff --git a/cppcheck-1.78-cfgdir.patch b/cppcheck-1.78-cfgdir.patch deleted file mode 100644 index f42f0bb..0000000 --- a/cppcheck-1.78-cfgdir.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up cppcheck-1.78/CMakeLists.txt.orig cppcheck-1.78/CMakeLists.txt -diff -up cppcheck-1.78/cmake/options.cmake.orig cppcheck-1.78/cmake/options.cmake ---- cppcheck-1.78/cmake/options.cmake.orig 2017-04-01 11:05:13.000000000 +0200 -+++ cppcheck-1.78/cmake/options.cmake 2017-04-09 14:13:30.130818011 +0200 -@@ -23,6 +23,11 @@ option(ANALYZE_DATAFLOW "Clang dynam - option(WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF) - option(WARNINGS_ANSI_ISO "Issue all the mandatory diagnostics Listed in C standard" ON) - -+option(CFGDIR "Configuration file directory" OFF) -+if(CFGDIR) -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCFG=${CFGDIR}") -+endif(CFGDIR) -+ - set(USE_MATCHCOMPILER "Auto" CACHE STRING "Usage of match compliler") - set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify) - if (USE_MATCHCOMPILER STREQUAL "Auto") diff --git a/cppcheck-1.81-translations.patch b/cppcheck-1.81-translations.patch deleted file mode 100644 index 9e9a662..0000000 --- a/cppcheck-1.81-translations.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -up cppcheck-1.81/gui/CMakeLists.txt.translations cppcheck-1.81/gui/CMakeLists.txt ---- cppcheck-1.81/gui/CMakeLists.txt.translations 2017-10-18 16:41:50.647580110 +0200 -+++ cppcheck-1.81/gui/CMakeLists.txt 2017-10-18 16:42:38.432882931 +0200 -@@ -27,7 +27,7 @@ if (BUILD_GUI) - qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS}) - - 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) - -diff -up cppcheck-1.81/gui/translationhandler.cpp.translations cppcheck-1.81/gui/translationhandler.cpp ---- cppcheck-1.81/gui/translationhandler.cpp.translations 2017-10-07 23:11:39.000000000 +0200 -+++ cppcheck-1.81/gui/translationhandler.cpp 2017-10-18 16:41:50.649580081 +0200 -@@ -116,15 +116,7 @@ bool TranslationHandler::setLanguage(con - 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/lang/" + mTranslations[index].mFilename + ".qm"); - - if (!mTranslator->load(translationFile) && !failure) { - //If it failed, lets check if the default file exists diff --git a/cppcheck-1.83-cmake.patch b/cppcheck-1.83-cmake.patch deleted file mode 100644 index 04fc91c..0000000 --- a/cppcheck-1.83-cmake.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up cppcheck-1.83/cmake/findDependencies.cmake.qt5cmake cppcheck-1.83/cmake/findDependencies.cmake ---- cppcheck-1.83/cmake/findDependencies.cmake.qt5cmake 2018-04-02 09:02:50.000000000 +0200 -+++ cppcheck-1.83/cmake/findDependencies.cmake 2018-06-02 16:50:28.656036644 +0200 -@@ -1,6 +1,8 @@ - if (BUILD_GUI) -- set(GUI_QT_COMPONENTS Core Gui Widgets PrintSupport) -- find_package(Qt5 COMPONENTS ${GUI_QT_COMPONENTS}) -+ find_package(Qt5Core) -+ find_package(Qt5Gui) -+ find_package(Qt5Widgets) -+ find_package(Qt5PrintSupport) - find_package(Qt5LinguistTools) - endif() - -diff -up cppcheck-1.83/CMakeLists.txt.qt5cmake cppcheck-1.83/CMakeLists.txt ---- cppcheck-1.83/CMakeLists.txt.qt5cmake 2018-06-02 16:47:11.038242820 +0200 -+++ cppcheck-1.83/CMakeLists.txt 2018-06-02 16:47:11.070242301 +0200 -@@ -1,5 +1,5 @@ - project(CppCheck) --cmake_minimum_required(VERSION 2.8.4) -+cmake_minimum_required(VERSION 2.8.11) - - include(GNUInstallDirs) - -diff -up cppcheck-1.83/gui/CMakeLists.txt.qt5cmake cppcheck-1.83/gui/CMakeLists.txt ---- cppcheck-1.83/gui/CMakeLists.txt.qt5cmake 2018-06-02 16:47:11.049242641 +0200 -+++ cppcheck-1.83/gui/CMakeLists.txt 2018-06-02 16:47:24.622022436 +0200 -@@ -24,8 +24,8 @@ if (BUILD_GUI) - target_link_libraries(cppcheck-gui pcre) - endif() - target_link_libraries(cppcheck-gui tinyxml2) -- qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS}) -- -+ target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport) -+ - install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) - install(FILES ${qms} DESTINATION share/${PROJECT_NAME}/lang/ COMPONENT applications) - diff --git a/cppcheck-1.83-tinyxml.patch b/cppcheck-1.83-tinyxml.patch deleted file mode 100644 index b396f48..0000000 --- a/cppcheck-1.83-tinyxml.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- cppcheck-1.83.orig/cli/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/cli/CMakeLists.txt 2018-04-12 12:46:04.990212969 -0400 -@@ -1,5 +1,4 @@ - include_directories(${PROJECT_SOURCE_DIR}/lib/) --include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) - include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) - - file(GLOB hdrs "*.h") -@@ -8,13 +7,14 @@ - list(REMOVE_ITEM srcs ${mainfile}) - - add_library(cli_objs OBJECT ${hdrs} ${srcs}) --add_executable(cppcheck ${hdrs} ${mainfile} $ $ $ $) -+add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) - if (HAVE_RULES) - target_link_libraries(cppcheck pcre) - endif() - if (MSVC) - target_link_libraries(cppcheck Shlwapi.lib) - endif() -+target_link_libraries(cppcheck tinyxml2) - - install(TARGETS cppcheck - RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ---- cppcheck-1.83.orig/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/CMakeLists.txt 2018-04-12 12:45:04.959219411 -0400 -@@ -16,7 +16,6 @@ - enable_testing() - endif() - --add_subdirectory(externals/tinyxml) - add_subdirectory(externals/simplecpp) - add_subdirectory(lib) # CppCheck Library - add_subdirectory(cli) # Client application ---- cppcheck-1.83.orig/gui/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/gui/CMakeLists.txt 2018-04-12 12:45:04.959219411 -0400 -@@ -10,7 +10,6 @@ - endif() - - include_directories(${PROJECT_SOURCE_DIR}/lib/) -- include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/) - - file(GLOB hdrs "*.h") - file(GLOB srcs "*.cpp") -@@ -20,10 +19,11 @@ - QT5_ADD_RESOURCES(resources "gui.qrc") - QT5_ADD_TRANSLATION(qms ${tss}) - -- add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $ $) -+ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $) - if (HAVE_RULES) - target_link_libraries(cppcheck-gui pcre) - endif() -+ target_link_libraries(cppcheck-gui tinyxml2) - qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS}) - - install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) ---- cppcheck-1.83.orig/test/CMakeLists.txt 2018-04-02 03:02:50.000000000 -0400 -+++ cppcheck-1.83.orig/test/CMakeLists.txt 2018-04-12 12:45:04.959219411 -0400 -@@ -1,16 +1,16 @@ - if (BUILD_TESTS) - - include_directories(${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/cli/) -- include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml) - include_directories(${PROJECT_SOURCE_DIR}/externals/simplecpp/) - - file(GLOB hdrs "*.h") - file(GLOB srcs "*.cpp") - -- add_executable(testrunner ${hdrs} ${srcs} $ $ $ $) -+ add_executable(testrunner ${hdrs} ${srcs} $ $ $) - if (HAVE_RULES) - target_link_libraries(testrunner pcre) - endif() -+ target_link_libraries(testrunner tinyxml2) - - add_custom_target(copy_cfg ALL - COMMENT "Copying cfg files") diff --git a/cppcheck-1.83.tar.gz b/cppcheck-1.83.tar.gz deleted file mode 100644 index 1108e2d..0000000 Binary files a/cppcheck-1.83.tar.gz and /dev/null differ diff --git a/cppcheck-1.88-htmlreport-python3.patch b/cppcheck-1.88-htmlreport-python3.patch new file mode 100644 index 0000000..7bca2b7 --- /dev/null +++ b/cppcheck-1.88-htmlreport-python3.patch @@ -0,0 +1,27 @@ +diff -up cppcheck-1.88/htmlreport/cppcheck-htmlreport.python3 cppcheck-1.88/htmlreport/cppcheck-htmlreport +--- cppcheck-1.88/htmlreport/cppcheck-htmlreport.python3 2019-06-29 09:51:25.000000000 +0200 ++++ cppcheck-1.88/htmlreport/cppcheck-htmlreport 2019-08-14 11:02:23.791627296 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + + from __future__ import unicode_literals + +diff -up cppcheck-1.88/htmlreport/setup.py.python3 cppcheck-1.88/htmlreport/setup.py +--- cppcheck-1.88/htmlreport/setup.py.python3 2019-06-29 09:51:25.000000000 +0200 ++++ cppcheck-1.88/htmlreport/setup.py 2019-08-14 11:02:28.570423533 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + + from setuptools import setup + +diff -up cppcheck-1.88/htmlreport/test_htmlreport.py.python3 cppcheck-1.88/htmlreport/test_htmlreport.py +--- cppcheck-1.88/htmlreport/test_htmlreport.py.python3 2019-06-29 09:51:25.000000000 +0200 ++++ cppcheck-1.88/htmlreport/test_htmlreport.py 2019-08-14 11:02:20.296776345 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + """Test cppcheck-htmlreport.""" + + import os diff --git a/cppcheck-2.2-translations.patch b/cppcheck-2.2-translations.patch new file mode 100644 index 0000000..796d078 --- /dev/null +++ b/cppcheck-2.2-translations.patch @@ -0,0 +1,32 @@ +diff -urp cppcheck-2.2.orig/gui/CMakeLists.txt cppcheck-2.2/gui/CMakeLists.txt +--- cppcheck-2.2.orig/gui/CMakeLists.txt 2020-10-03 11:05:53.000000000 +0200 ++++ cppcheck-2.2/gui/CMakeLists.txt 2020-10-04 07:18:23.309796000 +0200 +@@ -40,7 +40,7 @@ if (BUILD_GUI) + 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) + +diff -urp cppcheck-2.2.orig/gui/translationhandler.cpp cppcheck-2.2/gui/translationhandler.cpp +--- cppcheck-2.2.orig/gui/translationhandler.cpp 2020-10-03 11:05:53.000000000 +0200 ++++ cppcheck-2.2/gui/translationhandler.cpp 2020-10-04 07:19:44.765892500 +0200 +@@ -113,15 +113,7 @@ bool TranslationHandler::setLanguage(con + + QString datadir = getDataDir(); + +- 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/lang/" + mTranslations[index].mFilename + ".qm"); + + if (!mTranslator->load(translationFile) && !failure) { + //If it failed, lets check if the default file exists diff --git a/cppcheck-2.5-disable-test-testexprengine-array7.patch b/cppcheck-2.5-disable-test-testexprengine-array7.patch new file mode 100644 index 0000000..b810b30 --- /dev/null +++ b/cppcheck-2.5-disable-test-testexprengine-array7.patch @@ -0,0 +1,13 @@ +diff --git a/test/testexprengine.cpp b/test/testexprengine.cpp +index f23671a3d..c6069b49c 100644 +--- a/test/testexprengine.cpp ++++ b/test/testexprengine.cpp +@@ -92,7 +92,7 @@ private: + TEST_CASE(array4); + TEST_CASE(array5); + TEST_CASE(array6); +- TEST_CASE(array7); ++ // TEST_CASE(array7); + TEST_CASE(arrayInit1); + TEST_CASE(arrayInit2); + TEST_CASE(arrayInit3); diff --git a/cppcheck.spec b/cppcheck.spec index 6ca36dd..e072bdb 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -1,16 +1,14 @@ Name: cppcheck -Version: 1.83 -Release: 8 +Version: 2.6.3 +Release: 1 Summary: Tool for static C/C++ code analysis -License: GPLv3+ +License: GPLv3 and LPGL-3.0-only and MIT URL: http://cppcheck.wiki.sourceforge.net/ -Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +Source0: https://github.com/danmar/cppcheck/archive/refs/tags/2.6.3.tar.gz -Patch0000: cppcheck-1.83-tinyxml.patch -Patch0001: cppcheck-1.81-translations.patch -Patch0002: cppcheck-1.78-cfgdir.patch -Patch0003: cppcheck-1.83-cmake.patch -Patch0004: bugfix-SIGSTKSZ-not-constant.patch +Patch0000: cppcheck-2.2-translations.patch +Patch0001: cppcheck-1.88-htmlreport-python3.patch +Patch0002: cppcheck-2.5-disable-test-testexprengine-array7.patch BuildRequires: gcc-c++ pcre-devel docbook-style-xsl libxslt cmake desktop-file-utils tinyxml2-devel >= 2.1.0 @@ -30,13 +28,10 @@ Documentation for cppcheck %prep %autosetup -p1 -rm -r externals/tinyxml %build %make_build DB2MAN=%{_datadir}/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl man -xsltproc --nonet -o man/manual.html \ - %{_datadir}/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl \ - man/manual.docbook +xsltproc --nonet -o man/manual.html %{_datadir}/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl man/manual-ja.docbook mkdir objdir-%{_target_platform} cd objdir-%{_target_platform} @@ -54,15 +49,20 @@ cd objdir-%{_target_platform}/bin %files %doc AUTHORS COPYING -%{_datadir}/CppCheck/ +%{_datadir}/Cppcheck/ %{_bindir}/cppcheck %{_bindir}/cppcheck-htmlreport +%exclude %{_libdir}/* +%exclude %{_usrsrc}/* %files help %doc man/manual.html %{_mandir}/man1/cppcheck.1* %changelog +* Tue Jan 18 2022 SimpleUpdate Robot - 2.6.3-1 +- Upgrade to version 2.6.3 + * Tue Aug 10 2021 Shenmei Tu - 1.83-8 - bugfix-SIGSTKSZ-not-constant.patch