From 09a434b55a68692d234ec5215dcbcc9c35c1d01e Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 8 Jan 2018 19:09:54 +0100 Subject: [PATCH] make 'rlib' first-class citizen Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/47 Signed-off-by: Igor Gnatenko --- data/macros.cargo | 2 +- rust2rpm/__main__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/macros.cargo b/data/macros.cargo index c951418..ebf3edb 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -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 (\ diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index fba33b3..1cc6933 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -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: