From 1d82217884d5f1deb0d12f39938b82fed1961754 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Sat, 2 Jun 2018 12:05:38 +0200 Subject: [PATCH 1/2] Add htmlreport tool. --- cppcheck.spec | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/cppcheck.spec b/cppcheck.spec index c572e1d..b94b300 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -6,9 +6,8 @@ Name: cppcheck Version: 1.83 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tool for static C/C++ code analysis -Group: Development/Languages License: GPLv3+ URL: http://cppcheck.wiki.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -44,13 +43,26 @@ errors in the code (i.e. have zero false positives). %if %{gui} %package gui Summary: Graphical user interface for cppcheck -Group: Applications/Engineering Requires: %{name}%{?_isa} = %{version}-%{release} %description gui This package contains the graphical user interface for cppcheck. %endif +%package htmlreport +Summary: HTML reporting for cppcheck +Requires: %{name}%{?_isa} = %{version}-%{release} +%if 0%{?rhel} > 0 && 0%{?rhel} < 8 +# RHEL packages aren't versioned +Requires: python-pygments +%else +Requires: python2-pygments +%endif + +%description htmlreport +This package contains the Python utility for generating html reports +from xml files first generated using cppcheck. + %prep %setup -q %patch0 -p1 -b .tinyxml @@ -86,6 +98,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/cppcheck-gui.desktop install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppcheck-gui.png %endif +# Install htmlreport +install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport + + %check cd objdir-%{_target_platform}/bin ./testrunner -g -q @@ -105,7 +121,13 @@ cd objdir-%{_target_platform}/bin %{_datadir}/icons/hicolor/scalable/apps/cppcheck-gui.svg %endif +%files htmlreport +%{_bindir}/cppcheck-htmlreport + %changelog +* Sat Jun 02 2018 Susi Lehtola - 1.83-2 +- Add htmlreport tool. + * Sat Apr 14 2018 Susi Lehtola - 1.83-1 - GUI no longer available on RHEL 7 due to Qt5 dependency. - Update to 1.83. From 20c4501d89a363ba7a695ed2a68b372e352d2818 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Sat, 2 Jun 2018 15:34:26 +0200 Subject: [PATCH 2/2] Patch out obsoleted CMake syntax. --- cppcheck-1.83-cmake.patch | 24 ++++++++++++++++++++++++ cppcheck.spec | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 cppcheck-1.83-cmake.patch diff --git a/cppcheck-1.83-cmake.patch b/cppcheck-1.83-cmake.patch new file mode 100644 index 0000000..7bed3ff --- /dev/null +++ b/cppcheck-1.83-cmake.patch @@ -0,0 +1,24 @@ +diff -up cppcheck-1.83/CMakeLists.txt.qt5cmake cppcheck-1.83/CMakeLists.txt +--- cppcheck-1.83/CMakeLists.txt.qt5cmake 2018-06-02 14:01:44.339998373 +0200 ++++ cppcheck-1.83/CMakeLists.txt 2018-06-02 14:01:44.370997858 +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 14:01:44.372997824 +0200 ++++ cppcheck-1.83/gui/CMakeLists.txt 2018-06-02 14:02:04.869656720 +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 Qt5::LinguistTools) ++ + 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.spec b/cppcheck.spec index b94b300..12d57b7 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -18,6 +18,8 @@ Patch0: cppcheck-1.83-tinyxml.patch Patch1: cppcheck-1.81-translations.patch # Set location of config files Patch2: cppcheck-1.78-cfgdir.patch +# Use modern qt5 cmake +Patch3: cppcheck-1.83-cmake.patch BuildRequires: gcc-c++ BuildRequires: pcre-devel @@ -68,6 +70,7 @@ from xml files first generated using cppcheck. %patch0 -p1 -b .tinyxml %patch1 -p1 -b .translations %patch2 -p1 -b .cfgdir +%patch3 -p1 -b .qt5cmake # Make sure bundled tinyxml is not used rm -r externals/tinyxml