make 'rlib' first-class citizen

Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/47
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-01-08 19:09:54 +01:00
parent 4b31b3e594
commit 09a434b55a
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@
%cargo_registry %{_datadir}/cargo/registry
%__cargo_is_lib() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F -x "$(printf 'lib\\\nproc-macro')"
%__cargo_is_lib() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F -x "$(printf 'lib\\\nrlib\\\nproc-macro')"
%__cargo_is_bin() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F -x bin
%cargo_prep (\

View file

@ -261,7 +261,7 @@ def main():
kwargs = {}
bins = [tgt for tgt in metadata.targets if tgt.kind == "bin"]
libs = [tgt for tgt in metadata.targets if tgt.kind in ("lib", "proc-macro")]
libs = [tgt for tgt in metadata.targets if tgt.kind in ("lib", "rlib", "proc-macro")]
is_bin = len(bins) > 0
is_lib = len(libs) > 0
if is_bin: