From f89e4b4d98733ee042ccc889f9f31606991cf094 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 8 Jun 2019 23:08:45 +0200 Subject: [PATCH] Regenerate patches Signed-off-by: Igor Gnatenko --- 0013-Implement-__cargo_skip_build.patch | 61 ++++++++++--------- ...dArch-noarch-with-__cargo_skip_build.patch | 6 +- rust-packaging.spec | 5 +- 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/0013-Implement-__cargo_skip_build.patch b/0013-Implement-__cargo_skip_build.patch index b4942f3..02df663 100644 --- a/0013-Implement-__cargo_skip_build.patch +++ b/0013-Implement-__cargo_skip_build.patch @@ -1,4 +1,4 @@ -From 7b06496a5c1ded5e3cf59d6af0e757974c6ff704 Mon Sep 17 00:00:00 2001 +From 37cf4d78df2f3805f1f230252e1c0030a2f08877 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 8 Jun 2019 19:35:38 +0200 Subject: [PATCH 13/14] Implement %__cargo_skip_build @@ -8,37 +8,16 @@ module builds. Signed-off-by: Igor Gnatenko --- - data/macros.cargo | 80 ++++++++++++++++++++++++------------ - rust2rpm/templates/main.spec | 34 ++++++++------- - 2 files changed, 72 insertions(+), 42 deletions(-) + data/macros.cargo | 65 +++++++++++++++++++++--------------- + data/macros.rust-srpm | 16 +++++++++ + rust2rpm/templates/main.spec | 34 ++++++++++--------- + 3 files changed, 73 insertions(+), 42 deletions(-) diff --git a/data/macros.cargo b/data/macros.cargo -index a60289a..961732d 100644 +index a60289a..1182850 100644 --- a/data/macros.cargo +++ b/data/macros.cargo -@@ -10,6 +10,21 @@ - - %cargo_registry %{_datadir}/cargo/registry - -+# If crate not in _build_crates and _module_build is set, we should skip the build -+%__cargo_skip_build %{lua: -+local crate = rpm.expand('%{crate}') -+local build_crate = false -+for w in rpm.expand('%{?_build_crates}'):gmatch('%S+') do -+ if w == crate then -+ build_crate = true -+ break -+ end -+end -+if (rpm.expand('%{defined _module_build}') ~= '0' and not build_crate) then -+ print(1) -+else -+ print(0) -+end} - %__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 - -@@ -49,27 +64,35 @@ EOF\ +@@ -49,27 +49,35 @@ EOF\ } %cargo_generate_buildrequires(af:) \ @@ -92,7 +71,7 @@ index a60289a..961732d 100644 %cargo_install(t:naf:) (\ set -eu \ -@@ -88,15 +111,18 @@ if %__cargo_is_lib; then \ +@@ -88,15 +96,18 @@ if %__cargo_is_lib; then \ %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps} \ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ fi \ @@ -120,6 +99,30 @@ index a60289a..961732d 100644 ) %__cargo_feature_from_name(n:) %{lua: +diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm +index 872b87f..88d5a0f 100644 +--- a/data/macros.rust-srpm ++++ b/data/macros.rust-srpm +@@ -37,3 +37,19 @@ + \ + print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate') + } ++ ++# If crate not in _build_crates and _module_build is set, we should skip the build ++%__cargo_skip_build %{lua: ++local crate = rpm.expand('%{crate}') ++local build_crate = false ++for w in rpm.expand('%{?_build_crates}'):gmatch('%S+') do ++ if w == crate then ++ build_crate = true ++ break ++ end ++end ++if (rpm.expand('%{defined _module_build}') ~= '0' and not build_crate) then ++ print(1) ++else ++ print(0) ++end} diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec index 660bb60..69d23d7 100644 --- a/rust2rpm/templates/main.spec diff --git a/0014-Set-BuildArch-noarch-with-__cargo_skip_build.patch b/0014-Set-BuildArch-noarch-with-__cargo_skip_build.patch index 63a2895..8094aad 100644 --- a/0014-Set-BuildArch-noarch-with-__cargo_skip_build.patch +++ b/0014-Set-BuildArch-noarch-with-__cargo_skip_build.patch @@ -1,4 +1,4 @@ -From b345d23e7a11357d828751e4db47a0685cfe207b Mon Sep 17 00:00:00 2001 +From cbd5313fb9d5ca1aa59ffa3dffaa8d1ad9e68d69 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 8 Jun 2019 20:01:12 +0200 Subject: [PATCH 14/14] Set BuildArch: noarch with %__cargo_skip_build @@ -12,14 +12,14 @@ Signed-off-by: Igor Gnatenko 1 file changed, 3 insertions(+) diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec -index 69d23d7..b4734b7 100644 +index 69d23d7..a3e3c2e 100644 --- a/rust2rpm/templates/main.spec +++ b/rust2rpm/templates/main.spec @@ -39,6 +39,9 @@ Patch0: {{ patch_file }} {% endif %} ExclusiveArch: %{rust_arches} -+%if ! %{__cargo_skip_build} ++%if %{__cargo_skip_build} +BuildArch: noarch +%endif diff --git a/rust-packaging.spec b/rust-packaging.spec index 1dd8d19..0357a8e 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 9 -Release: 2%{?dist} +Release: 3%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -85,6 +85,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sat Jun 08 2019 Igor Gnatenko - 9-3 +- Update patches + * Sat Jun 08 2019 Igor Gnatenko - 9-2 - Backport patches from upstream