Merge pull request #30088 from zimbatm/rust-1.20.0

Rust 1.20.0
This commit is contained in:
zimbatm 2017-10-23 00:31:18 +01:00 committed by GitHub
commit 2d59a6215c
55 changed files with 220 additions and 616 deletions

View File

@ -9,16 +9,15 @@ date: 2017-03-05
To install the rust compiler and cargo put
```
rustStable.rustc
rustStable.cargo
rust
```
into the `environment.systemPackages` or bring them into scope with
`nix-shell -p rustStable.rustc -p rustStable.cargo`.
into the `environment.systemPackages` or bring them into
scope with `nix-shell -p rust`.
There are also `rustBeta` and `rustNightly` package sets available.
These are not updated very regularly. For daily builds use either rustup from
nixpkgs or use the [Rust nightlies overlay](#using-the-rust-nightlies-overlay).
For daily builds (beta and nightly) use either rustup from
nixpkgs or use the [Rust nightlies
overlay](#using-the-rust-nightlies-overlay).
## Packaging Rust applications
@ -38,7 +37,7 @@ buildRustPackage rec {
sha256 = "0y5d1n6hkw85jb3rblcxqas2fp82h3nghssa4xqrhqnz25l799pj";
};
depsSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx";
cargoSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx";
meta = with stdenv.lib; {
description = "A utility that combines the usability of The Silver Searcher with the raw speed of grep";
@ -50,7 +49,7 @@ buildRustPackage rec {
}
```
`buildRustPackage` requires a `depsSha256` attribute which is computed over
`buildRustPackage` requires a `cargoSha256` attribute which is computed over
all crate sources of this package. Currently it is obtained by inserting a
fake checksum into the expression and building the package once. The correct
checksum can be then take from the failed build.
@ -76,11 +75,11 @@ in the `~/.config/nixpkgs/overlays` directory.
The latest version can be installed with the following command:
$ nix-env -Ai nixos.rustChannels.stable.rust
$ nix-env -Ai nixos.latest.rustChannels.stable.rust
Or using the attribute with nix-shell:
$ nix-shell -p nixos.rustChannels.stable.rust
$ nix-shell -p nixos.latest.rustChannels.stable.rust
To install the beta or nightly channel, "stable" should be substituted by
"nightly" or "beta", or

View File

@ -13,7 +13,7 @@ buildRustPackage rec {
sha256 = "1rg7ydvnhlg8w6blilm3cv6v4q51x1hgrbkln2ikhpdq0vakp5fd";
};
depsSha256 = "1n4rxipna307r4xppb2iaads7kpa3yjv99fimvpn8l0f999ir2rz";
cargoSha256 = "0i9617qwc6d4jvlbydwk03rcsnyvxzpbn2ms10ds4r6x7jy2a4sy";
cargoBuildFlags = ["--features cli"];

View File

@ -13,12 +13,13 @@ buildRustPackage rec {
sha256 = "1w651g4p2mc4ljp20l8lwvfx3l3fzyp6gf2izr85vyb1wjbaccqn";
};
depsSha256 = "14x8pbjgkz0g724lnvd9mi2alqd6fipjljw6xsraf9gqwijn1knq";
cargoSha256 = "14x8pbjgkz0g724lnvd9mi2alqd6fipjljw6xsraf9gqwijn1kn0";
meta = {
description = "Directly run Ethereum bytecode";
homepage = https://github.com/dapphub/ethrun/;
maintainers = [stdenv.lib.maintainers.dbrock];
broken = true; # mark temporary as broken
inherit version;
};
}

View File

@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
sha256 = "02l1f46frpvw1r6k1wfh77mrsnmsdvifqx0vnscxz4xgb9ia9d1c";
};
depsSha256 = "02qx8zdhmj7rmhqqq5q9428x9mlrjxxcnn4yhnygz9gfgvada2hx";
cargoSha256 = "1b0kal53ggcr59hbrsdj8fifjycahrmzwq677n9h3fywv4r237m6";
installPhase = ''
mkdir -p $out/lib

View File

@ -38,7 +38,7 @@ buildRustPackage rec {
sha256 = "0h37x12r33xwz9vf1n8y24c0ph5w17lhkpfi5q6lbpgidvbs6fyx";
};
depsSha256 = "05gkl2zg546i2pm0gx11s56f7dk72qpm39kml1d2myj81s0vyb5z";
cargoSha256 = "0w3j92kd27pny37pfvlv6qsnbb1lgphmfbhvvng0z96r2b1wjviz";
buildInputs = [
cmake
@ -69,6 +69,7 @@ buildRustPackage rec {
dontPatchELF = true;
meta = with stdenv.lib; {
broken = true;
description = "GPU-accelerated terminal emulator";
homepage = https://github.com/jwilm/alacritty;
license = with licenses; [ asl20 ];

View File

@ -14,7 +14,7 @@ buildRustPackage rec {
sha256 = "0pqrm85pd9hqn5fwqjbyyrrfh4k7q9mi9qy9hm8yigk5l8mw44y1";
};
depsSha256 = "1ahfm5agvabqqqgjsyjb95xxbc7mng1mdyclcakwp1m1qdkxx9py";
cargoSha256 = "1ahfm5agvabqqqgjsyjb95xxbc7mng1mdyclcakwp1m1qdkxx9p0";
buildInputs = [ libsodium libarchive openssl ];
@ -35,5 +35,6 @@ buildRustPackage rec {
license = licenses.asl20;
maintainers = [ maintainers.rushmorem ];
platforms = [ "x86_64-linux" "x86_64-darwin" ];
broken = true; # mark temporary as broken due git dependencies
};
}

View File

@ -12,7 +12,7 @@ buildRustPackage rec {
sha256 = "1mcdjykrgh0jq6k6y664lai8sbgzk6j7k0r944f43vg63d1jql5b";
};
depsSha256 = "0whs3fgmpb6g1mjajs3qs9g613x5dal4x6ghzzkpl73a9pgydkpn";
cargoSha256 = "0k9d6pxsb4gvkqs00g71c1nnz773iccg4vajgn33qdym6m6qsjwy";
buildInputs = [ makeWrapper openssl ];

View File

@ -23,7 +23,7 @@ buildRustPackage rec {
sha256 = "1sx6sc2dj3l61gbiqz8vfyhw5w4xjdyfzn1ixz0y8ipm579yc7a2";
};
depsSha256 = "1z2n3z5wkh5z5vc976yscq77fgjszwzwlrp7g17hmsbhzx6x170h";
cargoSha256 = "08zbvjwjdpv2sbj6mh73py82inhs18jvmh8m9k4l94fcz6ykgqwr";
nativeBuildInputs = [
cmake

View File

@ -18,7 +18,7 @@ buildRustPackage rec {
doCheck = false;
depsSha256 = "1qzzpnkyw1bn5fnj06c80f7985v1q0rqcphrrrkpbi33lg5mzgbv";
cargoSha256 = "0r69vghjd6b30v0qjsipyv56n92iwvyxmllrnwjzjf5pzhhjl7sy";
meta = with stdenv.lib; {
description = "A distributed version control system";

View File

@ -14,13 +14,14 @@ buildRustPackage rec {
sha256 = "10s01x54kwjm2c85v57i6g3pvj5w3wpkjblj036mmd865fla1brb";
};
depsSha256 = "1k5xbw2zhm5z650mxdbxixr90im53wlpjdvq2pbnx2snqm84idlc";
cargoSha256 = "06qivlybmmc49ksv4232sm1r4hp923xsq4c2ksa4i2azdzc1csdc";
buildInputs = [ wlc dbus_libs dbus_glib cairo libxkbcommon ];
nativeBuildInputs = [ pkgconfig ];
meta = with stdenv.lib; {
broken = true;
description = "Customizable Wayland compositor (window manager)";
longDescription = ''
Way Cooler is a customizable tiling window manager written in Rust

View File

@ -9,7 +9,7 @@ rustPlatform.buildRustPackage rec {
sha256 = "1r74nhcwiy2rmifzjhdal3jcqz4jz48nfvhdyw4gasa6nxp3msdl";
};
depsSha256 = "0z7h8ybh2db3xl8qxbzby5lncdaijixzmbn1j8a45lbky1xiix71";
cargoSha256 = "0z92ml84b5652zgwzn08a8vvxksaa54jql66sfpdz1mvjwhgdmvn";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libXinerama libX11 ];
@ -31,6 +31,7 @@ rustPlatform.buildRustPackage rec {
'';
meta = with stdenv.lib; {
broken = true;
description = "A tiling window manager in Rust";
homepage = https://github.com/Kintaro/wtftw;
license = stdenv.lib.licenses.bsd3;

View File

@ -0,0 +1,32 @@
{ fetchurl, stdenv }:
let
inherit (stdenv) system;
version = "0.1.12";
hashes = {
x86_64-linux = "1hxlavcxy374yypfamlkygjg662lhll8j434qcvdawkvlidg5ii5";
x86_64-darwin = "1jkvhh710gwjnnjx59kaplx2ncfvkx9agfa76rr94sbjqq4igddm";
};
hash = hashes. ${system} or (throw "missing bootstrap hash for platform ${system}");
platforms = {
x86_64-linux = "x86_64-unknown-linux-musl";
x86_64-darwin = "x86_64-apple-darwin";
};
platform = platforms . ${system};
in stdenv.mkDerivation {
name = "cargo-vendor-${version}";
src = fetchurl {
url = "https://github.com/alexcrichton/cargo-vendor/releases/download/${version}/cargo-vendor-${version}-${platform}.tar.gz";
sha256 = hash;
};
phases = "unpackPhase installPhase";
installPhase = ''
install -Dm755 cargo-vendor $out/bin/cargo-vendor
'';
}

View File

@ -1,10 +1,14 @@
{ stdenv, callPackage, path, cacert, git, rust, rustRegistry }:
{ fetchurl, stdenv, path, cacert, git, rust }:
let
rustRegistry' = rustRegistry;
cargoVendor = import ./cargo-vendor.nix {
inherit fetchurl stdenv;
};
fetchcargo = import ./fetchcargo.nix {
inherit stdenv cacert git rust cargoVendor;
};
in
{ name, depsSha256
, rustRegistry ? rustRegistry'
{ name, cargoSha256
, src ? null
, srcs ? null
, sourceRoot ? null
@ -18,17 +22,13 @@ in
let
lib = stdenv.lib;
fetchDeps = import ./fetchcargo.nix {
inherit stdenv cacert git rust rustRegistry;
};
cargoDeps = fetchDeps {
cargoDeps = fetchcargo {
inherit name src srcs sourceRoot cargoUpdateHook;
sha256 = depsSha256;
sha256 = cargoSha256;
};
in stdenv.mkDerivation (args // {
inherit cargoDeps rustRegistry;
inherit cargoDeps;
patchRegistryDeps = ./patch-registry-deps;
@ -43,71 +43,24 @@ in stdenv.mkDerivation (args // {
postUnpack = ''
eval "$cargoDepsHook"
echo "Using cargo deps from $cargoDeps"
mkdir .cargo
cat >.cargo/config <<-EOF
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
cp -a "$cargoDeps" deps
chmod +w deps -R
# It's OK to use /dev/null as the URL because by the time we do this, cargo
# won't attempt to update the registry anymore, so the URL is more or less
# irrelevant
cat <<EOF > deps/config
[registry]
index = "file:///dev/null"
[source.vendored-sources]
directory = '$cargoDeps'
EOF
export CARGO_HOME="$(realpath deps)"
export RUST_LOG=${logLevel}
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
# Let's find out which $indexHash cargo uses for file:///dev/null
(cd $sourceRoot && cargo fetch &>/dev/null) || true
cd deps
indexHash="$(basename $(echo registry/index/*))"
echo "Using indexHash '$indexHash'"
rm -rf -- "registry/cache/$indexHash" \
"registry/index/$indexHash"
mv registry/cache/HASH "registry/cache/$indexHash"
echo "Using rust registry from $rustRegistry"
ln -s "$rustRegistry" "registry/index/$indexHash"
# Retrieved the Cargo.lock file which we saved during the fetch
cd ..
mv deps/Cargo.lock $sourceRoot/
(
cd $sourceRoot
cargo fetch
cargo clean
)
'' + (args.postUnpack or "");
prePatch = ''
# Patch registry dependencies, using the scripts in $patchRegistryDeps
(
set -euo pipefail
cd $NIX_BUILD_TOP/deps/registry/src/*
for script in $patchRegistryDeps/*; do
# Run in a subshell so that directory changes and shell options don't
# affect any following commands
( . $script)
done
)
'' + (args.prePatch or "");
buildPhase = with builtins; args.buildPhase or ''
runHook preBuild
echo "Running cargo build --release ${concatStringsSep " " cargoBuildFlags}"
cargo build --release ${concatStringsSep " " cargoBuildFlags}
cargo build --release --frozen ${concatStringsSep " " cargoBuildFlags}
runHook postBuild
'';
@ -126,4 +79,6 @@ in stdenv.mkDerivation (args // {
find target/release -maxdepth 1 -executable -exec cp "{}" $out/bin \;
runHook postInstall
'';
passthru = { inherit cargoDeps; };
})

View File

@ -1,209 +0,0 @@
# copied from libgit2 source code 'repo-template.h'
makeGitTemplate() {
local target="$1"
mkdir -p -m777 "$target/info" "$target/pack" "$target/objects" "$target/refs"
mkdir -p -m777 "$target/refs/heads" "$target/refs/tags" "$target/objects/info" "$target/objects/pack"
cat <<'EOF' > "$target/description"
Unnamed repository; edit this file 'description' to name the repository.
EOF
chmod 666 "$target/description"
cat <<'EOF' > "$target/info/exclude"
# File patterns to ignore; see `git help ignore` for more information.
# Lines that start with '#' are comments.
EOF
}
fetchCargoDeps() {
src=$(realpath $1)
out=$(realpath $2)
echo "Fetching $src to $out"
mkdir $out
# Configure git template dir to make libgit2 more deterministic
#
# Without a template dir, libgit2 defaults to /usr/share/git-core/templates,
# which can vary between systems if sandboxed builds aren't used.
#
# Note: we explictly set --tmpdir for mktemp here to make it more friendly
# for nix-shell users, where $TMPDIR is not necessarily set to NIX_BUILD_TOP
echo "Setting up git templatedir"
export GIT_TEMPLATE_DIR="$(mktemp -d --tmpdir=$NIX_BUILD_TOP git-template.XXX)"
makeGitTemplate "$GIT_TEMPLATE_DIR"
export XDG_CONFIG_HOME="$(mktemp -d --tmpdir=$NIX_BUILD_TOP home.XXX)"
mkdir -p $XDG_CONFIG_HOME/git
cat <<EOF > $XDG_CONFIG_HOME/git/config
[init]
templatedir = $GIT_TEMPLATE_DIR
EOF
# Configure cargo to fetch from a local copy of the crates.io registry
echo "Using rust registry from $rustRegistry"
cat <<EOF > $out/config
[registry]
index = "file://$rustRegistry"
EOF
export CARGO_HOME=$out
cd $src
if [[ ! -f Cargo.lock ]]; then
echo
echo "ERROR: The Cargo.lock file doesn't exist"
echo
echo "Cargo.lock is needed to make sure that depsSha256 doesn't change"
echo "when the registry is updated."
echo
exit 1
fi
# We need to do the following string replacement so that 'cargo fetch'
# doesn't ignore the versions specified in Cargo.lock
substituteInPlace Cargo.lock \
--replace "registry+https://github.com/rust-lang/crates.io-index" \
"registry+file://$rustRegistry"
# Do any possible 'cargo update -p <pkgName> --precise <version>' ad-hoc updates
eval "$cargoUpdateHook"
# Do the fetch
cargo fetch --verbose
# Now that we have fetched everything, let's make the output deterministic
# Cargo uses the following directory structure for fetched data, where
# $indexHash is a hash of the registry index URL:
#
#
# /config:
#
# Cargo config file. We'll delete this because it's not deterministic,
# and instead recreate it just before running 'cargo build'.
#
# /registry/cache/$indexHash/:
#
# This is where tarballs of registry package dependencies are kept
# We'll need to keep this, but make sure $indexHash is a fixed name.
#
# /registry/index/$indexHash/:
#
# A copy of the registry index is kept here. We can delete this, and
# instead, just before running 'cargo build', we'll symlink this
# directory to our static copy of the registry in the Nix store.
#
# /registry/src/$indexHash/{pkgName-pkgVersion}/:
#
# Here cargo keeps extracted sources of the cached tarballs.
# We'll just delete this because cargo will re-populate them from the
# tarballs.
#
# /git/db/{domain-hash}/:
#
# Here cargo keeps the `.git` directories of git dependencies.
# We'll need to keep these, but make them deterministic.
#
# /git/checkouts/{domain-hash}/{branchName}/:
#
# Here cargo keeps checked-out sources of the git dependencies.
# We can delete this, because cargo will re-populate them from the above
# `.git` directories.
#
# Let's start
# Remove cargo config file, which points to the ever-changing registry
rm $out/config
# Save the Cargo.lock file into the output, so that we don't have to do another
# 'cargo update' during the build (which would try to access the network) for
# any ad-hoc package updates (through $cargoUpdateHook).
#
# We need to replace the rustRegistry URL with something deterministic.
# Since the URL won't actually be accessed anymore, it's fine to use /dev/null.
substituteInPlace Cargo.lock \
--replace "registry+file://$rustRegistry" \
"registry+file:///dev/null"
mv Cargo.lock $out/
# Let's replace $indexHash with something more deterministic
mv $out/registry/cache/* $out/registry/cache/HASH
# The registry index changes all the time, so it's not deterministic
# We'll symlink it before running 'cargo build'
rm -rf $out/registry/index/*
# Make git DBs deterministic
# TODO: test with git submodules
[[ ! -d $out/git/checkouts ]] || (cd $out/git/checkouts && for name in *; do
revs=""
cd "$out/git/checkouts/$name"
while read dir; do
# extract substring: [dir = "./xxx/yyy/.git"] => [branch = "xxx/yyy"]
branch="${dir:2:$((${#dir}-7))}"
cd "$out/git/checkouts/$name/$branch"
rev="$(git rev-parse HEAD)"
revs="$rev $revs"
done < <(find . -type d -name .git -print)
echo "List of revs to keep for git db $name: $revs"
(
# The following code was adapted from nix-prefetch-git
cd "$out/git/db/$name"
export GIT_DIR=.
# Remove all remote branches
git branch -r | while read branch; do
git branch -rD "$branch" >&2
done
# Remove all tags
git tag | while read tag; do
git tag -d "$tag" >&2
done
# Remove all local branches
branchrefs=()
eval "$(git for-each-ref --shell --format='branchrefs+=(%(refname))' refs/heads/)"
for branchref in "${branchrefs[@]}"; do
git update-ref -d "$branchref" >&2
done
# Create ad-hoc branches for the revs we need
echo "$revs" | while read -d " " rev; do
echo "Creating git branch b_$rev $rev"
git branch b_$rev $rev
done
# Remove files that have timestamps or otherwise have non-deterministic
# properties.
rm -rf logs/ hooks/ index FETCH_HEAD ORIG_HEAD refs/remotes/origin/HEAD config
# Do a full repack. Must run single-threaded, or else we lose determinism.
git config pack.threads 1
git repack -A -d -f
rm -f config
# Garbage collect unreferenced objects.
git gc --prune=all
)
done)
# Remove unneeded outputs
[[ ! -d $out/registry/src ]] || rm -rf $out/registry/src
[[ ! -d $out/git/checkouts ]] || rm -rf $out/git/checkouts
# XXX: provide some debugging output to see find out why we are seeing
# sporadic hash mismatches
find $out ! -type f
find $out -type f -exec sha256sum {} +
}

View File

@ -1,19 +1,30 @@
{ stdenv, cacert, git, rust, rustRegistry }:
{ stdenv, cacert, git, rust, cargoVendor }:
{ name ? "cargo-deps", src, srcs, sourceRoot, sha256, cargoUpdateHook ? "" }:
stdenv.mkDerivation {
name = "${name}-fetch";
buildInputs = [ rust.cargo rust.rustc git ];
inherit src srcs sourceRoot rustRegistry cargoUpdateHook;
name = "${name}-vendor";
buildInputs = [ cacert cargoVendor git rust.cargo ];
inherit src srcs sourceRoot;
phases = "unpackPhase installPhase";
installPhase = ''
source ${./fetch-cargo-deps}
if [[ ! -f Cargo.lock ]]; then
echo
echo "ERROR: The Cargo.lock file doesn't exist"
echo
echo "Cargo.lock is needed to make sure that cargoSha256 doesn't change"
echo "when the registry is updated."
echo
exit 1
fi
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
fetchCargoDeps . "$out"
cargo vendor
cp -ar vendor $out
'';
outputHashAlgo = "sha256";

View File

@ -1,40 +0,0 @@
{ stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl
, targets ? []
, targetToolchains ? []
, targetPatches ? []
}:
let
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
in
rec {
rustc = callPackage ./rustc.nix {
inherit llvm targets targetPatches targetToolchains rustPlatform;
version = "beta-2017-05-27";
configureFlags = [ "--release-channel=beta" ];
src = fetchurl {
url = "https://static.rust-lang.org/dist/2017-05-27/rustc-beta-src.tar.gz";
sha256 = "9f3f92efef7fb2b4bf38e57e4ff1f416dc221880b90841c4bdaee350801c0b57";
};
patches = [
./patches/darwin-disable-fragile-tcp-tests.patch
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
doCheck = false;
broken = true;
};
cargo = callPackage ./cargo.nix rec {
version = "0.18.0";
srcRev = "fe7b0cdcf5ca7aab81630706ce40b70f6aa2e666";
srcSha = "164iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px";
depsSha256 = "1mrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm";
inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo
};
}

View File

@ -1,6 +1,18 @@
{ stdenv, fetchurl, makeWrapper, cacert, zlib, curl }:
let
# Note: the version MUST be one version prior to the version we're
# building
version = "1.19.0";
# fetch hashes by running `print-hashes.sh 1.19.0`
hashes = {
i686-unknown-linux-gnu = "657b78f3c1a1b4412e12f7278e20cc318022fa276a58f0d38a0d15b515e39713";
x86_64-unknown-linux-gnu = "30ff67884464d32f6bbbde4387e7557db98868e87fb2afbb77c9b7716e3bff09";
i686-apple-darwin = "bdfd2189245dc5764c9f26bdba1429c2bf9d57477d8e6e3f0ba42ea0dc63edeb";
x86_64-apple-darwin = "5c668fb60a3ba3e97dc2cb8967fc4bb9422b629155284dcb89f94d116bb17820";
};
platform =
if stdenv.system == "i686-linux"
then "i686-unknown-linux-gnu"
@ -12,27 +24,11 @@ let
then "x86_64-apple-darwin"
else throw "missing bootstrap url for platform ${stdenv.system}";
# fetch hashes by patching print-hashes.sh to not use the "$DATE" variable
# then running `print-hashes.sh 1.16.0`
bootstrapHash =
if stdenv.system == "i686-linux"
then "b5859161ebb182d3b75fa14a5741e5de87b088146fb0ef4a30f3b2439c6179c5"
else if stdenv.system == "x86_64-linux"
then "48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd"
else if stdenv.system == "i686-darwin"
then "26356b14164354725bd0351e8084f9b164abab134fb05cddb7758af35aad2065"
else if stdenv.system == "x86_64-darwin"
then "2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926"
else throw "missing bootstrap hash for platform ${stdenv.system}";
src = fetchurl {
url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
sha256 = bootstrapHash;
sha256 = hashes."${platform}";
};
# Note: the version MUST be one version prior to the version we're
# building
version = "1.16.0";
in import ./binaryBuild.nix
{ inherit stdenv fetchurl makeWrapper cacert zlib curl;
buildRustPackage = null;

View File

@ -1,19 +1,20 @@
{ stdenv, fetchgit, file, curl, pkgconfig, python, openssl, cmake, zlib
{ stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
, version, srcRev, srcSha, depsSha256
, version, srcSha, cargoSha256
, patches ? []}:
rustPlatform.buildRustPackage rec {
name = "cargo-${version}";
inherit version;
src = fetchgit {
url = "https://github.com/rust-lang/cargo";
rev = srcRev;
src = fetchFromGitHub {
owner = "rust-lang";
repo = "cargo";
rev = version;
sha256 = srcSha;
};
inherit depsSha256;
inherit cargoSha256;
inherit patches;
passthru.rustc = rustc;

View File

@ -6,30 +6,31 @@
let
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
version = "1.17.0";
version = "1.20.0";
in
rec {
rustc = callPackage ./rustc.nix {
inherit llvm targets targetPatches targetToolchains rustPlatform version;
forceBundledLLVM = true;
configureFlags = [ "--release-channel=stable" ];
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
sha256 = "4baba3895b75f2492df6ce5a28a916307ecd1c088dc1fd02dbfa8a8e86174f87";
sha256 = "0542y4rnzlsrricai130mqyxl8r6rd991frb4qsnwb27yigqg91a";
};
patches = [
./patches/darwin-disable-fragile-tcp-tests.patch
./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
};
cargo = callPackage ./cargo.nix rec {
version = "0.18.0";
srcRev = "fe7b0cdcf5ca7aab81630706ce40b70f6aa2e666";
srcSha = "164iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px";
depsSha256 = "1mrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm";
version = "0.22.0";
srcSha = "0x9pm73hkkd1hq4qrmz8iv91djgpdsxzwll7jari0h77vpwajmw4";
cargoSha256 = "0xd0rb8gcqy6xngsx9l30jg3fqrcwccgv904ksqs9c4d44hga0gd";
inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo

View File

@ -1,37 +0,0 @@
{ stdenv, callPackage, rustPlatform, llvm, fetchurl
, targets ? []
, targetToolchains ? []
, targetPatches ? []
}:
rec {
rustc = callPackage ./rustc.nix {
inherit llvm targets targetPatches targetToolchains rustPlatform;
version = "nightly-2017-05-30";
configureFlags = [ "--release-channel=nightly" ];
src = fetchurl {
url = "https://static.rust-lang.org/dist/2017-05-30/rustc-nightly-src.tar.gz";
sha256 = "90ce76db56a93f1b4532f2e62bbf12c243c4d156662b0d80c25319211ee7d0e0";
};
patches = [
./patches/darwin-disable-fragile-tcp-tests.patch
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
doCheck = false;
broken = true;
};
cargo = callPackage ./cargo.nix rec {
version = "0.18.0";
srcRev = "fe7b0cdcf5ca7aab81630706ce40b70f6aa2e666";
srcSha = "164iywv1l3v87b0pznf5kkzxigd6w19myv9d7ka4c65zgrk9n9px";
depsSha256 = "1mrgd8ib48vxxbhkvsqqq4p19sc6b74x3cd8p6lhhlm6plrajrvm";
inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo
};
}

View File

@ -1,23 +0,0 @@
{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl }:
let
platform = if stdenv.system == "x86_64-linux"
then "x86_64-unknown-linux-gnu"
else throw "missing bootstrap url for platform ${stdenv.system}";
bootstrapHash =
if stdenv.system == "x86_64-linux"
then "0svlm4bxsdhdn4jsv46f278kid23a9w978q2137qrba4xnyb06kf"
else throw "missing bootstrap hash for platform ${stdenv.system}";
src = fetchurl {
url = "https://static.rust-lang.org/dist/${version}/rust-nightly-${platform}.tar.gz";
sha256 = bootstrapHash;
};
version = "2017-06-26";
in import ./binaryBuild.nix
{ inherit stdenv fetchurl makeWrapper cacert zlib buildRustPackage curl;
inherit version src platform;
versionType = "nightly";
}

View File

@ -1,17 +1,18 @@
From 1d8a91d5b09cb762fe890d04bfb61b9eefd0624a Mon Sep 17 00:00:00 2001
From: Moritz Ulrich <moritz@tarn-vedra.de>
Date: Sun, 8 Jan 2017 10:28:17 +0100
Subject: [PATCH] Disable libstd::net::tcp::{ttl, timeouts} on Darwin
From 26d3b70abec1adf773522643b31ce9c03439916a Mon Sep 17 00:00:00 2001
From: Joerg Thalheim <joerg@thalheim.io>
Date: Tue, 10 Oct 2017 00:40:20 +0100
Subject: [PATCH] Disable fragile tests libstd::net::tcp on Darwin/Linux
Signed-off-by: Joerg Thalheim <joerg@thalheim.io>
---
src/libstd/net/tcp.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
src/libstd/net/tcp.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index 0e7c5b0671..d42fd26267 100644
index 8d1e7882e5..2c223fb315 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -551,6 +551,7 @@ mod tests {
@@ -949,6 +949,7 @@ mod tests {
})
}
@ -19,7 +20,7 @@ index 0e7c5b0671..d42fd26267 100644
#[test]
fn write_close() {
each_ip(&mut |addr| {
@@ -1022,7 +1023,10 @@ mod tests {
@@ -1421,7 +1422,10 @@ mod tests {
// FIXME: re-enabled bitrig/openbsd tests once their socket timeout code
// no longer has rounding errors.
@ -31,7 +32,7 @@ index 0e7c5b0671..d42fd26267 100644
#[test]
fn timeouts() {
let addr = next_test_ip4();
@@ -1101,6 +1105,7 @@ mod tests {
@@ -1500,6 +1504,7 @@ mod tests {
assert_eq!(false, t!(stream.nodelay()));
}
@ -39,6 +40,14 @@ index 0e7c5b0671..d42fd26267 100644
#[test]
fn ttl() {
let ttl = 100;
@@ -1568,6 +1573,7 @@ mod tests {
})
}
+ #[cfg_attr(target_os = "linux", ignore)]
#[test]
fn connect_timeout_unroutable() {
// this IP is unroutable, so connections should always time out,
--
2.11.0
2.14.2

View File

@ -1,25 +0,0 @@
From 5702d7cdb2bed7ac3af3c01087b181da35f6e108 Mon Sep 17 00:00:00 2001
From: joachim schiele <js@lastlog.de>
Date: Thu, 24 Nov 2016 22:25:48 +0100
Subject: [PATCH 2/2] asdf
---
src/tools/tidy/src/main.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs
index cabaee5..685df94 100644
--- a/src/tools/tidy/src/main.rs
+++ b/src/tools/tidy/src/main.rs
@@ -48,7 +48,7 @@ fn main() {
errors::check(&path, &mut bad);
cargo::check(&path, &mut bad);
features::check(&path, &mut bad);
- cargo_lock::check(&path, &mut bad);
+ //cargo_lock::check(&path, &mut bad);
pal::check(&path, &mut bad);
if bad {
--
2.10.0

View File

@ -1,25 +0,0 @@
From ac204f8be95cdb2350a1dd893641e38528aaf01d Mon Sep 17 00:00:00 2001
From: joachim schiele <js@lastlog.de>
Date: Fri, 25 Nov 2016 02:17:02 +0100
Subject: [PATCH] asdf
---
src/tools/tidy/src/main.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs
index cb11fe2..c9b7d2a 100644
--- a/src/tools/tidy/src/main.rs
+++ b/src/tools/tidy/src/main.rs
@@ -45,7 +45,7 @@ fn main() {
bins::check(&path, &mut bad);
style::check(&path, &mut bad);
errors::check(&path, &mut bad);
- cargo::check(&path, &mut bad);
+ //cargo::check(&path, &mut bad);
features::check(&path, &mut bad);
pal::check(&path, &mut bad);
--
2.10.0

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
# All rust-related downloads can be found at
# https://static.rust-lang.org/dist/index.html. To find the date on
@ -6,25 +7,30 @@
# file, e.g.
# https://static.rust-lang.org/dist/channel-rust-beta-date.txt
PLATFORMS="i686-unknown-linux-gnu x86_64-unknown-linux-gnu i686-apple-darwin x86_64-apple-darwin"
BASEURL="https://static.rust-lang.org/dist"
DATE=$1
VERSION=$2
PLATFORMS=(
i686-unknown-linux-gnu
x86_64-unknown-linux-gnu
i686-apple-darwin
x86_64-apple-darwin
)
BASEURL=https://static.rust-lang.org/dist
VERSION=${1:-}
DATE=${2:-}
if [[ -z $DATE ]]
then
echo "No date supplied"
exit -1
fi
if [[ -z $VERSION ]]
if [[ -z $VERSION ]]
then
echo "No version supplied"
exit -1
fi
for PLATFORM in $PLATFORMS
if [[ -n $DATE ]]
then
BASEURL=$BASEURL/$DATE
fi
for PLATFORM in "${PLATFORMS[@]}"
do
URL="$BASEURL/$DATE/rust-$VERSION-$PLATFORM.tar.gz.sha256"
curl $URL
URL="$BASEURL/rust-$VERSION-$PLATFORM.tar.gz.sha256"
SHA256=$(curl -sSfL $URL | cut -d ' ' -f 1)
echo "$PLATFORM = \"$SHA256\";"
done

View File

@ -48,15 +48,18 @@ stdenv.mkDerivation {
configureFlags = configureFlags
++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
++ [ "--enable-vendor" "--disable-locked-deps" ]
++ [ "--enable-llvm-link-shared" ]
# ++ [ "--jemalloc-root=${jemalloc}/lib"
++ [ "--default-linker=${stdenv.cc}/bin/cc" "--default-ar=${binutils.out}/bin/ar" ]
++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
++ optional (stdenv.cc.cc ? isClang) "--enable-clang"
++ optional (targets != []) "--target=${target}"
++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
patches = patches ++ targetPatches;
# the rust build system complains that nix alters the checksums
dontFixLibtool = true;
passthru.target = target;
postPatch = ''

View File

@ -3,17 +3,17 @@
with rustPlatform;
buildRustPackage rec {
version = "0.3.4";
version = "2017-06-23";
name = "loc-${version}";
src = fetchFromGitHub {
owner = "cgag";
repo = "loc";
rev = "9f3590f6299a1be3560f00de7f4f8bef61a02642";
sha256 = "0dga8prwnnmsa616jh64wzic957ff0491xghm0bjlns35ajc8lif";
rev = "bbea575f56879ef614d57a42a6b79fd45b9a8b38";
sha256 = "0agyhi55rh248fmlsip4fi1iw4xv3433q7bcb2lpjfnjpzxxlvfn";
};
depsSha256 = "1xcfhbnz208dk7xb748v8kv28zbhyr7wqg9gsgbiw3lnvc2a3nn6";
cargoSha256 = "0f3i8av9g19r2nhr9m8ca8s23kq294c5kqyvx155l6p76r7a9kvb";
meta = {
homepage = http://github.com/cgag/loc;

View File

@ -13,7 +13,7 @@ buildRustPackage rec {
sha256 = "1wxglc4n1dar5qphhj5pab7ps34cjr7jy611fwn72lz0f6c7jp3z";
};
depsSha256 = "0gkg3bxx7nxsvff33n7pif731djfvlzk0msia27h0wq0mazq7kw3";
cargoSha256 = "1pi8fh6vz6m5hr38wm0v0hxp1yxm1ma8yzish3b78zkv8f90kmv0";
meta = {
description = "Generate changelogs from local git metadata";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, rustPlatform, openssl, cmake, perl, pkgconfig, zlib }:
{ stdenv, fetchFromGitHub, fetchpatch, rustPlatform, openssl, cmake, perl, pkgconfig, zlib }:
with rustPlatform;
@ -13,14 +13,24 @@ buildRustPackage rec {
sha256 = "07mgq5h6r1gf3jflbv2khcz32bdazw7z1s8xcsafdarnm13ps014";
};
depsSha256 = "1xypk9ck7znca0nqm61m5ngpz6q7c0wydlpwxq4mnkd1np27xn53";
cargoSha256 = "06w864f73kijq24xzljfaf47d97aqyg4md3crzbq8hns157m3sv2";
cargoDepsHook = ''
(
cd ${name}-src
# see https://github.com/git-series/git-series/pull/56
patch -p1 < ${fetchpatch {
url = "https://github.com/Mic92/git-series/commit/3aa30a47d74ebf90b444dccdf8c153f07f119483.patch";
sha256 = "06v8br9skvy75kcw2zgbswxyk82sqzc8smkbqpzmivxlc2i9rnh0";
}}
)
'';
nativeBuildInputs = [ cmake pkgconfig perl ];
buildInputs = [ openssl zlib ];
postBuild = ''
mkdir -p "$out/man/man1"
cp "$src/git-series.1" "$out/man/man1"
install -D "$src/git-series.1" "$out/man/man1/git-series.1"
'';
meta = with stdenv.lib; {

View File

@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
sha256 = "1bzs3mr6f9bna39b9ddwwq0raas07nbn106mnq3widxg59i0gxhd";
};
depsSha256 = "1cz93mrpxmyrza0ipdyg2a6mynl66plpsb446wxnmmy7y7zd6xbf";
cargoSha256 = "0y0rkxhkv31v5sa0425dwskd80i6srwbqhqkrw1g1kbmbs9y0vxz";
installPhase = ''
mkdir -p $out/bin
@ -19,6 +19,7 @@ rustPlatform.buildRustPackage rec {
'';
meta = with stdenv.lib; {
broken = true;
description = "Count code, quickly";
homepage = https://github.com/Aaronepower/tokei;
license = licenses.mit;

View File

@ -13,7 +13,7 @@ buildRustPackage rec {
sha256 = "066f6sdy0vrp113wlg18q9p0clyrg9iqbj17ly0yn8dxr5iar002";
};
depsSha256 = "138h0q2a2gghfjpwfi11zw4rkipvmglb7srqz56ibbw2xliid2wl";
cargoSha256 = "0c4awm1d87b396d3g3mp1md5p92i5a64a9jdawpr8mwjd0bly05m";
buildInputs = [ llvmPackages.clang-unwrapped v8 ];

View File

@ -24,7 +24,7 @@ rustPlatform.buildRustPackage rec {
wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped}/lib"
'';
depsSha256 = "06b5zyw9p7h73h30c1nlnwjb0zmkfx52wqsl9b14y9hx51g9bw0r";
cargoSha256 = "128skg31lc9v8i7ghfb3wyiazivqfvzhi1mvmjcl0gkx1hi5006v";
doCheck = false; # A test fails because it can't find standard headers in NixOS

View File

@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
sha256 = "06k50f2vj2w08afh3nrlhs0amcvw2i45bhfwr70sgs395xicjswp";
};
depsSha256 = "1gywnjbjl9jalbq6wkfmbczav4qbhgw2h8lyxkyppnhw9y4j0nc1";
cargoSha256 = "1w5imxyqlyv24dvzncq6dy01zn2x8p1aciyvzh8ac1x1wdjcacjc";
buildInputs = [ makeWrapper ];

View File

@ -14,7 +14,7 @@ buildRustPackage rec {
doCheck = false;
depsSha256 = "0db18m0vxzvg821gb5g8njhlnxw7im81m089i4982n8hmnhm1497";
cargoSha256 = "1h7hm7vkk1grah6pn5ydfi5pzc2kd48lh2kxim5jlvrxhd2dingg";
buildInputs = [ makeWrapper ];

View File

@ -13,9 +13,10 @@ buildRustPackage rec {
sha256 = "07vh4g120sx569wkzclq91blkkd7q7z582pl8vz0li1l9ij8md01";
};
depsSha256 = "1ckrf77s1glrqi0gvrv9wqmip4i97dk0arn0iz87jg4q2wfss85k";
cargoSha256 = "14kd25mw6m20blqcr221cclcqxw0j229zxq8hsaay6q7jgv0c7a0";
meta = with stdenv.lib; {
broken = true;
description = "Rust IDEs. parse-analysis";
homepage = https://github.com/RustDT/Rainicorn;
license = with licenses; [ mit asl20 ];

View File

@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
sha256 = "12l3ff0s0pzhcf5jbs8wqawjk4jghhhz8j6dq1n5201yvny12jlr";
};
depsSha256 = "1nnb2lpzjf6hv1a7cw3cbkc22fb54rsp6h87wzmqi4hsy1csff7a";
cargoSha256 = "0gppki9mgx99xipapg36ydwk1bplygnz6sbyzbg46vhn10iggfwm";
meta = with stdenv.lib; {
description = "A tool for formatting Rust code according to style guidelines";

View File

@ -6,7 +6,7 @@ rustPlatform.buildRustPackage rec {
name = "rustup-${version}";
version = "1.3.0";
depsSha256 = "078hssgffgpakv735p1xg60kic151r2dvpdr9sipb63lwqr4dxfb";
cargoSha256 = "1yd7k0jpx78p5bp6iyzgbyj7pjz8vyjg9g7fmf1bl60jsbdpgv3g";
src = fetchFromGitHub {
owner = "rust-lang-nursery";

View File

@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
buildInputs = [ perl zlib openssl ]
++ stdenv.lib.optional stdenv.isDarwin curl;
depsSha256 = "1lg1jh6f9w28i94vaj62r859g6raalxmxabvw7av6sqr0hr56p05";
cargoSha256 = "0c3324b7z77kiwc6whbppfmrli254fr1nyd0vpsxvpc0av3279jg";
meta = with stdenv.lib; {
description = "Twitter command-line interface written in rust";

View File

@ -13,7 +13,7 @@ buildRustPackage rec {
sha256 = "0c2haw9qiwysyp1xj6qla8d6zpsdlygagzh86sk04c2b4ssyaca3";
};
depsSha256 = "0w2jgbrcx57js8ihzs5acp6b1niw1c7khdxrv14y3z9mmm9j55hs";
cargoSha256 = "0ydi44710as0bb442zryzx30nk4mscdw3gsahwprnsvvaril33rn";
meta = with stdenv.lib; {
description = "Modern system shell with simple (and powerful) syntax";

View File

@ -14,7 +14,7 @@ buildRustPackage rec {
sha256 = "0j27qdgyxybaixggh7k57mpm6rifimn4z2vydk463msc8b3kgywj";
};
depsSha256 = "1n57i9wkak76ram748mwq0dn32d041ajd31laqc13c76pp29agrp";
cargoSha256 = "1fcl2nnplcic729cmvall2k7wf3jdm7dspvlbxji99bn813ackig";
buildInputs = [ openssl zeromq czmq zlib ];

View File

@ -14,7 +14,7 @@ buildRustPackage rec {
sha256 = "0c7ar3pc7n59lzfy74lwz51p09s2bglc870rfr4c0vmc91jl0pj2";
};
depsSha256 = "0wzr8hk63gh3nm8f7dbzwj8pgc3cm8p8mr2q7bbgvri1a5i83sfb";
cargoSha256 = "0q3mrcvl1yyrx4a88kanjlfcx6slf7r79i0dh4w81sj6gp07sssm";
buildInputs = [ openssl zeromq czmq zlib ];

View File

@ -14,7 +14,7 @@ buildRustPackage rec {
sha256 = "16a5fkpyqkf8w20k3ircc1d0qmif7nygkzxj6mzk9609dlb0dmxq";
};
depsSha256 = "0nax7h7f5qgalgxsfidrxrv1ybl5xvrpc1k7xc1kmaf955gqmc46";
cargoSha256 = "0qwbgwxrjc0dvjbpqa59jixy5nq7lng2c1z91rw48qc91v7fa664";
buildInputs = [ openssl zeromq czmq zlib ];

View File

@ -12,7 +12,7 @@ buildRustPackage rec {
sha256 = "0qy1g4crhfgs2f5cmrsjv6qscg3r66gb8n6sxhimm9ksivhjyyjp";
};
depsSha256 = "04jlz7nzsmg86i73w75i8rmlbk635xrg8m1dfac8h17dwb29yj6a";
cargoSha256 = "0dmn9bccicxhqcj9zrsxxp0vb5ma12a1hs9brpc22n4g1qy4yzcn";
buildInputs = [ lzo zlib ];

View File

@ -6,7 +6,7 @@ buildRustPackage rec {
name = "exa-${version}";
version = "0.8.0";
depsSha256 = "0yz41prkjs5rmvdhr9k58a52l7hvwy5mfg8rcpsq4ybgf601lja2";
cargoSha256 = "08zzn3a32xfjkmpawcjppn1mr26ws3iv40cckiz8ldz4qc8y9gdh";
src = fetchFromGitHub {
owner = "ogham";

View File

@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
sha256 = "1aw4pgsmvzzqlvbxzv5jnw42nf316qfhvr50b58iqi2dxy8z8cmv";
};
depsSha256 = "17fjlmdwp8582dvv68b5h3zzvmd71yd9sw9xalyrrww46h7fd84g";
cargoSha256 = "1v9wg4dq4c7i85bkdhd79bj8gx7200z6np05wsyj2ycbv97p095j";
meta = {
description = "A simple, fast and user-friendly alternative to find";

View File

@ -13,7 +13,7 @@ buildRustPackage rec {
sha256 = "1fcrbjwnhcz71i70ppy0rcgk5crwwmbkm9nrk1kapvks33pv0az7";
};
depsSha256 = "05mj84a5k65ai492grwg03c3wq6ardhs114bv951fgysc9rs07p5";
cargoSha256 = "0kqkzjd90v19qvl3iv1vv2fi8h0z75b0yn0z5jq8w4m94fvh0p95";
# some tests require a tty, this variable turns them off for Travis CI,
# which we can also make use of

View File

@ -15,7 +15,7 @@ buildRustPackage rec {
buildInputs = [ zlib openssl ];
depsSha256 = "1v7ir56j6biximnnhyvadd98azcj3i5hc8aky0am2nf0swq0jimq";
cargoSha256 = "1m4yb7472g1n900dh3xqvdcywk3v01slj3bkk7bk7a9p5x1kyjfn";
meta = with stdenv.lib; {
description = "A utility for managing cargo dependencies from the command line";
@ -23,5 +23,6 @@ buildRustPackage rec {
license = with licenses; [ mit ];
maintainers = with maintainers; [ jb55 ];
platforms = platforms.all;
broken = true;
};
}

View File

@ -12,7 +12,7 @@ buildRustPackage rec {
rev = "v${version}";
sha256 = "1lmg65yqkwf2a5qxm3dmv8158kqhnriir062vlgar5wimf409rm5";
};
depsSha256 = "0v145fi9bfiwvsdy7hz9lw4m2f2j8sxvixfzmjwfnq4klm51c8yl";
cargoSha256 = "0cxdrzjmqq3ywdh0f5mzkcf50hbbgd3bak4398v2ls5gy5s9fcz2";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ openssl curl];

View File

@ -13,7 +13,7 @@ buildRustPackage rec {
sha256 = "1cnvwxbznmsn1gand8hhy5zadax5p67lvm46fkj1a1s89f158w3a";
};
depsSha256 = "1kx9xazhj93xa3cnys39wwr84qqjqrlsbbi5ih71vxppskdpvd6m";
cargoSha256 = "00y2vdnrg02clqin9pg57s9micrp66f6y49wq89cmykrfg3r8cwf";
preFixup = ''
mkdir -p "$out/man/man1"

View File

@ -11,9 +11,10 @@ rustPlatform.buildRustPackage rec {
sha256 = "1zbd1gx0ik2r7bavcid776j37g6rzd3f6cs94kq1qar4gyf1gqjm";
};
depsSha256 = "1gwfkh3ck8n3zcy43ch2mnc28a6y10p3srhnx9dh8gwnwbpb733c";
cargoSha256 = "074mfyanwdykg6wci2ia63wcnnyik741g8n624pac215sg4i95h7";
meta = {
broken = true;
description = "A command line program that lets you compute statistics from values from a file or standard input";
longDescription = ''
Staccato (`st` for short) is a command line program that lets you

View File

@ -13,7 +13,7 @@ buildRustPackage rec {
sha256 = "0z1z3b6nzaid510jaikkawvpmv4kjphzz84p0hppq6vcp5jy00s2";
};
depsSha256 = "13hy835871zxdnakwsr4bjm4krahlz4aqk5lh0rw78avfla89q9q";
cargoSha256 = "0pdzh2xr40dgwravh3i58g602bpszj6c8inggzgmq2kfk8ck6rgj";
meta = with stdenv.lib; {
description = "A fast CSV toolkit written in Rust";

View File

@ -14,7 +14,7 @@ buildRustPackage rec {
sha256 = "0k5vkn112bjwh4wnxryzqz79dlja64k7s105mf3yaik136hqnmqv";
};
depsSha256 = "1vxvkh1v9x6j4ggbh6sysi5i3089hrs0mjbp910a1jljiav7l8nj";
cargoSha256 = "03bqhgz8c4ipdkd3g448bcrr6d188h87vskcfcc3mqlcxg77b8q5";
nativeBuildInputs = [ pkgconfig ];

View File

@ -130,7 +130,6 @@ mapAliases (rec {
robomongo = robo3t; #added 2017-09-28
rssglx = rss-glx; #added 2015-03-25
rubygems = throw "deprecated 2016-03-02: rubygems is now bundled with ruby";
rustUnstable = rustNightly; # added 2016-11-29
rxvt_unicode_with-plugins = rxvt_unicode-with-plugins; # added 2015-04-02
samsungUnifiedLinuxDriver = samsung-unified-linux-driver; # added 2016-01-25
saneBackends = sane-backends; # added 2016-01-02

View File

@ -6175,33 +6175,9 @@ with pkgs;
inherit (darwin) apple_sdk;
};
rustRegistry = callPackage ./rust-packages.nix { };
rust = rustStable;
rustStable = callPackage ../development/compilers/rust {
inherit (llvmPackages_4) llvm;
};
rustBeta = lowPrio (recurseIntoAttrs (callPackage ../development/compilers/rust/beta.nix {}));
rustNightly = rustBeta;
# rust support in nixpkgs isn't yet well maintained enough for us to
# pretend to support nightlies in a meaningful way.
# rustNightly = lowPrio (recurseIntoAttrs (callPackage ../development/compilers/rust/nightly.nix {
# rustPlatform = recurseIntoAttrs (makeRustPlatform rustBeta);
# }));
rustNightlyBin = lowPrio (callPackage ../development/compilers/rust/nightlyBin.nix {
buildRustPackage = callPackage ../build-support/rust {
rust = rustNightlyBin;
};
});
cargo = rust.cargo;
rustc = rust.rustc;
cargo-edit = callPackage ../tools/package-management/cargo-edit { };
# For beta and nightly releases use the nixpkgs-mozilla overlay
rust = callPackage ../development/compilers/rust { };
inherit (rust) cargo rustc;
rustPlatform = recurseIntoAttrs (makeRustPlatform rust);
@ -6224,6 +6200,8 @@ with pkgs;
});
cargo-edit = callPackage ../tools/package-management/cargo-edit { };
rainicorn = callPackage ../development/tools/rust/rainicorn { };
rustfmt = callPackage ../development/tools/rust/rustfmt { };
rustracer = callPackage ../development/tools/rust/racer { };

View File

@ -1,46 +0,0 @@
# This file defines the source of Rust / cargo's crates registry
#
# buildRustPackage will automatically download dependencies from the registry
# version that we define here. If you're having problems downloading / finding
# a Rust library, try updating this to a newer commit.
{ stdenv, fetchFromGitHub, git }:
stdenv.mkDerivation {
name = "rustRegistry-2017-10-08";
src = fetchFromGitHub {
owner = "rust-lang";
repo = "crates.io-index";
rev = "78ab44cf22c2ce5d40e562ffc7df7ab10ac12b86";
sha256 = "0fa3l3px6b89ap63h40bhn2x50zf5j65jrgbb7j103j0cdayk2l0";
};
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
# For some reason, cargo doesn't like fetchgit's git repositories, not even
# if we set leaveDotGit to true, set the fetchgit branch to 'master' and clone
# the repository (tested with registry rev
# 965b634156cc5c6f10c7a458392bfd6f27436e7e), failing with the message:
#
# "Target OID for the reference doesn't exist on the repository"
#
# So we'll just have to create a new git repository from scratch with the
# contents downloaded with fetchgit...
mkdir -p $out
cp -r ./* $out/
cd $out
git="${git}/bin/git"
$git init
$git config --local user.email "example@example.com"
$git config --local user.name "example"
$git add .
$git commit --quiet -m 'Rust registry commit'
touch $out/touch . "$out/.cargo-index-lock"
'';
}