1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 06:01:15 +00:00
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
cargo-vendor-normalise.py
carnix.nix
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
fetchcargo.nix treewide: use dontUnpack 2019-07-01 04:23:51 -04:00
fetchcrate.nix