Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Wolfgang Stöggl | 0318041ec1 | |
Wolfgang Stöggl | 3cbed43cee |
|
@ -43,3 +43,5 @@ cppcheck-1.44.tar.bz2
|
|||
/cppcheck-1.90.tar.gz
|
||||
/cppcheck-2.0.tar.gz
|
||||
/cppcheck-2.1.tar.gz
|
||||
/cppcheck-2.2.tar.gz
|
||||
/cppcheck-2.3.tar.gz
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
diff -up cppcheck-2.1/cli/CMakeLists.txt.orig cppcheck-2.1/cli/CMakeLists.txt
|
||||
--- cppcheck-2.1/cli/CMakeLists.txt.orig 2020-06-13 18:08:37.000000000 +0200
|
||||
+++ cppcheck-2.1/cli/CMakeLists.txt 2020-06-15 11:52:39.095165469 +0200
|
||||
@@ -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,7 +7,7 @@ file(GLOB mainfile "main.cpp")
|
||||
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_LIBRARY})
|
||||
endif()
|
||||
@@ -18,6 +17,7 @@ endif()
|
||||
if (WIN32 AND NOT BORLAND)
|
||||
target_link_libraries(cppcheck Shlwapi.lib)
|
||||
endif()
|
||||
+target_link_libraries(cppcheck tinyxml2)
|
||||
|
||||
install(TARGETS cppcheck
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
|
||||
diff -up cppcheck-2.1/CMakeLists.txt.orig cppcheck-2.1/CMakeLists.txt
|
||||
--- cppcheck-2.1/CMakeLists.txt.orig 2020-06-13 18:08:37.000000000 +0200
|
||||
+++ cppcheck-2.1/CMakeLists.txt 2020-06-15 11:52:39.099165304 +0200
|
||||
@@ -23,7 +23,6 @@ if (BUILD_TESTS)
|
||||
enable_testing()
|
||||
endif()
|
||||
|
||||
-add_subdirectory(externals/tinyxml)
|
||||
add_subdirectory(externals/simplecpp)
|
||||
add_subdirectory(lib) # CppCheck Library
|
||||
add_subdirectory(cli) # Client application
|
||||
diff -up cppcheck-2.1/gui/CMakeLists.txt.orig cppcheck-2.1/gui/CMakeLists.txt
|
||||
--- cppcheck-2.1/gui/CMakeLists.txt.orig 2020-06-13 18:08:37.000000000 +0200
|
||||
+++ cppcheck-2.1/gui/CMakeLists.txt 2020-06-15 11:53:24.866217469 +0200
|
||||
@@ -10,7 +10,6 @@ if (BUILD_GUI)
|
||||
endif()
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/lib/)
|
||||
- include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml/)
|
||||
|
||||
file(GLOB hdrs "*.h")
|
||||
file(GLOB srcs "*.cpp")
|
||||
@@ -20,14 +19,14 @@ if (BUILD_GUI)
|
||||
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_LIBRARY})
|
||||
endif()
|
||||
if (USE_Z3)
|
||||
target_link_libraries(cppcheck-gui ${Z3_LIBRARIES})
|
||||
endif()
|
||||
- target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport)
|
||||
+ target_link_libraries(cppcheck-gui tinyxml2 Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport)
|
||||
if(WITH_QCHART)
|
||||
target_compile_definitions (cppcheck-gui PRIVATE HAVE_QCHART )
|
||||
target_link_libraries(cppcheck-gui Qt5::Charts)
|
||||
diff -up cppcheck-2.1/test/CMakeLists.txt.orig cppcheck-2.1/test/CMakeLists.txt
|
||||
--- cppcheck-2.1/test/CMakeLists.txt.orig 2020-06-15 11:52:39.108164933 +0200
|
||||
+++ cppcheck-2.1/test/CMakeLists.txt 2020-06-15 11:54:10.167286593 +0200
|
||||
@@ -13,19 +13,19 @@ if (BUILD_TESTS)
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout 90)
|
||||
|
||||
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_LIBRARY})
|
||||
endif()
|
||||
if (USE_Z3)
|
||||
target_link_libraries(testrunner ${Z3_LIBRARIES})
|
||||
endif()
|
||||
+ target_link_libraries(testrunner tinyxml2)
|
||||
|
||||
add_custom_target(copy_cfg ALL
|
||||
COMMENT "Copying cfg files")
|
|
@ -1,7 +1,7 @@
|
|||
diff -urp cppcheck-1.89.orig/gui/CMakeLists.txt cppcheck-1.89/gui/CMakeLists.txt
|
||||
--- cppcheck-1.89.orig/gui/CMakeLists.txt 2019-12-07 13:41:32.651559443 -0500
|
||||
+++ cppcheck-1.89/gui/CMakeLists.txt 2019-12-07 13:45:16.037535529 -0500
|
||||
@@ -30,7 +30,7 @@ if (BUILD_GUI)
|
||||
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)
|
||||
|
@ -10,12 +10,12 @@ diff -urp cppcheck-1.89.orig/gui/CMakeLists.txt cppcheck-1.89/gui/CMakeLists.txt
|
|||
|
||||
install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
|
||||
diff -urp cppcheck-1.89.orig/gui/translationhandler.cpp cppcheck-1.89/gui/translationhandler.cpp
|
||||
--- cppcheck-1.89.orig/gui/translationhandler.cpp 2019-09-01 09:01:12.000000000 -0400
|
||||
+++ cppcheck-1.89/gui/translationhandler.cpp 2019-12-07 13:46:47.085525782 -0500
|
||||
@@ -116,15 +116,7 @@ bool TranslationHandler::setLanguage(con
|
||||
if (datadir.isEmpty())
|
||||
datadir = appPath;
|
||||
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"))
|
||||
|
@ -26,7 +26,7 @@ diff -urp cppcheck-1.89.orig/gui/translationhandler.cpp cppcheck-1.89/gui/transl
|
|||
-
|
||||
- else
|
||||
- translationFile = appPath + "/" + mTranslations[index].mFilename + ".qm";
|
||||
+ QString translationFile("/usr/share/Cppcheck/lang/" + 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
|
|
@ -0,0 +1,24 @@
|
|||
diff --git a/lib/programmemory.cpp b/lib/programmemory.cpp
|
||||
index 753a5c846..bb9569624 100644
|
||||
--- a/lib/programmemory.cpp
|
||||
+++ b/lib/programmemory.cpp
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "symboldatabase.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
+#include <limits>
|
||||
#include <memory>
|
||||
|
||||
void ProgramMemory::setValue(nonneg int varid, const ValueFlow::Value &value)
|
||||
diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp
|
||||
index 1d2bc8d54..399ea7593 100644
|
||||
--- a/test/testsymboldatabase.cpp
|
||||
+++ b/test/testsymboldatabase.cpp
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
+#include <limits>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <set>
|
|
@ -1,39 +1,35 @@
|
|||
# Gui built in all branches
|
||||
%global gui 1
|
||||
%undefine __cmake_in_source_build
|
||||
|
||||
Name: cppcheck
|
||||
Version: 2.1
|
||||
Release: 3%{?dist}
|
||||
Version: 2.3
|
||||
Release: 1%{?dist}
|
||||
Summary: Tool for static C/C++ code analysis
|
||||
License: GPLv3+
|
||||
URL: http://cppcheck.wiki.sourceforge.net/
|
||||
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
|
||||
|
||||
# Use system tinyxml2
|
||||
Patch0: cppcheck-2.1-tinyxml.patch
|
||||
# Fix location of translations
|
||||
Patch1: cppcheck-1.89-translations.patch
|
||||
Patch0: cppcheck-2.2-translations.patch
|
||||
# Select python3 explicitly
|
||||
Patch2: cppcheck-1.88-htmlreport-python3.patch
|
||||
Patch1: cppcheck-1.88-htmlreport-python3.patch
|
||||
# Fix for missing #include with gcc-11
|
||||
Patch2: cppcheck-2.3-gcc11.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: pcre-devel
|
||||
BuildRequires: docbook-style-xsl
|
||||
BuildRequires: libxslt
|
||||
BuildRequires: pandoc
|
||||
BuildRequires: cmake
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: tinyxml2-devel >= 2.1.0
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: z3-devel >= 4.7.1
|
||||
BuildRequires: qt5-qtbase-devel
|
||||
BuildRequires: qt5-qttools-devel
|
||||
BuildRequires: qt5-linguist
|
||||
|
||||
%if %{gui}
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: cmake
|
||||
BuildRequires: z3-devel >= 4.7.1
|
||||
%else
|
||||
Obsoletes: %{name}-gui < %{version}-%{release}
|
||||
%endif
|
||||
|
||||
%description
|
||||
Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++
|
||||
|
@ -42,14 +38,12 @@ errors in the code. Cppcheck primarily detects the types of bugs that
|
|||
the compilers normally do not detect. The goal is to detect only real
|
||||
errors in the code (i.e. have zero false positives).
|
||||
|
||||
%if %{gui}
|
||||
%package gui
|
||||
Summary: Graphical user interface for cppcheck
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description gui
|
||||
This package contains the graphical user interface for cppcheck.
|
||||
%endif
|
||||
|
||||
%package htmlreport
|
||||
Summary: HTML reporting for cppcheck
|
||||
|
@ -62,11 +56,14 @@ from xml files first generated using cppcheck.
|
|||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .tinyxml
|
||||
%patch1 -p1 -b .translations
|
||||
%patch2 -p1 -b .python3
|
||||
# Make sure bundled tinyxml is not used
|
||||
rm -r externals/tinyxml
|
||||
%patch0 -p1 -b .translations
|
||||
%patch1 -p1 -b .python3
|
||||
%patch2 -p1 -b .gcc11
|
||||
# Make sure bundled tinyxml2 is not used
|
||||
rm -r externals/tinyxml2
|
||||
# Generate the Qt online-help file
|
||||
cd gui/help
|
||||
qhelpgenerator-qt5 online-help.qhcp -o online-help.qhc
|
||||
|
||||
%build
|
||||
# Manuals
|
||||
|
@ -75,31 +72,27 @@ pandoc man/manual.md -o man/manual.html -s --number-sections --toc
|
|||
pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-sections --toc
|
||||
|
||||
# Binaries
|
||||
mkdir objdir-%{_target_platform}
|
||||
cd objdir-%{_target_platform}
|
||||
# Upstream doesn't support shared libraries (unversioned solib)
|
||||
%cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DUSE_Z3=yes -DHAVE_RULES=yes -DBUILD_GUI=%{gui} -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck
|
||||
# SMP make doesn't seem to work
|
||||
make cppcheck
|
||||
%cmake -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DUSE_Z3=yes -DHAVE_RULES=yes -DBUILD_GUI=1 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck -DUSE_BUNDLED_TINYXML2=OFF
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
make -C objdir-%{_target_platform} DESTDIR=%{buildroot} install
|
||||
%cmake_install
|
||||
install -D -p -m 644 cppcheck.1 %{buildroot}%{_mandir}/man1/cppcheck.1
|
||||
|
||||
%if %{gui}
|
||||
# Install desktop file
|
||||
desktop-file-validate %{buildroot}%{_datadir}/applications/cppcheck-gui.desktop
|
||||
# Install logo
|
||||
install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppcheck-gui.png
|
||||
%endif
|
||||
# Install the Qt online-help file
|
||||
install -D -p -m 644 gui/help/online-help.qhc %{buildroot}%{_datadir}/Cppcheck/help/online-help.qhc
|
||||
install -D -p -m 644 gui/help/online-help.qch %{buildroot}%{_datadir}/Cppcheck/help/online-help.qch
|
||||
|
||||
# Install htmlreport
|
||||
install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport
|
||||
|
||||
|
||||
%check
|
||||
cd objdir-%{_target_platform}/bin
|
||||
cd %{_vpath_builddir}/bin
|
||||
./testrunner -g -q
|
||||
|
||||
%files
|
||||
|
@ -109,19 +102,23 @@ cd objdir-%{_target_platform}/bin
|
|||
%{_bindir}/cppcheck
|
||||
%{_mandir}/man1/cppcheck.1*
|
||||
|
||||
%if %{gui}
|
||||
%files gui
|
||||
%{_bindir}/cppcheck-gui
|
||||
%{_datadir}/applications/cppcheck-gui.desktop
|
||||
%{_datadir}/pixmaps/cppcheck-gui.png
|
||||
%{_datadir}/icons/hicolor/64x64/apps/cppcheck-gui.png
|
||||
%{_datadir}/icons/hicolor/scalable/apps/cppcheck-gui.svg
|
||||
%endif
|
||||
|
||||
%files htmlreport
|
||||
%{_bindir}/cppcheck-htmlreport
|
||||
|
||||
%changelog
|
||||
* Sat Dec 05 2020 Wolfgang Stöggl <c72578@yahoo.de> - 2.3-1
|
||||
- Update to 2.3.
|
||||
|
||||
* Mon Nov 09 2020 Wolfgang Stöggl <c72578@yahoo.de> - 2.2-1
|
||||
- Update to 2.2.
|
||||
|
||||
* Tue Jun 16 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1-3
|
||||
- Drop EPEL specifics since cppcheck is included in RHEL8.
|
||||
|
||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
|||
SHA512 (cppcheck-2.1.tar.gz) = 5001486c0f5dd2149c733df6167e274217dba6e248f525aba0f1523c92f44ad119b7e4c5655ccc812567ccf9ab11bcaaa35aa165d5d256212802f69594a581b8
|
||||
SHA512 (cppcheck-2.3.tar.gz) = ee15890f77c58847d4add7d555398e4bb83e3a73e942f218413b9830f05b2c975b49bf0aeb0092e0467f0cd7f26b9f05013f701dd80ee5e2aa3d2ef81945c4ed
|
||||
|
|
Loading…
Reference in New Issue