1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 extra-cmake-modules,
8 pkg-config,
9 wayland-scanner,
10 dtk6declarative,
11 dtk6widget,
12 dde-qt-dbus-factory,
13 qt6Packages,
14 qt6integration,
15 qt6platform-plugins,
16 dde-tray-loader,
17 dde-application-manager,
18 wayland,
19 wayland-protocols,
20 treeland-protocols,
21 yaml-cpp,
22 xorg,
23}:
24
25stdenv.mkDerivation (finalAttrs: {
26 pname = "dde-shell";
27 version = "1.0.10";
28
29 src = fetchFromGitHub {
30 owner = "linuxdeepin";
31 repo = "dde-shell";
32 rev = finalAttrs.version;
33 hash = "sha256-0nyTvSIJglx8raehPi6pYfQcxIjsCAaD1hVbuGvtfY8=";
34 };
35
36 patches = [
37 ./fix-path-for-nixos.diff
38 (fetchpatch {
39 name = "resolve-compilation-issues-on-Qt-6_9.patch";
40 url = "https://github.com/linuxdeepin/dde-shell/commit/936d62a2c20398b9ca6ae28f9101dd288c8b1678.patch";
41 hash = "sha256-u5TcPy2kZsOLGUgjTGZ5JX3mWnr/rOQ3SWBRyjWEiw4=";
42 })
43 (fetchpatch {
44 name = "adapt-import-change-of-QtQml-Models-in-Qt-6_9.patch";
45 url = "https://github.com/linuxdeepin/dde-shell/commit/ad92c160508a5eb53fd5af558ef1b1ba881b97ac.patch";
46 hash = "sha256-3GdkbFEt51EP04RQN54EDsGyXkeZoWhbnQAHkwjUeGY=";
47 })
48
49 ];
50
51 postPatch = ''
52 for file in $(grep -rl "/usr/lib/dde-dock"); do
53 substituteInPlace $file --replace-fail "/usr/lib/dde-dock" "/run/current-system/sw/lib/dde-dock"
54 done
55
56 for file in $(grep -rl "/usr/lib/deepin-daemon"); do
57 substituteInPlace $file --replace-fail "/usr/lib/deepin-daemon" "/run/current-system/sw/lib/deepin-daemon"
58 done
59 '';
60
61 nativeBuildInputs = [
62 cmake
63 extra-cmake-modules
64 pkg-config
65 qt6Packages.wrapQtAppsHook
66 qt6Packages.qttools
67 wayland-scanner
68 ];
69
70 buildInputs = [
71 dde-tray-loader
72 dde-application-manager
73 dtk6declarative
74 dtk6widget
75 dde-qt-dbus-factory
76 qt6Packages.qtbase
77 qt6Packages.qtwayland
78 qt6Packages.qtsvg
79 qt6platform-plugins
80 qt6integration
81 wayland
82 wayland-protocols
83 treeland-protocols
84 yaml-cpp
85 xorg.libXcursor
86 xorg.libXres
87 ];
88
89 env.PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
90
91 cmakeFlags = [ "-DQML_INSTALL_DIR=${placeholder "out"}/${qt6Packages.qtbase.qtQmlPrefix}" ];
92
93 qtWrapperArgs = [
94 "--prefix TRAY_LOADER_EXECUTE_PATH : ${dde-tray-loader}/libexec/trayplugin-loader"
95 "--suffix DDE_SHELL_PLUGIN_PATH : /run/current-system/sw/lib/dde-shell"
96 "--suffix DDE_SHELL_PACKAGE_PATH : /run/current-system/sw/share/dde-shell"
97 ];
98
99 meta = {
100 description = "Plugin system that integrates plugins developed on DDE";
101 homepage = "https://github.com/linuxdeepin/dde-shell";
102 license = with lib.licenses; [ gpl3Plus ];
103 platforms = lib.platforms.linux;
104 maintainers = with lib.maintainers; [ rewine ];
105 };
106})