From d74c6aa7ecf0fa52ab766ab7e5e4b884a50f2bff Mon Sep 17 00:00:00 2001 From: yangzhenyu Date: Sun, 8 Dec 2024 19:50:04 +0800 Subject: [PATCH] * add python3-clang package and install scanbuild-py Signed-off-by: yangzhenyu --- clang.spec | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/clang.spec b/clang.spec index 9e72619..6ab574e 100644 --- a/clang.spec +++ b/clang.spec @@ -44,7 +44,7 @@ Name: %{pkg_name} Version: %{clang_version} -Release: 31 +Release: 32 Summary: A C language family front-end for LLVM License: NCSA URL: http://llvm.org @@ -217,6 +217,13 @@ Requires: python3 %description -n git-clang-format clang-format integration for git. +%package -n python3-clang +Summary: Python3 bindings for clang +Requires: %{name}-libs = %{version}-%{release} +Requires: python3 +%description -n python3-clang +Python3 bindings for clang. + %prep %setup -T -q -b 1 -n %{clang_tools_srcdir} %autopatch -m200 -p2 @@ -298,6 +305,19 @@ pathfix.py -i %{__python3} -pn \ %install %cmake_install + +# install clang python bindings +mkdir -p %{buildroot}%{python3_sitelib}/clang/ +install -p -m644 bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/ +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/clang + +# install scanbuild-py +mv %{buildroot}%{_prefix}/%{_lib}/{libear,libscanbuild} %{buildroot}%{python3_sitelib} +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/libear +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/libscanbuild +chmod a+x %{buildroot}%{_datadir}/scan-view/Reporter.py +chmod a+x %{buildroot}%{_datadir}/scan-view/startfile.py + mkdir -p %{buildroot}/%{_bindir} rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript @@ -363,10 +383,10 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{__cmak %{install_bindir}/intercept-build %{install_bindir}/scan-build-py %{install_prefix}/share/man/man1/* -%{install_libdir}/libear -%{install_libdir}/libscanbuild %{install_sharedir}/scan-view %{install_sharedir}/scan-build +%{python3_sitelib}/libear +%{python3_sitelib}/libscanbuild %files tools-extra @@ -416,7 +436,13 @@ LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{__cmak %files -n git-clang-format %{install_bindir}/git-clang-format +%files -n python3-clang +%{python3_sitelib}/clang/ + %changelog +* Wed Nov 27 2024 Yangzhenyu - 17.0.6-32 +- add python3-clang and install scanbuild-py + * Thu Nov 21 2024 eastb233 - 17.0.6-31 - Add option -fGNU-compatibility -- Gitee