diff --git a/0001-Adjust-build-flags-to-allow-the-new-implementation-u.patch b/0001-Adjust-build-flags-to-allow-the-new-implementation-u.patch deleted file mode 100644 index b907252d1f166f0d7bcf05893dcd3c78a4a970e3..0000000000000000000000000000000000000000 --- a/0001-Adjust-build-flags-to-allow-the-new-implementation-u.patch +++ /dev/null @@ -1,26 +0,0 @@ -From cbf80996c70475088be9613778ea7cb282e3a8c3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Mon, 8 Aug 2022 17:43:46 +0200 -Subject: [PATCH] Adjust build flags to allow the new implementation using - --package-metadata - -C.f. https://src.fedoraproject.org/rpms/package-notes/pull-request/4. -This version should be compatible with both the old and new definitions -in package-notes-srpm-macros. ---- - data/macros.rust | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/data/macros.rust b/data/macros.rust -index efa46a3212..b8ea742ec0 100644 ---- a/data/macros.rust -+++ b/data/macros.rust -@@ -12,7 +12,7 @@ - -Ccodegen-units=%rustflags_codegen_units - -Clink-arg=-Wl,-z,relro - -Clink-arg=-Wl,-z,now -- %{?_package_note_file:-Clink-arg=-Wl,-dT,%{_package_note_file}} -+ %[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""] - --cap-lints=warn - } - diff --git a/0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch b/0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch new file mode 100644 index 0000000000000000000000000000000000000000..2195780dee7987ce31d400bf7766324232a5b66b --- /dev/null +++ b/0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch @@ -0,0 +1,27 @@ +From c1cb014722147a3373a7d7ebbf99781cbb335cbf Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Fri, 13 Oct 2023 00:31:15 +0200 +Subject: [PATCH] Temporarily accept cargo_prep -V flag for spec compatibiltiy + with RHEL + +--- + macros.d/macros.cargo | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/macros.d/macros.cargo b/macros.d/macros.cargo +index e99f5a6..05159d8 100644 +--- a/macros.d/macros.cargo ++++ b/macros.d/macros.cargo +@@ -54,7 +54,8 @@ + # -v - use vendored sources from instead of + # %%cargo_registry + # -N - Don't set up any registry. Only set up the build configuration. +-%cargo_prep(v:N)\ ++%cargo_prep(V:v:N)\ ++%{-V:%{?fedora:%{error:The -V flag for cargo_prep is not supported in Fedora}}}\ + %{-v:%{-N:%{error:-v and -N are mutually exclusive!}}}\ + (\ + set -euo pipefail\ +-- +2.41.0 + diff --git a/0002-Add-support-for-conditionally-building-with-frame-po.patch b/0002-Add-support-for-conditionally-building-with-frame-po.patch deleted file mode 100644 index 4d5cbb25b1de41a30cb3b52588cf58ebfc7e6975..0000000000000000000000000000000000000000 --- a/0002-Add-support-for-conditionally-building-with-frame-po.patch +++ /dev/null @@ -1,24 +0,0 @@ -From c28d5efbbf674b0abd3a000cb67363969541ab05 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Thu, 26 Jan 2023 23:22:23 +0100 -Subject: [PATCH] Add support for conditionally building with frame pointers - ---- - data/macros.rust | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/data/macros.rust b/data/macros.rust -index b8ea742..e573772 100644 ---- a/data/macros.rust -+++ b/data/macros.rust -@@ -10,6 +10,7 @@ - -Copt-level=%rustflags_opt_level - -Cdebuginfo=%rustflags_debuginfo - -Ccodegen-units=%rustflags_codegen_units -+ %{expr:0%{?_include_frame_pointers} && ("%{_arch}" != "ppc64le" && "%{_arch}" != "s390x" && "%{_arch}" != "i386") ? "-Cforce-frame-pointers=yes" : ""} - -Clink-arg=-Wl,-z,relro - -Clink-arg=-Wl,-z,now - %[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""] --- -2.39.1 - diff --git a/09a496c.patch b/09a496c.patch deleted file mode 100644 index f4872ef478de1f72213a8600e883075441f48525..0000000000000000000000000000000000000000 --- a/09a496c.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 09a496c65e5f91767336daddd0c9aa13d22160d5 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Oct 31 2022 14:26:11 +0000 -Subject: rust2rpm: fix crash in sorting of binary targets - - -The "sort" Jinja2 filter doesn't work because the bins are objects, -not strings. This commit changes the sorting to happen correctly, -before binary targets are passed to the template for rendering. - ---- - -diff --git a/rust2rpm/generator.py b/rust2rpm/generator.py -index e01c1b5..76875f7 100644 ---- a/rust2rpm/generator.py -+++ b/rust2rpm/generator.py -@@ -1,3 +1,4 @@ -+import operator - import time - - import jinja2 -@@ -52,6 +53,9 @@ def spec_file_render( - is_bin = len(bins) > 0 - is_lib = len(libs) > 0 - -+ # sort binaries by name for consistent ordering -+ bins.sort(key=operator.attrgetter("name")) -+ - kwargs = { - "generator_version": __version__, - "target": args.target, -diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec -index b39df3b..13b9bfd 100644 ---- a/rust2rpm/templates/main.spec -+++ b/rust2rpm/templates/main.spec -@@ -124,7 +124,7 @@ Requires: {{ req }} - {% for file in doc_files %} - %doc {{ file }} - {% endfor %} -- {% for bin in bins | sort %} -+ {% for bin in bins %} - %{_bindir}/{{ bin.name }} - {% endfor %} - {% if not only_main %} - diff --git a/1000-fix-pytest-error.patch b/1000-fix-pytest-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..ca334352d16292a9b622b3ffbf9793adb825e393 --- /dev/null +++ b/1000-fix-pytest-error.patch @@ -0,0 +1,55 @@ +From fa7c4747c2c374c800e3fee6c884e3a6df242228 Mon Sep 17 00:00:00 2001 +From: Chunmei Xu +Date: Fri, 12 Apr 2024 15:00:08 +0800 +Subject: [PATCH 1/1] fix pytest error + +--- + tests/test_macros_cargo.py | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/tests/test_macros_cargo.py b/tests/test_macros_cargo.py +index 5aa93d3..e24eb88 100644 +--- a/tests/test_macros_cargo.py ++++ b/tests/test_macros_cargo.py +@@ -71,9 +71,9 @@ def test_cargo_prep(evaluater): + 'strip = "none"', + "", + "[env]", +- f'CFLAGS = "{build_cflags} "', +- f'CXXFLAGS = "{build_cxxflags} "', +- f'LDFLAGS = "{build_ldflags} "', ++ f'CFLAGS = "{build_cflags}"', ++ f'CXXFLAGS = "{build_cxxflags}"', ++ f'LDFLAGS = "{build_ldflags} "', + "", + "[install]", + f'root = "{buildroot}{prefix}"', +@@ -134,9 +134,9 @@ def test_cargo_prep_vendor(evaluater): + 'strip = "none"', + "", + "[env]", +- f'CFLAGS = "{build_cflags} "', +- f'CXXFLAGS = "{build_cxxflags} "', +- f'LDFLAGS = "{build_ldflags} "', ++ f'CFLAGS = "{build_cflags}"', ++ f'CXXFLAGS = "{build_cxxflags}"', ++ f'LDFLAGS = "{build_ldflags} "', + "", + "[install]", + f'root = "{buildroot}{prefix}"', +@@ -195,9 +195,9 @@ def test_cargo_prep_no_replacement(evaluater): + 'strip = "none"', + "", + "[env]", +- f'CFLAGS = "{build_cflags} "', +- f'CXXFLAGS = "{build_cxxflags} "', +- f'LDFLAGS = "{build_ldflags} "', ++ f'CFLAGS = "{build_cflags}"', ++ f'CXXFLAGS = "{build_cxxflags}"', ++ f'LDFLAGS = "{build_ldflags} "', + "", + "[install]", + f'root = "{buildroot}{prefix}"', +-- +2.41.0 + diff --git a/1869f5a.patch b/1869f5a.patch deleted file mode 100644 index 89ce6905468d94025082b4ee43b13e532c69bc26..0000000000000000000000000000000000000000 --- a/1869f5a.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 1869f5a7e078491263d4260883832e081c207b85 Mon Sep 17 00:00:00 2001 -From: Michel Alexandre Salim -Date: Oct 31 2022 17:53:38 +0000 -Subject: Add tests for CargoSemVer.eval_ - - -There are logic errors in `KIND_GTE` and `KIND_LTE`, surface them with -the new test - -Signed-off-by: Michel Alexandre Salim - ---- - -diff --git a/rust2rpm/tests/test_version.py b/rust2rpm/tests/test_version.py -index 58648db..746d9e0 100644 ---- a/rust2rpm/tests/test_version.py -+++ b/rust2rpm/tests/test_version.py -@@ -146,6 +146,20 @@ def test_coerce(version, coerced_version): - - - @pytest.mark.parametrize( -+ "v1, op, v2, expected", -+ [ -+ (Version(0, 2, 2, None, None), CargoSemVer.KIND_GT, Version(0, 3, 5, None, None), False), -+ (Version(0, 2, 2, None, None), CargoSemVer.KIND_GTE, Version(0, 3, 5, None, None), False), -+ (Version(0, 3, 5, None, None), CargoSemVer.KIND_LT, Version(0, 2, 2, None, None), False), -+ (Version(0, 3, 5, None, None), CargoSemVer.KIND_LTE, Version(0, 2, 2, None, None), False), -+ ], -+) -+def test_eval(v1, op, v2, expected): -+ result = CargoSemVer.eval_(v1, op, v2) -+ assert result == expected -+ -+ -+@pytest.mark.parametrize( - "version, next_version", - [ - ((0, None, None, None, None), (1, 0, 0, None, None)), - diff --git a/3dec94d.patch b/3dec94d.patch deleted file mode 100644 index b5db5935b45628245251c1e2fd953a5e66de3bf6..0000000000000000000000000000000000000000 --- a/3dec94d.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 3dec94dc859b2288e3d55603b1c1e79f5290e0cd Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Nov 03 2022 20:40:20 +0000 -Subject: add more tests for version comparisons and reformat with black - - ---- - -diff --git a/rust2rpm/core/metadata.py b/rust2rpm/core/metadata.py -index 7f2bb1f..4ec0895 100644 ---- a/rust2rpm/core/metadata.py -+++ b/rust2rpm/core/metadata.py -@@ -165,10 +165,7 @@ class CargoSemVer: - or (v1.major == v2.major and v1.minor == v2.minor and v1.patch > v2.patch) - ) - elif op == CargoSemVer.KIND_GTE: -- return ( -- CargoSemVer.eval_(v1, CargoSemVer.KIND_GT, v2) -- or CargoSemVer.eval_(v1, CargoSemVer.KIND_SHORTEQ, v2) -- ) -+ return CargoSemVer.eval_(v1, CargoSemVer.KIND_GT, v2) or CargoSemVer.eval_(v1, CargoSemVer.KIND_SHORTEQ, v2) - elif op == CargoSemVer.KIND_LT: - return ( - (v1.major < v2.major) -@@ -176,10 +173,7 @@ class CargoSemVer: - or (v1.major == v2.major and v1.minor == v2.minor and v1.patch < v2.patch) - ) - elif op == CargoSemVer.KIND_LTE: -- return ( -- CargoSemVer.eval_(v1, CargoSemVer.KIND_LT, v2) -- or CargoSemVer.eval_(v1, CargoSemVer.KIND_SHORTEQ, v2) -- ) -+ return CargoSemVer.eval_(v1, CargoSemVer.KIND_LT, v2) or CargoSemVer.eval_(v1, CargoSemVer.KIND_SHORTEQ, v2) - else: - raise ValueError(f"Cannot evaluate operator: {op}") - -diff --git a/rust2rpm/tests/test_version.py b/rust2rpm/tests/test_version.py -index 746d9e0..4a338c0 100644 ---- a/rust2rpm/tests/test_version.py -+++ b/rust2rpm/tests/test_version.py -@@ -149,9 +149,13 @@ def test_coerce(version, coerced_version): - "v1, op, v2, expected", - [ - (Version(0, 2, 2, None, None), CargoSemVer.KIND_GT, Version(0, 3, 5, None, None), False), -+ (Version(0, 2, 2, None, None), CargoSemVer.KIND_LT, Version(0, 3, 5, None, None), True), - (Version(0, 2, 2, None, None), CargoSemVer.KIND_GTE, Version(0, 3, 5, None, None), False), -+ (Version(0, 2, 2, None, None), CargoSemVer.KIND_LTE, Version(0, 3, 5, None, None), True), - (Version(0, 3, 5, None, None), CargoSemVer.KIND_LT, Version(0, 2, 2, None, None), False), -+ (Version(0, 3, 5, None, None), CargoSemVer.KIND_GT, Version(0, 2, 2, None, None), True), - (Version(0, 3, 5, None, None), CargoSemVer.KIND_LTE, Version(0, 2, 2, None, None), False), -+ (Version(0, 3, 5, None, None), CargoSemVer.KIND_GTE, Version(0, 2, 2, None, None), True), - ], - ) - def test_eval(v1, op, v2, expected): - diff --git a/6a5931b.patch b/6a5931b.patch deleted file mode 100644 index 5626a1fdb16cc3d40d2b9f5a1bb284a78cfff0a0..0000000000000000000000000000000000000000 --- a/6a5931b.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 6a5931b7dd97ff556c484ccdc7354063b2ad13f5 Mon Sep 17 00:00:00 2001 -From: Michel Alexandre Salim -Date: Oct 31 2022 17:54:37 +0000 -Subject: Fix CargoSemVer.eval_ KIND_GTE and KIND_LTE comparisons - - -Just make use of KIND_GT/KIND_LT and KIND_SHORTEQ - -Signed-off-by: Michel Alexandre Salim - ---- - -diff --git a/rust2rpm/core/metadata.py b/rust2rpm/core/metadata.py -index 6d740d0..7f2bb1f 100644 ---- a/rust2rpm/core/metadata.py -+++ b/rust2rpm/core/metadata.py -@@ -166,9 +166,8 @@ class CargoSemVer: - ) - elif op == CargoSemVer.KIND_GTE: - return ( -- (v1.major >= v2.major) -- or (v1.major == v2.major and v1.minor >= v2.minor) -- or (v1.major == v2.major and v1.minor == v2.minor and v1.patch >= v2.patch) -+ CargoSemVer.eval_(v1, CargoSemVer.KIND_GT, v2) -+ or CargoSemVer.eval_(v1, CargoSemVer.KIND_SHORTEQ, v2) - ) - elif op == CargoSemVer.KIND_LT: - return ( -@@ -178,9 +177,8 @@ class CargoSemVer: - ) - elif op == CargoSemVer.KIND_LTE: - return ( -- (v1.major <= v2.major) -- or (v1.major == v2.major and v1.minor <= v2.minor) -- or (v1.major == v2.major and v1.minor == v2.minor and v1.patch <= v2.patch) -+ CargoSemVer.eval_(v1, CargoSemVer.KIND_LT, v2) -+ or CargoSemVer.eval_(v1, CargoSemVer.KIND_SHORTEQ, v2) - ) - else: - raise ValueError(f"Cannot evaluate operator: {op}") - diff --git a/b5c64f5.patch b/b5c64f5.patch deleted file mode 100644 index 45fc9ea490d4cb8caef00578069746a2cfad1329..0000000000000000000000000000000000000000 --- a/b5c64f5.patch +++ /dev/null @@ -1,48 +0,0 @@ -From b5c64f585ed4ba6b259cfb6f7ed85caaf5d9e159 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Jan 05 2023 16:49:57 +0000 -Subject: rust2rpm: update test fixtures for 2023 - - ---- - -diff --git a/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec b/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec -index ffcb40b..e6223db 100644 ---- a/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec -+++ b/rust2rpm/tests/samples/cxx-build-1.0.71.opensuse.spec -@@ -1,7 +1,7 @@ - # - # spec file for package rust-cxx-build - # --# Copyright (c) 2022 Jane Jane . -+# Copyright (c) 2024 Jane Jane . - # - # All modifications and additions to the file contributed by third parties - # remain the property of their copyright owners, unless otherwise agreed -diff --git a/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec b/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec -index a9046e6..8673887 100644 ---- a/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec -+++ b/rust2rpm/tests/samples/nix-0.24.1.opensuse.spec -@@ -1,7 +1,7 @@ - # - # spec file for package rust-nix - # --# Copyright (c) 2022 Jane Jane . -+# Copyright (c) 2024 Jane Jane . - # - # All modifications and additions to the file contributed by third parties - # remain the property of their copyright owners, unless otherwise agreed -diff --git a/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec b/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec -index e19c1c1..f64b1b7 100644 ---- a/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec -+++ b/rust2rpm/tests/samples/tokio-1.19.2.opensuse.spec -@@ -1,7 +1,7 @@ - # - # spec file for package rust-tokio - # --# Copyright (c) 2022 Jane Jane . -+# Copyright (c) 2024 Jane Jane . - # - # All modifications and additions to the file contributed by third parties - # remain the property of their copyright owners, unless otherwise agreed - diff --git a/d9aa58b.patch b/d9aa58b.patch deleted file mode 100644 index cad9ff7cb06f3576ca25e9b173f34b6b4eabb6d1..0000000000000000000000000000000000000000 --- a/d9aa58b.patch +++ /dev/null @@ -1,162 +0,0 @@ -From d9aa58b6cba7add64b575f2fcb3dd386a741ad4b Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Nov 07 2022 19:57:50 +0000 -Subject: rust2rpm: fix edge cases in cfg-expression evaluation - - -Some cfg-expressions evaluated to "False" because all target_arch -checks were evaluated as "True", but that broke in situations where -the cfg-expression checked for the *absence* of a match for a specific -target_arch. - -With this change, cfg-expressions are now evaluated once for every -supported target_arch, and they evaluate to "True" if the expression -evaluated to "True" for *any* value of target_arch. - ---- - -diff --git a/rust2rpm/__init__.py b/rust2rpm/__init__.py -index 1d8d5c3..5fd02bd 100644 ---- a/rust2rpm/__init__.py -+++ b/rust2rpm/__init__.py -@@ -1,3 +1,12 @@ - from . import licensing - - __version__ = "23" -+ -+TARGET_ARCHES = [ -+ "x86_64", -+ "x86", -+ "aarch64", -+ "arm", -+ "powerpc64", -+ "s390x", -+] -diff --git a/rust2rpm/cfg.py b/rust2rpm/cfg.py -index f167064..55e853e 100644 ---- a/rust2rpm/cfg.py -+++ b/rust2rpm/cfg.py -@@ -5,6 +5,7 @@ import pyparsing as pp - from pyparsing import ParseException - - from . import log -+from . import TARGET_ARCHES - - pp.ParserElement.enablePackrat() - -@@ -60,7 +61,7 @@ def cfg_grammar(): - - - @functools.cache --def evaluate_predicate(name: str, value: str) -> bool: -+def evaluate_predicate(name: str, value: str, target_arch: str) -> bool: - # based on: https://doc.rust-lang.org/reference/conditional-compilation.html - - match name: -@@ -68,7 +69,7 @@ def evaluate_predicate(name: str, value: str) -> bool: - # Needs to be ignored, as we cannot generate patches that are - # different depending on the host architecture - except if the - # target architecture is "wasm32", which we don't support. -- return value not in ["wasm32", "wasm64"] -+ return value == target_arch - - case "target_feature": - # The "target_feature" predicate can be ignored as well, since the -@@ -114,30 +115,32 @@ def evaluate_atom(name: str) -> bool: - return True - case "windows": - return False -+ case "miri": -+ return False - case _: - log.warn( - f"Ignoring unknown identifier {name!r} in cfg-expression. " -- + 'Only "unix" and "windows" are standard identifiers, ' -- + 'any non-standard "--cfg" flags are not supported.' -+ + 'only "unix", "windows", and "miri" are standard identifiers; ' -+ + 'any non-standard "--cfg" flags are ignored.' - ) - return False - - --def evaluate(expr, nested=False) -> bool: -+def evaluate(expr, target_arch: str, nested: bool = False) -> bool: - if hasattr(expr, "asList"): - expr = expr.asList() # compat with pyparsing 2.7.x - match expr: - case ["cfg", subexpr] if not nested: -- return evaluate(subexpr, True) -+ return evaluate(subexpr, target_arch, True) - case ["not", subexpr] if nested: -- return not evaluate(subexpr, True) -+ return not evaluate(subexpr, target_arch, True) - case ["all", *args] if nested: -- return all(evaluate(arg, True) for arg in args) -+ return all(evaluate(arg, target_arch, True) for arg in args) - case ["any", *args] if nested: -- return any(evaluate(arg, True) for arg in args) -+ return any(evaluate(arg, target_arch, True) for arg in args) - case [variable, value] if nested: - v = ast.literal_eval(value) -- return evaluate_predicate(variable, v) -+ return evaluate_predicate(variable, v, target_arch) - case [variable] if nested: - return evaluate_atom(variable) - case _: -@@ -145,5 +148,8 @@ def evaluate(expr, nested=False) -> bool: - - - def parse_and_evaluate(expr): -- parsed = cfg_grammar().parseString(expr) -- return evaluate(parsed[0]) -+ parsed = cfg_grammar().parseString(expr)[0] -+ -+ # evaluate cfg-expression for all supported target_arch values -+ # returns True if it evaluates to True for any supported architecture -+ return any(evaluate(parsed, target_arch) for target_arch in TARGET_ARCHES) -diff --git a/rust2rpm/tests/test_cfg.py b/rust2rpm/tests/test_cfg.py -index 5a2b314..6f14bbc 100644 ---- a/rust2rpm/tests/test_cfg.py -+++ b/rust2rpm/tests/test_cfg.py -@@ -26,6 +26,7 @@ def test_pyparsing_run_tests(): - ("cfg(unix)", True), - ("cfg(not(unix))", False), - ("cfg(windows)", False), -+ ("cfg(miri)", False), - ("cfg(linux)", False), # not defined - ("cfg(not(windows))", True), - ("cfg(any(unix, windows))", True), -@@ -36,6 +37,32 @@ def test_pyparsing_run_tests(): - ('cfg(all(target_os = "linux"))', True), - ('cfg(any(target_os = "linux", target_os = "macos"))', True), - ('cfg(any(target_pointer_width = "16", target_pointer_width = "32", target_pointer_width = "64"))', True), -+ # from rustix 0.35.12 -+ ('cfg(any(target_os = "android", target_os = "linux"))', True), -+ ( -+ 'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", ' -+ 'any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), ' -+ 'all(target_endian = "little", any(target_arch = "arm", ' -+ 'all(target_arch = "aarch64", target_pointer_width = "64"), ' -+ 'target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))', -+ True, -+ ), -+ ( -+ 'cfg(any(rustix_use_libc, miri, not(all(target_os = "linux", ' -+ 'any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), ' -+ 'all(target_endian = "little", any(target_arch = "arm", ' -+ 'all(target_arch = "aarch64", target_pointer_width = "64"), ' -+ 'target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))))', -+ True, -+ ), -+ ('cfg(not(target_os = "emscripten"))', True), -+ # from tokio 1.21.2 -+ ('cfg(all(any(target_arch = "wasm32", target_arch = "wasm64"), not(target_os = "wasi")))', False), -+ ("cfg(loom)", False), -+ ('cfg(not(all(any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown")))', True), -+ ('cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))', True), -+ ('cfg(target_os = "freebsd")', False), -+ ("cfg(tokio_unstable)", False), - ], - ) - def test_expressions(expr, expected): - diff --git a/rust-packaging-26.2.tar.gz b/rust-packaging-26.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..88c52607770583ce1b5124c329d8048ea6bc3ef5 Binary files /dev/null and b/rust-packaging-26.2.tar.gz differ diff --git a/rust-packaging.spec b/rust-packaging.spec index ea00b06902ea0d0bafb35ed2aea4e2f422f6b901..44ec862636118924dd48228b2debc6db5fd696fb 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -1,117 +1,87 @@ -%define anolis_release 2 +%define anolis_release 1 %bcond_without check -# https://pagure.io/koji/issue/659 -%global debug_package %{nil} Name: rust-packaging -Version: 23 +Version: 26.2 Release: %{anolis_release}%{?dist} -Summary: RPM macros for building Rust packages +Summary: RPM macros and generators for building Rust packages License: MIT -URL: https://pagure.io/fedora-rust/rust2rpm -Source: %{url}/archive/v%{version}/rust2rpm-v%{version}.tar.gz +URL: https://pagure.io/fedora-rust/rust-packaging +Source: %{url}/archive/%{version}/rust-packaging-%{version}.tar.gz -# https://pagure.io/fedora-rust/rust2rpm/pull-request/221 -Patch: 0001-Adjust-build-flags-to-allow-the-new-implementation-u.patch +Patch0: 0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch -# patches for backporting upstream bug fixes -Patch: https://pagure.io/fedora-rust/rust2rpm/c/09a496c.patch -Patch: https://pagure.io/fedora-rust/rust2rpm/c/1869f5a.patch -Patch: https://pagure.io/fedora-rust/rust2rpm/c/6a5931b.patch -Patch: https://pagure.io/fedora-rust/rust2rpm/c/3dec94d.patch -Patch: https://pagure.io/fedora-rust/rust2rpm/c/d9aa58b.patch -Patch: https://pagure.io/fedora-rust/rust2rpm/c/b5c64f5.patch +Patch1: 1000-fix-pytest-error.patch -# upstream patch to add support for building with frame pointers: -# https://pagure.io/fedora-rust/rust2rpm/c/c2176f2 -# https://pagure.io/fedora-rust/rust2rpm/c/3443c98 -Patch: 0002-Add-support-for-conditionally-building-with-frame-po.patch - -ExclusiveArch: %{rust_arches} - -BuildRequires: python3-devel +BuildArch: noarch %if %{with check} -BuildRequires: cargo +BuildRequires: python3-pytest %endif -Requires: python3-rust2rpm-core = %{EVR} -Requires: rust-srpm-macros = %{version} +%description +%{summary}. -Requires: rust -Requires: cargo >= 1.41 +%package -n rust-srpm-macros +Summary: RPM macros for building Rust projects -# gawk is needed for stripping dev-deps in macro -Requires: gawk +%description -n rust-srpm-macros +RPM macros for building source packages for Rust projects. -%description -The package provides RPM macros for building Rust projects. +%package -n cargo-rpm-macros +Summary: RPM macros for building projects with cargo -Note that rust-srpm-macros is a seperate arch-independent package that -is also required to build Rust packages. +Obsoletes: rust-packaging < 24 +Provides: rust-packaging = %{version}-%{release} -%package -n python3-rust2rpm -Summary: Generate RPM spec files for Rust packages -Requires: cargo -Requires: python3-rust2rpm-core = %{EVR} -Provides: rust2rpm = %{version}-%{release} - -%description -n python3-rust2rpm -rust2rpm is a tool that automates the generation of RPM spec files for -Rust crates. +Requires: cargo2rpm >= 0.1.8 -%package -n python3-rust2rpm-core -Summary: Generate RPM spec files for Rust packages (core functionality) Requires: cargo -Provides: cargo-inspector = %{version}-%{release} +Requires: gawk +Requires: grep -%description -n python3-rust2rpm-core -rust2rpm is a tool that automates the generation of RPM spec files for -Rust crates. +Requires: rust-srpm-macros = %{version}-%{release} -This package contains the core functionality which doesn't depend on -any third-party python packages. +%description -n cargo-rpm-macros +RPM macros for building projects with cargo. %prep -%autosetup -n rust2rpm-v%{version} -p1 - -%generate_buildrequires -%pyproject_buildrequires -t +%autosetup -p1 %build -%pyproject_wheel +# nothing to do %install -%pyproject_install - -install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo -install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr +install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.cargo +install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust +install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust-srpm +install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo.attr +install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo_vendor.attr %if %{with check} %check -%tox +export MACRO_DIR=%{buildroot}%{_rpmmacrodir} +pytest -vv %endif -%files +%files -n rust-srpm-macros +%license LICENSE %{_rpmmacrodir}/macros.rust -%{_rpmmacrodir}/macros.cargo -%{_fileattrsdir}/cargo.attr - -%files -n python3-rust2rpm -%{_bindir}/rust2rpm -%{python3_sitelib}/rust2rpm-*.dist-info/ -%{python3_sitelib}/rust2rpm/ -%exclude %{python3_sitelib}/rust2rpm/core/ +%{_rpmmacrodir}/macros.rust-srpm -%files -n python3-rust2rpm-core +%files -n cargo-rpm-macros %license LICENSE -%doc README.md NEWS -%{_bindir}/cargo-inspector -%{python3_sitelib}/rust2rpm/core/ +%{_rpmmacrodir}/macros.cargo +%{_rpmmacrodir}/macros.rust +%{_fileattrsdir}/cargo.attr +%{_fileattrsdir}/cargo_vendor.attr %changelog +* Fri Apr 12 2024 mgb01105731 - 26.2-1 +- Update to version 26.2 + * Wed Mar 13 2024 Zhao Hang - 1:23-2 - Rebuild with python3.11 - update Copyright date diff --git a/rust2rpm-v23.tar.gz b/rust2rpm-v23.tar.gz deleted file mode 100644 index 4f267ba6f65fdbde58f6811eaa23b17ccc521d87..0000000000000000000000000000000000000000 Binary files a/rust2rpm-v23.tar.gz and /dev/null differ