mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
rust: Add
This commit is contained in:
parent
512a3a4e46
commit
2a0f1cd6f1
|
@ -35,6 +35,7 @@
|
|||
ktosiek = "Tomasz Kontusz <tomasz.kontusz@gmail.com>";
|
||||
lovek323 = "Jason O'Conal <jason@oconal.id.au>";
|
||||
ludo = "Ludovic Courtès <ludo@gnu.org>";
|
||||
madjar = "Georges Dubus <georges.dubus@compiletoi.net>";
|
||||
marcweber = "Marc Weber <marco-oweber@gmx.de>";
|
||||
matejc = "Matej Cotman <cotman.matej@gmail.com>";
|
||||
modulistic = "Pablo Costa <modulistic@gmail.com>";
|
||||
|
|
51
pkgs/development/compilers/rust/default.nix
Normal file
51
pkgs/development/compilers/rust/default.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{stdenv, fetchurl, which, file, perl, curl, python27, makeWrapper}:
|
||||
|
||||
let snapshotName = "rust-stage0-2014-01-05-a6d3e57-linux-x86_64-aa8fbbacdb1d8a078f3a3fe3478dcbc506bd4090.tar.bz2"; in
|
||||
stdenv.mkDerivation {
|
||||
name = "rust-0.9";
|
||||
|
||||
src = fetchurl {
|
||||
url = http://static.rust-lang.org/dist/rust-0.9.tar.gz;
|
||||
sha256 = "1lfmgnn00wrc30nf5lgg52w58ir3xpsnpmzk2v5a35xp8lsir4f0";
|
||||
};
|
||||
|
||||
# We need rust to build rust. If we don't provide it, configure will try to download it
|
||||
snapshot = fetchurl {
|
||||
url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
|
||||
sha256 = "17inc23jpznqp0vnskvznm74mm24c1nffhz2bkadhvp2ww0vpjjx";
|
||||
};
|
||||
|
||||
# Put the snapshot where it is expected
|
||||
postUnpack = ''
|
||||
mkdir $sourceRoot/dl
|
||||
ln -s $snapshot $sourceRoot/dl/${snapshotName}
|
||||
'';
|
||||
|
||||
# Modify the snapshot compiler so that is can be executed
|
||||
preBuild = ''
|
||||
make x86_64-unknown-linux-gnu/stage0/bin/rustc
|
||||
patchelf --interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 \
|
||||
--set-rpath ${stdenv.gcc.gcc}/lib/ \
|
||||
x86_64-unknown-linux-gnu/stage0/bin/rustc
|
||||
'';
|
||||
|
||||
# rustc requires cc
|
||||
postInstall = ''
|
||||
for f in $out/bin/*; do
|
||||
wrapProgram $f --prefix PATH : "${stdenv.gcc}/bin"
|
||||
done
|
||||
'';
|
||||
|
||||
buildInputs = [ which file perl curl python27 makeWrapper];
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
homepage = http://www.rust-lang.org/;
|
||||
description = "A safe, concurrent, practical language";
|
||||
maintainers = [ stdenv.lib.maintainers.madjar ];
|
||||
license = map (builtins.getAttr "shortName") [stdenv.lib.licenses.mit stdenv.lib.licenses.asl20 ];
|
||||
# platforms as per http://static.rust-lang.org/doc/master/tutorial.html#getting-started
|
||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin"];
|
||||
};
|
||||
}
|
||||
|
|
@ -3103,8 +3103,7 @@ let
|
|||
|
||||
roadsend = callPackage ../development/compilers/roadsend { };
|
||||
|
||||
# TODO: the corresponding nix file is missing
|
||||
# rust = pkgsi686Linux.callPackage ../development/compilers/rust {};
|
||||
rust = callPackage ../development/compilers/rust {};
|
||||
|
||||
sbcl = builderDefsPackage (import ../development/compilers/sbcl) {
|
||||
inherit makeWrapper;
|
||||
|
|
Loading…
Reference in a new issue