mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
- 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]
This commit is contained in:
parent
9f4e7930a3
commit
c9bbe54ef5
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=442261
6 changed files with 126 additions and 55 deletions
|
@ -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= *
|
||||
|
||||
OPTIONS_DEFINE= MATCHCOMPILER RULES MANPAGES
|
||||
OPTIONS_DEFAULT= MATCHCOMPILER RULES MANPAGES
|
||||
|
||||
MATCHCOMPILER_DESC= Build-time optimizations via Python
|
||||
RULES_DESC= User-defined rule support (requires PCRE)
|
||||
RULES_CMAKE_BOOL= HAVE_RULES
|
||||
RULES_LIB_DEPENDS= libpcre.so:devel/pcre
|
||||
RULES_USES= localbase:ldflags
|
||||
|
||||
GUI_CMAKE_BOOL= BUILD_GUI
|
||||
GUI_USE= QT4=corelib,gui,xml,qmake_build,moc_build,uic_build,rcc_build,linguisttools_build
|
||||
|
||||
TEST_CMAKE_BOOL= BUILD_TESTS
|
||||
|
||||
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_ALL_TARGET= man
|
||||
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-patch:
|
||||
@${REINPLACE_CMD} \
|
||||
-e 's|-Iexternals/tinyxml|-I${LOCALBASE}/include|' \
|
||||
${WRKSRC}/Makefile
|
||||
|
||||
post-patch-MANPAGES-on:
|
||||
@${REINPLACE_CMD} -e '\|DB2MAN=|d' \
|
||||
${WRKSRC}/Makefile
|
||||
|
||||
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
|
||||
post-install-HTMLREPORT-on:
|
||||
${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
|
||||
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}/man/man1
|
||||
|
||||
do-test-TEST-on:
|
||||
cd ${WRKSRC} && ctest
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -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
|
||||
|
|
8
devel/cppcheck/files/patch-CMakeLists.txt
Normal file
8
devel/cppcheck/files/patch-CMakeLists.txt
Normal file
|
@ -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)
|
11
devel/cppcheck/files/patch-gui_CMakeLists.txt
Normal file
11
devel/cppcheck/files/patch-gui_CMakeLists.txt
Normal file
|
@ -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)
|
||||
|
42
devel/cppcheck/files/patch-tools_matchcompiler.py
Normal file
42
devel/cppcheck/files/patch-tools_matchcompiler.py
Normal file
|
@ -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')
|
||||
|
29
devel/cppcheck/pkg-plist
Normal file
29
devel/cppcheck/pkg-plist
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue