diff --git a/pkgs/tools/misc/cloc/default.nix b/pkgs/tools/misc/cloc/default.nix index f6de1942ba6..a8fc4a4f01b 100644 --- a/pkgs/tools/misc/cloc/default.nix +++ b/pkgs/tools/misc/cloc/default.nix @@ -1,8 +1,9 @@ { lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages }: -stdenv.mkDerivation rec { +let version = "1.98"; +in stdenv.mkDerivation { pname = "cloc"; - version = "1.98"; + inherit version; src = fetchFromGitHub { owner = "AlDanial"; @@ -27,6 +28,28 @@ stdenv.mkDerivation rec { postFixup = "wrapProgram $out/bin/cloc --prefix PERL5LIB : $PERL5LIB"; + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + echo -n 'checking --version...' + $out/bin/cloc --version | grep '${version}' > /dev/null + echo ' ok' + + cat > test.nix < /dev/null + echo ' ok' + + runHook postInstallCheck + ''; + meta = { description = "A program that counts lines of source code"; homepage = "https://github.com/AlDanial/cloc";