From 22b081016d87c398eb7d05211db84a99ca4037d9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 22 Jul 2024 12:25:34 +0000 Subject: [PATCH] Add python3-lit to big-merge --- build.spec.inc | 6 ++++++ check.spec.inc | 5 +++++ files.spec.inc | 9 +++++++++ install.spec.inc | 11 +++++++++-- packages.spec.inc | 12 ++++++++++++ 5 files changed, 41 insertions(+), 2 deletions(-) diff --git a/build.spec.inc b/build.spec.inc index bb41376..a4b04b0 100644 --- a/build.spec.inc +++ b/build.spec.inc @@ -39,6 +39,12 @@ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:`pwd`/llvm/%{_vpath_builddir}/%{_lib} cd llvm +#region LLVM lit +pushd utils/lit +%py3_build +popd +#endregion + %if 0%{?rhel} == 8 %undefine __cmake_in_source_build %endif diff --git a/check.spec.inc b/check.spec.inc index a774b3c..913fe7b 100644 --- a/check.spec.inc +++ b/check.spec.inc @@ -69,6 +69,11 @@ function test_list_to_regex() } #endregion +#region Test LLVM lit +reset_test_opts +%cmake_build --target check-lit +#endregion + #region Test LLVM reset_test_opts # Xfail testing of update utility tools diff --git a/files.spec.inc b/files.spec.inc index 31b3e6a..9464e0d 100644 --- a/files.spec.inc +++ b/files.spec.inc @@ -1,3 +1,12 @@ +#region LLVM lit files +%files -n python3-lit +%license llvm/utils/lit/LICENSE.TXT +%doc llvm/utils/lit/README.rst +%{python3_sitelib}/lit/ +%{python3_sitelib}/lit-*-info/ +%{_bindir}/lit +#endregion + #region LLVM files %files -n %{pkg_name_llvm} diff --git a/install.spec.inc b/install.spec.inc index ff5e487..1b0261b 100644 --- a/install.spec.inc +++ b/install.spec.inc @@ -1,10 +1,17 @@ #region LLVM installation -cd llvm +pushd llvm + +pushd utils/lit +%py3_install + +# Strip out #!/usr/bin/env python +sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/lit/*.py +popd %cmake_install -cd - +popd mkdir -p %{buildroot}/%{_bindir} diff --git a/packages.spec.inc b/packages.spec.inc index 43397bc..18065d2 100644 --- a/packages.spec.inc +++ b/packages.spec.inc @@ -1,3 +1,15 @@ +#region LLVM lit package +%package -n python3-lit +Summary: LLVM lit test runner for Python 3 + +BuildArch: noarch +Requires: python3-setuptools +Recommends: python3-psutil + +%description -n python3-lit +lit is a tool used by the LLVM project for executing its test suites. +#endregion + #region LLVM packages %package -n %{pkg_name_llvm}-devel