generator: fix adding Requires defined in config to feature subpackages

This commit is contained in:
Fabio Valentini 2023-10-06 22:18:15 +02:00
parent 9b52109a44
commit ec8dcf58d0
No known key found for this signature in database
GPG key ID: 5AC5F572E5D410AF
5 changed files with 38 additions and 1 deletions

View file

@ -185,6 +185,7 @@ def spec_render_crate(
conf_key = f"lib+{feature}"
if requires_features := tomlconf.requires_features:
conf_lib_requires[conf_key] = requires_features.get(feature) or list()
else:
conf_lib_requires[conf_key] = list()
if features_hide := tomlconf.features_hide:

View file

@ -70,6 +70,7 @@ use the "dox" feature of the "%{crate}" crate.
%package -n %{name}+v2_58-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.58
%description -n %{name}+v2_58-devel %{_description}
@ -82,6 +83,7 @@ use the "v2_58" feature of the "%{crate}" crate.
%package -n %{name}+v2_60-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.60
%description -n %{name}+v2_60-devel %{_description}
@ -94,6 +96,7 @@ use the "v2_60" feature of the "%{crate}" crate.
%package -n %{name}+v2_62-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.62
%description -n %{name}+v2_62-devel %{_description}
@ -106,6 +109,7 @@ use the "v2_62" feature of the "%{crate}" crate.
%package -n %{name}+v2_64-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.64
%description -n %{name}+v2_64-devel %{_description}
@ -118,6 +122,7 @@ use the "v2_64" feature of the "%{crate}" crate.
%package -n %{name}+v2_66-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.66
%description -n %{name}+v2_66-devel %{_description}
@ -130,6 +135,7 @@ use the "v2_66" feature of the "%{crate}" crate.
%package -n %{name}+v2_68-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.68
%description -n %{name}+v2_68-devel %{_description}
@ -142,6 +148,7 @@ use the "v2_68" feature of the "%{crate}" crate.
%package -n %{name}+v2_70-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.70
%description -n %{name}+v2_70-devel %{_description}
@ -154,6 +161,7 @@ use the "v2_70" feature of the "%{crate}" crate.
%package -n %{name}+v2_72-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.72
%description -n %{name}+v2_72-devel %{_description}
@ -166,6 +174,7 @@ use the "v2_72" feature of the "%{crate}" crate.
%package -n %{name}+v2_74-devel
Summary: %{summary}
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.74
%description -n %{name}+v2_74-devel %{_description}

View file

@ -85,6 +85,7 @@ use the "dox" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.58
%description -n %{name}+v2_58-devel %{_description}
@ -98,6 +99,7 @@ use the "v2_58" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.60
%description -n %{name}+v2_60-devel %{_description}
@ -111,6 +113,7 @@ use the "v2_60" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.62
%description -n %{name}+v2_62-devel %{_description}
@ -124,6 +127,7 @@ use the "v2_62" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.64
%description -n %{name}+v2_64-devel %{_description}
@ -137,6 +141,7 @@ use the "v2_64" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.66
%description -n %{name}+v2_66-devel %{_description}
@ -150,6 +155,7 @@ use the "v2_66" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.68
%description -n %{name}+v2_68-devel %{_description}
@ -163,6 +169,7 @@ use the "v2_68" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.70
%description -n %{name}+v2_70-devel %{_description}
@ -176,6 +183,7 @@ use the "v2_70" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.72
%description -n %{name}+v2_72-devel %{_description}
@ -189,6 +197,7 @@ use the "v2_72" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.74
%description -n %{name}+v2_74-devel %{_description}

View file

@ -102,6 +102,7 @@ use the "dox" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.58
%description -n %{name}+v2_58-devel %{_description}
@ -115,6 +116,7 @@ use the "v2_58" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.60
%description -n %{name}+v2_60-devel %{_description}
@ -128,6 +130,7 @@ use the "v2_60" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.62
%description -n %{name}+v2_62-devel %{_description}
@ -141,6 +144,7 @@ use the "v2_62" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.64
%description -n %{name}+v2_64-devel %{_description}
@ -154,6 +158,7 @@ use the "v2_64" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.66
%description -n %{name}+v2_66-devel %{_description}
@ -167,6 +172,7 @@ use the "v2_66" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.68
%description -n %{name}+v2_68-devel %{_description}
@ -180,6 +186,7 @@ use the "v2_68" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.70
%description -n %{name}+v2_70-devel %{_description}
@ -193,6 +200,7 @@ use the "v2_70" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.72
%description -n %{name}+v2_72-devel %{_description}
@ -206,6 +214,7 @@ use the "v2_72" feature of the "%{crate}" crate.
Summary: %{summary}
Group: Development/Libraries/Rust
BuildArch: noarch
Requires: pkgconfig(glib-2.0) >= 2.74
%description -n %{name}+v2_74-devel %{_description}

View file

@ -94,6 +94,7 @@ BuildArch: noarch
Provides: crate(glib-sys/v2_58) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.58
%description -n %{name}+v2_58-devel %{_description}
@ -110,6 +111,7 @@ Provides: crate(glib-sys/v2_60) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_58) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.60
%description -n %{name}+v2_60-devel %{_description}
@ -126,6 +128,7 @@ Provides: crate(glib-sys/v2_62) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_60) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.62
%description -n %{name}+v2_62-devel %{_description}
@ -142,6 +145,7 @@ Provides: crate(glib-sys/v2_64) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_62) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.64
%description -n %{name}+v2_64-devel %{_description}
@ -158,6 +162,7 @@ Provides: crate(glib-sys/v2_66) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_64) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.66
%description -n %{name}+v2_66-devel %{_description}
@ -174,6 +179,7 @@ Provides: crate(glib-sys/v2_68) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_66) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.68
%description -n %{name}+v2_68-devel %{_description}
@ -190,6 +196,7 @@ Provides: crate(glib-sys/v2_70) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_68) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.70
%description -n %{name}+v2_70-devel %{_description}
@ -206,6 +213,7 @@ Provides: crate(glib-sys/v2_72) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_70) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.72
%description -n %{name}+v2_72-devel %{_description}
@ -222,6 +230,7 @@ Provides: crate(glib-sys/v2_74) = 0.17.2
Requires: cargo
Requires: crate(glib-sys) = 0.17.2
Requires: crate(glib-sys/v2_72) = 0.17.2
Requires: pkgconfig(glib-2.0) >= 2.74
%description -n %{name}+v2_74-devel %{_description}