[Nix-dev] [PATCH] Add a "smatch" package.

Cyril Roelandt tipecaml at gmail.com
Fri Oct 5 03:24:09 CEST 2012


Signed-off-by: Cyril Roelandt <tipecaml at gmail.com>
---
 pkgs/development/tools/analysis/smatch/default.nix |   29 ++++++++++++++++++++
 pkgs/top-level/all-packages.nix                    |    5 ++++
 2 files changed, 34 insertions(+)
 create mode 100644 pkgs/development/tools/analysis/smatch/default.nix

diff --git a/pkgs/development/tools/analysis/smatch/default.nix b/pkgs/development/tools/analysis/smatch/default.nix
new file mode 100644
index 0000000..9312b05
--- /dev/null
+++ b/pkgs/development/tools/analysis/smatch/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchgit, sqlite, pkgconfig
+, buildllvmsparse ? true
+, buildc2xml ? true
+, llvm ? null, libxml2 ? null
+}:
+
+assert buildllvmsparse -> llvm != null;
+assert buildc2xml -> libxml2 != null;
+
+stdenv.mkDerivation {
+  name = "smatch";
+
+  src = fetchgit {
+    url = git://repo.or.cz/smatch.git;
+    rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
+  };
+
+  buildInputs = [sqlite pkgconfig]
+   ++ stdenv.lib.optional buildllvmsparse llvm
+   ++ stdenv.lib.optional buildc2xml libxml2;
+
+  installFlags = "DESTDIR=$(out)";
+
+  meta = {
+    description = "A semantic analysis tool for C";
+    homepage = "http://smatch.sourceforge.net/";
+    license = "free"; /* http://www.opensource.org */
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2e8a80a..da3f5bd 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3200,6 +3200,11 @@ let
 
   sloccount = callPackage ../development/tools/misc/sloccount { };
 
+  smatch = callPackage ../development/tools/analysis/smatch {
+    buildllvmsparse = false;
+    buildc2xml = false;
+  };
+
   sparse = callPackage ../development/tools/analysis/sparse { };
 
   spin = callPackage ../development/tools/analysis/spin { };
-- 
1.7.10.4



More information about the nix-dev mailing list