aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbf <bf@FreeBSD.org>2013-01-17 02:05:43 +0800
committerbf <bf@FreeBSD.org>2013-01-17 02:05:43 +0800
commit87b7be68991f484c530c54504cac1c278e84ccd3 (patch)
treea8cccac5f73ab67d421b3758c7622f6b23f3940e
parent33a4e7c914f7c9cd56964f18c7ee76f8ab5bbb39 (diff)
downloadfreebsd-ports-gnome-87b7be68991f484c530c54504cac1c278e84ccd3.tar.gz
freebsd-ports-gnome-87b7be68991f484c530c54504cac1c278e84ccd3.tar.zst
freebsd-ports-gnome-87b7be68991f484c530c54504cac1c278e84ccd3.zip
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
-rw-r--r--devel/cppcheck/Makefile71
-rw-r--r--devel/cppcheck/distinfo4
-rw-r--r--devel/cppcheck/files/patch-Makefile23
3 files changed, 53 insertions, 45 deletions
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 <pgj@FreeBSD.org>
-#
+# Created by: Gabor Pali <pgj@FreeBSD.org>
# $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
-PLIST_FILES= bin/cppcheck
+OPTIONS_DEFINE= MATCHCOMPILER RULES
+OPTIONS_DEFAULT= MATCHCOMPILER RULES
-ALL_TARGET= cppcheck
+MATCHCOMPILER_DESC= Build-time optimizations via Python
+RULES_DESC= User-defined rule support (requires PCRE)
-.include <bsd.port.pre.mk>
+PLIST_FILES= bin/cppcheck
+
+.include <bsd.port.options.mk>
.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 <bsd.port.post.mk>
+.include <bsd.port.mk>
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
-