Date: Wed, 31 May 2017 20:07:15 +0000 (UTC) From: Dmitry Marakasov <amdmi3@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r442261 - in head/devel/cppcheck: . files Message-ID: <201705312007.v4VK7FXE018857@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: amdmi3 Date: Wed May 31 20:07:15 2017 New Revision: 442261 URL: https://svnweb.freebsd.org/changeset/ports/442261 Log: - Update to 1.79 - Fix segfault due to conflict between bundled and system tinyxml [1] - Switch to cmake build, simplifying the port - Enable GUI PR: 217881 [1], 218876 [1] Added: head/devel/cppcheck/files/ head/devel/cppcheck/files/patch-CMakeLists.txt (contents, props changed) head/devel/cppcheck/files/patch-gui_CMakeLists.txt (contents, props changed) head/devel/cppcheck/files/patch-tools_matchcompiler.py (contents, props changed) head/devel/cppcheck/pkg-plist (contents, props changed) Modified: head/devel/cppcheck/Makefile head/devel/cppcheck/distinfo Modified: head/devel/cppcheck/Makefile ============================================================================== --- head/devel/cppcheck/Makefile Wed May 31 19:25:55 2017 (r442260) +++ head/devel/cppcheck/Makefile Wed May 31 20:07:15 2017 (r442261) @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= cppcheck -PORTVERSION= 1.78 -PORTREVISION= 2 +PORTVERSION= 1.79 CATEGORIES= devel MASTER_SITES= SF @@ -13,68 +12,50 @@ COMMENT= Static analysis of C/C++ code LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING -LIB_DEPENDS= libtinyxml2.so:textproc/tinyxml2 - BROKEN_powerpc64= fails to compile: analyzerinfo.cpp: 'to_string' is not a member of 'std' -USES= compiler:c++11-lib execinfo gmake python shebangfix tar:bzip2 +USES= compiler:c++11-lib cmake shebangfix tar:bzip2 SHEBANG_FILES= htmlreport/cppcheck-htmlreport -USE_CXXSTD= c++11 -ALL_TARGET= cppcheck -TEST_TARGET= test -LDFLAGS+= -L${LOCALBASE}/lib -lexecinfo -MAKE_ENV= TINYXML=-ltinyxml2 CFGDIR="${DATADIR}/cfg" +OPTIONS_DEFINE= RULES GUI HTMLREPORT MANPAGES MATCHCOMPILER TEST +OPTIONS_DEFAULT= RULES GUI HTMLREPORT MANPAGES MATCHCOMPILER +OPTIONS_SUB= yes -PLIST_FILES= bin/cppcheck bin/cppcheck-htmlreport -PORTDATA= * +RULES_DESC= User-defined rule support (requires PCRE) +RULES_CMAKE_BOOL= HAVE_RULES +RULES_LIB_DEPENDS= libpcre.so:devel/pcre +RULES_USES= localbase:ldflags -OPTIONS_DEFINE= MATCHCOMPILER RULES MANPAGES -OPTIONS_DEFAULT= MATCHCOMPILER RULES MANPAGES +GUI_CMAKE_BOOL= BUILD_GUI +GUI_USE= QT4=corelib,gui,xml,qmake_build,moc_build,uic_build,rcc_build,linguisttools_build -MATCHCOMPILER_DESC= Build-time optimizations via Python -RULES_DESC= User-defined rule support (requires PCRE) +TEST_CMAKE_BOOL= BUILD_TESTS -MANPAGES_ALL_TARGET= man +HTMLREPORT_DESC= Install cppcheck-htmlreport +HTMLREPORT_USES= python:2,${PYUSE:C/ /,/W} +HTMLREPORT_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pygments>0:textproc/py-pygments +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 -MANPAGES_MAKE_ENV= DB2MAN="${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl" -MANPAGES_PLIST_FILES= man/man1/cppcheck.1.gz -MATCHCOMPILER_MAKE_ENV= SRCDIR=build -MATCHCOMPILER_USES= python:2,build +MATCHCOMPILER_DESC= Build-time optimizations via Python +MATCHCOMPILER_CMAKE_BOOL= USE_MATCHCOMPILER +MATCHCOMPILER_USES= python:2,${PYUSE:C/ /,/W} +MATCHCOMPILER_VARS= PYUSE+=build -RULES_LIB_DEPENDS= libpcre.so:devel/pcre -RULES_MAKE_ENV= HAVE_RULES=yes +post-install-HTMLREPORT-on: + ${INSTALL_SCRIPT} ${WRKSRC}/htmlreport/cppcheck-htmlreport ${STAGEDIR}${PREFIX}/bin -post-patch: - @${REINPLACE_CMD} \ - -e 's|-Iexternals/tinyxml|-I${LOCALBASE}/include|' \ - ${WRKSRC}/Makefile +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-patch-MANPAGES-on: - @${REINPLACE_CMD} -e '\|DB2MAN=|d' \ - ${WRKSRC}/Makefile +post-install-MANPAGES-on: + ${INSTALL_MAN} ${WRKSRC}/man/cppcheck.1 ${STAGEDIR}${PREFIX}/man/man1 -post-patch-MATCHCOMPILER-on: - @${REINPLACE_CMD} -e 's|python|${PYTHON_CMD}|' \ - ${WRKSRC}/Makefile - -post-patch-RULES-on: - @${REINPLACE_CMD} \ - -e '\|CXXFLAGS +=| \ - s| -DTIXML_USE_STL $$(shell pcre-config --cflags)||' \ - -e '\|$$(SRCDIR)/cppcheck.cpp| \ - s|$${INCLUDE_FOR_LIB}|& $$(shell pcre-config --cflags)|' \ - ${WRKSRC}/Makefile - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/cppcheck ${STAGEDIR}${PREFIX}/bin - ${INSTALL_SCRIPT} ${WRKSRC}/htmlreport/cppcheck-htmlreport ${STAGEDIR}${PREFIX}/bin - @${MKDIR} ${STAGEDIR}${DATADIR}/cfg - @cd ${WRKSRC}/cfg; ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/cfg/ - -do-install-MANPAGES-on: - ${INSTALL_MAN} ${WRKSRC}/cppcheck.1 ${STAGEDIR}${PREFIX}/man/man1 +do-test-TEST-on: + cd ${WRKSRC} && ctest .include <bsd.port.mk> Modified: head/devel/cppcheck/distinfo ============================================================================== --- head/devel/cppcheck/distinfo Wed May 31 19:25:55 2017 (r442260) +++ head/devel/cppcheck/distinfo Wed May 31 20:07:15 2017 (r442261) @@ -1,3 +1,3 @@ -TIMESTAMP = 1491648981 -SHA256 (cppcheck-1.78.tar.bz2) = e42696f7d6321b98cb479ad9728d051effe543b26aca8102428f60b9850786b1 -SIZE (cppcheck-1.78.tar.bz2) = 1201959 +TIMESTAMP = 1495198335 +SHA256 (cppcheck-1.79.tar.bz2) = 2b85b693de54f15048f1841e7aef74574f99da6270d2182baba78514fa27f06d +SIZE (cppcheck-1.79.tar.bz2) = 1206623 Added: head/devel/cppcheck/files/patch-CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/cppcheck/files/patch-CMakeLists.txt Wed May 31 20:07:15 2017 (r442261) @@ -0,0 +1,8 @@ +--- CMakeLists.txt.orig 2017-05-13 09:27:11 UTC ++++ CMakeLists.txt +@@ -1,4 +1,4 @@ +-project(CppCheck) ++project(cppcheck) + cmake_minimum_required(VERSION 2.8) + + include(GNUInstallDirs) Added: head/devel/cppcheck/files/patch-gui_CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/cppcheck/files/patch-gui_CMakeLists.txt Wed May 31 20:07:15 2017 (r442261) @@ -0,0 +1,11 @@ +--- gui/CMakeLists.txt.orig 2017-05-13 09:27:11 UTC ++++ gui/CMakeLists.txt +@@ -29,7 +29,7 @@ if (BUILD_GUI) + + + 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 ${CMAKE_INSTALL_FULL_DATAROOTDIR}/${PROJECT_NAME}/lang COMPONENT applications) + + install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + Added: head/devel/cppcheck/files/patch-tools_matchcompiler.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/cppcheck/files/patch-tools_matchcompiler.py Wed May 31 20:07:15 2017 (r442261) @@ -0,0 +1,42 @@ +commit 9d64e9a5577877dd9608823fb42fbef8d13af085 +Author: Dmitry Marakasov <amdmi3@amdmi3.ru> +Date: Fri May 19 21:36:54 2017 +0300 + + Fix matchcompiler failure in case of parallel build + + During parallel build, multiple processes will try to create build_dir + in parallel, so the build will fail. Fix that by calling makedirs + unconditionally and ignoring errors from it. If there's actual + problem with directory creation, it'll be caught later by isdir() + check. + +diff --git tools/matchcompiler.py tools/matchcompiler.py +index 71f176d59..2ba36b29f 100755 +--- tools/matchcompiler.py ++++ tools/matchcompiler.py +@@ -22,6 +22,7 @@ import sys + import re + import glob + import argparse ++import errno + + + class MatchCompiler: +@@ -667,8 +668,16 @@ def main(): + sys.exit(-1) + + # Create build directory if needed +- if not os.path.exists(build_dir): ++ try: + os.makedirs(build_dir) ++ except OSError as e: ++ # due to race condition in case of parallel build, ++ # makedirs may fail. Ignore that; if there's actual ++ # problem with directory creation, it'll be caught ++ # by the following isdir check ++ if e.errno != errno.EEXIST: ++ raise ++ + if not os.path.isdir(build_dir): + raise Exception(build_dir + ' is not a directory') + Added: head/devel/cppcheck/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/cppcheck/pkg-plist Wed May 31 20:07:15 2017 (r442261) @@ -0,0 +1,29 @@ +%%GUI%%bin/cppcheck-gui +bin/cppcheck +%%DATADIR%%/avr.cfg +%%DATADIR%%/gnu.cfg +%%DATADIR%%/gtk.cfg +%%GUI%%%%DATADIR%%/lang/cppcheck_de.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_es.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_fi.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_fr.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_it.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_ja.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_ko.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_nl.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_ru.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_sr.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_sv.qm +%%GUI%%%%DATADIR%%/lang/cppcheck_zh_CN.qm +%%DATADIR%%/microsoft_sal.cfg +%%DATADIR%%/posix.cfg +%%DATADIR%%/qt.cfg +%%DATADIR%%/sdl.cfg +%%DATADIR%%/sfml.cfg +%%DATADIR%%/std.cfg +%%DATADIR%%/windows.cfg +%%DATADIR%%/wxwidgets.cfg +%%MANPAGES%%man/man1/cppcheck.1.gz +%%GUI%%share/applications/cppcheck-gui.desktop +%%GUI%%share/icons/hicolor/64x64/apps/cppcheck-gui.png +%%GUI%%share/icons/hicolor/scalable/apps/cppcheck-gui.svg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705312007.v4VK7FXE018857>