From 172abb4b26e0453300fa873c5256f4b171258486 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Fri, 5 Oct 2012 03:24:09 +0200 Subject: [PATCH] Add a "smatch" package. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cyril Roelandt Signed-off-by: Ludovic Courtès --- .../tools/analysis/smatch/default.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++++ 2 files changed, 35 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 00000000000..8b9deca409f --- /dev/null +++ b/pkgs/development/tools/analysis/smatch/default.nix @@ -0,0 +1,30 @@ +{ 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"; + sha256 = "09a44967d4cff026c67062f778e251d0b432af132e9d59a47b7d3167f379adfa"; + }; + + 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"; /* OSL, see http://www.opensource.org */ + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bd554b7f1d1..d1b93ce496f 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 { };