nixpkgs/pkgs/build-support/rust
Daniël de Kok 85c6d72011 buildRustCrate: add support for renaming crates
Before this change, buildRustCrate always called rustc with

--extern libName=[...]libName[...]

However, Cargo permits using a different name under which a dependency
is known to a crate. For example, rand 0.7.0 uses:

[dependencies]
getrandom_package = { version = "0.1.1", package = "getrandom", optional = true }

Which introduces the getrandom dependency such that it is known as
getrandom_package to the rand crate. In this case, the correct extern
flag is of the form

--extern getrandom_package=[...]getrandom[...]

which is currently not supported. In order to support such cases, this
change introduces a crateRenames argument to buildRustCrate. This
argument is an attribute set of dependencies that should be renamed. In
this case, crateRenames would be:

{
  "getrandom" = "getrandom_package";
}

The extern options are then built such that if the libName occurs as
an attribute in this set, it value will be used as the local
name. Otherwise libName will be used as before.
2019-09-08 19:17:52 +02:00
..
build-rust-crate buildRustCrate: add support for renaming crates 2019-09-08 19:17:52 +02:00
cargo-vendor cargo-vendor: 0.1.13 -> 0.1.23 2019-04-21 12:11:54 +02:00
patch-registry-deps buildRustPackage: don't hardcode /nix/store, use $NIX_STORE 2016-01-12 13:45:11 -05:00
cargo-vendor-normalise.py fetchcargo: add type checking to cargo-vendor-normalise.py 2018-09-11 23:44:14 +02:00
carnix.nix Carnix: 0.9 -> 0.10 2019-03-26 18:54:28 +00:00
crates-io.nix cargo-vendor: 0.1.13 -> 0.1.23 2019-04-21 12:11:54 +02:00
default-crate-overrides.nix gdk-pixbuf: rename from gdk_pixbuf 2019-07-22 18:50:57 -04:00
default.nix Merge master into staging-next 2019-08-17 09:30:16 +02:00
fetchcargo-default-config.toml fectchcargo: don't break old sha256 2018-09-11 23:44:14 +02:00
fetchcargo.nix treewide: use dontUnpack 2019-07-01 04:23:51 -04:00
fetchcrate.nix add fetchCrate function to fetch rust crates 2017-12-12 04:58:45 -06:00