From 9c08f90e999c3e348635884a658748fcf4850eb0 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Mon, 3 Mar 2025 13:49:42 +0000 Subject: [PATCH] Remove python pack without sys_llvm Signed-off-by: liyunfei (cherry picked from commit 0d879db9aa0f8819f493137db611937188963e0e) --- llvm-toolset-17.spec | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/llvm-toolset-17.spec b/llvm-toolset-17.spec index bf3846d..f12ce0d 100644 --- a/llvm-toolset-17.spec +++ b/llvm-toolset-17.spec @@ -150,7 +150,7 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 4 +Release: 5 Summary: The Low Level Virtual Machine License: NCSA @@ -564,7 +564,9 @@ License: Apache-2.0 WITH LLVM-exception OR NCSA URL: http://lldb.llvm.org/ Requires: %{pkg_name_clang}-libs%{?_isa} = %{version}-%{release} -Requires: %{?scl_prefix}python3-lldb +%if %{with sys_llvm} +Requires: python%{python3_pkgversion}-lldb +%endif %description -n %{pkg_name_lldb} LLDB is a next generation, high-performance debugger. It is built as a set @@ -579,15 +581,17 @@ Requires: %{pkg_name_lldb}%{?_isa} = %{version}-%{release} %description -n %{pkg_name_lldb}-devel The package contains header files for the LLDB debugger. -%package -n %{?scl_prefix}python3-lldb -%{?python_provide:%python_provide python3-lldb} +%if %{with sys_llvm} +%package -n python%{python3_pkgversion}-lldb +%{?python_provide:%python_provide python%{python3_pkgversion}-lldb} Summary: Python module for LLDB Requires: %{pkg_name_lldb}%{?_isa} = %{version}-%{release} -%description -n %{?scl_prefix}python3-lldb +%description -n python%{python3_pkgversion}-lldb The package contains the LLDB Python module. %endif +%endif #endregion LLDB packages #region MLIR packages @@ -619,16 +623,18 @@ Requires: %{pkg_name_mlir}-static%{?_isa} = %{version}-%{release} %description -n %{pkg_name_mlir}-devel MLIR development files. -%package -n %{?scl_prefix}python3-mlir -%{?python_provide:%python_provide python3-mlir} +%if %{with sys_llvm} +%package -n python%{python3_pkgversion}-mlir +%{?python_provide:%python_provide python%{python3_pkgversion}-mlir} Summary: MLIR python bindings Requires: python3 -Requires: python3-numpy +Requires: python%{python3_pkgversion}-numpy -%description -n %{?scl_prefix}python3-mlir +%description -n python%{python3_pkgversion}-mlir MLIR python bindings. %endif +%endif #endregion MLIR packages #region libcxx packages @@ -1380,19 +1386,24 @@ install -D -m 644 -t %{buildroot}%{_mandir}/man1/ lld/docs/ld.lld.1 # python: fix binary libraries location liblldb=$(basename $(readlink -e %{buildroot}%{install_libdir}/liblldb.so)) +%if %{with sys_llvm} mkdir -p %{buildroot}%{python3_sitearch} mv %{buildroot}%{install_prefix}/..%{python3_sitearch}/lldb %{buildroot}%{python3_sitearch}/lldb ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so %py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/lldb %endif +rm -rf %{buildroot}%{install_prefix}/..%{python3_sitearch}/lldb +%endif #endregion LLDB installation #region mlir installation %if %{with mlir} +%if %{with sys_llvm} mkdir -p %{buildroot}/%{python3_sitearch} mv %{buildroot}%{install_prefix}/python_packages/mlir_core/mlir %{buildroot}/%{python3_sitearch} +%endif # These directories should be empty now. -rmdir %{buildroot}%{install_prefix}/python_packages/mlir_core %{buildroot}%{install_prefix}/python_packages +rm -rf %{buildroot}%{install_prefix}/python_packages/mlir_core %{buildroot}%{install_prefix}/python_packages # Unneeded files. rm -rf %{buildroot}%{install_prefix}/src/python %endif @@ -2612,9 +2623,11 @@ fi %files -n %{pkg_name_lldb}-devel %{install_includedir}/lldb -%files -n %{?scl_prefix}python3-lldb +%if %{with sys_llvm} +%files -n python%{python3_pkgversion}-lldb %{python3_sitearch}/lldb %endif +%endif #endregion LLDB files #region MLIR files @@ -2684,9 +2697,11 @@ fi %{install_libdir}/libmlir_runner_utils.so %{install_libdir}/libMLIR*.so -%files -n %{?scl_prefix}python3-mlir +%if %{with sys_llvm} +%files -n python%{python3_pkgversion}-mlir %{python3_sitearch}/mlir/ %endif +%endif #endregion MLIR files #region libcxx files @@ -2750,6 +2765,9 @@ fi #endregion files %changelog +* Mon Mar 3 2025 liyunfei liyunfei33@huawei.com - 17.0.6-5 +- Remove python pack without sys_llvm + * Tue Feb 25 2025 liyunfei - 17.0.6-4 - Bugfix for package name & clang-17 conflict -- Gitee