summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorreed <reed>2007-05-21 20:46:43 +0000
committerreed <reed>2007-05-21 20:46:43 +0000
commitb470f86844553fa225f40474aaf39aa839e44f44 (patch)
treef1b71aaee0b6d93bb23afbd78aff3427f6abed2c
parent74f1227447e04c01145c98c71a57c989c2235da8 (diff)
downloadpkgsrc-b470f86844553fa225f40474aaf39aa839e44f44.tar.gz
Import sparse.
Sparse, the semantic parser, provides a compiler frontend capable of parsing most of ANSI C as well as many GCC extensions, and a collection of sample compiler backends, including a static analyzer also called "sparse". Sparse provides a set of annotations designed to convey semantic information about types, such as what address space pointers point to, or what locks a function acquires or releases. Linus Torvalds started writing Sparse in 2003, initially targeting issues such as mixing pointers to user address space and pointers to kernel address space.
-rw-r--r--devel/sparse/DESCR11
-rw-r--r--devel/sparse/Makefile22
-rw-r--r--devel/sparse/PLIST26
-rw-r--r--devel/sparse/distinfo6
-rw-r--r--devel/sparse/patches/patch-aa35
5 files changed, 100 insertions, 0 deletions
diff --git a/devel/sparse/DESCR b/devel/sparse/DESCR
new file mode 100644
index 00000000000..8db09c7108d
--- /dev/null
+++ b/devel/sparse/DESCR
@@ -0,0 +1,11 @@
+Sparse, the semantic parser, provides a compiler frontend capable
+of parsing most of ANSI C as well as many GCC extensions, and a
+collection of sample compiler backends, including a static analyzer
+also called "sparse". Sparse provides a set of annotations designed
+to convey semantic information about types, such as what address
+space pointers point to, or what locks a function acquires or
+releases.
+
+Linus Torvalds started writing Sparse in 2003, initially targeting
+issues such as mixing pointers to user address space and pointers
+to kernel address space.
diff --git a/devel/sparse/Makefile b/devel/sparse/Makefile
new file mode 100644
index 00000000000..de14dab4629
--- /dev/null
+++ b/devel/sparse/Makefile
@@ -0,0 +1,22 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $
+#
+
+DISTNAME= sparse-0.3
+CATEGORIES= devel lang
+MASTER_SITES= http://kernel.org/pub/software/devel/sparse/dist/
+
+MAINTAINER= reed@reedmedia.net
+HOMEPAGE= http://kernel.org/pub/software/devel/sparse/
+COMMENT= Semantic parser for C
+
+INSTALLATION_DIRS+= share/doc/sparse
+PKGCONFIG_OVERRIDE+= sparse.pc.in
+REPLACE_PERL= cgcc
+USE_TOOLS+= gmake perl:run
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/FAQ ${PREFIX}/share/doc/sparse/
+ ${INSTALL_DATA} ${WRKSRC}/LICENSE ${PREFIX}/share/doc/sparse/
+ ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/sparse/
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/devel/sparse/PLIST b/devel/sparse/PLIST
new file mode 100644
index 00000000000..93ec2949d51
--- /dev/null
+++ b/devel/sparse/PLIST
@@ -0,0 +1,26 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $
+bin/cgcc
+bin/sparse
+include/sparse/allocate.h
+include/sparse/bitmap.h
+include/sparse/compat.h
+include/sparse/dissect.h
+include/sparse/expression.h
+include/sparse/flow.h
+include/sparse/ident-list.h
+include/sparse/lib.h
+include/sparse/linearize.h
+include/sparse/parse.h
+include/sparse/ptrlist.h
+include/sparse/scope.h
+include/sparse/storage.h
+include/sparse/symbol.h
+include/sparse/target.h
+include/sparse/token.h
+lib/libsparse.a
+lib/pkgconfig/sparse.pc
+share/doc/sparse/FAQ
+share/doc/sparse/LICENSE
+share/doc/sparse/README
+@dirrm include/sparse
+@dirrm share/doc/sparse
diff --git a/devel/sparse/distinfo b/devel/sparse/distinfo
new file mode 100644
index 00000000000..13e96b350ab
--- /dev/null
+++ b/devel/sparse/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $
+
+SHA1 (sparse-0.3.tar.gz) = 1d868b29234176abd5f3f5463aad1f11d5268dc2
+RMD160 (sparse-0.3.tar.gz) = 36bb7e5611f56c5b222f33a0853e8315af406704
+Size (sparse-0.3.tar.gz) = 177462 bytes
+SHA1 (patch-aa) = 234aa80cdd04835b9a8b2bfe4e41b0c7a1f07ff2
diff --git a/devel/sparse/patches/patch-aa b/devel/sparse/patches/patch-aa
new file mode 100644
index 00000000000..f99a8400b0a
--- /dev/null
+++ b/devel/sparse/patches/patch-aa
@@ -0,0 +1,35 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/05/21 20:46:43 reed Exp $
+
+--- Makefile.orig 2007-05-21 15:15:45.000000000 -0500
++++ Makefile 2007-05-21 15:17:21.000000000 -0500
+@@ -15,8 +15,8 @@
+ #
+ CFLAGS += -DDEBUG
+
+-DESTDIR=
+-PREFIX=$(HOME)
++DESTDIR?=
++PREFIX?=$(HOME)
+ BINDIR=$(PREFIX)/bin
+ LIBDIR=$(PREFIX)/lib
+ INCLUDEDIR=$(PREFIX)/include
+@@ -48,15 +48,15 @@
+ install -d $(DESTDIR)$(INCLUDEDIR)/sparse
+ install -d $(DESTDIR)$(PKGCONFIGDIR)
+ for f in $(INST_PROGRAMS); do \
+- install -v $$f $(DESTDIR)$(BINDIR)/$$f || exit 1; \
++ install $$f $(DESTDIR)$(BINDIR)/$$f || exit 1; \
+ done
+ for f in $(LIBS); do \
+- install -m 644 -v $$f $(DESTDIR)$(LIBDIR)/$$f || exit 1; \
++ install -m 644 $$f $(DESTDIR)$(LIBDIR)/$$f || exit 1; \
+ done
+ for f in $(LIB_H); do \
+- install -m 644 -v $$f $(DESTDIR)$(INCLUDEDIR)/sparse/$$f || exit 1; \
++ install -m 644 $$f $(DESTDIR)$(INCLUDEDIR)/sparse/$$f || exit 1; \
+ done
+- install -m 644 -v sparse.pc $(DESTDIR)$(PKGCONFIGDIR)/sparse.pc
++ install -m 644 sparse.pc $(DESTDIR)$(PKGCONFIGDIR)/sparse.pc
+
+ sparse.pc: sparse.pc.in
+ sed 's|@version@|$(VERSION)|g;s|@prefix@|$(PREFIX)|g;s|@libdir@|$(LIBDIR)|g;s|@includedir@|$(INCLUDEDIR)|g' sparse.pc.in > sparse.pc