%define _disable_source_fetch 0
%define debug_package %{nil}

Name:           sonic-frameworks-windowsystem
Version:        6.24.0.1
Release:        1%{?dist}
Summary:        SonicDE Window System (fork of KWindowSystem)

License:        LGPL-2.0-or-later
URL:            https://github.com/Sonic-DE/sonic-frameworks-windowsystem
Source0:        %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz

BuildRequires:  extra-cmake-modules
BuildRequires:  kf6-rpm-macros
BuildRequires:  qt6-qtbase-devel
BuildRequires:  qt6-qtbase-private-devel
BuildRequires:  qt6-qtdeclarative-devel
BuildRequires:  qt6-qtwayland-devel
BuildRequires:  gcc-c++
BuildRequires:  libxcb-devel
# BuildRequires:  cmake(XCB)
BuildRequires:  libXfixes-devel
BuildRequires:  pkgconfig(xcb-keysyms)
BuildRequires:  pkgconfig(xcb-res)
BuildRequires:  pkgconfig(xcb-icccm)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xrender)
BuildRequires:  pkgconfig(xfixes)
BuildRequires:  pkgconfig(xkbcommon)
BuildRequires:  wayland-devel
BuildRequires:  pkgconfig(wayland-client)

Provides:       kf6-kwindowsystem%{?_isa} >= %{version}
Provides:       kf6-kwindowsystem >= %{version}
Obsoletes:      kf6-kwindowsystem <= %{version}

%description
SonicDE Window System is a fork of KWindowSystem, providing windowing
system abstraction in SonicDE.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       qt6-qtbase-devel

%description    devel
Development files for %{name}.

Provides:       kf6-kwindowsystem-devel%{?_isa} >= %{version}
Provides:       kf6-kwindowsystem-devel >= %{version}
Obsoletes:      kf6-kwindowsystem-devel <= %{version}

%prep
%autosetup -p1

%build
%cmake_kf6
%cmake_build

%install
%cmake_install
%find_lang kwindowsystem6 --with-qt --all-name

%files -f kwindowsystem6.lang
%license LICENSES/*
%{_libdir}/libKF6WindowSystem.so.*
%{_qt6_plugindir}/kf6/kwindowsystem/
%{_libdir}/qt6/qml/org/kde/kwindowsystem/
%{_datadir}/qlogging-categories6/kwindowsystem.categories
%{_datadir}/qlogging-categories6/kwindowsystem.renamecategories

%files devel
%{_includedir}/KF6/KWindowSystem/
%{_libdir}/libKF6WindowSystem.so
%{_libdir}/cmake/KF6WindowSystem/
%{_libdir}/pkgconfig/KF6WindowSystem.pc

%changelog
* Tue Mar 24 2026 Anders da Silva Rytter Hansen <andersrh@users.noreply.github.com> - 6.24.0-1
- Initial release of sonic-frameworks-windowsystem for SonicDE
