From f4cb02c443f1acee0718cdf5d440bff81c6110ad Mon Sep 17 00:00:00 2001 From: Brendan Fabeny Date: Wed, 16 Jan 2013 18:05:43 +0000 Subject: [PATCH] update to 1.58; sort some assignments; shorten a long line; trim Makefile header; fix header search order; make it possible to build a slim version with minimal dependencies --- devel/cppcheck/Makefile | 71 +++++++++++++++++++++-------- devel/cppcheck/distinfo | 4 +- devel/cppcheck/files/patch-Makefile | 23 ---------- 3 files changed, 53 insertions(+), 45 deletions(-) delete mode 100644 devel/cppcheck/files/patch-Makefile diff --git a/devel/cppcheck/Makefile b/devel/cppcheck/Makefile index 03a7bef1f30c..ffbca6203621 100644 --- a/devel/cppcheck/Makefile +++ b/devel/cppcheck/Makefile @@ -1,13 +1,8 @@ -# New ports collection makefile for: cppcheck -# Date created: March 3, 2009 -# Whom: Gabor Pali -# +# Created by: Gabor Pali # $FreeBSD$ -# PORTNAME= cppcheck -PORTVERSION= 1.57 -PORTREVISION= 1 +PORTVERSION= 1.58 CATEGORIES= devel MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}/ @@ -16,38 +11,74 @@ COMMENT= Static analysis of C/C++ code LICENSE= GPLv3 -LIB_DEPENDS= pcre:${PORTSDIR}/devel/pcre \ - tinyxml:${PORTSDIR}/textproc/tinyxml +LIB_DEPENDS= tinyxml:${PORTSDIR}/textproc/tinyxml -USE_GMAKE= yes USE_BZIP2= yes +USE_GMAKE= yes + +ALL_TARGET= cppcheck LDFLAGS+= ${PTHREAD_LIBS} -L${LOCALBASE}/lib -CPPFLAGS+= -I${LOCALBASE}/include -MAKE_ENV+= HAVE_RULES=yes TINYXML=-ltinyxml +MAKE_ENV+= TINYXML=-ltinyxml + +OPTIONS_DEFINE= MATCHCOMPILER RULES +OPTIONS_DEFAULT= MATCHCOMPILER RULES + +MATCHCOMPILER_DESC= Build-time optimizations via Python +RULES_DESC= User-defined rule support (requires PCRE) PLIST_FILES= bin/cppcheck -ALL_TARGET= cppcheck - -.include +.include .if ${PORT_OPTIONS:MDOCS} +ALL_TARGET+= man BUILD_DEPENDS+= xsltproc:${PORTSDIR}/textproc/libxslt \ ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:${PORTSDIR}/textproc/docbook-xsl - -MANCOMPRESSED= no +MAKE_ENV+= DB2MAN="${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl" MAN1= cppcheck.1 -ALL_TARGET+= man +MANCOMPRESSED= no post-install: @${INSTALL_MAN} ${WRKSRC}/cppcheck.1 ${PREFIX}/man/man1 .endif +.if ${PORT_OPTIONS:MMATCHCOMPILER} +MAKE_ENV+= SRCDIR=build +USE_PYTHON_BUILD= 2.6+ +.endif + +.if ${PORT_OPTIONS:MRULES} +LIB_DEPENDS+= pcre:${PORTSDIR}/devel/pcre +MAKE_ENV+= HAVE_RULES=yes +.endif + +post-patch: + @${REINPLACE_CMD} \ + -e 's|-Iexternals/tinyxml|-I${LOCALBASE}/include|' \ + ${WRKSRC}/Makefile +.if ${PORT_OPTIONS:MDOCS} + @${REINPLACE_CMD} -e '\|DB2MAN=|d' \ + ${WRKSRC}/Makefile +.endif +.if ${PORT_OPTIONS:MMATCHCOMPILER} + @${REINPLACE_CMD} -e 's|python|${PYTHON_CMD}|' \ + ${WRKSRC}/Makefile +.endif +.if ${PORT_OPTIONS:MRULES} + @${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 +.endif + do-install: @${INSTALL_PROGRAM} ${WRKSRC}/cppcheck ${PREFIX}/bin check regression-test test: build @(cd ${BUILD_WRKSRC}; \ - ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} test) + ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} \ + ${_MAKE_JOBS} ${MAKE_ARGS} test) -.include +.include diff --git a/devel/cppcheck/distinfo b/devel/cppcheck/distinfo index 7653e5d34bc4..db574451cfa3 100644 --- a/devel/cppcheck/distinfo +++ b/devel/cppcheck/distinfo @@ -1,2 +1,2 @@ -SHA256 (cppcheck-1.57.tar.bz2) = 8774a804e08465787e3ddc3af9faf496606c207aa65f750eefd2851a9ccdafd5 -SIZE (cppcheck-1.57.tar.bz2) = 1180272 +SHA256 (cppcheck-1.58.tar.bz2) = d82e98f83ad9fa963d8f9f72d73b409abe13a35aaf302a86a0114a161715b19b +SIZE (cppcheck-1.58.tar.bz2) = 1230439 diff --git a/devel/cppcheck/files/patch-Makefile b/devel/cppcheck/files/patch-Makefile deleted file mode 100644 index c752b5b142e8..000000000000 --- a/devel/cppcheck/files/patch-Makefile +++ /dev/null @@ -1,23 +0,0 @@ ---- Makefile.orig 2011-12-10 07:00:45.000000000 -0500 -+++ Makefile 2011-12-10 23:10:57.000000000 -0500 -@@ -31,17 +31,17 @@ - endif - - ifndef INCLUDE_FOR_CLI -- INCLUDE_FOR_CLI=-Ilib -Iexternals -Iexternals/tinyxml -+ INCLUDE_FOR_CLI=-Ilib -Iexternals - endif - - ifndef INCLUDE_FOR_TEST -- INCLUDE_FOR_TEST=-Ilib -Icli -Iexternals -Iexternals/tinyxml -+ INCLUDE_FOR_TEST=-Ilib -Icli -Iexternals - endif - - BIN=$(DESTDIR)$(PREFIX)/bin - - # For 'make man': sudo apt-get install xsltproc docbook-xsl docbook-xml on Linux --DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl -+DB2MAN=${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl - XP=xsltproc -''-nonet -''-param man.charmap.use.subset "0" - MAN_SOURCE=man/cppcheck.1.xml -