summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2014-10-01 09:41:02 +0000
committerwiz <wiz@pkgsrc.org>2014-10-01 09:41:02 +0000
commit2df1fbf57ad59c9e8320e2d8c2e0ebc168afa11c (patch)
tree6a0089ba8045feac71701c2ad1e239c1bb8999fe /lang
parent6342399532d623a1b76a655bfa56a06bf912bafb (diff)
downloadpkgsrc-2df1fbf57ad59c9e8320e2d8c2e0ebc168afa11c.tar.gz
Add option for installing the static analyzer.
Default off since it depends on perl AND python.
Diffstat (limited to 'lang')
-rw-r--r--lang/clang/Makefile4
-rw-r--r--lang/clang/PLIST.static-analyzer15
-rw-r--r--lang/clang/distinfo3
-rw-r--r--lang/clang/options.mk40
-rw-r--r--lang/clang/patches/patch-tools_clang_tools_scan-build_scan-build44
5 files changed, 104 insertions, 2 deletions
diff --git a/lang/clang/Makefile b/lang/clang/Makefile
index 65ce480475f..dc79675cdd5 100644
--- a/lang/clang/Makefile
+++ b/lang/clang/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2014/09/06 07:37:14 adam Exp $
+# $NetBSD: Makefile,v 1.31 2014/10/01 09:41:02 wiz Exp $
DISTNAME= clang-3.5.0
CATEGORIES= lang
@@ -84,6 +84,8 @@ SUBST_SED.fix-paths+= -e 's,^.*cxa_finalize.*$$, ; //cxa_finalize.o,g'
. endif
.endif
+.include "options.mk"
+
post-extract:
mv ${WRKDIR}/libcxx-${PKGVERSION_NOREV}.src ${WRKSRC}/projects/libcxx
mv ${WRKDIR}/compiler-rt-${PKGVERSION_NOREV}.src ${WRKSRC}/projects/compiler-rt
diff --git a/lang/clang/PLIST.static-analyzer b/lang/clang/PLIST.static-analyzer
new file mode 100644
index 00000000000..7ee70194bb6
--- /dev/null
+++ b/lang/clang/PLIST.static-analyzer
@@ -0,0 +1,15 @@
+@comment $NetBSD: PLIST.static-analyzer,v 1.1 2014/10/01 09:41:02 wiz Exp $
+bin/scan-build
+bin/scan-view
+libexec/c++-analyzer
+libexec/ccc-analyzer
+man/man1/scan-build.1
+share/llvm/static-analyzer/Reporter.py
+share/llvm/static-analyzer/Resources/FileRadar.scpt
+share/llvm/static-analyzer/Resources/GetRadarVersion.scpt
+share/llvm/static-analyzer/Resources/bugcatcher.ico
+share/llvm/static-analyzer/ScanView.py
+share/llvm/static-analyzer/scan-view
+share/llvm/static-analyzer/scanview.css
+share/llvm/static-analyzer/sorttable.js
+share/llvm/static-analyzer/startfile.py
diff --git a/lang/clang/distinfo b/lang/clang/distinfo
index 5e70b14f47d..517f3faf82d 100644
--- a/lang/clang/distinfo
+++ b/lang/clang/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.26 2014/09/06 07:37:14 adam Exp $
+$NetBSD: distinfo,v 1.27 2014/10/01 09:41:02 wiz Exp $
SHA1 (cfe-3.5.0.src.tar.xz) = 834cee2ed8dc6638a486d8d886b6dce3db675ffa
RMD160 (cfe-3.5.0.src.tar.xz) = 695592b5ef12ed602a4dd78f2dc2681058ca8253
@@ -16,3 +16,4 @@ SHA1 (patch-ab) = 8dd0da6d47a57ac25eea358996cf874dd3289e08
SHA1 (patch-ac) = 0f0cc98d443ec957fc5374fb491809d27e4f9d4e
SHA1 (patch-ad) = ad1f6720e4c73e57fce10ba968b03637a133602d
SHA1 (patch-include_llvm_Support_Host.h) = 545f9542cd2aaa6cea58d3653902b4e1a9e7189a
+SHA1 (patch-tools_clang_tools_scan-build_scan-build) = a671f1e513fb43ddc0e73751a78235ab39aeaf9d
diff --git a/lang/clang/options.mk b/lang/clang/options.mk
new file mode 100644
index 00000000000..f864a3d54bb
--- /dev/null
+++ b/lang/clang/options.mk
@@ -0,0 +1,40 @@
+# $NetBSD: options.mk,v 1.1 2014/10/01 09:41:02 wiz Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.clang
+PKG_SUPPORTED_OPTIONS= clang-static-analyzer
+PKG_SUGGESTED_OPTIONS= # clang-static-analyzer disabled since it needs python and perl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mclang-static-analyzer)
+PLIST_SRC+= PLIST PLIST.static-analyzer
+
+INSTALLATION_DIRS+= bin
+INSTALLATION_DIRS+= libexec
+INSTALLATION_DIRS+= ${PKGMANDIR}/man1
+INSTALLATION_DIRS+= share/llvm/static-analyzer
+INSTALLATION_DIRS+= share/llvm/static-analyzer/Resources
+
+USE_TOOLS+= perl:run
+REPLACE_PERL+= tools/clang/tools/scan-build/c++-analyzer
+REPLACE_PERL+= tools/clang/tools/scan-build/ccc-analyzer
+REPLACE_PERL+= tools/clang/tools/scan-build/scan-build
+
+REPLACE_PYTHON+= tools/clang/tools/scan-view/scan-view
+PYTHON_VERSIONS_INCOMPATIBLE= 33 34 # not yet ported as of 3.5
+.include "../../lang/python/application.mk"
+
+post-build:
+ ${ECHO} '#!/bin/sh' > ${WRKSRC}/scan-view
+ ${ECHO} "${PREFIX}/share/llvm/static-analyzer/scan-view "'"$$@"' >> ${WRKSRC}/scan-view
+post-install:
+ cd ${WRKSRC}/tools/clang/tools/scan-build && \
+ ${INSTALL_SCRIPT} scan-build ${DESTDIR}${PREFIX}/bin; \
+ ${INSTALL_SCRIPT} c++-analyzer ccc-analyzer ${DESTDIR}${PREFIX}/libexec; \
+ ${INSTALL_DATA} scan-build.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \
+ ${INSTALL_DATA} scanview.css sorttable.js ${DESTDIR}${PREFIX}/share/llvm/static-analyzer
+ cd ${WRKSRC}/tools/clang/tools/scan-view && \
+ ${INSTALL_DATA} Resources/* ${DESTDIR}${PREFIX}/share/llvm/static-analyzer/Resources; \
+ ${INSTALL_SCRIPT} scan-view *.py ${DESTDIR}${PREFIX}/share/llvm/static-analyzer
+ ${INSTALL_SCRIPT} ${WRKSRC}/scan-view ${DESTDIR}${PREFIX}/bin
+.endif
diff --git a/lang/clang/patches/patch-tools_clang_tools_scan-build_scan-build b/lang/clang/patches/patch-tools_clang_tools_scan-build_scan-build
new file mode 100644
index 00000000000..2f0a8f03776
--- /dev/null
+++ b/lang/clang/patches/patch-tools_clang_tools_scan-build_scan-build
@@ -0,0 +1,44 @@
+$NetBSD: patch-tools_clang_tools_scan-build_scan-build,v 1.1 2014/10/01 09:41:02 wiz Exp $
+
+Adapt paths for pkgsrc installation.
+
+--- tools/clang/tools/scan-build/scan-build.orig 2014-07-17 08:40:35.000000000 +0000
++++ tools/clang/tools/scan-build/scan-build
+@@ -437,7 +437,7 @@ sub CopyFiles {
+
+ my $Dir = shift;
+
+- my $JS = Cwd::realpath("$RealBin/sorttable.js");
++ my $JS = Cwd::realpath("$RealBin/../share/llvm/static-analyzer/sorttable.js");
+
+ DieDiag("Cannot find 'sorttable.js'.\n")
+ if (! -r $JS);
+@@ -447,7 +447,7 @@ sub CopyFiles {
+ DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
+ if (! -r "$Dir/sorttable.js");
+
+- my $CSS = Cwd::realpath("$RealBin/scanview.css");
++ my $CSS = Cwd::realpath("$RealBin/../share/llvm/static-analyzer/scanview.css");
+
+ DieDiag("Cannot find 'scanview.css'.\n")
+ if (! -r $CSS);
+@@ -1657,8 +1657,8 @@ $HtmlDir = GetHTMLRunDir($HtmlDir);
+
+ # Determine the location of ccc-analyzer.
+ my $AbsRealBin = Cwd::realpath($RealBin);
+-my $Cmd = "$AbsRealBin/libexec/ccc-analyzer";
+-my $CmdCXX = "$AbsRealBin/libexec/c++-analyzer";
++my $Cmd = "$AbsRealBin/../libexec/ccc-analyzer";
++my $CmdCXX = "$AbsRealBin/../libexec/c++-analyzer";
+
+ # Portability: use less strict but portable check -e (file exists) instead of
+ # non-portable -x (file is executable). On some windows ports -x just checks
+@@ -1726,7 +1726,7 @@ if (defined $OutputFormat) {
+ if ($ViewResults and -r "$HtmlDir/index.html") {
+ Diag "Analysis run complete.\n";
+ Diag "Viewing analysis results in '$HtmlDir' using scan-view.\n";
+- my $ScanView = Cwd::realpath("$RealBin/scan-view");
++ my $ScanView = Cwd::realpath("$RealBin/../share/llvm/static-analyzer/scan-view");
+ if (! -x $ScanView) { $ScanView = "scan-view"; }
+ exec $ScanView, "$HtmlDir";
+ }