From 085da94aceb11bb819c39775359ff4a1f9d1eb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Heredia=20Montiel?= Date: Mon, 16 Nov 2020 18:14:12 -0600 Subject: [PATCH] shards: refactor and 0.11.0 -> {0.11.1, 0.12.0} --- .../tools/build-managers/shards/default.nix | 74 +++++++++++++------ pkgs/top-level/all-packages.nix | 5 +- 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/pkgs/development/tools/build-managers/shards/default.nix b/pkgs/development/tools/build-managers/shards/default.nix index 53bc057fc131..dc990af910fe 100644 --- a/pkgs/development/tools/build-managers/shards/default.nix +++ b/pkgs/development/tools/build-managers/shards/default.nix @@ -1,30 +1,56 @@ -{ stdenv, fetchFromGitHub, crystal }: +{ stdenv +, fetchFromGitHub +, crystal_0_34 +, crystal_0_35 +}: -crystal.buildCrystalPackage rec { - pname = "shards"; - version = "0.10.0"; +let + generic = ( + { version + , sha256 + , crystal + }: - src = fetchFromGitHub { - owner = "crystal-lang"; - repo = "shards"; - rev = "v${version}"; - sha256 = "1bjy3hcdqq8769bx73f3pwn26rnkj23dngyfbw4iv32bw23x1d49"; + crystal.buildCrystalPackage { + pname = "shards"; + inherit version; + + src = fetchFromGitHub { + owner = "crystal-lang"; + repo = "shards"; + rev = "v${version}"; + inherit sha256; + }; + + # we cannot use `make` here as it would introduce a dependency on itself + format = "crystal"; + shardsFile = ./shards.nix; + crystalBinaries.shards.src = "./src/shards.cr"; + + # tries to execute git which fails spectacularly + doCheck = false; + + meta = with stdenv.lib; { + description = "Dependency manager for the Crystal language"; + license = licenses.asl20; + maintainers = with maintainers; [ peterhoeg ]; + inherit (crystal.meta) homepage platforms; + }; + } + ); + +in rec { + shards_0_11 = generic { + version = "0.11.1"; + sha256 = "05qnhc23xbmicdl4fwyxfpcvd8jq4inzh6v7jsjjw4n76vzb1f71"; + crystal = crystal_0_34; }; - # we cannot use `make` here as it would introduce a dependency on itself - format = "crystal"; - - shardsFile = ./shards.nix; - - crystalBinaries.shards.src = "./src/shards.cr"; - - # tries to execute git which fails spectacularly - doCheck = false; - - meta = with stdenv.lib; { - description = "Dependency manager for the Crystal language"; - license = licenses.asl20; - maintainers = with maintainers; [ peterhoeg ]; - inherit (crystal.meta) homepage platforms; + shards_0_12 = generic { + version = "0.12.0"; + sha256 = "0dginczw1gc5qlb9k4b6ldxzqz8n97jrrnjvj3mm9wcdbc9j6h3c"; + crystal = crystal_0_35; }; + + shards = shards_0_12; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e216a76cc6ce..5c8a88d4ba9f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11825,7 +11825,10 @@ julia_15 = callPackage ../development/compilers/julia/1.5.nix { shallot = callPackage ../tools/misc/shallot { }; - shards = callPackage ../development/tools/build-managers/shards { }; + inherit (callPackage ../development/tools/build-managers/shards { }) + shards_0_11 + shards_0_12 + shards; shellcheck = callPackage ../development/tools/shellcheck {};