2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-11-17 00:14:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, crystal_0_34
|
2021-02-11 04:47:25 +00:00
|
|
|
, crystal_0_36
|
2020-11-17 00:14:12 +00:00
|
|
|
}:
|
|
|
|
let
|
2020-12-22 04:08:01 +00:00
|
|
|
generic =
|
|
|
|
{ version, sha256, crystal }:
|
2016-12-21 08:23:01 +00:00
|
|
|
|
2020-11-17 00:14:12 +00:00
|
|
|
crystal.buildCrystalPackage {
|
|
|
|
pname = "shards";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "crystal-lang";
|
2020-12-22 04:08:01 +00:00
|
|
|
repo = "shards";
|
|
|
|
rev = "v${version}";
|
2020-11-17 00:14:12 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
2016-12-21 08:23:01 +00:00
|
|
|
|
2020-12-22 04:08:01 +00:00
|
|
|
# we cannot use `make` or `shards` here as it would introduce a cyclical dependency
|
2020-11-17 00:14:12 +00:00
|
|
|
format = "crystal";
|
|
|
|
shardsFile = ./shards.nix;
|
|
|
|
crystalBinaries.shards.src = "./src/shards.cr";
|
2020-04-19 08:52:58 +01:00
|
|
|
|
2020-11-17 00:14:12 +00:00
|
|
|
# tries to execute git which fails spectacularly
|
|
|
|
doCheck = false;
|
2020-04-19 08:52:58 +01:00
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2020-11-17 00:14:12 +00:00
|
|
|
description = "Dependency manager for the Crystal language";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
|
|
inherit (crystal.meta) homepage platforms;
|
|
|
|
};
|
2020-12-22 04:08:01 +00:00
|
|
|
};
|
2016-12-21 08:23:01 +00:00
|
|
|
|
2020-12-22 04:08:01 +00:00
|
|
|
in
|
|
|
|
rec {
|
2021-02-11 04:47:25 +00:00
|
|
|
# needed for anything that requires the old v1 shards format
|
2020-11-17 00:14:12 +00:00
|
|
|
shards_0_11 = generic {
|
|
|
|
version = "0.11.1";
|
|
|
|
sha256 = "05qnhc23xbmicdl4fwyxfpcvd8jq4inzh6v7jsjjw4n76vzb1f71";
|
|
|
|
crystal = crystal_0_34;
|
|
|
|
};
|
2020-04-19 08:52:58 +01:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
shards_0_14 = generic {
|
2021-03-19 12:08:12 +00:00
|
|
|
version = "0.14.1";
|
|
|
|
sha256 = "sha256-/C6whh5RbTBkFWqpn0GqyVe0opbrklm8xPv5MIG99VU=";
|
2021-02-11 04:47:25 +00:00
|
|
|
crystal = crystal_0_36;
|
2016-12-21 08:23:01 +00:00
|
|
|
};
|
2020-11-17 00:14:12 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
shards = shards_0_14;
|
2016-12-21 08:23:01 +00:00
|
|
|
}
|