forked from mirrors/nixpkgs
Switch to fetchgit
This commit is contained in:
parent
d6c4e3e8fb
commit
4f7c9186f0
3 changed files with 56 additions and 39 deletions
|
@ -1,27 +1,33 @@
|
||||||
require "yaml"
|
require "yaml"
|
||||||
|
require "json"
|
||||||
|
|
||||||
|
class PrefetchJSON
|
||||||
|
JSON.mapping(sha256: String)
|
||||||
|
end
|
||||||
|
|
||||||
File.open "shards.nix", "w+" do |file|
|
File.open "shards.nix", "w+" do |file|
|
||||||
file.puts "{"
|
file.puts %({)
|
||||||
yaml = YAML.parse(File.read("shard.lock"))
|
yaml = YAML.parse(File.read("shard.lock"))
|
||||||
yaml["shards"].each do |key, value|
|
yaml["shards"].each do |key, value|
|
||||||
file.puts " #{key} = {"
|
url = "https://github.com/#{value["github"]}"
|
||||||
file.puts %( url = "https://github.com/#{value["github"]}";)
|
rev = if value["version"]?
|
||||||
if value["commit"]?
|
"v#{value["version"]}"
|
||||||
file.puts %( rev = "#{value["commit"]}";)
|
else
|
||||||
else
|
value["commit"].as_s
|
||||||
url = "https://github.com/#{value["github"]}"
|
end
|
||||||
ref = "v#{value["version"]}"
|
|
||||||
|
|
||||||
puts "git ls-remote #{url} #{ref}"
|
sha256 = ""
|
||||||
Process.run("git", args: ["ls-remote", url, ref]) do |x|
|
args = ["--url", url, "--rev", rev]
|
||||||
x.error.each_line { |e| puts e }
|
Process.run("nix-prefetch-git", args: args) do |x|
|
||||||
x.output.each_line { |o| value.as_h["commit"] = o.split("\t")[0] }
|
x.error.each_line { |e| puts e }
|
||||||
end
|
sha256 = PrefetchJSON.from_json(x.output).sha256
|
||||||
|
|
||||||
file.puts %( rev = "#{value["commit"]};)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
file.puts " };"
|
file.puts %( #{key} = {)
|
||||||
|
file.puts %( url = "#{url}";)
|
||||||
|
file.puts %( rev = "#{rev}";)
|
||||||
|
file.puts %( sha256 = "#{sha256}";)
|
||||||
|
file.puts %( };)
|
||||||
end
|
end
|
||||||
file.puts "}"
|
file.puts %(})
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{stdenv, lib, remarshal, runCommand, crystal, zlib, openssl, duktape}:
|
{stdenv, lib, fetchgit, crystal, zlib, openssl, duktape}:
|
||||||
let
|
let
|
||||||
crystalPackages = lib.mapAttrs (name: src:
|
crystalPackages = lib.mapAttrs (name: src:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = lib.replaceStrings ["/"] ["-"] name;
|
name = lib.replaceStrings ["/"] ["-"] name;
|
||||||
src = fetchGit src;
|
src = fetchgit src;
|
||||||
phases = "installPhase";
|
phases = "installPhase";
|
||||||
installPhase = ''cp -r $src $out'';
|
installPhase = ''cp -r $src $out'';
|
||||||
passthru = { libName = name; };
|
passthru = { libName = name; };
|
||||||
|
@ -30,9 +30,10 @@ in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "2018-05-27";
|
version = "2018-05-27";
|
||||||
name = "mint-${version}";
|
name = "mint-${version}";
|
||||||
src = fetchGit {
|
src = fetchgit {
|
||||||
url = "https://github.com/mint-lang/mint.git";
|
url = "https://github.com/mint-lang/mint.git";
|
||||||
rev = "a3f0c86f54b8b3a18dda5c39c2089bdb1d774b4f";
|
rev = "a3f0c86f54b8b3a18dda5c39c2089bdb1d774b4f";
|
||||||
|
sha256 = "1bgs6jkwfc2ksq4gj55cl3h2l5g25f5bwlsjryiw9cbx5k4bp1kz";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ crystal zlib openssl duktape ];
|
buildInputs = [ crystal zlib openssl duktape ];
|
||||||
|
|
|
@ -1,42 +1,52 @@
|
||||||
{
|
{
|
||||||
admiral = {
|
admiral = {
|
||||||
url = "jwaldrip/admiral.cr";
|
url = "https://github.com/jwaldrip/admiral.cr";
|
||||||
rev = "07dde44b2d499c0a941b8da6270e1eac0baadcc2";
|
rev = "v1.6.1";
|
||||||
|
sha256 = "0y30b9b9rkz43afd3b9l24hs0r170qyc07r05kvydbv89376c53i";
|
||||||
};
|
};
|
||||||
ameba = {
|
ameba = {
|
||||||
url = "veelenga/ameba";
|
url = "https://github.com/veelenga/ameba";
|
||||||
rev = "7a4fcec5ce62ff92197014f67143c8112866cf8a";
|
rev = "v0.6.0";
|
||||||
|
sha256 = "16jfyrkfc909h16si513lw944qp3dyapymczcqc2ic0jaal0af5b";
|
||||||
};
|
};
|
||||||
baked_file_system = {
|
baked_file_system = {
|
||||||
url = "schovi/baked_file_system";
|
url = "https://github.com/schovi/baked_file_system";
|
||||||
rev = "22956aa79e889c241884017461e9dc79443d84d9";
|
rev = "v0.9.6";
|
||||||
|
sha256 = "06cpriaizp5pcqwdq3jl2lm4sz9b2gcxg3a9q3lh0fqk2acajzmx";
|
||||||
};
|
};
|
||||||
duktape = {
|
duktape = {
|
||||||
url = "jessedoyle/duktape.cr";
|
url = "https://github.com/jessedoyle/duktape.cr";
|
||||||
rev = "0e59b56835da23068fe5bd5fbddb935cf0123b67";
|
rev = "v0.13.0";
|
||||||
|
sha256 = "0v0nckprgr7idmsx97g98as1a7z4hmlmwl924dbbaqvyslv5ls6w";
|
||||||
};
|
};
|
||||||
kemal = {
|
kemal = {
|
||||||
url = "kemalcr/kemal";
|
url = "https://github.com/kemalcr/kemal";
|
||||||
rev = "17bd3dce3724b092fd1151cad126f5973da00204";
|
rev = "v0.22.0";
|
||||||
|
sha256 = "0gq3c27grgh90fykbj9fdsz507lwd41gk686qfnig6npndqv1v10";
|
||||||
};
|
};
|
||||||
kilt = {
|
kilt = {
|
||||||
url = "jeromegn/kilt";
|
url = "https://github.com/jeromegn/kilt";
|
||||||
rev = "d177f02e124a197d22c4cc6d8dee7e1b33821bb1";
|
rev = "v0.4.0";
|
||||||
|
sha256 = "1w9ib6j4xhwxdxx58nzc06gw7ci7vga03vgj1z1bnklamb0b0l0k";
|
||||||
};
|
};
|
||||||
radix = {
|
radix = {
|
||||||
url = "luislavena/radix";
|
url = "https://github.com/luislavena/radix";
|
||||||
rev = "4acb5cfbc304751d94201cdbca72947214af6ee1";
|
rev = "v0.3.8";
|
||||||
|
sha256 = "1kn2xxj8a8j6f6g1dr0s9mkrj1xqnpzw9wnbq24mbv8ach9a1hva";
|
||||||
};
|
};
|
||||||
string_inflection = {
|
string_inflection = {
|
||||||
url = "mosop/string_inflection";
|
url = "https://github.com/mosop/string_inflection";
|
||||||
rev = "fe46a7269ff8183d4d24728fb24cfa576e89829e";
|
rev = "v0.2.1";
|
||||||
|
sha256 = "10vkr28h7n53ijjv57ldxhh473086qg313lzs55a7wsh0zgc104m";
|
||||||
};
|
};
|
||||||
time_format = {
|
time_format = {
|
||||||
url = "vladfaust/time_format.cr";
|
url = "https://github.com/vladfaust/time_format.cr";
|
||||||
rev = "30676d3712cb9a0a667c763c69912d801368f90d";
|
rev = "v0.1.0";
|
||||||
|
sha256 = "1f3rssdlcw2a5f74qa8bzlf1rh5dzvyg1d32w9qlisf2cc4lkh9g";
|
||||||
};
|
};
|
||||||
tree_template = {
|
tree_template = {
|
||||||
url = "anykeyh/tree_template";
|
url = "https://github.com/anykeyh/tree_template";
|
||||||
rev = "3fcb71ee6852040077dd1a2c8c55c67f4a95ba4e";
|
rev = "3fcb71ee6852040077dd1a2c8c55c67f4a95ba4e";
|
||||||
|
sha256 = "04w89wpnkna4ipyy3pxshqqwgk965hz1d31vqp0mrb0ilmpsywdk";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue