Created attachment 637186 [details, diff] patch that allows selecting crate features Currently, there's no easy way to override the crate features. You either have to edit the Cargo.toml, or override all of cargo_src_compile, cargo_src_install and cargo_src_test. This patch adds a simple function called cargo_feature and provides cargo_src_configure to enable the selected features. An example use would be: src_configure() { use alsa && cargo_feature "alsa_backend" use pulseaudio && cargo_feature "pulseaudio_backend" use portaudio && cargo_feature "portaudio_backend" use dbus && cargo_feature "dbus_keyring" && cargo_feature "dbus_mpris" cargo_src_configure } Right now, cargo_feature does not check wether the feature is actually listed in the Cargo.toml, that could probably be improved. You can see this modification in use in my overlay at https://github.com/Jannik2099/jannik-hideout , the above example is taken from media-sound/spotifyd. Note that the eclass in there has another modification not related to this patch.
Thanks for the patch. There are plans do add similar functionality to cargo.eclass, a bit differently though. Work is in progress and I'll commit as soon as it's ready.
alternative implementation posted for review https://archives.gentoo.org/gentoo-dev/message/9c97d515d9b28cd026a9dad2ceafcc27
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be8bafc57aff94f0f708726805bccd44ddcd30a8 commit be8bafc57aff94f0f708726805bccd44ddcd30a8 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-06-13 00:56:33 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-09-23 05:58:47 +0000 eclass/cargo.eclass: add cargo_src_configure (revised) simple src_configure implementation inspired by cmake.eclass plus some nice improvements to eclass. Closes: https://bugs.gentoo.org/721936 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> eclass/cargo.eclass | 103 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 87 insertions(+), 16 deletions(-)