git: a309971953b0 - main - devel/cppcheck: update 2.7.5 → 2.9.1

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Tue, 08 Nov 2022 12:09:40 UTC
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a309971953b0f7693db1c28c4468c8ede7c0286d

commit a309971953b0f7693db1c28c4468c8ede7c0286d
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-11-07 16:36:48 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-11-08 12:09:17 +0000

    devel/cppcheck: update 2.7.5 → 2.9.1
    
    - Merge cppcheck-gui into cppcheck to simplify maintenance and testing
    - Install manpage into canonical location
    
    PR:             267262
    Submitted by:   jailbird@fdf.net
---
 MOVED                                              |  1 +
 devel/Makefile                                     |  1 -
 devel/cppcheck-gui/Makefile                        |  7 ---
 devel/cppcheck/Makefile                            | 51 ++++++++++------------
 devel/cppcheck/distinfo                            |  6 +--
 devel/cppcheck/files/patch-cli_CMakeLists.txt      |  6 +--
 devel/cppcheck/files/patch-gui_CMakeLists.txt      | 10 ++---
 .../patch-gui_test_benchmark_simple_CMakeLists.txt | 12 ++---
 .../patch-gui_test_xmlreportv2_CMakeLists.txt      |  6 +--
 devel/cppcheck/files/patch-lib_CMakeLists.txt      | 12 ++---
 devel/cppcheck/files/patch-oss-fuzz_CMakeLists.txt |  6 +--
 devel/cppcheck/files/patch-test_CMakeLists.txt     |  6 +--
 devel/cppcheck/pkg-plist                           |  6 ++-
 devel/cppcheck/pkg-plist-gui                       | 16 -------
 14 files changed, 60 insertions(+), 86 deletions(-)

diff --git a/MOVED b/MOVED
index 66f1c34b2a66..4536700c91fe 100644
--- a/MOVED
+++ b/MOVED
@@ -17605,3 +17605,4 @@ devel/py-pyxdg|devel/py-xdg|2022-10-28|Remove duplicate port
 lang/chicken5|lang/chicken|2022-10-30|Has expired: Please use lang/chicken instead
 devel/py-spyder|devel/spyder|2022-11-06|Spyder is an application, and not a library
 www/grafana7||2022-11-07|Has expired: EOLed upstream, unfixed vulnerabilities
+devel/cppcheck-gui|devel/cppcheck|2022-11-07|GUI is now included in devel/cppcheck port
diff --git a/devel/Makefile b/devel/Makefile
index 693da10dc79d..081cbb629e78 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -430,7 +430,6 @@
     SUBDIR += cpp-netlib
     SUBDIR += cpp2py
     SUBDIR += cppcheck
-    SUBDIR += cppcheck-gui
     SUBDIR += cppi
     SUBDIR += cpplint
     SUBDIR += cpprestsdk
diff --git a/devel/cppcheck-gui/Makefile b/devel/cppcheck-gui/Makefile
deleted file mode 100644
index e4406c9a768e..000000000000
--- a/devel/cppcheck-gui/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-PORTREVISION=	0
-
-MASTERDIR=	${.CURDIR}/../cppcheck
-
-GUI_ONLY=	yes
-
-.include "${MASTERDIR}/Makefile"
diff --git a/devel/cppcheck/Makefile b/devel/cppcheck/Makefile
index 80d376a2abfb..b4aa0a320ee3 100644
--- a/devel/cppcheck/Makefile
+++ b/devel/cppcheck/Makefile
@@ -1,10 +1,9 @@
 PORTNAME=	cppcheck
-PORTVERSION=	2.7.5
-PORTREVISION?=	0	# devel/cppcheck-gui
+PORTVERSION=	2.9.1
 CATEGORIES=	devel
 
 MAINTAINER=	amdmi3@FreeBSD.org
-COMMENT?=	Tool for static C/C++ code analysis
+COMMENT=	Tool for static C/C++ code analysis
 WWW=		https://cppcheck.sourceforge.io/
 
 LICENSE=	GPLv3+
@@ -12,34 +11,16 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 LIB_DEPENDS=	libtinyxml2.so:textproc/tinyxml2
 
-USES=		compiler:c++11-lib cmake:insource tar:bzip2
+USES=		compiler:c++11-lib cmake shebangfix tar:bzip2
 USE_GITHUB=	yes
 GH_ACCOUNT=	danmar
+SHEBANG_FILES=	htmlreport/cppcheck-htmlreport
 CMAKE_OFF=	USE_BUNDLED_TINYXML2
 
-.if defined(GUI_ONLY)
-COMMENT=		Static analysis of C/C++ code (GUI)
-
-RUN_DEPENDS=		cppcheck:devel/cppcheck
-
-CMAKE_ON+=		BUILD_GUI
-USES+=			qt:5
-USE_QT=			core gui widgets printsupport help qmake:build buildtools:build linguisttools:build
-
-BUILD_WRKSRC=		${WRKSRC}/gui
-INSTALL_WRKSRC=		${WRKSRC}/gui
-
-PLIST=			${PKGDIR}/pkg-plist-gui
-
-PKGNAMESUFFIX=		-gui
-.else
-USES+=			shebangfix
-SHEBANG_FILES=		htmlreport/cppcheck-htmlreport
-
 PORTDATA=		*
 
-OPTIONS_DEFINE=		RULES HTMLREPORT MANPAGES MATCHCOMPILER TEST
-OPTIONS_DEFAULT=	RULES HTMLREPORT MANPAGES MATCHCOMPILER
+OPTIONS_DEFINE=		RULES HTMLREPORT MANPAGES MATCHCOMPILER GUI CHARTS TEST
+OPTIONS_DEFAULT=	RULES HTMLREPORT MANPAGES MATCHCOMPILER GUI
 OPTIONS_SUB=		yes
 
 RULES_DESC=		User-defined rule support (requires PCRE)
@@ -48,6 +29,8 @@ RULES_LIB_DEPENDS=	libpcre.so:devel/pcre
 RULES_USES=		localbase:ldflags
 
 TEST_CMAKE_BOOL=	BUILD_TESTS
+TEST_IMPLIES=		GUI
+TEST_USE=		QT=testlib
 
 HTMLREPORT_DESC=	Install cppcheck-htmlreport
 HTMLREPORT_USES=	python:${PYUSE:C/ /,/W}
@@ -59,10 +42,21 @@ MANPAGES_BUILD_DEPENDS=	xsltproc:textproc/libxslt \
 			${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl
 
 MATCHCOMPILER_DESC=	Build-time optimizations via Python
-MATCHCOMPILER_CMAKE_BOOL=	USE_MATCHCOMPILER
+MATCHCOMPILER_CMAKE_ON=	-DUSE_MATCHCOMPILER=On
+MATCHCOMPILER_CMAKE_OFF=-DUSE_MATCHCOMPILER=Off
 MATCHCOMPILER_USES=	python:${PYUSE:C/ /,/W}
 MATCHCOMPILER_VARS=	PYUSE+=build
 
+GUI_DESC=		Build the Qt GUI application
+GUI_CMAKE_BOOL=		BUILD_GUI
+GUI_USES=		qt:5
+GUI_USE=		QT=core,gui,widgets,printsupport,help,network,qmake:build,buildtools:build,linguisttools:build
+
+CHARTS_DESC=		Enable QtCharts usage in the GUI
+CHARTS_CMAKE_BOOL=	WITH_QCHART
+CHARTS_IMPLIES=		GUI
+CHARTS_USE=		QT=charts
+
 post-install-HTMLREPORT-on:
 	${INSTALL_SCRIPT} ${WRKSRC}/htmlreport/cppcheck-htmlreport ${STAGEDIR}${PREFIX}/bin
 
@@ -71,10 +65,9 @@ post-build-MANPAGES-on:
 		${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl cppcheck.1.xml
 
 post-install-MANPAGES-on:
-	${INSTALL_MAN} ${WRKSRC}/man/cppcheck.1 ${STAGEDIR}${PREFIX}/man/man1
+	${INSTALL_MAN} ${WRKSRC}/man/cppcheck.1 ${STAGEDIR}${PREFIX}/share/man/man1
 
 do-test-TEST-on:
-	cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ctest
-.endif
+	cd ${BUILD_WRKSRC} && ${SETENV} ${TEST_ENV} ctest
 
 .include <bsd.port.mk>
diff --git a/devel/cppcheck/distinfo b/devel/cppcheck/distinfo
index 9526af3607b2..1cdaf0fdf59d 100644
--- a/devel/cppcheck/distinfo
+++ b/devel/cppcheck/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1650279480
-SHA256 (danmar-cppcheck-2.7.5_GH0.tar.gz) = 6c7ac29e57fa8b3ac7be224510200e579d5a90217e2152591ef46ffc947d8f78
-SIZE (danmar-cppcheck-2.7.5_GH0.tar.gz) = 3940968
+TIMESTAMP = 1667826946
+SHA256 (danmar-cppcheck-2.9.1_GH0.tar.gz) = 41059bbb314167df5fd4751fc7c6eae1f14c1d233221b91fcb927d71ba0f2ae5
+SIZE (danmar-cppcheck-2.9.1_GH0.tar.gz) = 5471242
diff --git a/devel/cppcheck/files/patch-cli_CMakeLists.txt b/devel/cppcheck/files/patch-cli_CMakeLists.txt
index d202b9d3a9dd..76469f8fbc4f 100644
--- a/devel/cppcheck/files/patch-cli_CMakeLists.txt
+++ b/devel/cppcheck/files/patch-cli_CMakeLists.txt
@@ -1,11 +1,11 @@
---- cli/CMakeLists.txt.orig	2022-03-19 11:35:06 UTC
+--- cli/CMakeLists.txt.orig	2022-08-28 12:43:18 UTC
 +++ cli/CMakeLists.txt
-@@ -35,7 +35,7 @@ if (WIN32 AND NOT BORLAND)
+@@ -37,7 +37,7 @@ if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
      endif()
  endif()
  if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
 -    target_link_libraries(cppcheck ${tinyxml2_LIBRARIES})
 +    target_link_libraries(cppcheck tinyxml2::tinyxml2)
  endif()
+ target_link_libraries(cppcheck ${CMAKE_THREAD_LIBS_INIT})
  
- add_dependencies(cppcheck copy_cfg)
diff --git a/devel/cppcheck/files/patch-gui_CMakeLists.txt b/devel/cppcheck/files/patch-gui_CMakeLists.txt
index 6cc7ac50c7be..48bfc79062c7 100644
--- a/devel/cppcheck/files/patch-gui_CMakeLists.txt
+++ b/devel/cppcheck/files/patch-gui_CMakeLists.txt
@@ -1,15 +1,15 @@
---- gui/CMakeLists.txt.orig	2022-03-19 11:35:06 UTC
+--- gui/CMakeLists.txt.orig	2022-08-28 12:43:18 UTC
 +++ gui/CMakeLists.txt
-@@ -36,7 +36,7 @@ if (BUILD_GUI)
-         target_link_libraries(cppcheck-gui ${Z3_LIBRARIES})
+@@ -34,7 +34,7 @@ if (BUILD_GUI)
+         target_link_libraries(cppcheck-gui ${PCRE_LIBRARY})
      endif()
      if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
 -        target_link_libraries(cppcheck-gui ${tinyxml2_LIBRARIES})
 +        target_link_libraries(cppcheck-gui tinyxml2::tinyxml2)
      endif()
-     target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Help)
+     target_link_libraries(cppcheck-gui ${QT_CORE_LIB} ${QT_GUI_LIB} ${QT_WIDGETS_LIB} ${QT_PRINTSUPPORT_LIB} ${QT_HELP_LIB})
      if(WITH_QCHART)
-@@ -51,7 +51,7 @@ if (BUILD_GUI)
+@@ -49,7 +49,7 @@ if (BUILD_GUI)
      endif()
  
      install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
diff --git a/devel/cppcheck/files/patch-gui_test_benchmark_simple_CMakeLists.txt b/devel/cppcheck/files/patch-gui_test_benchmark_simple_CMakeLists.txt
index 35de39f7ee02..0bc2b678c1ca 100644
--- a/devel/cppcheck/files/patch-gui_test_benchmark_simple_CMakeLists.txt
+++ b/devel/cppcheck/files/patch-gui_test_benchmark_simple_CMakeLists.txt
@@ -1,11 +1,11 @@
---- gui/test/benchmark/simple/CMakeLists.txt.orig	2022-03-19 11:35:06 UTC
+--- gui/test/benchmark/simple/CMakeLists.txt.orig	2022-08-28 12:43:18 UTC
 +++ gui/test/benchmark/simple/CMakeLists.txt
-@@ -20,5 +20,5 @@ if (USE_Z3)
-     target_link_libraries(benchmark-simple ${Z3_LIBRARIES})
+@@ -17,7 +17,7 @@ if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
+     target_link_libraries(benchmark-simple ${PCRE_LIBRARY})
  endif()
  if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
 -    target_link_libraries(benchmark-simple ${tinyxml2_LIBRARIES})
--endif()
-\ No newline at end of file
 +    target_link_libraries(benchmark-simple tinyxml2::tinyxml2)
-+endif()
+ endif()
+ 
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
diff --git a/devel/cppcheck/files/patch-gui_test_xmlreportv2_CMakeLists.txt b/devel/cppcheck/files/patch-gui_test_xmlreportv2_CMakeLists.txt
index 650aecfdad42..de51aaf9da44 100644
--- a/devel/cppcheck/files/patch-gui_test_xmlreportv2_CMakeLists.txt
+++ b/devel/cppcheck/files/patch-gui_test_xmlreportv2_CMakeLists.txt
@@ -1,7 +1,7 @@
---- gui/test/xmlreportv2/CMakeLists.txt.orig	2022-03-19 11:35:06 UTC
+--- gui/test/xmlreportv2/CMakeLists.txt.orig	2022-08-28 12:43:18 UTC
 +++ gui/test/xmlreportv2/CMakeLists.txt
-@@ -24,5 +24,5 @@ if (USE_Z3)
-     target_link_libraries(test-xmlreportv2 ${Z3_LIBRARIES})
+@@ -21,5 +21,5 @@ if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
+     target_link_libraries(test-xmlreportv2 ${PCRE_LIBRARY})
  endif()
  if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
 -    target_link_libraries(test-xmlreportv2 ${tinyxml2_LIBRARIES})
diff --git a/devel/cppcheck/files/patch-lib_CMakeLists.txt b/devel/cppcheck/files/patch-lib_CMakeLists.txt
index f2999fceb629..b3bf45f144a5 100644
--- a/devel/cppcheck/files/patch-lib_CMakeLists.txt
+++ b/devel/cppcheck/files/patch-lib_CMakeLists.txt
@@ -1,11 +1,11 @@
---- lib/CMakeLists.txt.orig	2022-03-19 11:35:06 UTC
+--- lib/CMakeLists.txt.orig	2022-08-28 12:43:18 UTC
 +++ lib/CMakeLists.txt
-@@ -36,6 +36,8 @@ add_library(lib_objs OBJECT ${srcs_lib} ${hdrs})
- target_include_directories(lib_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/)
+@@ -36,6 +36,8 @@ if(USE_BUNDLED_TINYXML2)
+ target_include_directories(lib_objs SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/externals/)
  if(USE_BUNDLED_TINYXML2)
-     target_include_directories(lib_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
+     target_include_directories(lib_objs SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
 +else()
 +    target_link_libraries(lib_objs PRIVATE tinyxml2::tinyxml2)
  endif()
- target_include_directories(lib_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/picojson/)
- target_include_directories(lib_objs PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/)
+ target_include_directories(lib_objs SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/externals/picojson/)
+ target_include_directories(lib_objs SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/externals/simplecpp/)
diff --git a/devel/cppcheck/files/patch-oss-fuzz_CMakeLists.txt b/devel/cppcheck/files/patch-oss-fuzz_CMakeLists.txt
index ba9d6741a87d..cb5b20f0ca8f 100644
--- a/devel/cppcheck/files/patch-oss-fuzz_CMakeLists.txt
+++ b/devel/cppcheck/files/patch-oss-fuzz_CMakeLists.txt
@@ -1,7 +1,7 @@
---- oss-fuzz/CMakeLists.txt.orig	2022-03-19 11:35:06 UTC
+--- oss-fuzz/CMakeLists.txt.orig	2022-08-28 12:43:18 UTC
 +++ oss-fuzz/CMakeLists.txt
-@@ -25,7 +25,7 @@ if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES 
-         target_link_libraries(fuzz-client PRIVATE ${Z3_LIBRARIES})
+@@ -22,7 +22,7 @@ if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES 
+         target_link_libraries(fuzz-client PRIVATE ${PCRE_LIBRARY})
      endif()
      if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
 -        target_link_libraries(fuzz-client PRIVATE ${tinyxml2_LIBRARIES})
diff --git a/devel/cppcheck/files/patch-test_CMakeLists.txt b/devel/cppcheck/files/patch-test_CMakeLists.txt
index 210d2f9f9b5e..7ad2144b350f 100644
--- a/devel/cppcheck/files/patch-test_CMakeLists.txt
+++ b/devel/cppcheck/files/patch-test_CMakeLists.txt
@@ -1,11 +1,11 @@
---- test/CMakeLists.txt.orig	2022-03-19 11:35:06 UTC
+--- test/CMakeLists.txt.orig	2022-08-28 12:43:18 UTC
 +++ test/CMakeLists.txt
-@@ -26,7 +26,7 @@ if (BUILD_TESTS)
+@@ -23,7 +23,7 @@ if (BUILD_TESTS)
          endif()
      endif()
      if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
 -        target_link_libraries(testrunner ${tinyxml2_LIBRARIES})
 +        target_link_libraries(testrunner tinyxml2::tinyxml2)
      endif()
+     target_link_libraries(testrunner ${CMAKE_THREAD_LIBS_INIT})
  
-     if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
diff --git a/devel/cppcheck/pkg-plist b/devel/cppcheck/pkg-plist
index 5e8bca7096a2..747f0498beb3 100644
--- a/devel/cppcheck/pkg-plist
+++ b/devel/cppcheck/pkg-plist
@@ -1,2 +1,6 @@
 bin/cppcheck
-%%MANPAGES%%man/man1/cppcheck.1.gz
+%%GUI%%bin/cppcheck-gui
+%%GUI%%share/applications/cppcheck-gui.desktop
+%%GUI%%share/icons/hicolor/64x64/apps/cppcheck-gui.png
+%%GUI%%share/icons/hicolor/scalable/apps/cppcheck-gui.svg
+%%MANPAGES%%share/man/man1/cppcheck.1.gz
diff --git a/devel/cppcheck/pkg-plist-gui b/devel/cppcheck/pkg-plist-gui
deleted file mode 100644
index 59166495601d..000000000000
--- a/devel/cppcheck/pkg-plist-gui
+++ /dev/null
@@ -1,16 +0,0 @@
-bin/cppcheck-gui
-share/applications/cppcheck-gui.desktop
-%%DATADIR%%/lang/cppcheck_de.qm
-%%DATADIR%%/lang/cppcheck_es.qm
-%%DATADIR%%/lang/cppcheck_fi.qm
-%%DATADIR%%/lang/cppcheck_fr.qm
-%%DATADIR%%/lang/cppcheck_it.qm
-%%DATADIR%%/lang/cppcheck_ja.qm
-%%DATADIR%%/lang/cppcheck_ko.qm
-%%DATADIR%%/lang/cppcheck_nl.qm
-%%DATADIR%%/lang/cppcheck_ru.qm
-%%DATADIR%%/lang/cppcheck_sr.qm
-%%DATADIR%%/lang/cppcheck_sv.qm
-%%DATADIR%%/lang/cppcheck_zh_CN.qm
-share/icons/hicolor/64x64/apps/cppcheck-gui.png
-share/icons/hicolor/scalable/apps/cppcheck-gui.svg