Skip to content

Commit

Permalink
marcos.cargo: add path parameter in cargo_install (#3)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
aplanas authored Jan 18, 2023
1 parent 9701922 commit c429b77
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions macros.cargo
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
%* \
}

%cargo_install() \
%cargo_install(p:) \
%{shrink:\
unset LIBSSH2_SYS_USE_PKG_CONFIG && \
if [[ -z $RUSTC_WRAPPER ]]; then CARGO_AUDITABLE="auditable" ; fi && \
Expand All @@ -36,7 +36,6 @@
--offline \
--no-track \
--root=%{buildroot}%{_prefix} \
--path . \
--path %{-p:%{-p*}}%{!-p:.} \
%* \
}

0 comments on commit c429b77

Please sign in to comment.