nixpkgs/pkgs/development/tools/build-managers/cargo/default.nix

37 lines
950 B
Nix
Raw Normal View History

{ stdenv, fetchgit, rustPlatform, file, curl, python, pkgconfig, openssl
, cmake, zlib }:
2015-09-23 18:58:38 +02:00
with ((import ./common.nix) { inherit stdenv; version = "0.5.0"; });
with rustPlatform;
buildRustPackage rec {
inherit name version meta;
2015-09-23 18:58:38 +02:00
# Needs to use fetchgit instead of fetchFromGitHub to fetch submodules
src = fetchgit {
2015-09-23 18:58:38 +02:00
url = "git://github.com/rust-lang/cargo";
rev = "refs/tags/${version}";
sha256 = "1wg7vr6fpk9n76ly65lf2z9w1dj5nhykffbwrv46lybd8m3r8x3w";
};
2015-09-23 18:58:38 +02:00
depsSha256 = "1q92q63g9pz7fy9fhx8y0kqarsshmzv1dq18ki3hdd7d5pcbczna";
buildInputs = [ file curl pkgconfig python openssl cmake zlib ];
configurePhase = ''
2015-04-21 20:17:05 +02:00
./configure --enable-optimize --prefix=$out --local-cargo=${cargo}/bin/cargo
'';
buildPhase = "make";
# Disable check phase as there are lots of failures (some probably due to
# trying to access the network).
doCheck = false;
installPhase = ''
make install
${postInstall}
'';
}