From 27cade038646c97b69efec0ea148847d2106c353 Mon Sep 17 00:00:00 2001 From: Wolfgang Stöggl Date: Oct 04 2020 16:52:57 +0000 Subject: Prepare for Cppcheck 2.2: Rename patch files --- diff --git a/cppcheck-1.89-translations.patch b/cppcheck-1.89-translations.patch deleted file mode 100644 index 966e2b4..0000000 --- a/cppcheck-1.89-translations.patch +++ /dev/null @@ -1,32 +0,0 @@ -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) - 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-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; - -- 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.1-tinyxml.patch b/cppcheck-2.1-tinyxml.patch deleted file mode 100644 index 18cf85e..0000000 --- a/cppcheck-2.1-tinyxml.patch +++ /dev/null @@ -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} $ $ $ $) -+add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) - 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} $ $ $) -+ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $) - 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} $ $ $ $) -+ add_executable(testrunner ${hdrs} ${srcs} $ $ $) - 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") diff --git a/cppcheck-2.2-tinyxml.patch b/cppcheck-2.2-tinyxml.patch new file mode 100644 index 0000000..18cf85e --- /dev/null +++ b/cppcheck-2.2-tinyxml.patch @@ -0,0 +1,90 @@ +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} $ $ $ $) ++add_executable(cppcheck ${hdrs} ${mainfile} $ $ $) + 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} $ $ $) ++ add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $ $) + 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} $ $ $ $) ++ add_executable(testrunner ${hdrs} ${srcs} $ $ $) + 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") diff --git a/cppcheck-2.2-translations.patch b/cppcheck-2.2-translations.patch new file mode 100644 index 0000000..966e2b4 --- /dev/null +++ b/cppcheck-2.2-translations.patch @@ -0,0 +1,32 @@ +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) + 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-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; + +- 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