1{ lib, fetchFromGitHub, crystal, makeWrapper, openssl }:
2
3crystal.buildCrystalPackage rec {
4 pname = "lucky-cli";
5 version = "1.1.0";
6
7 src = fetchFromGitHub {
8 owner = "luckyframework";
9 repo = "lucky_cli";
10 rev = "v${version}";
11 hash = "sha256-mDUx9cQoYpU9kSAls36kzNVYZ8a4aqHEMIWfzS41NBk=";
12 };
13
14 # the integration tests will try to clone a remote repos
15 postPatch = ''
16 rm -rf spec/integration
17 '';
18
19 format = "crystal";
20
21 lockFile = ./shard.lock;
22 shardsFile = ./shards.nix;
23
24 crystalBinaries.lucky.src = "src/lucky.cr";
25
26 buildInputs = [ openssl ];
27
28 nativeBuildInputs = [ makeWrapper ];
29
30 postInstall = ''
31 wrapProgram $out/bin/lucky \
32 --prefix PATH : ${lib.makeBinPath [ crystal ]}
33 '';
34
35 meta = with lib; {
36 description = "A Crystal library for creating and running tasks. Also generates Lucky projects";
37 homepage = "https://luckyframework.org/";
38 license = licenses.mit;
39 maintainers = with maintainers; [ peterhoeg ];
40 mainProgram = "lucky";
41 platforms = platforms.unix;
42 broken = lib.versionOlder crystal.version "1.6.0";
43 };
44}