From 2a54d91fb7afe331923024a0c8137891fbe31d17 Mon Sep 17 00:00:00 2001 From: liyunfei Date: Fri, 25 Apr 2025 17:35:54 +0800 Subject: [PATCH] replace os_version with dist --- llvm-toolset-18.spec | 50 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/llvm-toolset-18.spec b/llvm-toolset-18.spec index 98cbc27..b2f1413 100644 --- a/llvm-toolset-18.spec +++ b/llvm-toolset-18.spec @@ -4,19 +4,21 @@ %global min_ver 1 %global patch_ver 8 -%global os_version %{lua: print(tonumber(rpm.expand("%{dist}"):match("oe(%d+)") or 9999))} +%if "%dist" == "%nil" +%global dist .oe2403 +%endif # Build sys_llvm packages or compat packages %bcond_with sys_llvm %bcond_with check -%if %{os_version} <= 2203 +%if "%dist" < ".oe2403" %bcond_with toolchain_clang %else %bcond_without toolchain_clang %endif # mlir requires pybind11-2.9 but 22.03 only have pybind11-2.8 -%if %{os_version} <= 2203 +%if "%dist" < ".oe2403" %bcond_with mlir %else %bcond_without mlir @@ -79,7 +81,7 @@ %global llvm_triple %{_host} %global build_src_dir %{_builddir}/%{src_tarball_dir} -%if %{os_version} <= 2403 +%if "%dist" < ".oe2503" %global build_dir _build %else %global build_dir llvm/%{_vpath_builddir} @@ -149,7 +151,7 @@ #region main package Name: llvm-toolset-%{maj_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 6 +Release: 7 Summary: The Low Level Virtual Machine License: NCSA @@ -182,7 +184,7 @@ BuildRequires: python3-devel BuildRequires: python3-psutil BuildRequires: python3-sphinx BuildRequires: python3-setuptools -%if %{maj_ver} >= 18 && %{os_version} > 2203 +%if %{maj_ver} >= 18 && "%dist" >= ".oe2403" BuildRequires: python3-myst-parser %endif %if %{with toolchain_clang} @@ -813,7 +815,7 @@ export ASMFLAGS="%{build_cflags}" -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \\\ -DLLVM_BUILD_DOCS:BOOL=ON -%if %{os_version} <= 2203 && %{maj_ver} >= 18 +%if "%dist" < ".oe2403" && %{maj_ver} >= 18 %global cmake_config_args %{cmake_config_args} \\\ -DLLVM_ENABLE_SPHINX:BOOL=OFF %else @@ -973,7 +975,7 @@ export ASMFLAGS="%{build_cflags}" extra_cmake_args='' #endregion cmake options -%if %{os_version} <= 2403 +%if "%dist" < ".oe2503" mkdir _build cd _build %define __cmake_in_source_build 1 @@ -1006,7 +1008,7 @@ cd llvm # /usr/lib64/libomptarget-amdgpu-*.bc # /usr/lib64/libomptarget-nvptx-*.bc -%if %{os_version} >= 2403 +%if "%dist" >= ".oe2403" %build_tool %cmake_target_opts runtimes @@ -1046,7 +1048,7 @@ cd %{build_src_dir}/_build_libcxx -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \ -DLLVM_BUILD_DOCS=ON \ -%if %{os_version} <= 2203 && %{maj_ver} >= 18 +%if "%dist" < ".oe2403" && %{maj_ver} >= 18 -DLLVM_ENABLE_SPHINX=OFF \ %else -DLLVM_ENABLE_SPHINX=ON \ @@ -1125,7 +1127,7 @@ cd %{build_src_dir}/_build_compiler-rt -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on? -%if %{os_version} <= 2403 +%if "%dist" < ".oe2409" %make_build %else %build_tool @@ -1139,7 +1141,7 @@ cd %{build_src_dir} %install #region LLVM installation -%if %{os_version} <= 2403 +%if "%dist" < ".oe2409" cd %{build_src_dir}/%{build_dir} %else cd %{build_src_dir}/llvm @@ -1147,7 +1149,7 @@ cd %{build_src_dir}/llvm %install_tool -%if %{os_version} <= 2203 +%if "%dist" < ".oe2403" cd %{build_src_dir}/_build_libcxx %install_tool @@ -1155,12 +1157,8 @@ cd %{build_src_dir}/_build_openmp %install_tool cd %{build_src_dir}/_build_compiler-rt -%if %{os_version} > 2403 -%install_tool -%else %make_install %endif -%endif rm -Rvf %{build_install_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtbegin.o rm -Rvf %{build_install_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple}/clang_rt.crtend.o @@ -1367,7 +1365,7 @@ rm -rf %{buildroot}/%{install_datadir}/gdb %ifnarch %{ix86} # Remove files that we don't package, yet. -%if %{os_version} >= 2403 +%if "%dist" >= ".oe2403" %if %{maj_ver} >= 20 rm %{buildroot}%{install_bindir}/llvm-offload-device-info %else @@ -1922,7 +1920,7 @@ fi %files -n %{pkg_name_llvm} %license llvm/LICENSE.TXT -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %exclude %{_mandir}/man1/llvm-config* %{_mandir}/man1/bugpoint%{exec_suffix}.1.gz @@ -2226,7 +2224,7 @@ fi %ghost %{_bindir}/llvm-config-%{maj_ver} %{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %{_mandir}/man1/llvm-config* %endif %{install_includedir}/llvm @@ -2292,11 +2290,11 @@ fi %{install_bindir}/clang-cl %{install_bindir}/clang-cpp %{_mandir}/man1/clang++-%{maj_ver}.1.gz -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %{_mandir}/man1/clang-%{maj_ver}.1.gz %endif %if %{with sys_llvm} -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %{_mandir}/man1/clang.1.gz %endif %{_mandir}/man1/clang++.1.gz @@ -2446,7 +2444,7 @@ fi %endif %{_emacs_sitestartdir}/clang-include-fixer.el %endif -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %{_mandir}/man1/diagtool%{exec_suffix}.1.gz %{_mandir}/man1/extraclangtools%{exec_suffix}.1.gz %endif @@ -2633,7 +2631,7 @@ fi %{install_libdir}/liblldb*.so %{install_libdir}/liblldb.so.* %{install_libdir}/liblldbIntelFeatures.so.* -%if %{os_version} > 2203 +%if "%dist" >= ".oe2403" %{_mandir}/man1/lldb-server%{exec_suffix}.1.gz %{_mandir}/man1/lldb%{exec_suffix}.1.gz %endif @@ -2786,6 +2784,10 @@ fi #endregion files %changelog +* Tue Jun 10 2025 liyunfei - 18.1.8-7 +- replace os_version with dist +- default dist to .oe2403 + * Fri May 16 2025 Wenlong Zhang - 18.1.8-6 - Fix libomptarget.rtl.amdgpu|cuda|loonarch64.so file not found -- Gitee