Initial import of vera++, version 1.1.1.

The build system of this package is completely fubar'd (mostly because this
has been designed to be built against the Boost source files and to never
be installed).  I have made an attempt to make the build system and the
runtime finding of configuration systems slightly more sane, but can't
promise it will work everywhere yet.  So far only tested in OS X 10.6.

Description:

Vera++ is a programmable tool for verification, analysis and
transformation of C++ source code.

Vera++ is a tool designed for programmers -- not only in the sense that
it helps with everyday development work, but also in the sense that all
its rules are implemented as scripts that can be modified or added by
the user.  Thanks to this, programmers have complete freedom and control
over what the tool does and how it works.

Vera++ is mainly an engine that parses C++ source files and presents the
result of this parsing to scripts in the form of various collections --
the scripts are actually performing the requested tasks.
This commit is contained in:
jmmv 2011-10-13 18:43:51 +00:00
parent 0f2bf7cf17
commit 574938521c
7 changed files with 243 additions and 0 deletions

12
devel/vera++/DESCR Normal file
View file

@ -0,0 +1,12 @@
Vera++ is a programmable tool for verification, analysis and
transformation of C++ source code.
Vera++ is a tool designed for programmers -- not only in the sense that
it helps with everyday development work, but also in the sense that all
its rules are implemented as scripts that can be modified or added by
the user. Thanks to this, programmers have complete freedom and control
over what the tool does and how it works.
Vera++ is mainly an engine that parses C++ source files and presents the
result of this parsing to scripts in the form of various collections --
the scripts are actually performing the requested tasks.

40
devel/vera++/Makefile Normal file
View file

@ -0,0 +1,40 @@
# $NetBSD: Makefile,v 1.1.1.1 2011/10/13 18:43:51 jmmv Exp $
#
DISTNAME= vera++-1.1.1
CATEGORIES= devel
MASTER_SITES= http://www.inspirel.com/vera/files/
MAINTAINER= jmmv@NetBSD.org
HOMEPAGE= http://www.inspirel.com/vera/
COMMENT= Programmable verification and analysis tool for C++
PKG_DESTDIR_SUPPORT= user-destdir
BUILD_TARGET= build
LICENSE= boost-license
USE_LANGUAGES= c++
USE_TOOLS+= gmake pax
CXXFLAGS+= -DVERA_ROOT=\"${PREFIX:Q}/share/vera++\"
MAKE_FLAGS+= BOOST_DIR=${BUILDLINK_PREFIX.boost-headers}/include
MAKE_FLAGS+= BOOSTLIB_DIR=${BUILDLINK_PREFIX.boost-libs}/lib
MAKE_FLAGS+= TCLINCLUDE_DIR=${BUILDLINK_PREFIX.tcl}/include
MAKE_FLAGS+= TCLLIB_DIR=${BUILDLINK_PREFIX.tcl}/lib
INSTALLATION_DIRS= bin share/doc/vera++ share/vera++
post-extract:
cd ${WRKSRC} && find . -type f -exec chmod -x {} \;
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/vera++ ${DESTDIR}${PREFIX}/bin/vera++
cd ${WRKSRC}/doc && pax -rw * ${DESTDIR}${PREFIX}/share/doc/vera++/
cd ${WRKSRC} && \
pax -rw profiles scripts ${DESTDIR}${PREFIX}/share/vera++/
.include "../../devel/boost-headers/buildlink3.mk"
.include "../../devel/boost-libs/buildlink3.mk"
.include "../../lang/tcl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

80
devel/vera++/PLIST Normal file
View file

@ -0,0 +1,80 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2011/10/13 18:43:51 jmmv Exp $
bin/vera++
share/doc/vera++/manual.html
share/doc/vera++/rules/F001.html
share/doc/vera++/rules/F002.html
share/doc/vera++/rules/L001.html
share/doc/vera++/rules/L002.html
share/doc/vera++/rules/L003.html
share/doc/vera++/rules/L004.html
share/doc/vera++/rules/L005.html
share/doc/vera++/rules/L006.html
share/doc/vera++/rules/T001.html
share/doc/vera++/rules/T002.html
share/doc/vera++/rules/T003.html
share/doc/vera++/rules/T004.html
share/doc/vera++/rules/T005.html
share/doc/vera++/rules/T006.html
share/doc/vera++/rules/T007.html
share/doc/vera++/rules/T008.html
share/doc/vera++/rules/T009.html
share/doc/vera++/rules/T010.html
share/doc/vera++/rules/T011.html
share/doc/vera++/rules/T012.html
share/doc/vera++/rules/T013.html
share/doc/vera++/rules/T014.html
share/doc/vera++/rules/T015.html
share/doc/vera++/rules/T016.html
share/doc/vera++/rules/T017.html
share/doc/vera++/rules/T018.html
share/doc/vera++/rules/T019.html
share/doc/vera++/rules/index.html
share/doc/vera++/rules/style.css
share/doc/vera++/style.css
share/doc/vera++/tclapi.html
share/doc/vera++/transformations/index.html
share/doc/vera++/transformations/move_includes.html
share/doc/vera++/transformations/move_macros.html
share/doc/vera++/transformations/move_namespace.html
share/doc/vera++/transformations/style.css
share/doc/vera++/transformations/to_lower.html
share/doc/vera++/transformations/to_xml.html
share/doc/vera++/transformations/to_xml2.html
share/doc/vera++/transformations/trim_right.html
share/vera++/profiles/boost
share/vera++/profiles/default
share/vera++/scripts/rules/DUMP.tcl
share/vera++/scripts/rules/F001.tcl
share/vera++/scripts/rules/F002.tcl
share/vera++/scripts/rules/L001.tcl
share/vera++/scripts/rules/L002.tcl
share/vera++/scripts/rules/L003.tcl
share/vera++/scripts/rules/L004.tcl
share/vera++/scripts/rules/L005.tcl
share/vera++/scripts/rules/L006.tcl
share/vera++/scripts/rules/T001.tcl
share/vera++/scripts/rules/T002.tcl
share/vera++/scripts/rules/T003.tcl
share/vera++/scripts/rules/T004.tcl
share/vera++/scripts/rules/T005.tcl
share/vera++/scripts/rules/T006.tcl
share/vera++/scripts/rules/T007.tcl
share/vera++/scripts/rules/T008.tcl
share/vera++/scripts/rules/T009.tcl
share/vera++/scripts/rules/T010.tcl
share/vera++/scripts/rules/T011.tcl
share/vera++/scripts/rules/T012.tcl
share/vera++/scripts/rules/T013.tcl
share/vera++/scripts/rules/T014.tcl
share/vera++/scripts/rules/T015.tcl
share/vera++/scripts/rules/T016.tcl
share/vera++/scripts/rules/T017.tcl
share/vera++/scripts/rules/T018.tcl
share/vera++/scripts/rules/T019.tcl
share/vera++/scripts/transformations/move_includes.tcl
share/vera++/scripts/transformations/move_macros.tcl
share/vera++/scripts/transformations/move_namespace.tcl
share/vera++/scripts/transformations/to_lower.tcl
share/vera++/scripts/transformations/to_xml.tcl
share/vera++/scripts/transformations/to_xml2.tcl
share/vera++/scripts/transformations/trim_right.tcl

8
devel/vera++/distinfo Normal file
View file

@ -0,0 +1,8 @@
$NetBSD: distinfo,v 1.1.1.1 2011/10/13 18:43:51 jmmv Exp $
SHA1 (vera++-1.1.1.tar.gz) = fe3c14775b50a580d88872e0ada8602b39a2ae01
RMD160 (vera++-1.1.1.tar.gz) = d085fe4605930c7cf18ed2e8471b1771d08511e1
Size (vera++-1.1.1.tar.gz) = 53263 bytes
SHA1 (patch-aa) = aada15eb28d58718e30b151bb7d148d8f9d1dc05
SHA1 (patch-ab) = 1164e33cc69ddd87c9d4f8dc082ffdf2b7abad84
SHA1 (patch-ac) = e23a83a69620c50c4b29711b12982a22aec536fe

View file

@ -0,0 +1,30 @@
$NetBSD: patch-aa,v 1.1.1.1 2011/10/13 18:43:51 jmmv Exp $
The structures/lexer directory rebuilds part of Boost.Wave by attempting to
access the raw Boost source files. This is not appropriate for a package,
so just link against the installed Boost.Wave library.
--- src/Makefile.orig 2008-08-25 13:41:57.000000000 +0000
+++ src/Makefile
@@ -8,18 +8,15 @@ PLUGINS_OBJ = plugins/Interpreter.o plug
plugins/Transformations.o plugins/RootDirectory.o plugins/Parameters.o \
plugins/Reports.o plugins/cpptcl-1.1.4/cpptcl.o
-LIBS_DIRS = -L./structures/lexer -L${TCLLIB_DIR}
-LIBS = -l${TCL_LIB} -llexer
+LIBS_DIRS = -L${BOOSTLIB_DIR} -L${TCLLIB_DIR}
+LIBS = -l${TCL_LIB} -lboost_wave -lboost_system
ALL_OBJ = ${STRUCTURES_OBJ} ${PLUGINS_OBJ}
-vera++ : main.o structures_objects plugins_objects liblexer
+vera++ : main.o structures_objects plugins_objects
${CXX} -o $@ main.o ${ALL_OBJ} ${LIBS_DIRS} ${LIBS}
-liblexer :
- make -C structures/lexer
-
main.o : main.cpp
${CXX} -c -o $@ ${CXXFLAGS} $?

View file

@ -0,0 +1,30 @@
$NetBSD: patch-ab,v 1.1.1.1 2011/10/13 18:43:51 jmmv Exp $
Mangle some variables to ensure that the values we provide from the Makefile
package are properly propagated. Also allow us to inject extra flags to the
compiler from the package.
--- src/Make.common.orig 2008-08-25 13:41:57.000000000 +0000
+++ src/Make.common
@@ -1,16 +1,16 @@
# Paths that can be different in each installation:
# Location of Boost libraries:
-BOOST_DIR = /usr/local/include/boost_1_36_0
+BOOST_DIR = undefined
# Location of headers and libraries for the Tcl interpreter:
-TCLINCLUDE_DIR = /usr/include
-TCLLIB_DIR = /usr/lib
+TCLINCLUDE_DIR = undefined
+TCLLIB_DIR = undefined
TCL_LIB = tcl
# Common compilation options and choices:
-CXX = g++
-CXXFLAGS = -Wall -pedantic -W -Wshadow -O2
+CXX ?= g++
+CXXFLAGS += -Wall -pedantic -W -Wshadow -O2
CXXFLAGS_BOOST = -Wall -pedantic -Wno-long-long -O2
CXXFLAGS_TCL = -Wall -pedantic -W -Wshadow -Wno-long-long -O2

View file

@ -0,0 +1,43 @@
$NetBSD: patch-ac,v 1.1.1.1 2011/10/13 18:43:51 jmmv Exp $
Vera++ comes with a set of profiles to validate the syntax of files.
However, the whole system is not designed to be installed. Change the
rules for the location of the profiles to something more natural: first
attempt user overrides and, if these fail, fallback to the system
installed files.
--- src/main.cpp.orig 2008-08-25 13:41:57.000000000 +0000
+++ src/main.cpp
@@ -5,6 +5,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
+extern "C" {
+#include <unistd.h>
+}
+
#include "structures/SourceFiles.h"
#include "plugins/Profiles.h"
#include "plugins/Rules.h"
@@ -65,15 +69,16 @@ int main(int argc, char * argv[])
// the directory containing the profile and rule definitions
// by default it is (in this order, first has highest precedence):
// - VERA_ROOT (if VERA_ROOT is defined)
- // - HOME/.vera (if HOME is defined)
- // - current directory
+ // - HOME/.vera (if HOME is defined and the directory exists)
+ // - the installed files for Vera in prefix/share/vera++
- RootDirectory::DirectoryName veraRoot(".");
+ RootDirectory::DirectoryName veraRoot(VERA_ROOT);
char * veraRootEnv = getenv("HOME");
if (veraRootEnv != NULL)
{
- veraRoot = veraRootEnv;
- veraRoot += "/.vera++";
+ const string homeRoot = string(veraRootEnv) + "/.vera++";
+ if (::access(homeRoot.c_str(), X_OK) != -1)
+ veraRoot = homeRoot;
}
veraRootEnv = getenv("VERA_ROOT");
if (veraRootEnv != NULL)