File qt6platform-plugins.spec of Package qt6platform-plugins

#
# spec file for package qt6platform-plugins
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2023 Hillwood Yang <hillwood@opensuse.org>
#
# 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 http://bugs.opensuse.org/
#

# %define   commit          f5fe61fb6a641f8f34f6e916b6dda27657266646
# %define   shortcommit     %(c=%{commit}; echo ${c:0:7})
# %define   qt_version      5.15.5
%define dtkver 6

Name:           qt6platform-plugins
Version:        6.0.44
Release:        0
Summary:        Qt platform integration plugins
License:        LGPL-3.0-or-later
Group:          Development/Libraries/X11
Url:            https://github.com/linuxdeepin/qt6platform-plugins
Source0:        https://github.com/linuxdeepin/qt6platform-plugins/archive/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE Qt-6_9_0-XCB-headers.patch hillwood@opensuse.org - Add xcb headers from qtbase-everywhere 6.9.0
Patch0:         Qt-6_9_0-XCB-headers.patch
# PATCH-FIX-OPENSUSE Qt-6_9_1-XCB-headers.patch hillwood@opensuse.org - Add xcb headers from qtbase-everywhere 6.9.1
Patch1:         Qt-6_9_1-XCB-headers.patch
# PATCH-FIX-OPENSUSE Qt-6_9_2-XCB-headers.patch hillwood@opensuse.org - Add xcb headers from qtbase-everywhere 6.9.2
Patch2:         Qt-6_9_2-XCB-headers.patch
# PATCH-FIX-OPENSUSE Qt-6_10_0-XCB-headers.patch hillwood@opensuse.org - Add xcb headers from qtbase-everywhere 6.10.0
Patch3:         Qt-6_10_0-XCB-headers.patch
BuildRequires:  gmock
BuildRequires:  extra-cmake-modules
BuildRequires:  wayland-devel
BuildRequires:  gtest
BuildRequires:  qt6-tools-linguist
BuildRequires:  qt6-widgets-private-devel
BuildRequires:  qt6-base-private-devel
BuildRequires:  qt6-platformsupport-private-devel
BuildRequires:  qt6-wayland-private-devel
BuildRequires:  -libudev-mini1
BuildRequires:  cmake(KWayland)
BuildRequires:  cmake(DtkBuildHelper)
BuildRequires:  cmake(Qt6XcbQpaPrivate)
BuildRequires:  pkgconfig(Qt6OpenGL)
BuildRequires:  pkgconfig(Qt6Gui)
BuildRequires:  pkgconfig(Qt6WaylandClient)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xcb-cursor)
BuildRequires:  pkgconfig(xcb-xkb)
BuildRequires:  pkgconfig(xcb-renderutil)
BuildRequires:  pkgconfig(xcb-image)
BuildRequires:  pkgconfig(xcb-icccm)
BuildRequires:  pkgconfig(xcb-keysyms)
BuildRequires:  pkgconfig(xcb-xinerama)
BuildRequires:  pkgconfig(xcb-damage)
BuildRequires:  pkgconfig(xcb-composite)
BuildRequires:  pkgconfig(xcb-util)
BuildRequires:  pkgconfig(xproto)
BuildRequires:  pkgconfig(mtdev)
BuildRequires:  pkgconfig(xkbcommon-x11)
BuildRequires:  pkgconfig(udev)
BuildRequires:  pkgconfig(xrender)
BuildRequires:  pkgconfig(sm)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  git-core
%if 0%{?suse_version} < 1600
BuildRequires:  gcc13-c++
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The qt6dxcb-plugin is the Qt platform integration plugin for Deepin Desktop
Environment.

%package -n qt6-dxcbplugin
Summary:        A Qt platform integration plugin
Group:          Development/Libraries/X11

%description -n qt6-dxcbplugin
The qt6-dxcbplugin is the Qt platform dxcbp plugin for Deepin Desktop
Environment.

#%package -n qt6-dwaylandplugin
#Summary:        A Qt platform integration plugin
#Group:          Development/Libraries/X11

#%description -n qt6-dwaylandplugin
#The qt6-dxcbplugin is the Qt platform dwayland plugin for Deepin Desktop
#Environment.

#%package -n qt6-kwayland-shellplugin
#Summary:        A Qt platform integration plugin
#Group:          Development/Libraries/X11

#%description -n qt6-kwayland-shellplugin
#The qt6-dxcbplugin is the Qt platform kwayland-shell plugin for Deepin Desktop
#Environment.

%prep
# %setup -q -a1 -n %{name}-%{version}
%autosetup -p1 -n %{name}-%{version}
sed -i '/find_package/i find_package(ECM REQUIRED 1.0.0)\nset(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})' wayland/wayland-shell/wayland-shell.cmake
# Disable wayland for now: https://github.com/linuxdeepin/qt6platform-plugins/issues/47
# sed -i '/wayland/d' qt6platform-plugins.pro
cp xcb/libqt6xcbqpa-dev/6.6.2 xcb/libqt6xcbqpa-dev/6.6.3 -r

%build
%if 0%{?suse_version} < 1600
    export CXX=g++-13
%endif
# export Qt_version="`rpm -q --queryformat '%%{VERSION}' libqt6Core5|cut -c 1-6`"
%cmake -DDTK_VERSION=%{dtkver}
%cmake_build

%install
%cmake_install

%check

%files -n qt6-dxcbplugin
%defattr(-,root,root,-)
%doc CHANGELOG.md README.md
%license LICENSE
%dir %{_libdir}/qt6/plugins/platforms/
%{_libdir}/qt6/plugins/platforms/libdxcb.so

#%files -n qt6-dwaylandplugin
#%defattr(-,root,root,-)
#%doc CHANGELOG.md README.md
#%license LICENSE
#%dir %{_libdir}/qt6/plugins/platforms/
#%{_libdir}/qt6/plugins/platforms/libdwayland.so

#%files -n qt6-kwayland-shellplugin
#%defattr(-,root,root,-)
#%doc CHANGELOG.md README.md
#%license LICENSE
#%dir %{_libdir}/qt6/plugins/wayland-shell-integration/
#%{_libdir}/qt6/plugins/wayland-shell-integration/libkwayland-shell.so

%changelog
openSUSE Build Service is sponsored by