diff --git a/.gitignore b/.gitignore index 04554ce..999065d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ cppcheck-1.44.tar.bz2 /cppcheck-1.87.tar.gz /cppcheck-1.88.tar.gz /cppcheck-1.89.tar.gz +/cppcheck-1.90.tar.gz diff --git a/cppcheck-1.87-cfgdir.patch b/cppcheck-1.87-cfgdir.patch deleted file mode 100644 index 82becc5..0000000 --- a/cppcheck-1.87-cfgdir.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -urp cppcheck-1.87.orig/cmake/options.cmake cppcheck-1.87/cmake/options.cmake ---- cppcheck-1.87.orig/cmake/options.cmake 2019-02-09 03:31:27.000000000 -0500 -+++ cppcheck-1.87/cmake/options.cmake 2019-02-09 13:17:25.237561852 -0500 -@@ -22,6 +22,10 @@ option(ANALYZE_UNDEFINED "Clang dynam - option(ANALYZE_DATAFLOW "Clang dynamic analyzer: general dynamic dataflow analysis." OFF) - 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 compiler") - set_property(CACHE USE_MATCHCOMPILER PROPERTY STRINGS Auto Off On Verify) diff --git a/cppcheck-1.88-tinyxml.patch b/cppcheck-1.88-tinyxml.patch deleted file mode 100644 index c51ce0e..0000000 --- a/cppcheck-1.88-tinyxml.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff -urp cppcheck-1.88.orig/cli/CMakeLists.txt cppcheck-1.88/cli/CMakeLists.txt ---- cppcheck-1.88.orig/cli/CMakeLists.txt 2019-06-29 03:51:25.000000000 -0400 -+++ cppcheck-1.88/cli/CMakeLists.txt 2019-07-01 20:38:10.056775258 -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,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} $ $ $ $) -+add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) - if (HAVE_RULES) - find_library(PCRE_LIBRARY pcre) - target_link_libraries(cppcheck ${PCRE_LIBRARY}) -@@ -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 -urp cppcheck-1.88.orig/CMakeLists.txt cppcheck-1.88/CMakeLists.txt ---- cppcheck-1.88.orig/CMakeLists.txt 2019-06-29 03:51:25.000000000 -0400 -+++ cppcheck-1.88/CMakeLists.txt 2019-07-01 20:38:10.078775256 -0400 -@@ -19,7 +19,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 -urp cppcheck-1.88.orig/gui/CMakeLists.txt cppcheck-1.88/gui/CMakeLists.txt ---- cppcheck-1.88.orig/gui/CMakeLists.txt 2019-06-29 03:51:25.000000000 -0400 -+++ cppcheck-1.88/gui/CMakeLists.txt 2019-07-01 20:41:48.862751778 -0400 -@@ -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,11 +19,11 @@ if (BUILD_GUI) - 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 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 -urp cppcheck-1.88.orig/test/CMakeLists.txt cppcheck-1.88/test/CMakeLists.txt ---- cppcheck-1.88.orig/test/CMakeLists.txt 2019-06-29 03:51:25.000000000 -0400 -+++ cppcheck-1.88/test/CMakeLists.txt 2019-07-01 20:43:12.299742824 -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.89-manual.patch b/cppcheck-1.89-manual.patch deleted file mode 100644 index adfa23f..0000000 --- a/cppcheck-1.89-manual.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urp cppcheck-1.89.orig/man/manual.docbook cppcheck-1.89/man/manual.docbook ---- cppcheck-1.89.orig/man/manual.docbook 2019-09-01 09:01:12.000000000 -0400 -+++ cppcheck-1.89/man/manual.docbook 2019-12-07 14:04:54.363409384 -0500 -@@ -1217,7 +1217,7 @@ Checking pen1.c... - </resource> - </def> - -- Functions that reallocate memory can be configured using a realloc tag. The input argument which points to the memory that shall be reallocated can also be configured (the default is the first argument). As an example, here is a configuration file for the fopen, freopen and fclose functions from the c standard library: -+ Functions that reallocate memory can be configured using a realloc tag. The input argument which points to the memory that shall be reallocated can also be configured (the default is the first argument). As an example, here is a configuration file for the fopen, freopen and fclose functions from the c standard library: - - <?xml version="1.0"?> - <def> diff --git a/cppcheck-1.89-translations.patch b/cppcheck-1.89-translations.patch index 1ba2604..966e2b4 100644 --- a/cppcheck-1.89-translations.patch +++ b/cppcheck-1.89-translations.patch @@ -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 diff --git a/cppcheck-1.90-tinyxml.patch b/cppcheck-1.90-tinyxml.patch new file mode 100644 index 0000000..69faf37 --- /dev/null +++ b/cppcheck-1.90-tinyxml.patch @@ -0,0 +1,84 @@ +diff -urp a/cli/CMakeLists.txt b/cli/CMakeLists.txt +--- a/cli/CMakeLists.txt 2019-12-21 11:51:10.000000000 +0100 ++++ b/cli/CMakeLists.txt 2019-12-21 23:29:02.266101262 +0100 +@@ -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} $ $ $ $) ++add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) + if (HAVE_RULES) + find_library(PCRE_LIBRARY pcre) + target_link_libraries(cppcheck ${PCRE_LIBRARY}) +@@ -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 -urp a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2019-12-21 11:51:10.000000000 +0100 ++++ b/CMakeLists.txt 2019-12-21 23:30:07.419801154 +0100 +@@ -21,7 +21,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 -urp a/gui/CMakeLists.txt b/gui/CMakeLists.txt +--- a/gui/CMakeLists.txt 2019-12-21 11:51:10.000000000 +0100 ++++ b/gui/CMakeLists.txt 2019-12-21 23:33:01.688541115 +0100 +@@ -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,11 +19,11 @@ if (BUILD_GUI) + 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 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 -urp a/test/CMakeLists.txt b/test/CMakeLists.txt +--- a/test/CMakeLists.txt 2019-12-21 11:51:10.000000000 +0100 ++++ b/test/CMakeLists.txt 2019-12-21 23:34:50.432203245 +0100 +@@ -12,16 +12,16 @@ 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} $ $ $ $) ++ 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.spec b/cppcheck.spec index 2e6ff5c..deebf9c 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -2,28 +2,25 @@ %global gui 1 Name: cppcheck -Version: 1.89 -Release: 2%{?dist} +Version: 1.90 +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-1.88-tinyxml.patch +Patch0: cppcheck-1.90-tinyxml.patch # Fix location of translations Patch1: cppcheck-1.89-translations.patch -# Set location of config files -Patch2: cppcheck-1.87-cfgdir.patch # Select python3 explicitly -Patch3: cppcheck-1.88-htmlreport-python3.patch -# Fixup missing in manual -Patch4: cppcheck-1.89-manual.patch +Patch2: cppcheck-1.88-htmlreport-python3.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 @@ -75,25 +72,19 @@ from xml files first generated using cppcheck. %setup -q %patch0 -p1 -b .tinyxml %patch1 -p1 -b .translations -%patch2 -p1 -b .cfgdir -%patch3 -p1 -b .python3 -%patch4 -p1 -b .manual +%patch2 -p1 -b .python3 # Make sure bundled tinyxml is not used rm -r externals/tinyxml %build # Manuals -make 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 +make DB2MAN=%{_datadir}/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl man +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} -# Add -fsigned-char to CXXFLAGS, to make all tests pass also on armv7hl -# aarch64 ppc64le s390x, See https://trac.cppcheck.net/ticket/9359 -export CXXFLAGS="$RPM_OPT_FLAGS -fsigned-char" # Upstream doesn't support shared libraries (unversioned solib) %cmake .. -DCMAKE_BUILD_TYPE=Release -DMATCHCOMPILER=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 @@ -120,7 +111,8 @@ cd objdir-%{_target_platform}/bin ./testrunner -g -q %files -%doc AUTHORS COPYING man/manual.html +%doc AUTHORS man/manual.html man/reference-cfg-format.html +%license COPYING %{_datadir}/Cppcheck/ %{_bindir}/cppcheck %{_mandir}/man1/cppcheck.1* @@ -138,6 +130,9 @@ cd objdir-%{_target_platform}/bin %{_bindir}/cppcheck-htmlreport %changelog +* Sat Dec 21 2019 Wolfgang Stöggl - 1.90-1 +- New upstream version 1.90 + * Thu Dec 12 2019 Steve Grubb - 1.89-2 - Add "-fsigned-char" to CXXFLAGS, to make tests pass - https://trac.cppcheck.net/ticket/9359 diff --git a/sources b/sources index 7fcdb38..08837ed 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cppcheck-1.89.tar.gz) = 0e8f7ae6fe70261f69954ec830c20faff37126ec41a7fdc59ce91db99313a1c99e1850656efeb7182a37fb78fbf8402b71d72a11d6189a5bede2819bdde69b9b +SHA512 (cppcheck-1.90.tar.gz) = 9d78ed05af3d46f399de1a993859cf41ec3abc9cd869e1e85c10af7f70e00487ada0c0134d049e0ace50b3f4913680b4f0e4fa94a5fde13833285879994303db