cargo.eclass should have a unified way of handling path dependencies [1]. To build rdedup, I have this hack, but it depends on the inner workings of cargo.eclass, and is fragile. rdedup/Cargo.toml ... [dependencies] rdedup-lib = { version = "1.0.2", path = "lib" } ... rdedup-1.0.2.ebuild: CRATES="... rdedup-lib-1.0.2 ..." src_prepare() { ln -sf "${WORKDIR}/cargo_home/gentoo/rdedup-lib-${PV}" "${S}/lib" } At the very least, it would be good to have a manual helper eg: usage: cargo_path_dep $CRATE_SPEC $PATHSPEC example: cargo_path_dep rdedup-lib-${PV} "${S}/lib" Better would be scanning the main Cargo.toml and applying it automatically. [1] http://doc.crates.io/specifying-dependencies.html#specifying-path-dependencies
We should handle in the same way also git deps/patches in the cargo eclass and specially how to generate them with cargo-ebuild. I'm looking to some solutions. - Have a CRATES_GIT and a CRATES_PATH generated by cargo-ebuild and handle them with - Encode CRATES with a descriptor (es git+path+$MYPATH+branch=patch)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49a81668b60c1d54885e62b000595141ee6ff333 commit 49a81668b60c1d54885e62b000595141ee6ff333 Author: Patrick McLean <chutzpah@gentoo.org> AuthorDate: 2023-01-26 23:20:13 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2023-02-08 20:08:12 +0000 cargo.eclass: Add support for GIT_CRATES This adds support for an associative array called GIT_CRATES containing any crates that must be fetched from git rather than just cargo crates. This will add the code to the cargo config to make sure that the locations are overridden so cargo won't try to fetch the crates from git. Currently it automatically handle GitHub and GitLab URIs, and will accept arbitrary URIs. Bug: https://bugs.gentoo.org/608396 Issue: https://github.com/gentoo/cargo-ebuild/issues/33 Closes: https://github.com/gentoo/gentoo/pull/29289 Tested-By: Georgy Yakovlev <gyakovlev@gentoo.org> Signed-off-by: Patrick McLean <chutzpah@gentoo.org> Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> eclass/cargo.eclass | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+)