File mingw64-qt6-tools.spec of Package mingw64-qt6-tools

#
# spec file for package mingw64-qt6-tools
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define examples 0
%define clang 1
%define desktop_support 0
%define qdoc 1
%define tools 1
%define _clang_sonum 14

%define real_version 6.6.2
%define short_version 6.6
%define _soversion 6
%define tar_name qttools-everywhere-src
%define tar_suffix %{nil}
#
%global qt6_flavor @BUILD_FLAVOR@%{nil}
%if "%{qt6_flavor}" == "docs"
%define pkg_suffix -docs
%endif
#
%define _name   qt6-tools%{?pkg_suffix}
Name:           mingw64-%{_name}
Version:        6.6.2
Release:        0
Summary:        Qt 6 Tools libraries and tools
# TODO Check if it's still valid
# Legal:
# most src/ subfolders are GPL-3.0-only WITH Qt-GPL-exception-1.0, except:
# qdoc is GPL-3.0-only WITH Qt-GPL-exception-1.0 + (LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later)) == GPL-3.0-only
# src/shared contains BSD-3-Clause and LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later) files. The
# 'GPL-3.0-only WITH Qt-GPL-exception-1.0' files in this folder are only used on Windows.
License:        LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later) AND GPL-3.0-only WITH Qt-GPL-exception-1.0
Group:          System/Libraries
URL:            https://www.qt.io
Source:         https://download.qt.io/official_releases/qt/%{short_version}/%{real_version}%{tar_suffix}/submodules/%{tar_name}-%{real_version}%{tar_suffix}.tar.xz
Source10:       org.qt.designer6.desktop
Source11:       org.qt.linguist6.desktop
Source12:       org.qt.qdbusviewer6.desktop
Source13:       org.qt.assistant6.desktop
# The 48x48 icon was removed from qttools
Source14:       linguist6.png
Source99:       mingw64-qt6-tools-rpmlintrc
Patch0:         0001-fix-missing-clang-libraries.patch
%if %clang
BuildRequires:  mingw64-clang%{_clang_sonum}-devel
%endif
BuildRequires:  mingw64-hicolor-icon-theme
BuildRequires:  mingw64-libxml2-devel
BuildRequires:  mingw64-qt6-core-private-devel
BuildRequires:  mingw64-qt6-dbus-private-devel
BuildRequires:  mingw64-qt6-gui-private-devel
BuildRequires:  mingw64-qt6-qml-private-devel
BuildRequires:  mingw64-qt6-quick-private-devel
BuildRequires:  mingw64-qt6-widgets-private-devel
BuildRequires:  update-desktop-files
BuildRequires:  mingw64(cmake:LLVM)  >= 14
BuildRequires:  mingw64(cmake:Qt6Core) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6DBus) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6Gui) = %{real_version}
# cyclic dependency as this package provide the dependency
#BuildRequires:  mingw64(cmake:Qt6LinguistTools) = %%{real_version}
BuildRequires:  mingw64(cmake:Qt6Network) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6OpenGL) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6OpenGLWidgets) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6PrintSupport) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6Quick) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6QuickWidgets) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6Sql) = %{real_version}
# depends on mingw64-qt6-tools-qdoc which is a cycle :-(
# BuildRequires:  mingw64(cmake:Qt6ToolsTools) = %%{real_version}
BuildRequires:  mingw64(cmake:Qt6Widgets) = %{real_version}
BuildRequires:  mingw64(cmake:Qt6Xml) = %{real_version}
# native uic
BuildRequires:  gcc%{gcc_version}
# These packages are required to generate documentation for the Qt packages
Requires:       mingw64-qt6-tools-helpgenerators
Requires:       mingw64-qt6-tools-qdoc
Recommends:     mingw64-qt6-tools-assistant
Recommends:     mingw64-qt6-tools-designer
Recommends:     mingw64-qt6-tools-linguist
Recommends:     mingw64-qt6-tools-qdbus
%_mingw64_package_header_debug
BuildArch:      noarch
%if "%{qt6_flavor}" == "docs"
BuildRequires:  mingw64-qt6-tools
BuildRequires:  qt6-tools
%{_mingw64_qt6_doc_packages}
%endif

%description
The QtTools modules contains some tools mostly useful for application
development.

Included are Qt Designer (GUI design), QDbusViewer and more.

%if !%{qt6_docs_flavor}

%package devel
Summary:        Qt 6 Tools libraries - Development files
Group:          Development/Libraries
Requires:       mingw64-qt6-tools = %{version}
Requires:       mingw64-qt6-tools-helpgenerators = %{version}
Requires:       mingw64-qt6-tools-qdoc = %{version}

%description devel
Development files for the Qt6 tools libraries.

%package private-devel
Summary:        Non-ABI stable API for the Qt 6 tools libraries

%description private-devel
This package provides private headers of qt6-tools that do not have any
ABI or API guarantees.

%package -n mingw64-libQt6Designer%{_soversion}
Summary:        Qt 6 Designer library
License:        GPL-3.0-only WITH Qt-GPL-exception-1.0

%description -n mingw64-libQt6Designer%{_soversion}
This package contains the Qt 6 Designer Library.

%package -n mingw64-qt6-designer-devel
Summary:        Qt 6 Designer libraries - Development files
Requires:       mingw64-libQt6Designer6 = %{version}
Requires:       mingw64(cmake:Qt6Gui) = %{real_version}
Requires:       mingw64(cmake:Qt6OpenGL) = %{real_version}
Requires:       mingw64(cmake:Qt6OpenGLWidgets) = %{real_version}
Requires:       mingw64(cmake:Qt6Widgets) = %{real_version}
Requires:       mingw64(cmake:Qt6Xml) = %{real_version}

%description -n mingw64-qt6-designer-devel
Development files for the Qt6 Designer libraries.

%package -n mingw64-qt6-designer-private-devel
Summary:        Non-ABI stable API for the Qt 6 Designer libraries
Requires:       mingw64(cmake:Qt6Designer) = %{real_version}
%requires_eq    mingw64-qt6-core-private-devel
%requires_eq    mingw64-qt6-gui-private-devel
%requires_eq    mingw64-qt6-widgets-private-devel

%description -n mingw64-qt6-designer-private-devel
This package provides private headers of libQt6Designer that do not have any
ABI or API guarantees.

%package -n mingw64-libQt6Help%{_soversion}
Summary:        Qt 6 Help library

%description -n mingw64-libQt6Help%{_soversion}
This package contains the Qt 6 Help library.

%package -n mingw64-qt6-help-devel
Summary:        Qt 6 Help library - Development files
Requires:       mingw64-libQt6Help6 = %{version}
Requires:       mingw64(cmake:Qt6Gui) = %{real_version}
Requires:       mingw64(cmake:Qt6Network) = %{real_version}
Requires:       mingw64(cmake:Qt6Sql) = %{real_version}
Requires:       mingw64(cmake:Qt6Widgets) = %{real_version}

%description -n mingw64-qt6-help-devel
Development files for the Qt6 Help library.

%package -n mingw64-qt6-help-private-devel
Summary:        Non-ABI stable API for the Qt 6 Help library
Requires:       mingw64(cmake:Qt6Help) = %{real_version}
%requires_eq    mingw64-qt6-core-private-devel

%description -n mingw64-qt6-help-private-devel
This package provides private headers of libQt6Help that do not have any
ABI or API guarantees.

%package -n mingw64-libQt6UiTools%{_soversion}
Summary:        Qt 6 UiTools library

%description -n mingw64-libQt6UiTools%{_soversion}
This package contains the Qt 6 UiTools library.

%package -n mingw64-qt6-uitools-devel
Summary:        Qt 6 UiTools library - Development files
Requires:       mingw64-libQt6UiTools6 = %{version}
# Qt6UiToolsDependencies.cmake has explicit dependencies on these libraries
Requires:       mingw64(cmake:Qt6Gui) = %{real_version}
Requires:       mingw64(cmake:Qt6OpenGL) = %{real_version}
Requires:       mingw64(cmake:Qt6OpenGLWidgets) = %{real_version}
Requires:       mingw64(cmake:Qt6UiPlugin) = %{real_version}
Requires:       mingw64(cmake:Qt6Widgets) = %{real_version}

%description -n mingw64-qt6-uitools-devel
Development files for the Qt6 UiTools library.

%package -n mingw64-qt6-uitools-private-devel
Summary:        Non-ABI stable API for the Qt 6 UiTools library
Requires:       mingw64(cmake:Qt6UiTools) = %{real_version}

%description -n mingw64-qt6-uitools-private-devel
This package provides private headers of libQt6UiTools that do not have any
ABI or API guarantees.

%package assistant
Summary:        Documentation browser

%description assistant
Qt Assistant is a tool for viewing documentation in Qt help file format.

%package designer
Summary:        Qt graphical interface creation tool

%description designer
Qt Designer is a tool for designing and building graphical user interface
with Qt Widgets.

%package helpgenerators
Summary:        Qt Help files generator
Requires:       mingw64-qt6-docs-common
# help files are SQLite databases, so qhelpgenerator needs the SQLite plugin
Requires:       mingw64-qt6-sql-sqlite

%description helpgenerators
Qt 6 tool for generating .qch help catalogs.

%package linguist
Summary:        Translation tool for Qt applications

%description linguist
Qt Linguist can be used by translator to translate text in Qt applications.

%package -n mingw64-qt6-linguist-devel
Summary:        Qt 6 linguist tools - Development files
# Executables are required
Requires:       mingw64-qt6-tools-linguist = %{version}

%description -n mingw64-qt6-linguist-devel
Development files for the Qt 6 linguist tools.

%package qdbus
Summary:        Command line client for communication over D-Bus
License:        GPL-3.0-only WITH Qt-GPL-exception-1.0

%description qdbus
Command line client for communication over D-Bus.

%if %qdoc
%package qdoc
Summary:        Qt 6 Tool used by Qt to generate documentation
License:        GPL-3.0-only
# qdoc hardcodes clang include paths: boo#1109367, QTBUG-70687
%requires_eq    mingw64-libclang%{_clang_sonum}

%description qdoc
Qt 6 Tool used by Qt to generate documentation.
%endif

### Private only library ###

%package -n mingw64-libQt6DesignerComponents%{_soversion}
Summary:        Qt 6 DesignerComponents library
License:        GPL-3.0-only WITH Qt-GPL-exception-1.0

%description -n mingw64-libQt6DesignerComponents%{_soversion}
The Qt 6 DesignerComponents library.
This library does not have any ABI or API guarantees.

%package -n mingw64-qt6-designercomponents-private-devel
Summary:        Development files for the Qt 6 DesignerComponents library
Requires:       mingw64-libQt6DesignerComponents6 = %{version}
Requires:       mingw64-qt6-designer-private-devel = %{version}
Requires:       mingw64(cmake:Qt6Core) = %{real_version}
Requires:       mingw64(cmake:Qt6Xml) = %{real_version}
%requires_eq    mingw64-qt6-gui-private-devel
%requires_eq    mingw64-qt6-widgets-private-devel

%description -n mingw64-qt6-designercomponents-private-devel
Development files for the Qt 6 DesignerComponents library.
This library does not have any ABI or API guarantees.

%if %examples
%{_mingw64_qt6_examples_package}
%endif

%endif

%_mingw64_debug_package

%prep
%autosetup -p1 -n %{tar_name}-%{real_version}%{tar_suffix}

%build
%_mingw64_cmake_qt6 \
    -DCMAKE_DLL_NAME_WITH_SOVERSION=1 \
    -DQT_FORCE_BUILD_TOOLS=1 \
    -DQT_FEATURE_clangcpp=ON \
    -DQT_APP_NAMES_WITH_VERSION=1 \
    -DQT_TOOL_NAMES_WITH_VERSION=1

%{_mingw64_qt6_build}

%install
%{_mingw64_qt6_install}

%if !%{qt6_docs_flavor}

# CMake files are not needed for plugins (except for Qt6UiPlugin)
rm %{buildroot}%{_mingw64_qt6_cmakedir}/Qt6Designer/*Plugin{Config,Targets}*.cmake

# Unused file. There are no private headers for this library
rm %{buildroot}%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_linguist_private.pri

# This doesn't look useful
rm -r %{buildroot}%{_mingw64_qt6_includedir}/QtQDocCatch*
rm -r %{buildroot}%{_mingw64_qt6_cmakedir}/Qt6QDocCatch*
rm %{buildroot}%{_mingw64_qt6_pkgconfigdir}/Qt6QDocCatch*.pc
rm %{buildroot}%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_qdoccatch*.pri
rm %{buildroot}%{_mingw64_qt6_descriptionsdir}/QDocCatch*.json

# Desktop files for applications
# needs configurated wine 64bit prefix to run on a linux host
%if %desktop_support
%suse_update_desktop_file -i org.qt.assistant6
%suse_update_desktop_file -i org.qt.designer6
%suse_update_desktop_file -i org.qt.linguist6
%suse_update_desktop_file -i org.qt.qdbusviewer6
# fix desktop files that are installed in native location
mv %{buildroot}%{_datadir}/applications %{buildroot}%{_mingw64_datadir}/applications

# Icons for the desktop files
install -D -m644 src/designer/src/designer/images/designer.png %{buildroot}%{_mingw64_datadir}/icons/hicolor/128x128/apps/designer6.png
install -D -m644 %{SOURCE14} %{buildroot}%{_mingw64_datadir}/icons/hicolor/48x48/apps/linguist6.png
install -D -m644 src/linguist/linguist/images/icons/linguist-128-32.png %{buildroot}%{_mingw64_datadir}/icons/hicolor/128x128/apps/linguist6.png
install -D -m644 src/qdbus/qdbusviewer/images/qdbusviewer.png %{buildroot}%{_mingw64_datadir}/icons/hicolor/32x32/apps/qdbusviewer6.png
install -D -m644 src/qdbus/qdbusviewer/images/qdbusviewer-128.png %{buildroot}%{_mingw64_datadir}/icons/hicolor/128x128/apps/qdbusviewer6.png
install -D -m644 src/assistant/assistant/images/assistant.png %{buildroot}%{_mingw64_datadir}/icons/hicolor/32x32/apps/assistant6.png
install -D -m644 src/assistant/assistant/images/assistant-128.png %{buildroot}%{_mingw64_datadir}/icons/hicolor/128x128/apps/assistant6.png
%endif

%files
%license LICENSES/*
%if %tools
%{_mingw64_bindir}/pixeltool6.exe
%{_mingw64_bindir}/qdistancefieldgenerator6.exe
%{_mingw64_bindir}/qtdiag6.exe
%{_mingw64_bindir}/qtplugininfo6.exe
%{_mingw64_qt6_libexecdir}/qtattributionsscanner6.exe
%endif

%files devel
%{_mingw64_qt6_cmakedir}/Qt6/FindWrapLibClang.cmake
%{_mingw64_qt6_cmakedir}/Qt6BuildInternals/StandaloneTests/QtToolsTestsConfig.cmake
%{_mingw64_qt6_cmakedir}/Qt6Tools/
%{_mingw64_qt6_cmakedir}/Qt6ToolsTools/
%{_mingw64_qt6_descriptionsdir}/Tools.json
%{_mingw64_qt6_includedir}/QtTools/
%exclude %{_mingw64_qt6_includedir}/QtTools/%{real_version}

%files private-devel
%{_mingw64_qt6_includedir}/QtTools/%{real_version}/
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_tools_private.pri

%files -n mingw64-libQt6Designer%{_soversion}
%{_mingw64_qt6_bindir}/libQt6Designer-%{_soversion}.dll

%files -n mingw64-qt6-designer-devel
%{_mingw64_qt6_cmakedir}/Qt6Designer/
%{_mingw64_qt6_cmakedir}/Qt6UiPlugin/
%{_mingw64_qt6_descriptionsdir}/Designer.json
%{_mingw64_qt6_descriptionsdir}/UiPlugin.json
%{_mingw64_qt6_includedir}/QtDesigner/
%{_mingw64_qt6_includedir}/QtUiPlugin/
%{_mingw64_qt6_libdir}/Qt6Designer.prl
%{_mingw64_qt6_libdir}/libQt6Designer.dll.a
%{_mingw64_qt6_metatypesdir}/qt6designer_*_metatypes.json
%{_mingw64_qt6_metatypesdir}/qt6uitools_*_metatypes.json
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_designer.pri
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_uiplugin.pri
%exclude %{_mingw64_qt6_includedir}/QtDesigner/%{real_version}
%{_mingw64_qt6_pkgconfigdir}/Qt6Designer.pc
%{_mingw64_qt6_pkgconfigdir}/Qt6UiPlugin.pc

%files -n mingw64-qt6-designer-private-devel
%{_mingw64_qt6_includedir}/QtDesigner/%{real_version}/
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_designer_private.pri

%files -n mingw64-libQt6Help%{_soversion}
%{_mingw64_qt6_bindir}/libQt6Help-%{_soversion}.dll

%files -n mingw64-qt6-help-devel
%{_mingw64_qt6_cmakedir}/Qt6Help/
%{_mingw64_qt6_descriptionsdir}/Help.json
%{_mingw64_qt6_includedir}/QtHelp/
%{_mingw64_qt6_libdir}/Qt6Help.prl
%{_mingw64_qt6_libdir}/libQt6Help.dll.a
%{_mingw64_qt6_metatypesdir}/qt6help_*_metatypes.json
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_help.pri
%exclude %{_mingw64_qt6_includedir}/QtHelp/%{real_version}
%{_mingw64_qt6_pkgconfigdir}/Qt6Help.pc

%files -n mingw64-qt6-help-private-devel
%{_mingw64_qt6_includedir}/QtHelp/%{real_version}/
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_help_private.pri

%files -n mingw64-libQt6UiTools%{_soversion}
%{_mingw64_qt6_bindir}/libQt6UiTools-%{_soversion}.dll

%files -n mingw64-qt6-uitools-devel
%{_mingw64_qt6_cmakedir}/Qt6UiTools/
%{_mingw64_qt6_descriptionsdir}/UiTools.json
%{_mingw64_qt6_includedir}/QtUiTools/
%{_mingw64_qt6_libdir}/Qt6UiTools.prl
%{_mingw64_qt6_libdir}/libQt6UiTools.dll.a
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_uitools.pri
%exclude %{_mingw64_qt6_includedir}/QtUiTools/%{real_version}
%{_mingw64_qt6_pkgconfigdir}/Qt6UiTools.pc

%files -n mingw64-qt6-uitools-private-devel
%{_mingw64_qt6_includedir}/QtUiTools/%{real_version}/
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_uitools_private.pri

%files assistant
%{_mingw64_qt6_bindir}/assistant6.exe
%if %desktop_support
%dir %{_mingw64_datadir}/applications
%{_mingw64_datadir}/applications/org.qt.assistant6.desktop
%{_mingw64_datadir}/icons/hicolor/128x128/apps/assistant6.png
%{_mingw64_datadir}/icons/hicolor/32x32/apps/assistant6.png
%endif

%files designer
%{_mingw64_qt6_bindir}/designer6.exe
%dir %{_mingw64_qt6_pluginsdir}/designer
%if %desktop_support
%dir %{_mingw64_datadir}/applications
%{_mingw64_datadir}/applications/org.qt.designer6.desktop
%{_mingw64_datadir}/icons/hicolor/128x128/apps/designer6.png
%endif
%{_mingw64_qt6_pluginsdir}/designer/libqquickwidget.dll

%files helpgenerators
%{_mingw64_qt6_bindir}/qhelpgenerator6.exe

%files linguist
%dir %{_mingw64_qt6_datadir}/phrasebooks
%{_mingw64_qt6_bindir}/lconvert6.exe
%{_mingw64_qt6_bindir}/linguist6.exe
%{_mingw64_qt6_bindir}/lrelease6.exe
%{_mingw64_qt6_bindir}/lupdate6.exe
%if %desktop_support
%dir %{_mingw64_datadir}/applications
%{_mingw64_datadir}/applications/org.qt.linguist6.desktop
%{_mingw64_datadir}/icons/hicolor/48x48/apps/linguist6.png
%{_mingw64_datadir}/icons/hicolor/128x128/apps/linguist6.png
%endif
%{_mingw64_qt6_datadir}/phrasebooks/*.qph
%{_mingw64_qt6_libexecdir}/lprodump6.exe
%{_mingw64_qt6_libexecdir}/lrelease-pro6.exe
%{_mingw64_qt6_libexecdir}/lupdate-pro6.exe

%files -n mingw64-qt6-linguist-devel
%{_mingw64_qt6_descriptionsdir}/Linguist.json
%{_mingw64_qt6_cmakedir}/Qt6Linguist/
%{_mingw64_qt6_cmakedir}/Qt6LinguistTools/
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_linguist.pri
%{_mingw64_qt6_pkgconfigdir}/Qt6Linguist.pc

%files qdbus
%if %tools
%{_mingw64_qt6_bindir}/qdbus6.exe
%{_mingw64_qt6_bindir}/qdbusviewer6.exe
%if %desktop_support
%dir %{_mingw64_datadir}/applications
%{_mingw64_datadir}/applications/org.qt.qdbusviewer6.desktop
%{_mingw64_datadir}/icons/hicolor/128x128/apps/qdbusviewer6.png
%{_mingw64_datadir}/icons/hicolor/32x32/apps/qdbusviewer6.png
%endif
%endif

%if %qdoc
%files qdoc
%{_mingw64_qt6_bindir}/qdoc6.exe

### Private only library ###
%files -n mingw64-libQt6DesignerComponents6
%{_mingw64_qt6_bindir}/libQt6DesignerComponents*.dll

%files -n mingw64-qt6-designercomponents-private-devel
%{_mingw64_qt6_cmakedir}/Qt6DesignerComponentsPrivate/
%{_mingw64_qt6_descriptionsdir}/DesignerComponentsPrivate.json
%{_mingw64_qt6_includedir}/QtDesignerComponents/
%{_mingw64_qt6_libdir}/Qt6DesignerComponents.prl
%{_mingw64_qt6_libdir}/libQt6DesignerComponents.dll.a
%{_mingw64_qt6_metatypesdir}/qt6designercomponentsprivate_*_metatypes.json
%{_mingw64_qt6_mkspecsdir}/modules/qt_lib_designercomponents_private.pri
%endif

%endif

%changelog
openSUSE Build Service is sponsored by