3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs
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
..
applications Merge pull request #68134 from avdv/wtf-add-infocmp 2019-09-05 21:08:26 -05:00
build-support buildRustCrate: add support for renaming crates 2019-09-08 19:17:52 +02:00
common-updater
data Merge branch 'gtk-no-plus' 2019-09-06 02:57:51 +02:00
desktops tree-wide: s/GTK+/GTK/g 2019-09-06 02:54:53 +02:00
development Merge branch 'gtk-no-plus' 2019-09-06 02:57:51 +02:00
games
misc tree-wide: s/GTK+/GTK/g 2019-09-06 02:54:53 +02:00
os-specific Merge pull request #68042 from dtzWill/update/v4l-utils-1.16.7 2019-09-05 09:00:18 +02:00
servers Merge pull request #68131 from 1000101/process-exporter 2019-09-05 21:09:33 +02:00
shells
stdenv
test
tools Merge pull request #68138 from johanot/ceph-14.2.3 2019-09-06 07:31:45 +02:00
top-level Merge branch 'gtk-no-plus' 2019-09-06 02:57:51 +02:00