summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/shards/default.nix
blob: 0f4ea722d96619fbd26287ca3e52379b6e281984 (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
45
46
47
48
49
50
51
52
53
{ lib
, fetchFromGitHub
, crystal_0_34
, crystal_0_36
}:
let
  generic =
    { version, sha256, crystal }:

    crystal.buildCrystalPackage {
      pname = "shards";
      inherit version;

      src = fetchFromGitHub {
        owner = "crystal-lang";
        repo = "shards";
        rev = "v${version}";
        inherit sha256;
      };

      # we cannot use `make` or `shards` here as it would introduce a cyclical dependency
      format = "crystal";
      shardsFile = ./shards.nix;
      crystalBinaries.shards.src = "./src/shards.cr";

      # tries to execute git which fails spectacularly
      doCheck = false;

      meta = with lib; {
        description = "Dependency manager for the Crystal language";
        license = licenses.asl20;
        maintainers = with maintainers; [ peterhoeg ];
        inherit (crystal.meta) homepage platforms;
      };
    };

in
rec {
  # needed for anything that requires the old v1 shards format
  shards_0_11 = generic {
    version = "0.11.1";
    sha256 = "05qnhc23xbmicdl4fwyxfpcvd8jq4inzh6v7jsjjw4n76vzb1f71";
    crystal = crystal_0_34;
  };

  shards_0_14 = generic {
    version = "0.14.0";
    sha256 = "sha256-HEyGXoGkQvLrk672/ekmBxnR1eRM//GwRPd/19LM8Wo=";
    crystal = crystal_0_36;
  };

  shards = shards_0_14;
}