From 359e4257acbbe18b8bd0c35e78030ef29db08f6d Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Tue, 14 Sep 2010 11:16:24 +0000 Subject: [PATCH] Coccinelle is a program matching and transformation engine which provides the language SmPL (Semantic Patch Language) for specifying desired matches and transformations in C code. Coccinelle was initially targeted towards performing collateral evolutions in Linux. Such evolutions comprise the changes that are needed in client code in response to evolutions in library APIs, and may include modifications such as renaming a function, adding a function argument whose value is somehow context-dependent, and reorganizing a data structure. Beyond collateral evolutions, Coccinelle is successfully used (by us and others) for finding and fixing bugs in systems code. WWW: http://coccinelle.lip6.fr/ PR: ports/150472 Submitted by: Andriy Gapon --- devel/Makefile | 1 + devel/coccinelle/Makefile | 23 ++++++ devel/coccinelle/distinfo | 3 + devel/coccinelle/files/patch-configure | 47 ++++++++++++ devel/coccinelle/files/patch-pycaml-Makefile | 11 +++ devel/coccinelle/pkg-descr | 11 +++ devel/coccinelle/pkg-plist | 76 ++++++++++++++++++++ 7 files changed, 172 insertions(+) create mode 100644 devel/coccinelle/Makefile create mode 100644 devel/coccinelle/distinfo create mode 100644 devel/coccinelle/files/patch-configure create mode 100644 devel/coccinelle/files/patch-pycaml-Makefile create mode 100644 devel/coccinelle/pkg-descr create mode 100644 devel/coccinelle/pkg-plist diff --git a/devel/Makefile b/devel/Makefile index 37ed6b455753..2c645b28ba0e 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -212,6 +212,7 @@ SUBDIR += cmph SUBDIR += cmunge SUBDIR += cobf + SUBDIR += coccinelle SUBDIR += cocktail SUBDIR += codeblocks SUBDIR += codeville diff --git a/devel/coccinelle/Makefile b/devel/coccinelle/Makefile new file mode 100644 index 000000000000..f70e286d57e1 --- /dev/null +++ b/devel/coccinelle/Makefile @@ -0,0 +1,23 @@ +# Ports collection makefile for: coccinnelle +# Date created: Sep 10, 2010 +# Whom: Andriy Gapon +# $FreeBSD$ + +PORTNAME= coccinelle +DISTVERSION= 0.2.4rc2 +CATEGORIES= devel +MASTER_SITES= http://coccinelle.lip6.fr/distrib/ +EXTRACT_SUFX= .tgz + +MAINTAINER= avg@icyb.net.ua +COMMENT= Coccinelle is a program matching and transformation engine + +GNU_CONFIGURE= yes +USE_GMAKE= yes +USE_PERL5_BUILD=yes +USE_PYTHON= 2.5+ +USE_OCAML= 3.0+ + +MAN1= spatch.1 + +.include diff --git a/devel/coccinelle/distinfo b/devel/coccinelle/distinfo new file mode 100644 index 000000000000..a42efc4dc89b --- /dev/null +++ b/devel/coccinelle/distinfo @@ -0,0 +1,3 @@ +MD5 (coccinelle-0.2.4rc2.tgz) = cbf7f16205316bf929f3a37994c130f3 +SHA256 (coccinelle-0.2.4rc2.tgz) = 513cbc237761db5c41a7902ac691451c1ac5000a4d14031db8218ceccb04d515 +SIZE (coccinelle-0.2.4rc2.tgz) = 2217241 diff --git a/devel/coccinelle/files/patch-configure b/devel/coccinelle/files/patch-configure new file mode 100644 index 000000000000..d1551ee523dd --- /dev/null +++ b/devel/coccinelle/files/patch-configure @@ -0,0 +1,47 @@ +--- configure 2010-07-03 01:08:25.000000000 +0300 ++++ configure 2010-09-09 13:28:04.692352989 +0300 +@@ -176,6 +176,6 @@ + pr2 ""; + + $error += check_config( +- "make -v 2>&1 |grep Make|", ++ "gmake -v 2>&1 |grep Make|", + "GNU Make [^0-9]*3\.[0-9]+.*", #version 3.79.1, 3.81 + "make (gnu version) is present.", +@@ -255,17 +255,17 @@ + All seems fine for $project. + + To compile $project type: +- \$ make depend +- \$ make all ++ \$ gmake depend ++ \$ gmake all + + Or alternatively, for the optimized version: +- \$ make all.opt ++ \$ gmake all.opt + If you want both, you could use: +- \$ make world ++ \$ gmake world + + + To install type: +- \$ make install ++ \$ gmake install + + Then, to test $project simply type: + \$ $projectcmdline +@@ -331,11 +331,11 @@ + my $pythonprefix = $python ? "yes" : "no"; + pr2 "Support for python scripting : $pythonprefix"; + `cd python; ln -sf ${pythonprefix}_pycocci.ml pycocci.ml; `; +-`cd python; make depend`; ++`cd python; gmake depend`; + + pr2 "Support for ocaml scripting : $ocamlprefix"; + `cd ocaml; ln -sf ${ocamlprefix}_prepare_ocamlcocci.ml prepare_ocamlcocci.ml;`; +-`cd ocaml; make depend`; ++`cd ocaml; gmake depend`; + + pr2 "Modifying globals/config.ml"; + my $command = "perl -p -e 's#Not_found.\*#Not_found->\\\"$src\\\"#' globals/config.ml.in > globals/config.ml"; diff --git a/devel/coccinelle/files/patch-pycaml-Makefile b/devel/coccinelle/files/patch-pycaml-Makefile new file mode 100644 index 000000000000..773243339a64 --- /dev/null +++ b/devel/coccinelle/files/patch-pycaml-Makefile @@ -0,0 +1,11 @@ +--- pycaml/Makefile.orig 2009-04-06 12:59:15.000000000 +0200 ++++ pycaml/Makefile 2009-04-06 12:59:20.000000000 +0200 +@@ -3,7 +3,7 @@ + OCAMLMAKEFILE = OCamlMakefile + PY_PREFIX = $(shell python getprefix.py) + PY_VERSION = $(shell python getversion.py) +-CLIBS = python$(PY_VERSION) pthread dl util m c ++CLIBS = python$(PY_VERSION) pthread util m c + + SOURCES = pycaml.ml pycaml_ml.c + RESULT = pycaml diff --git a/devel/coccinelle/pkg-descr b/devel/coccinelle/pkg-descr new file mode 100644 index 000000000000..a592bbdd0bf8 --- /dev/null +++ b/devel/coccinelle/pkg-descr @@ -0,0 +1,11 @@ +Coccinelle is a program matching and transformation engine which provides the +language SmPL (Semantic Patch Language) for specifying desired matches and +transformations in C code. Coccinelle was initially targeted towards performing +collateral evolutions in Linux. Such evolutions comprise the changes that are +needed in client code in response to evolutions in library APIs, and may +include modifications such as renaming a function, adding a function argument +whose value is somehow context-dependent, and reorganizing a data +structure. Beyond collateral evolutions, Coccinelle is successfully used (by us +and others) for finding and fixing bugs in systems code. + +WWW: http://coccinelle.lip6.fr/ diff --git a/devel/coccinelle/pkg-plist b/devel/coccinelle/pkg-plist new file mode 100644 index 000000000000..f528a1ecab74 --- /dev/null +++ b/devel/coccinelle/pkg-plist @@ -0,0 +1,76 @@ +bin/spatch +lib/dllpycaml_stubs.so +share/coccinelle/commons/common.cmi +share/coccinelle/commons/common_extra.cmi +share/coccinelle/commons/glimpse.cmi +share/coccinelle/commons/interfaces.cmi +share/coccinelle/commons/oarray.cmi +share/coccinelle/commons/oassoc.cmi +share/coccinelle/commons/objet.cmi +share/coccinelle/commons/ocollection.cmi +share/coccinelle/commons/ofullcommon.cmi +share/coccinelle/commons/ograph.cmi +share/coccinelle/commons/ograph_extended.cmi +share/coccinelle/commons/ograph_simple.cmi +share/coccinelle/commons/osequence.cmi +share/coccinelle/commons/oset.cmi +share/coccinelle/commons/parser_combinators.cmi +share/coccinelle/commons/seti.cmi +share/coccinelle/commons/sexp_common.cmi +share/coccinelle/ocaml/coccilib.cmi +share/coccinelle/parsing_c/ast_c.cmi +share/coccinelle/parsing_c/comment_annotater_c.cmi +share/coccinelle/parsing_c/compare_c.cmi +share/coccinelle/parsing_c/control_flow_c.cmi +share/coccinelle/parsing_c/control_flow_c_build.cmi +share/coccinelle/parsing_c/cpp_analysis_c.cmi +share/coccinelle/parsing_c/cpp_ast_c.cmi +share/coccinelle/parsing_c/cpp_token_c.cmi +share/coccinelle/parsing_c/flag_parsing_c.cmi +share/coccinelle/parsing_c/lexer_c.cmi +share/coccinelle/parsing_c/lexer_parser.cmi +share/coccinelle/parsing_c/lib_parsing_c.cmi +share/coccinelle/parsing_c/parse_c.cmi +share/coccinelle/parsing_c/parser_c.cmi +share/coccinelle/parsing_c/parsing_consistency_c.cmi +share/coccinelle/parsing_c/parsing_hacks.cmi +share/coccinelle/parsing_c/parsing_recovery_c.cmi +share/coccinelle/parsing_c/parsing_stat.cmi +share/coccinelle/parsing_c/pretty_print_c.cmi +share/coccinelle/parsing_c/semantic_c.cmi +share/coccinelle/parsing_c/sexp_ast_c.cmi +share/coccinelle/parsing_c/test_parsing_c.cmi +share/coccinelle/parsing_c/token_c.cmi +share/coccinelle/parsing_c/token_helpers.cmi +share/coccinelle/parsing_c/token_views_c.cmi +share/coccinelle/parsing_c/type_annoter_c.cmi +share/coccinelle/parsing_c/type_c.cmi +share/coccinelle/parsing_c/unparse_c.cmi +share/coccinelle/parsing_c/unparse_cocci.cmi +share/coccinelle/parsing_c/unparse_hrule.cmi +share/coccinelle/parsing_c/visitor_c.cmi +share/coccinelle/python/coccilib/__init__.py +share/coccinelle/python/coccilib/coccigui/__init__.py +share/coccinelle/python/coccilib/coccigui/coccigui.py +share/coccinelle/python/coccilib/coccigui/pycoccimodel.py +share/coccinelle/python/coccilib/coccigui/pygui.glade +share/coccinelle/python/coccilib/coccigui/pygui.gladep +share/coccinelle/python/coccilib/coccigui/vim.py +share/coccinelle/python/coccilib/coccigui/vimcom.py +share/coccinelle/python/coccilib/coccigui/vimeditor.py +share/coccinelle/python/coccilib/coccigui/vimembed.py +share/coccinelle/python/coccilib/elems.py +share/coccinelle/python/coccilib/org.py +share/coccinelle/python/coccilib/output.py +share/coccinelle/python/coccilib/report.py +share/coccinelle/python/coccilib/trac.py +share/coccinelle/spatch +share/coccinelle/standard.h +share/coccinelle/standard.iso +@dirrm share/coccinelle/python/coccilib/coccigui +@dirrm share/coccinelle/python/coccilib +@dirrm share/coccinelle/python +@dirrm share/coccinelle/parsing_c +@dirrm share/coccinelle/ocaml +@dirrm share/coccinelle/commons +@dirrm share/coccinelle