diff --git a/devel/cppcheck/Makefile b/devel/cppcheck/Makefile index e27a22f486fd..5fec5569fbf2 100644 --- a/devel/cppcheck/Makefile +++ b/devel/cppcheck/Makefile @@ -1,74 +1,77 @@ PORTNAME= cppcheck -PORTVERSION= 2.12.1 +PORTVERSION= 2.13.4 CATEGORIES= devel MAINTAINER= amdmi3@FreeBSD.org COMMENT= Tool for static C/C++ code analysis WWW= https://cppcheck.sourceforge.io/ \ https://github.com/danmar/cppcheck LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libtinyxml2.so:textproc/tinyxml2 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 PORTDATA= * 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) RULES_CMAKE_BOOL= HAVE_RULES 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} HTMLREPORT_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pygments>0:textproc/py-pygments@${PY_FLAVOR} HTMLREPORT_PLIST_FILES= bin/cppcheck-htmlreport HTMLREPORT_VARS= PYUSE+=run 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_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-patch: + @${REINPLACE_CMD} -e 's|%%WRKSRC%%|${WRKSRC}|' ${WRKSRC}/test/testfilelister.cpp + post-install-HTMLREPORT-on: ${INSTALL_SCRIPT} ${WRKSRC}/htmlreport/cppcheck-htmlreport ${STAGEDIR}${PREFIX}/bin post-build-MANPAGES-on: cd ${WRKSRC}/man && ${LOCALBASE}/bin/xsltproc --nonet --param man.charmap.use.subset "0" \ ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl cppcheck.1.xml post-install-MANPAGES-on: ${INSTALL_MAN} ${WRKSRC}/man/cppcheck.1 ${STAGEDIR}${PREFIX}/share/man/man1 do-test-TEST-on: cd ${BUILD_WRKSRC} && ${SETENV} ${TEST_ENV} ctest .include diff --git a/devel/cppcheck/distinfo b/devel/cppcheck/distinfo index 0d6560fcceb6..196c3a5af8c6 100644 --- a/devel/cppcheck/distinfo +++ b/devel/cppcheck/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1695753260 -SHA256 (danmar-cppcheck-2.12.1_GH0.tar.gz) = 2a3d4ba1179419612183ab3d6aed6d3b18be75e98cd6f138ea8e2020905dced2 -SIZE (danmar-cppcheck-2.12.1_GH0.tar.gz) = 3579702 +TIMESTAMP = 1709055380 +SHA256 (danmar-cppcheck-2.13.4_GH0.tar.gz) = d6ea064ebab76c6aa000795440479767d8d814dd29405918df4c1bbfcd6cb86c +SIZE (danmar-cppcheck-2.13.4_GH0.tar.gz) = 3646131 diff --git a/devel/cppcheck/files/patch-cli_cppcheckexecutor.cpp b/devel/cppcheck/files/patch-cli_cppcheckexecutor.cpp new file mode 100644 index 000000000000..03645dc3a08b --- /dev/null +++ b/devel/cppcheck/files/patch-cli_cppcheckexecutor.cpp @@ -0,0 +1,13 @@ +--- cli/cppcheckexecutor.cpp.orig 2024-02-16 08:46:10 UTC ++++ cli/cppcheckexecutor.cpp +@@ -64,6 +64,10 @@ + #include + #endif + ++#if !defined(WIN32) && !defined(__MINGW32__) ++#include // WIFEXITETED and friends ++#endif ++ + class CmdLineLoggerStd : public CmdLineLogger + { + public: diff --git a/devel/cppcheck/files/patch-test_testfilelister.cpp b/devel/cppcheck/files/patch-test_testfilelister.cpp new file mode 100644 index 000000000000..a02dbdbf18ce --- /dev/null +++ b/devel/cppcheck/files/patch-test_testfilelister.cpp @@ -0,0 +1,11 @@ +--- test/testfilelister.cpp.orig 2024-02-16 08:46:10 UTC ++++ test/testfilelister.cpp +@@ -43,7 +43,7 @@ class TestFileLister : public TestFixture { (private) + + // TODO: generate file list instead + static std::string findBaseDir() { +- std::string basedir; ++ std::string basedir = "%%WRKSRC%%/"; + while (!Path::isDirectory(Path::join(basedir, ".github"))) { + const std::string abspath = Path::getAbsoluteFilePath(basedir); + basedir += "../"; diff --git a/devel/cppcheck/files/patch-test_testother.cpp b/devel/cppcheck/files/patch-test_testother.cpp new file mode 100644 index 000000000000..6ee71403f6f7 --- /dev/null +++ b/devel/cppcheck/files/patch-test_testother.cpp @@ -0,0 +1,18 @@ +--- test/testother.cpp.orig 2024-02-16 08:46:10 UTC ++++ test/testother.cpp +@@ -2173,6 +2173,7 @@ class TestOther : public TestFixture { (private) + "}\n"); + ASSERT_EQUALS("[test.cpp:1]: (performance) Function parameter 't' should be passed by const reference.\n", errout.str()); + ++#ifndef __i386__ + check("struct S {\n" // #12138 + " union {\n" + " int a = 0;\n" +@@ -2191,6 +2192,7 @@ class TestOther : public TestFixture { (private) + " if (s.x > s.y) {}\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); ++#endif + + check("struct S { std::list l; };\n" // #12147 + "class C { public: std::list l; };\n"