From 7b27142d896b3309d6df08198a3e726c62ea82de Mon Sep 17 00:00:00 2001 From: U2FsdGVkX1 Date: Wed, 31 Jan 2024 18:52:20 +0800 Subject: [PATCH] Add riscv64 support --- python3.6.spec | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/python3.6.spec b/python3.6.spec index 38e23b8..e1921e1 100644 --- a/python3.6.spec +++ b/python3.6.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 22%{?dist} +Release: 22.rv64%{?dist} # Python is Python # pip MIT is and bundles: # appdirs: MIT @@ -184,8 +184,13 @@ License: Python and MIT and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and ( %global platform_triplet %{platform_triplet_upstream} %endif +%ifarch riscv64 +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized} +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug} +%else %global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{platform_triplet} %global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{platform_triplet} +%endif # All bytecode files are in a __pycache__ subdirectory, with a name # reflecting the version of the bytecode. @@ -1430,9 +1435,14 @@ CheckPython() { -x test_distutils \ -x test_bdist_rpm \ -x test_gdb \ - %ifarch ppc64le aarch64 + %ifarch ppc64le aarch64 riscv64 -x test_faulthandler \ %endif + %ifarch riscv64 + -x test_posix \ + -x test_socket \ + -x test_zlib \ + %endif %ifarch %{mips64} -x test_ctypes \ %endif @@ -1685,8 +1695,13 @@ CheckPython optimized # "Makefile" and the config-32/64.h file are needed by # distutils/sysconfig.py:_init_posix(), so we include them in the core # package, along with their parent directories (bug 531901): +%ifarch riscv64 +%dir %{pylibdir}/config-%{LDVERSION_optimized}/ +%{pylibdir}/config-%{LDVERSION_optimized}/Makefile +%else %dir %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/ %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile +%endif %dir %{_includedir}/python%{LDVERSION_optimized}/ %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} @@ -1702,7 +1717,11 @@ CheckPython optimized %{_bindir}/2to3-%{pybasever} %endif +%ifarch riscv64 +%{pylibdir}/config-%{LDVERSION_optimized}/* +%else %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/* +%endif %if %{without flatpackage} %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{platform_triplet}/Makefile %exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} @@ -1912,6 +1931,9 @@ CheckPython optimized # ====================================================== %changelog +* Wed Jan 31 2024 Songsong Zhang - 3.6.15-22.rv64 +- Add riscv64 support + * Mon Dec 18 2023 Lumír Balhar - 3.6.15-22 - Security fix for CVE-2023-27043 (rhbz#2196191)