···4# version that we define here. If you're having problems downloading / finding
5# a Rust library, try updating this to a newer commit.
67-{ runCommand, fetchFromGitHub, git
8-, src ? fetchFromGitHub {
00009 owner = "rust-lang";
10 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...
2627- mkdir -p $out
2829- cp -r ${src}/* $out/
3031- cd $out
3233- git="${git}/bin/git"
3435- $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'
4041- touch $out/touch . "$out/.cargo-index-lock"
42-''
0
···4# version that we define here. If you're having problems downloading / finding
5# a Rust library, try updating this to a newer commit.
67+{ stdenv, fetchFromGitHub, git }:
8+9+stdenv.mkDerivation {
10+ name = "rustRegistry-2017-06-25";
11+12+ src = fetchFromGitHub {
13 owner = "rust-lang";
14 repo = "crates.io-index";
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...
02930+ mkdir -p $out
3132+ cp -r ./* $out/
3334+ cd $out
3536+ git="${git}/bin/git"
3738+ $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'
4344+ touch $out/touch . "$out/.cargo-index-lock"
45+ '';
46+}