cloc: add basic install check
This commit is contained in:
parent
06b2bae611
commit
f297ac8a4d
|
@ -1,8 +1,9 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages }:
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let version = "1.98";
|
||||||
|
in stdenv.mkDerivation {
|
||||||
pname = "cloc";
|
pname = "cloc";
|
||||||
version = "1.98";
|
inherit version;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "AlDanial";
|
owner = "AlDanial";
|
||||||
|
@ -27,6 +28,28 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
postFixup = "wrapProgram $out/bin/cloc --prefix PERL5LIB : $PERL5LIB";
|
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 = {
|
meta = {
|
||||||
description = "A program that counts lines of source code";
|
description = "A program that counts lines of source code";
|
||||||
homepage = "https://github.com/AlDanial/cloc";
|
homepage = "https://github.com/AlDanial/cloc";
|
||||||
|
|
Loading…
Reference in a new issue