mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
cloc: add basic install check
This commit is contained in:
parent
06b2bae611
commit
f297ac8a4d
@ -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 <<EOF
|
||||
{a, b}: {
|
||||
test = a
|
||||
+ b;
|
||||
}
|
||||
EOF
|
||||
|
||||
echo -n 'checking lines in test.nix...'
|
||||
$out/bin/cloc --quiet --csv test.nix | grep '1,Nix,0,0,4' > /dev/null
|
||||
echo ' ok'
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A program that counts lines of source code";
|
||||
homepage = "https://github.com/AlDanial/cloc";
|
||||
|
Loading…
Reference in New Issue
Block a user