From 1067282e4da35e2e71622622f0eb4015a58f1c84 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Wed, 7 Aug 2024 02:10:03 +0000 Subject: [PATCH] add loongarch64 support for rust-packaging --- ...ongarch64-support-for-rust-packaging.patch | 39 +++++++++++++++++++ rust-packaging.spec | 6 ++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0001-add-loongarch64-support-for-rust-packaging.patch diff --git a/0001-add-loongarch64-support-for-rust-packaging.patch b/0001-add-loongarch64-support-for-rust-packaging.patch new file mode 100644 index 0000000..dd703b8 --- /dev/null +++ b/0001-add-loongarch64-support-for-rust-packaging.patch @@ -0,0 +1,39 @@ +From 01b9b64aa9613db62f9a66c33c6a518b6d5aad70 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Wed, 7 Aug 2024 02:07:50 +0000 +Subject: [PATCH] add loongarch64 support for rust-packaging + +--- + macros.d/macros.rust-srpm | 2 +- + tests/test_macros_rust_srpm.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/macros.d/macros.rust-srpm b/macros.d/macros.rust-srpm +index 45287a8..f3acc8c 100644 +--- a/macros.d/macros.rust-srpm ++++ b/macros.d/macros.rust-srpm +@@ -4,7 +4,7 @@ + # this list will probably always be a superset of all architectures that are + # supported by Fedora, which is why it is no longer required to set + # "ExclusiveArch: rust_arches" for Rust packages in Fedora. +-%rust_arches x86_64 %{ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x ++%rust_arches x86_64 %{ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x loongarch64 + + # version_no_tilde: lua macro for reconstructing the original crate version + # from the RPM version (i.e. replace any "~" characters with "-") +diff --git a/tests/test_macros_rust_srpm.py b/tests/test_macros_rust_srpm.py +index 0f188a9..14cdb33 100644 +--- a/tests/test_macros_rust_srpm.py ++++ b/tests/test_macros_rust_srpm.py +@@ -3,7 +3,7 @@ import pytest + + def test_rust_arches(evaluater): + ix86 = evaluater("%ix86")[0] +- assert evaluater("%rust_arches")[0] == f"x86_64 {ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x" ++ assert evaluater("%rust_arches")[0] == f"x86_64 {ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x loongarch64" + + + @pytest.mark.parametrize( +-- +2.41.0 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 44ec862..47436b9 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 %bcond_without check @@ -14,6 +14,7 @@ Source: %{url}/archive/%{version}/rust-packaging-%{version}.tar.gz Patch0: 0001-Temporarily-accept-cargo_prep-V-flag-for-spec-compat.patch Patch1: 1000-fix-pytest-error.patch +Patch2: 0001-add-loongarch64-support-for-rust-packaging.patch BuildArch: noarch @@ -79,6 +80,9 @@ pytest -vv %{_fileattrsdir}/cargo_vendor.attr %changelog +* Mon Aug 5 2024 Wenlong Zhang - 26.2-2 +- add loongarch64 support for rust-packaging + * Fri Apr 12 2024 mgb01105731 - 26.2-1 - Update to version 26.2 -- Gitee