2009-02-17 10:11:33 +00:00
|
|
|
{ fetchurl, stdenv, perl }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "sloccount-2.26";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-01-05 19:42:46 +00:00
|
|
|
url = "https://www.dwheeler.com/sloccount/${name}.tar.gz";
|
2009-02-17 10:11:33 +00:00
|
|
|
sha256 = "0ayiwfjdh1946asah861ah9269s5xkc8p5fv1wnxs9znyaxs4zzs";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
2010-06-01 11:13:25 +01:00
|
|
|
# Make sure the Flex-generated files are newer than the `.l' files, so that
|
|
|
|
# Flex isn't needed to recompile them.
|
2009-02-17 10:11:33 +00:00
|
|
|
patchPhase = ''
|
|
|
|
for file in *
|
|
|
|
do
|
2010-06-01 11:13:25 +01:00
|
|
|
if grep -q /usr/bin/perl "$file"
|
|
|
|
then
|
|
|
|
echo "patching \`$file'..."
|
|
|
|
substituteInPlace "$file" --replace \
|
|
|
|
"/usr/bin/perl" "${perl}/bin/perl"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for file in *.l
|
|
|
|
do
|
|
|
|
touch "$(echo $file | sed -es'/\.l$/.c/g')"
|
2009-02-17 10:11:33 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2014-12-03 21:11:56 +00:00
|
|
|
makeFlags = "PREFIX=$(out) CC=cc";
|
2009-02-17 10:11:33 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''HOME="$TMPDIR" PATH="$PWD:$PATH" make test'';
|
|
|
|
|
|
|
|
preInstall = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p "$out/bin"
|
|
|
|
mkdir -p "$out/share/man/man1"
|
|
|
|
mkdir -p "$out/share/doc"
|
2009-02-17 10:11:33 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "Set of tools for counting physical Source Lines of Code (SLOC)";
|
2009-02-17 10:11:33 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2009-02-17 10:11:33 +00:00
|
|
|
|
2018-01-05 19:42:46 +00:00
|
|
|
homepage = https://www.dwheeler.com/sloccount/;
|
2010-06-01 11:13:25 +01:00
|
|
|
|
2013-08-16 22:44:33 +01:00
|
|
|
maintainers = [ ];
|
2010-06-01 11:13:25 +01:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2009-02-17 10:11:33 +00:00
|
|
|
};
|
|
|
|
}
|