1{ lib, fetchFromGitHub, crystal, coreutils, makeWrapper, bash }:
2
3crystal.buildCrystalPackage rec {
4 pname = "scry";
5 version = "0.9.1";
6
7 src = fetchFromGitHub {
8 owner = "crystal-lang-tools";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-hqyG1aKY3M8q8lZEKzpUUKl9jS7NF+VMsma6+C0sCbg=";
12 };
13
14 # a bunch of tests fail when built in the sandbox while perfectly fine outside
15 postPatch = ''
16 rm spec/scry/{client,completion_provider,context,executable}_spec.cr
17 '';
18
19 format = "shards";
20
21 nativeBuildInputs = [ makeWrapper ];
22 buildInputs = [ bash ];
23
24 shardsFile = ./shards.nix;
25
26 postFixup = ''
27 wrapProgram $out/bin/scry \
28 --prefix PATH : ${lib.makeBinPath [ crystal coreutils ]}
29 '';
30
31 # the binary doesn't take any arguments, so this will hang
32 doInstallCheck = false;
33
34 meta = with lib; {
35 description = "Code analysis server for the Crystal programming language";
36 homepage = "https://github.com/crystal-lang-tools/scry";
37 license = licenses.mit;
38 maintainers = with maintainers; [ peterhoeg Br1ght0ne ];
39 };
40}