1 { lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages }:
4 in stdenv.mkDerivation {
8 src = fetchFromGitHub {
12 sha256 = "sha256-qTrBCCC2J8Ewt6GvYlnXU8F1iB31A1xTFXdkee8L0Os=";
16 sourceRoot=$(echo */Unix)
19 nativeBuildInputs = [ makeWrapper ];
20 buildInputs = with perlPackages; [
27 makeFlags = [ "prefix=" "DESTDIR=$(out)" "INSTALL=install" ];
29 postFixup = "wrapProgram $out/bin/cloc --prefix PERL5LIB : $PERL5LIB";
31 doInstallCheck = true;
32 installCheckPhase = ''
33 runHook preInstallCheck
35 echo -n 'checking --version...'
36 $out/bin/cloc --version | grep '${version}' > /dev/null
46 echo -n 'checking lines in test.nix...'
47 $out/bin/cloc --quiet --csv test.nix | grep '1,Nix,0,0,4' > /dev/null
50 runHook postInstallCheck
54 description = "Program that counts lines of source code";
55 homepage = "https://github.com/AlDanial/cloc";
56 license = lib.licenses.gpl2Plus;
57 platforms = lib.platforms.all;
58 maintainers = with lib.maintainers; [ rycee ];