Skip to content

Commit a22ef00

Browse files
committed
marcos.cargo: add path parameter in cargo_install
The `%{cargo_install}` macro is expanded adding a `--path .` paramenter at the end. With virtual workspaces we need to specify a different `path` per binary crate, but this cannot be done if there is already one `path` parameter. This patch adds a path parameter (-p) in the cargo_install macro, that if it is not present will default to the current "--path ." one. Now an user can specify a different path parameter: %{cargo_install -p binary-crate} --no-default-features Related with: rust-lang/cargo#7599 Signed-off-by: Alberto Planas <[email protected]>
1 parent 9701922 commit a22ef00

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

macros.cargo

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
%* \
2828
}
2929

30-
%cargo_install() \
30+
%cargo_install(p:) \
3131
%{shrink:\
3232
unset LIBSSH2_SYS_USE_PKG_CONFIG && \
3333
if [[ -z $RUSTC_WRAPPER ]]; then CARGO_AUDITABLE="auditable" ; fi && \
@@ -36,7 +36,6 @@
3636
--offline \
3737
--no-track \
3838
--root=%{buildroot}%{_prefix} \
39-
--path . \
39+
--path %{-p:%{-p*}}%{!-p:.} \
4040
%* \
4141
}
42-

0 commit comments

Comments
 (0)