File deepin-shell.spec of Package deepin-shell
#
# spec file for package deepin-shell
#
# Copyright (c) 2024 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 _name dde-shell
%define dtkver 6
%define qtver 6
%define sover 0
%if 0%{?suse_version} < 1600
%define _kf6_qmldir %{_libdir}/qt6/qml
%endif
Name: deepin-shell
Version: 1.0.10
Release: 0
Summary: A plugin system for dde
License: GPL-3.0-or-later
Group: System/GUI/Other
URL: https://github.com/linuxdeepin/dde-shell
Source0: https://github.com/linuxdeepin/dde-shell/archive/%{version}/%{_name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM do-not-hardcode-plugindir.patch hillwood@opensuse.org - Use variable instead of hardcode for plugin dir
Patch0: do-not-hardcode-plugindir.patch
# https://github.com/linuxdeepin/dde-shell/commit/936d62a2c20398b9ca6ae28f9101dd288c8b1678
Patch1: fix-Qt-6_9_0.patch
# https://github.com/linuxdeepin/dde-shell/pull/1173
Patch2: fix-Qt-6_9_0-qml.patch
BuildRequires: chrpath
BuildRequires: fdupes
BuildRequires: dtk%{dtkver}core
BuildRequires: extra-cmake-modules
BuildRequires: qt6-tools-linguist
BuildRequires: qt6-waylandclient-private-devel
BuildRequires: qt6-waylandcompositor-private-devel
BuildRequires: qt6-widgets-private-devel
BuildRequires: systemd-rpm-macros
BuildRequires: cmake(TreelandProtocols)
BuildRequires: cmake(DDEApplicationManager)
BuildRequires: pkgconfig(Qt%{qtver}Concurrent)
BuildRequires: pkgconfig(Qt%{qtver}Core)
BuildRequires: pkgconfig(Qt%{qtver}DBus)
BuildRequires: pkgconfig(Qt%{qtver}Gui)
BuildRequires: pkgconfig(Qt%{qtver}Linguist)
BuildRequires: pkgconfig(Qt%{qtver}Quick)
BuildRequires: pkgconfig(Qt%{qtver}Svg)
BuildRequires: pkgconfig(Qt%{qtver}WaylandClient)
BuildRequires: pkgconfig(Qt%{qtver}Widgets)
BuildRequires: pkgconfig(Qt%{qtver}Xml)
BuildRequires: pkgconfig(dde-tray-loader)
BuildRequires: pkgconfig(dframeworkdbus)
BuildRequires: pkgconfig(dtk%{dtkver}core)
BuildRequires: pkgconfig(dtk%{dtkver}gui)
BuildRequires: pkgconfig(dtk%{dtkver}widget)
BuildRequires: pkgconfig(libnm)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(xcb-aux)
BuildRequires: pkgconfig(xcb-ewmh)
BuildRequires: pkgconfig(xcb-image)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(xres)
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: pkgconfig(yaml-cpp)
Recommends: deepin-shell-launchpad
Recommends: deepin-shell-lang = %{version}-%{release}
Requires: deepin-tray-loader
%if 0%{?suse_version} < 1600
BuildRequires: gcc13-c++
%endif
%{?systemd_ordering}
%lang_package
%description
The dde-shell project provides a plugin system that integrates plugins developed
based on this plugin system into DDE.
%package -n lib%{_name}%{sover}
Summary: DDEShell Libraries
Group: System/Libraries
%description -n lib%{_name}%{sover}
This package provides libraries of deepin shell.
%package devel
Summary: Development library for Deepin Shell
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
Requires: lib%{_name}%{sover} = %{version}
%description devel
Development Library For Deepin Shell.
%prep
%autosetup -p1 -n %{_name}-%{version}
sed -i 's/TreeLandProtocols/TreelandProtocols/' panels/dock/taskmanager/CMakeLists.txt
%build
%if 0%{?suse_version} < 1600
export CXX=g++-13
%endif
%cmake -DBUILD_WITH_SYSTEMD=ON \
-DINCLUDE_INSTALL_DIR=%{_includedir}/%{_name}
%cmake_build
%install
%cmake_install
chrpath -d %{buildroot}%{_kf6_qmldir}/org/deepin/ds/dock/libdock-plugin.so
%find_lang org.deepin.ds.dock.clipboarditem --with-qt
%find_lang org.deepin.ds.dock.launcheritem --with-qt
%find_lang org.deepin.ds.dock.multitaskview --with-qt
%find_lang org.deepin.ds.dock.searchitem --with-qt
%find_lang org.deepin.ds.dock.taskmanager --with-qt
%find_lang org.deepin.ds.dock.workspaceitem --with-qt
%find_lang org.deepin.ds.dock --with-qt
%find_lang org.deepin.ds.notification --with-qt
%find_lang org.deepin.ds.osd.default --with-qt
%find_lang org.deepin.ds.osd.displaymode --with-qt
%find_lang org.deepin.ds.dock.showdesktop --with-qt
%find_lang org.deepin.ds.dock.tray --with-qt
cat org.*.lang > %{name}.lang
%fdupes %{buildroot}%{_datadir}
%post -n lib%{_name}%{sover} -p /sbin/ldconfig
%postun -n lib%{_name}%{sover} -p /sbin/ldconfig
%files
%{_bindir}/%{_name}
%{_userunitdir}/dde-shell*.service
%dir %{_datadir}/dde-dock
%{_datadir}/dde-dock/icons
%{_libdir}/%{_name}
%if 0%{?suse_version} < 1600
%dir %{_kf6_qmldir}/org
%endif
%{_kf6_qmldir}/org/deepin
%dir %{_datadir}/dsg
%dir %{_datadir}/dsg/configs
%{_datadir}/dsg/configs/org.deepin.ds.dock
%{_datadir}/dsg/configs/org.deepin.dde.shell
%dir %{_datadir}/%{_name}
%dir %{_datadir}/%{_name}/*
%{_datadir}/%{_name}/*/*.json
%{_datadir}/%{_name}/*/*.qml
%dir %{_datadir}/%{_name}/org.deepin.ds.example.applet/control
%{_datadir}/%{_name}/org.deepin.ds.example.applet/control/TextEx.qml
%dir %{_datadir}/%{_name}/*/icons
%{_datadir}/%{_name}/*/icons/*.dci
%{_datadir}/%{_name}/*/icons/*.svg
%files -n lib%{_name}%{sover}
%{_libdir}/lib%{_name}.so.*
%files devel
%dir %{_includedir}/%{_name}
%{_includedir}/%{_name}/*.h
%{_libdir}/lib%{_name}.so
%{_libdir}/cmake/DDEShell
%files lang -f %{name}.lang
%dir %{_datadir}/dde-shell/*/translations
%{_datadir}/dde-shell/org.deepin.ds.dock.clipboarditem/translations/org.deepin.ds.dock.clipboarditem.qm
%{_datadir}/dde-shell/org.deepin.ds.dock.launcheritem/translations/org.deepin.ds.dock.launcheritem.qm
%{_datadir}/dde-shell/org.deepin.ds.dock.multitaskview/translations/org.deepin.ds.dock.multitaskview.qm
%{_datadir}/dde-shell/org.deepin.ds.dock.searchitem/translations/org.deepin.ds.dock.searchitem.qm
%{_datadir}/dde-shell/org.deepin.ds.dock.taskmanager/translations/org.deepin.ds.dock.taskmanager.qm
%{_datadir}/dde-shell/org.deepin.ds.dock.workspaceitem/translations/org.deepin.ds.dock.workspaceitem.qm
%{_datadir}/dde-shell/org.deepin.ds.dock/translations/org.deepin.ds.dock.qm
%{_datadir}/dde-shell/org.deepin.ds.notification/translations/org.deepin.ds.notification.qm
%{_datadir}/dde-shell/org.deepin.ds.osd.default/translations/org.deepin.ds.osd.default.qm
%{_datadir}/dde-shell/org.deepin.ds.osd.displaymode/translations/org.deepin.ds.osd.displaymode.qm
%{_datadir}/dde-shell/org.deepin.ds.dock.showdesktop/translations/org.deepin.ds.dock.showdesktop.qm
%{_datadir}/dde-shell/org.deepin.ds.dock.tray/translations/org.deepin.ds.dock.tray.qm
%changelog