add support for proc-macro kind

Closes: https://pagure.io/fedora-rust/rust2rpm/issue/19
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2017-02-18 19:53:08 +01:00
parent d4334a2ee7
commit e834debc6a
2 changed files with 3 additions and 3 deletions

View file

@ -4,8 +4,8 @@
%cargo_registry %{_usrsrc}/rust %cargo_registry %{_usrsrc}/rust
%__cargo_is_lib() %{expand:%__cargo_inspector --target-kinds Cargo.toml | grep -q -F lib} %__cargo_is_lib() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F "$(printf 'lib\\\nproc-macro')"
%__cargo_is_bin() %{expand:%__cargo_inspector --target-kinds Cargo.toml | grep -q -F bin} %__cargo_is_bin() %__cargo_inspector --target-kinds Cargo.toml | grep -q -F bin
%cargo_prep (\ %cargo_prep (\
set -eu \ set -eu \

View file

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