Unbreak CMake Qt6::ExampleIconsPrivate package

This fixes build for the following CMakeLists.txt:
  cmake_minimum_required(VERSION 3.18)
  project(hello)
  find_package(Qt6 COMPONENTS ExampleIconsPrivate)
This commit is contained in:
LuK1337 2023-09-03 15:54:34 +02:00
parent 7f9c50ebd7
commit ca477f48a6
2 changed files with 57 additions and 4 deletions

View File

@ -38,7 +38,7 @@ BuildRequires: pkgconfig(libsystemd)
Name: qt6-qtbase Name: qt6-qtbase
Summary: Qt6 - QtBase components Summary: Qt6 - QtBase components
Version: 6.5.2 Version: 6.5.2
Release: 4%{?dist} Release: 5%{?dist}
License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
Url: http://qt-project.org/ Url: http://qt-project.org/
@ -66,6 +66,7 @@ Source6: 10-qt6-check-opengl2.sh
Source10: macros.qt6-qtbase Source10: macros.qt6-qtbase
Patch1: qtbase-tell-the-truth-about-private-API.patch Patch1: qtbase-tell-the-truth-about-private-API.patch
Patch2: qtbase-CMake-Install-objects-files-into-ARCHDATADIR.patch
# upstreamable patches # upstreamable patches
# namespace QT_VERSION_CHECK to workaround major/minor being pre-defined (#1396755) # namespace QT_VERSION_CHECK to workaround major/minor being pre-defined (#1396755)
@ -473,9 +474,6 @@ rm %{buildroot}/%{_qt6_libexecdir}/qt-cmake-private-install.cmake
# Use better location for some new scripts in qtbase-6.0.1 # Use better location for some new scripts in qtbase-6.0.1
mv %{buildroot}/%{_qt6_libexecdir}/ensure_pro_file.cmake %{buildroot}/%{_qt6_libdir}/cmake/Qt6/ensure_pro_file.cmake mv %{buildroot}/%{_qt6_libexecdir}/ensure_pro_file.cmake %{buildroot}/%{_qt6_libdir}/cmake/Qt6/ensure_pro_file.cmake
# FIXME why is this being installed?
rm %{buildroot}/%{_qt6_libdir}/objects-RelWithDebInfo/ExampleIconsPrivate_resources_1/.rcc/qrc_example_icons.cpp.o
%check %check
# verify Qt6.pc # verify Qt6.pc
export PKG_CONFIG_PATH=%{buildroot}%{_libdir}/pkgconfig export PKG_CONFIG_PATH=%{buildroot}%{_libdir}/pkgconfig
@ -720,6 +718,7 @@ make check -k ||:
%{_qt6_libdir}/cmake/Qt6XcbQpaPrivate/*.cmake %{_qt6_libdir}/cmake/Qt6XcbQpaPrivate/*.cmake
%{_qt6_libdir}/cmake/Qt6Xml/*.cmake %{_qt6_libdir}/cmake/Qt6Xml/*.cmake
%{_qt6_libdir}/qt6/metatypes/*.json %{_qt6_libdir}/qt6/metatypes/*.json
%{_qt6_libdir}/qt6/objects-RelWithDebInfo/ExampleIconsPrivate_resources_1/.rcc/qrc_example_icons.cpp.o
%{_qt6_libdir}/pkgconfig/*.pc %{_qt6_libdir}/pkgconfig/*.pc
%if 0%{?egl} %if 0%{?egl}
@ -825,6 +824,9 @@ make check -k ||:
%changelog %changelog
* Sun Sep 03 2023 LuK1337 <priv.luk@gmail.com> - 6.5.2-5
- Unbreak CMake Qt6::ExampleIconsPrivate package
* Mon Aug 28 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 6.5.2-4 * Mon Aug 28 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 6.5.2-4
- Use bundled libb2 in RHEL builds - Use bundled libb2 in RHEL builds

View File

@ -0,0 +1,51 @@
From 4e517492a03b6c0b710a2d9a3df05922ac233992 Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Wed, 24 May 2023 11:23:39 +0200
Subject: [PATCH] CMake: Install objects files into 'ARCHDATADIR'
Change-Id: I917a9ef4d83f93eb5c3e47964bf1814d1b53fdab
---
cmake/QtResourceHelpers.cmake | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cmake/QtResourceHelpers.cmake b/cmake/QtResourceHelpers.cmake
index 2df1fed50f..e4f34b5ff1 100644
--- a/cmake/QtResourceHelpers.cmake
+++ b/cmake/QtResourceHelpers.cmake
@@ -38,7 +38,7 @@ function(qt_internal_add_resource target resourceName)
if (out_targets)
qt_install(TARGETS ${out_targets}
EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets"
- DESTINATION "${INSTALL_LIBDIR}"
+ DESTINATION "${INSTALL_ARCHDATADIR}"
)
qt_internal_add_targets_to_additional_targets_export_file(
TARGETS ${out_targets}
@@ -47,7 +47,7 @@ function(qt_internal_add_resource target resourceName)
qt_internal_install_resource_pdb_files("${out_targets}")
qt_internal_record_rcc_object_files("${target}" "${out_targets}"
- INSTALL_DIRECTORY "${INSTALL_LIBDIR}")
+ INSTALL_DIRECTORY "${INSTALL_ARCHDATADIR}")
endif()
if (arg_OUTPUT_TARGETS)
@@ -77,7 +77,7 @@ function(qt_internal_record_rcc_object_files target resource_targets)
# It's comprised of thee following path parts:
#
# part (1) INSTALL_DIRECTORY.
- # A usual value is '${INSTALL_LIBDIR}/' for libraries
+ # A usual value is '${INSTALL_ARCHDATADIR}/' for libraries
# and '${INSTALL_QMLDIR}/foo/bar/' for qml plugin resources.
#
# part (2) the value computed by CMake's computeInstallObjectDir comprised of an
@@ -128,6 +128,6 @@ function(qt_internal_install_resource_pdb_files objlib_targets)
_qt_resource_generated_cpp_relative_path)
get_filename_component(rel_obj_file_dir "${generated_cpp_file_relative_path}" DIRECTORY)
qt_internal_install_pdb_files(${target}
- "${INSTALL_LIBDIR}/objects-$<CONFIG>/${target}/${rel_obj_file_dir}")
+ "${INSTALL_ARCHDATADIR}/objects-$<CONFIG>/${target}/${rel_obj_file_dir}")
endforeach()
endfunction()
--
2.40.1