From f59b3d14dc9eff54330b6e514c629a72f1858caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 17 Feb 2009 10:11:33 +0000 Subject: [PATCH] Add SLOCCount, a tool to count source lines of code (SLOCs). svn path=/nixpkgs/trunk/; revision=14091 --- .../tools/misc/sloccount/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/tools/misc/sloccount/default.nix diff --git a/pkgs/development/tools/misc/sloccount/default.nix b/pkgs/development/tools/misc/sloccount/default.nix new file mode 100644 index 000000000000..b25313f43558 --- /dev/null +++ b/pkgs/development/tools/misc/sloccount/default.nix @@ -0,0 +1,51 @@ +{ fetchurl, stdenv, perl }: + +stdenv.mkDerivation rec { + name = "sloccount-2.26"; + + src = fetchurl { + url = "http://www.dwheeler.com/sloccount/${name}.tar.gz"; + sha256 = "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs"; + }; + + buildInputs = [ perl ]; + + patchPhase = '' + for file in * + do + substituteInPlace "$file" --replace "/usr/bin/perl" "${perl}/bin/perl" + done + ''; + + configurePhase = '' + sed -i "makefile" -"es|PREFIX[[:blank:]]*=.*$|PREFIX = $out|g" + ''; + + doCheck = true; + checkPhase = ''HOME="$TMPDIR" PATH="$PWD:$PATH" make test''; + + preInstall = '' + ensureDir "$out/bin" + ensureDir "$out/share/man/man1" + ensureDir "$out/share/doc" + ''; + + meta = { + description = "SLOCCount, a set of tools for counting physical Source Lines of Code (SLOC)"; + + longDescription = '' + This is the home page of "SLOCCount", a set of tools for + counting physical Source Lines of Code (SLOC) in a large number + of languages of a potentially large set of programs. This suite + of tools was used in my papers More than a Gigabuck: Estimating + GNU/Linux's Size and Estimating Linux's Size to measure the SLOC + of entire GNU/Linux distributions, and my essay Linux Kernel + 2.6: It's Worth More! Others have measured Debian GNU/Linux and + the Perl CPAN library using this tool suite. + ''; + + license = "GPLv2+"; + + homepage = http://www.dwheeler.com/sloccount/; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 637a26461a41..9ece2bbd9557 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2503,6 +2503,10 @@ let stdenv = overrideInStdenv stdenv [gnumake380]; }; + sloccount = import ../development/tools/misc/sloccount { + inherit fetchurl stdenv perl; + }; + sparse = import ../development/tools/analysis/sparse { inherit fetchurl stdenv pkgconfig; };