about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/web/lucky-cli/default.nix
blob: 44b4af440800dbd3a1de5c1b0e1fb84694b9c945 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib, fetchFromGitHub, crystal, makeWrapper, openssl }:

crystal.buildCrystalPackage rec {
  pname = "lucky-cli";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "luckyframework";
    repo = "lucky_cli";
    rev = "v${version}";
    hash = "sha256-Ky4DmClSyAVBAetpZM5tFnQZ74fchCOgcxBftd+gwlE=";
  };

  # the integration tests will try to clone a remote repos
  postPatch = ''
    rm -rf spec/integration
  '';

  format = "crystal";

  lockFile = ./shard.lock;
  shardsFile = ./shards.nix;

  crystalBinaries.lucky.src = "src/lucky.cr";

  buildInputs = [ openssl ];

  nativeBuildInputs = [ makeWrapper ];

  postInstall = ''
    wrapProgram $out/bin/lucky \
      --prefix PATH : ${lib.makeBinPath [ crystal ]}
  '';

  meta = with lib; {
    description = "A Crystal library for creating and running tasks. Also generates Lucky projects";
    homepage = "https://luckyframework.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ peterhoeg ];
    mainProgram = "lucky";
    platforms = platforms.unix;
    broken = lib.versionOlder crystal.version "0.35.1";
  };
}