NixOS/nixpkgs — pull request #4568 by madjar (2014-10-17 12:53:30+00:00)
Title: [Do not merge] Rust packaging

Hello there

I've been working on the packaging of rust program (those that use cargo, to be specific), and here is what I've got for now.

You can package arbitrary rust package using `buildRustPackage`. It takes 4 arguments: a name, a src (a fetchgit derivation for example), sha256 (the sha of the cargo dependencies), and a optional buildInputs.

You can look at the provided `rust-example.nix` to see what it looks like and try it out (it is a small game I wrote to try rust out).

A lot of things must be finished before merging:
- The api `buildRustPackage` is not final at all. If you have comment on the right way to do it, or if you can me to good examples in nixpkgs, I'd be grateful.
- The documentation.
- The `nix-prefetch-cargo` should be on par with other `nix-prefetch` script, because it is required to determine the sha of the dependencies.
- Cargo itself does not build (actually, I can get it to build on nixos, even outside of nixpkgs). I think I'll wait for https://github.com/rust-lang/rfcs/pull/403 to be implemented before trying again.

@wizeman