2019-10-21 09:35:26 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, crystal, shards }:
|
|
|
|
|
2019-12-10 22:00:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-10-21 09:35:26 +01:00
|
|
|
pname = "ameba";
|
2019-12-10 22:00:56 +00:00
|
|
|
version = "0.11.0";
|
2019-10-21 09:35:26 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "crystal-ameba";
|
|
|
|
repo = "ameba";
|
2019-12-10 22:00:56 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0zjv59f555q2w8ahrvmpdzasrifwjgr0mk6rly9yss4ab3rj8cy2";
|
2019-10-21 09:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ crystal shards ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
shards build --release
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
install -Dm755 -t $out/bin bin/ameba
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
crystal spec
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A static code analysis tool for Crystal";
|
|
|
|
homepage = https://crystal-ameba.github.io;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ kimburgess ];
|
|
|
|
};
|
|
|
|
}
|