1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 libsForQt5,
8 dtkcore,
9 gsettings-qt,
10 libsecret,
11 xorg,
12 systemd,
13 dde-polkit-agent,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "dde-session";
18 version = "1.2.12";
19
20 src = fetchFromGitHub {
21 owner = "linuxdeepin";
22 repo = pname;
23 rev = version;
24 hash = "sha256-WiWG4f+vMgAYDBp/porjiV9a6ZqqdmxdXAqX1ISdlfU=";
25 };
26
27 postPatch = ''
28 substituteInPlace misc/CMakeLists.txt \
29 --replace "/etc" "$out/etc"
30
31 # Avoid using absolute path to distinguish applications
32 substituteInPlace src/dde-session/impl/sessionmanager.cpp \
33 --replace 'file.readAll().startsWith("/usr/bin/dde-lock")' 'file.readAll().contains("dde-lock")' \
34
35 substituteInPlace systemd/dde-session-initialized.target.wants/dde-polkit-agent.service \
36 --replace "/usr/lib/polkit-1-dde" "${dde-polkit-agent}/lib/polkit-1-dde"
37
38 for file in $(grep -rl "/usr/lib/deepin-daemon"); do
39 substituteInPlace $file --replace "/usr/lib/deepin-daemon" "/run/current-system/sw/lib/deepin-daemon"
40 done
41
42 for file in $(grep -rl "/usr/bin"); do
43 substituteInPlace $file --replace "/usr/bin/" "/run/current-system/sw/bin/"
44 done
45 '';
46
47 nativeBuildInputs = [
48 cmake
49 pkg-config
50 libsForQt5.wrapQtAppsHook
51 ];
52
53 buildInputs = [
54 libsForQt5.qtbase
55 dtkcore
56 gsettings-qt
57 libsecret
58 xorg.libXcursor
59 systemd
60 ];
61
62 # FIXME: dde-wayland always exits abnormally
63 passthru.providedSessions = [ "dde-x11" ];
64
65 meta = with lib; {
66 description = "New deepin session based on systemd and existing projects";
67 homepage = "https://github.com/linuxdeepin/dde-session";
68 license = licenses.gpl3Plus;
69 platforms = platforms.linux;
70 teams = [ teams.deepin ];
71 };
72}