@@ -4,39 +4,43 @@
44# version that we define here. If you're having problems downloading / finding
55# a Rust library, try updating this to a newer commit.
66
7−{ runCommand, fetchFromGitHub, git
8−, src ? fetchFromGitHub {
7+{ stdenv, fetchFromGitHub, git }:
8+
9+stdenv.mkDerivation {
10+ name = "rustRegistry-2017-06-25";
11+
12+ src = fetchFromGitHub {
913 owner = "rust-lang";
1014 repo = "crates.io-index";
11− rev = "cda0f689f844710a3d73c7ff459efa64997f73b5";
12− sha256 = "1b3brl9nn3qqaysd8lx9gaazd863grqx547iw7y9j6mkcc7sakvc";
13− }
14−}:
15−
16−runCommand "rustRegistry" { inherit src; } ''
17− # For some reason, cargo doesn't like fetchgit's git repositories, not even
18− # if we set leaveDotGit to true, set the fetchgit branch to 'master' and clone
19− # the repository (tested with registry rev
20− # 965b634156cc5c6f10c7a458392bfd6f27436e7e), failing with the message:
21− #
22− # "Target OID for the reference doesn't exist on the repository"
23− #
24− # So we'll just have to create a new git repository from scratch with the
25− # contents downloaded with fetchgit...
26−
27− mkdir -p $out
28−
29− cp -r ${src}/* $out/
30−
31− cd $out
32−
33− git="${git}/bin/git"
34−
35− $git init
36− $git config --local user.email "example@example.com"
37− $git config --local user.name "example"
38− $git add .
39− $git commit --quiet -m 'Rust registry commit'
40−
41− touch $out/touch . "$out/.cargo-index-lock"
42−''
15+ rev = "9714616bf3b7836cb827d8d1eabef017d730fb5e";
16+ sha256 = "02lpmjsqwa16j14y3jzgw4dpzfy001nfyi78x9b8rgp1w3qdjbkr";
17+ };
18+ phases = [ "unpackPhase" "installPhase" ];
19+ installPhase = ''
20+ # For some reason, cargo doesn't like fetchgit's git repositories, not even
21+ # if we set leaveDotGit to true, set the fetchgit branch to 'master' and clone
22+ # the repository (tested with registry rev
23+ # 965b634156cc5c6f10c7a458392bfd6f27436e7e), failing with the message:
24+ #
25+ # "Target OID for the reference doesn't exist on the repository"
26+ #
27+ # So we'll just have to create a new git repository from scratch with the
28+ # contents downloaded with fetchgit...
29+
30+ mkdir -p $out
31+
32+ cp -r ./* $out/
33+
34+ cd $out
35+
36+ git="${git}/bin/git"
37+
38+ $git init
39+ $git config --local user.email "example@example.com"
40+ $git config --local user.name "example"
41+ $git add .
42+ $git commit --quiet -m 'Rust registry commit'
43+
44+ touch $out/touch . "$out/.cargo-index-lock"
45+ '';
46+}