Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
bb72118e3b
!19 Upgrade to version 2.13.2
From: @lyn1001 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2024-02-01 11:55:04 +00:00
lyn1001
02699de685 Upgrade to version 2.13.2 2024-02-01 17:03:33 +08:00
openeuler-ci-bot
a7dc7bf87b
!14 Upgrade to 2.11.1
From: @cherry530 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2023-07-25 01:55:21 +00:00
cherry530
e211c1324f Upgrade 2.11.1
Signed-off-by: cherry530 <707078654@qq.com>
2023-07-25 09:13:02 +08:00
openeuler-ci-bot
9a79450896
!13 [sync] PR-11: openEuler-22.03-LTS-Next Packages upgrade
From: @openeuler-sync-bot 
Reviewed-by: @ruebb 
Signed-off-by: @ruebb
2022-04-27 03:12:14 +00:00
cherry530
4cd419d601 remove unuse files
(cherry picked from commit 18d9eb22c635f37a7e5a88aa24f566d71b0539f9)
2022-04-12 17:00:53 +08:00
openeuler-ci-bot
3479131696 !10 解决软件包cppcheck在mainline的编译失败问题
From: @tushenmei
Reviewed-by: @yanglijin
Signed-off-by: @yanglijin
2021-08-10 11:34:00 +00:00
tushenmei
33c34d30df bugfix-SIGSTKSZ-not-constant 2021-08-10 16:23:58 +08:00
openeuler-ci-bot
d939205330 !6 Add requires python3-unversioned-command to resolve compatibility
From: @maminjie
Reviewed-by: @wang_yue111,@small_leek
Signed-off-by: @small_leek
2021-03-04 14:07:27 +08:00
maminjie
898695168f Add requires python3-unversioned-command to resolve compatibility 2021-03-04 12:50:58 +08:00
8 changed files with 66 additions and 181 deletions

View File

@ -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")

View File

@ -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

View File

@ -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)

View File

@ -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} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
+add_executable(cppcheck ${hdrs} ${mainfile} $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
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} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
+ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:simplecpp_objs>)
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} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:tinyxml_objs> $<TARGET_OBJECTS:simplecpp_objs>)
+ add_executable(testrunner ${hdrs} ${srcs} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:cli_objs> $<TARGET_OBJECTS:simplecpp_objs>)
if (HAVE_RULES)
target_link_libraries(testrunner pcre)
endif()
+ target_link_libraries(testrunner tinyxml2)
add_custom_target(copy_cfg ALL
COMMENT "Copying cfg files")

Binary file not shown.

BIN
cppcheck-2.13.2.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,32 @@
diff -urp cppcheck-2.11.1.orig/gui/CMakeLists.txt cppcheck-2.11.1/gui/CMakeLists.txt
--- cppcheck-2.11.1.orig/gui/CMakeLists.txt 2023-06-22 05:07:56.000000000 -0400
+++ cppcheck-2.11.1/gui/CMakeLists.txt 2023-06-22 15:34:50.096373560 -0400
@@ -70,7 +70,7 @@ CheckOptions:
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.11.1.orig/gui/translationhandler.cpp cppcheck-2.11.1/gui/translationhandler.cpp
--- cppcheck-2.11.1.orig/gui/translationhandler.cpp 2023-06-22 05:07:56.000000000 -0400
+++ cppcheck-2.11.1/gui/translationhandler.cpp 2023-06-22 15:34:50.096373560 -0400
@@ -99,15 +99,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 = true;

View File

@ -1,19 +1,19 @@
Name: cppcheck
Version: 1.83
Release: 6
Version: 2.13.2
Release: 1
Summary: Tool for static C/C++ code analysis
License: GPLv3+
License: GPL-3.0-or-later
URL: http://cppcheck.wiki.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source0: https://github.com/danmar/%{name}/archive/%{version}/%{name}-%{version}.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
Patch0000: cppcheck-2.2-translations.patch
BuildRequires: gcc-c++ pcre-devel docbook-style-xsl libxslt cmake desktop-file-utils tinyxml2-devel >= 2.1.0
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-linguist
Requires: python3-pygments
Requires: python3-pygments python3-unversioned-command
Provides: %{name}-htmlreport = %{version}-%{release}
Obsoletes: %{name}-htmlreport < %{version}-%{release}
@ -29,18 +29,18 @@ Documentation for cppcheck
%prep
%autosetup -p1
rm -r externals/tinyxml
rm -r externals/tinyxml2
cd gui/help
qhelpgenerator-qt5 online-help.qhcp -o online-help.qhc
%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}
%cmake .. -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=1 -DBUILD_GUI=0 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=1 -DCFGDIR=%{_datadir}/CppCheck
%make_build cppcheck
%cmake .. -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=1 -DUSE_MATCHCOMPILER=yes -DBUILD_GUI=0 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=1 -DCFGDIR=%{_datadir}/CppCheck -DUSE_BUNDLED_TINYXML2=OFF -DENABLE_OSS_FUZZ=OFF
%make_build
%install
%make_install -C objdir-%{_target_platform}
@ -53,15 +53,32 @@ 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
* Thu Feb 1 2024 liyanan <liyanan61@h-partners.com> - 2.13.2-1
- Upgrade to version 2.13.2.
* Tue Jul 25 2023 xu_ping <707078654@qq.com> - 2.11.1-1
- Upgrade to version 2.11.1.
* Tue Jan 18 2022 SimpleUpdate Robot <tc@openeuler.org> - 2.6.3-1
- Upgrade to version 2.6.3
* Tue Aug 10 2021 Shenmei Tu <tushenmei@huawei.com> - 1.83-8
- bugfix-SIGSTKSZ-not-constant.patch
* Thu Mar 04 2021 maminjie <maminjie1@huawei.com> - 1.83-7
- Add requires python3-unversioned-command to resolve compatibility
* Fri Sep 11 2020 wutao <wutao61@huawei.com> - 1.83-6
- change requires to python3