From ce49256f42237861e41a635b8954621232b3ab87 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sep 17 2023 20:15:16 +0000 Subject: %cargo_generate_buildrequires: add a -t flag This commit adds a `-t` flag to `%cargo_generate_buildrequires` to install dev-dependencies regardless of whether the `check` bcond is set. Fixes: https://pagure.io/fedora-rust/rust-packaging/issue/8 --- diff --git a/macros.d/macros.cargo b/macros.d/macros.cargo index 3d03e2e..188fe0c 100644 --- a/macros.d/macros.cargo +++ b/macros.d/macros.cargo @@ -91,15 +91,12 @@ EOF\ } # cargo_generate_buildrequires: prints BuildRequires that are needed for -# building the crate with the specified feature flags, and with or without -# dependencies that are needed for compiling and running tests, depending -# on the "check" bcond -%cargo_generate_buildrequires(naf:) \ -%if %{with check} \ -%{__cargo_to_rpm} --path Cargo.toml buildrequires %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} --with-check \ -%else \ -%{__cargo_to_rpm} --path Cargo.toml buildrequires %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ -%endif +# building the crate with the specified feature flags. +# If the "check" bcond is set or if `-t` is passed, +# dependencies that are needed for compiling and running tests +# (dev-dependencies) will also be installed. +%cargo_generate_buildrequires(naf:t) \ +%{__cargo_to_rpm} --path Cargo.toml buildrequires %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} %{-t:--with-check} %{!?-t:%{?with_check:--with-check}} # cargo_build: builds the crate with cargo with the specified feature flags %cargo_build(naf:) \