Drop __cargo_skip_build logic

It looks like this logic was only used for module builds, which is not
how Rust packages have been built for a few Fedora releases now.

Fixes #142.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-11-22 13:38:20 +01:00 committed by zbyszek
parent ea59cb27d1
commit 1482f79e28
2 changed files with 30 additions and 48 deletions

View file

@ -49,26 +49,21 @@ EOF\
} }
%cargo_generate_buildrequires(af:) \ %cargo_generate_buildrequires(af:) \
%if ! 0%{?__cargo_skip_build} \
%{__cargo_inspector} -BR %{__cargo_parse_opts %{-a} %{-f:-f%{-f*}}} Cargo.toml \ %{__cargo_inspector} -BR %{__cargo_parse_opts %{-a} %{-f:-f%{-f*}}} Cargo.toml \
%if %{with check} \ %if %{with check} \
%{__cargo_inspector} -TR Cargo.toml \ %{__cargo_inspector} -TR Cargo.toml \
%endif \
%endif %endif
%cargo_build(naf:) \ %cargo_build(naf:) \
%if ! 0%{?__cargo_skip_build} \
%{shrink:\ %{shrink:\
%{__cargo} build \ %{__cargo} build \
%{__cargo_common_opts} \ %{__cargo_common_opts} \
--release \ --release \
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
%* \ %* \
} \ }
%endif
%cargo_test(naf:) \ %cargo_test(naf:) \
%if ! 0%{?__cargo_skip_build} \
%{shrink:\ %{shrink:\
%{__cargo} test \ %{__cargo} test \
%{__cargo_common_opts} \ %{__cargo_common_opts} \
@ -76,8 +71,7 @@ EOF\
--no-fail-fast \ --no-fail-fast \
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
%* \ %* \
} \ }
%endif
%cargo_install(t:naf:) ( \ %cargo_install(t:naf:) ( \
set -eu \ set -eu \
@ -96,7 +90,6 @@ if %__cargo_is_lib; then \
%{__rm} -f $REG_DIR/Cargo.toml.deps \ %{__rm} -f $REG_DIR/Cargo.toml.deps \
echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
fi \ fi \
%if ! %__cargo_skip_build \
if %__cargo_is_bin; then \ if %__cargo_is_bin; then \
%{shrink: \ %{shrink: \
%{__cargo} install \ %{__cargo} install \
@ -107,7 +100,6 @@ fi \
%* \ %* \
} \ } \
fi \ fi \
%endif \
) )
%__cargo_feature_from_name(n:) %{lua: %__cargo_feature_from_name(n:) %{lua:

View file

@ -6,7 +6,6 @@
%global debug_package %{nil} %global debug_package %{nil}
{% elif not include_devel %} {% elif not include_devel %}
{% set only_main = True %} {% set only_main = True %}
%global __cargo_skip_build 0
{% endif %} {% endif %}
%global crate {{ md.name }} %global crate {{ md.name }}
@ -43,11 +42,6 @@ Patch0: {{ patch_file }}
{% endif %} {% endif %}
ExclusiveArch: %{rust_arches} ExclusiveArch: %{rust_arches}
{% if not only_main %}
%if %{__cargo_skip_build}
BuildArch: noarch
%endif
{% endif %}
BuildRequires: rust-packaging BuildRequires: rust-packaging
{% if all_features %} {% if all_features %}
@ -62,7 +56,6 @@ BuildRequires: rust-packaging
{% set testrequires = normalize_deps(md.dev_dependencies)|sort %} {% set testrequires = normalize_deps(md.dev_dependencies)|sort %}
{% set has_buildrequires = (buildrequires + testrequires)|length > 0 %} {% set has_buildrequires = (buildrequires + testrequires)|length > 0 %}
{% if has_buildrequires and not only_main %} {% if has_buildrequires and not only_main %}
%if ! %{__cargo_skip_build}
{% endif %} {% endif %}
{% for req in buildrequires %} {% for req in buildrequires %}
BuildRequires: {{ req }} BuildRequires: {{ req }}
@ -78,7 +71,6 @@ BuildRequires: {{ req }}
BuildRequires: {{ req }} BuildRequires: {{ req }}
{% endfor %} {% endfor %}
{% if has_buildrequires and not only_main %} {% if has_buildrequires and not only_main %}
%endif
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -94,7 +86,6 @@ BuildRequires: {{ req }}
{% if include_main %} {% if include_main %}
{% if not only_main %} {% if not only_main %}
%if ! %{__cargo_skip_build}
{% endif %} {% endif %}
%package -n %{crate} %package -n %{crate}
Summary: %{summary} Summary: %{summary}
@ -118,7 +109,6 @@ Requires: {{ req }}
%{_bindir}/{{ bin.name }} %{_bindir}/{{ bin.name }}
{% endfor %} {% endfor %}
{% if not only_main %} {% if not only_main %}
%endif
{% endif %} {% endif %}
{% endif -%} {% endif -%}