···44# version that we define here. If you're having problems downloading / finding
55# a Rust library, try updating this to a newer commit.
6677-{ runCommand, fetchFromGitHub, git
88-, src ? fetchFromGitHub {
77+{ stdenv, fetchFromGitHub, git }:
88+99+stdenv.mkDerivation {
1010+ name = "rustRegistry-2017-06-25";
1111+1212+ src = fetchFromGitHub {
913 owner = "rust-lang";
1014 repo = "crates.io-index";
1111- rev = "cda0f689f844710a3d73c7ff459efa64997f73b5";
1212- sha256 = "1b3brl9nn3qqaysd8lx9gaazd863grqx547iw7y9j6mkcc7sakvc";
1313- }
1414-}:
1515-1616-runCommand "rustRegistry" { inherit src; } ''
1717- # For some reason, cargo doesn't like fetchgit's git repositories, not even
1818- # if we set leaveDotGit to true, set the fetchgit branch to 'master' and clone
1919- # the repository (tested with registry rev
2020- # 965b634156cc5c6f10c7a458392bfd6f27436e7e), failing with the message:
2121- #
2222- # "Target OID for the reference doesn't exist on the repository"
2323- #
2424- # So we'll just have to create a new git repository from scratch with the
2525- # contents downloaded with fetchgit...
1515+ rev = "9714616bf3b7836cb827d8d1eabef017d730fb5e";
1616+ sha256 = "02lpmjsqwa16j14y3jzgw4dpzfy001nfyi78x9b8rgp1w3qdjbkr";
1717+ };
1818+ phases = [ "unpackPhase" "installPhase" ];
1919+ installPhase = ''
2020+ # For some reason, cargo doesn't like fetchgit's git repositories, not even
2121+ # if we set leaveDotGit to true, set the fetchgit branch to 'master' and clone
2222+ # the repository (tested with registry rev
2323+ # 965b634156cc5c6f10c7a458392bfd6f27436e7e), failing with the message:
2424+ #
2525+ # "Target OID for the reference doesn't exist on the repository"
2626+ #
2727+ # So we'll just have to create a new git repository from scratch with the
2828+ # contents downloaded with fetchgit...
26292727- mkdir -p $out
3030+ mkdir -p $out
28312929- cp -r ${src}/* $out/
3232+ cp -r ./* $out/
30333131- cd $out
3434+ cd $out
32353333- git="${git}/bin/git"
3636+ git="${git}/bin/git"
34373535- $git init
3636- $git config --local user.email "example@example.com"
3737- $git config --local user.name "example"
3838- $git add .
3939- $git commit --quiet -m 'Rust registry commit'
3838+ $git init
3939+ $git config --local user.email "example@example.com"
4040+ $git config --local user.name "example"
4141+ $git add .
4242+ $git commit --quiet -m 'Rust registry commit'
40434141- touch $out/touch . "$out/.cargo-index-lock"
4242-''
4444+ touch $out/touch . "$out/.cargo-index-lock"
4545+ '';
4646+}