Add macros to build and fix Qt unit tests

Resolves: RHEL-28239
This commit is contained in:
Jan Grulich 2024-03-27 10:50:13 +01:00
parent d42b213f88
commit f33f31987f
2 changed files with 35 additions and 1 deletions

View File

@ -63,3 +63,32 @@
-DINSTALL_SYSCONFDIR=%{_qt6_sysconfdir} \\\
-DINSTALL_TRANSLATIONSDIR=%{_qt6_translationdir} \\\
-DQT_DISABLE_RPATH=TRUE
%qt6_fix_tests \
pushd tests/auto \
find . -type f -name 'CMakeLists.txt' \\\
-exec sed -i 's|\\\(.*DIR="*\\\)${CMAKE_CURRENT_SOURCE_DIR}/\\\(.*\\\)|\\\1\\\2|' {} \\\; \
find . -type f \\\( -name '*.sh' -o -name '*.py' \\\) \\\
-exec sed -i 's|/usr/bin/python$|/usr/bin/python3|' {} \\\; \\\
-exec sed -i 's|/usr/bin/env\\\ python3*|/usr/bin/python3|' {} \\\; \\\
-exec sed -i 's|^/bin/sh$|!#/bin/sh|' {} \\\; \
popd \
%qt6_dont_autoinstall_tests \
sed -i 's|include(".*tests/cmake_install.cmake")||' %_vpath_srcdir/%_vpath_builddir/cmake_install.cmake \
%qt6_install_tests \
mkdir -p %{buildroot}%{_qt6_archdatadir}/tests \
pushd tests/auto \
find . -type f \\\
! -path '*/.*' \\\
! -name '*.h' \\\
! -name '*.cpp' \\\
! -name 'CMakeLists.txt' \\\
-exec cp -r --parents {} %{buildroot}%{_qt6_archdatadir}/tests \\\; \
popd \
pushd %_vpath_srcdir/%_vpath_builddir/tests/auto \
find . -type f -executable \\\
-exec patchelf --remove-rpath {} \\\; \\\
-exec cp -r --parents {} %{buildroot}%{_qt6_archdatadir}/tests \\\; \
popd \

View File

@ -1,7 +1,7 @@
Name: qt6
Version: 6.6.1
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Qt6 meta package
License: GPL-3.0-only
URL: https://getfedora.org/
@ -91,6 +91,7 @@ Requires: qt6-rpm-macros
Summary: RPM macros for building Qt6 and KDE Frameworks 5 packages
Requires: cmake >= 3
Requires: gcc-c++
Requires: patchelf
%description rpm-macros
%{summary}.
@ -148,6 +149,10 @@ echo "- Qt6 devel meta package" > %{buildroot}%{_docdir}/qt6-devel/README
%changelog
* Wed Mar 27 2024 Jan Grulich <jgrulich@redhat.com> - 6.6.1-6
- Add macros to build and fix Qt unit tests
Resolves: RHEL-28239
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild