@@ -0,0 +1,76 @@
1+{ stdenv, fetchFromGitHub, pkgconfig, cmake, dde-qt-dbus-factory,
2+ dde-session-ui, deepin, deepin-desktop-schemas, deepin-wallpapers,
3+ dtkcore, dtkwidget, gsettings-qt, qtsvg, qttools, qtx11extras,
4+ which, xdg_utils, wrapGAppsHook }:
5+
6+stdenv.mkDerivation rec {
7+ name = "${pname}-${version}";
8+ pname = "dde-launcher";
9+ version = "4.6.13";
10+
11+ src = fetchFromGitHub {
12+ owner = "linuxdeepin";
13+ repo = pname;
14+ rev = version;
15+ sha256 = "1lwwn2qjbd4i7wx18mi8n7hzdh832i3kdadrivr10sbafdank7ky";
16+ };
17+
18+ nativeBuildInputs = [
19+ cmake
20+ pkgconfig
21+ qttools
22+ wrapGAppsHook
23+ deepin.setupHook
24+ ];
25+
26+ buildInputs = [
27+ dde-qt-dbus-factory
28+ dde-session-ui
29+ deepin-desktop-schemas
30+ deepin-wallpapers
31+ dtkcore
32+ dtkwidget
33+ gsettings-qt
34+ qtsvg
35+ qtx11extras
36+ which
37+ xdg_utils
38+ ];
39+
40+ postPatch = ''
41+ # debugging
42+ searchHardCodedPaths
43+
44+ substituteInPlace CMakeLists.txt --replace "/usr/share" "$out/share"
45+
46+ substituteInPlace src/dbusservices/com.deepin.dde.Launcher.service --replace "/usr" "$out"
47+
48+ substituteInPlace src/historywidget.cpp --replace "xdg-open" "${xdg_utils}/bin/xdg-open"
49+ substituteInPlace src/widgets/miniframebottombar.cpp --replace "dde-shutdown" "${dde-session-ui}/bin/dde-shutdown"
50+ substituteInPlace src/widgets/miniframerightbar.cpp --replace "which" "${which}/bin/which"
51+
52+ # Uncomment (and remove space after $) after packaging deepin-manual
53+ #substituteInPlace src/sharedeventfilter.cpp --replace "dman" "$ {deepin-manual}/bin/dman"
54+
55+ for f in src/boxframe/*.cpp; do
56+ substituteInPlace $f --replace "/usr/share/backgrounds/default_background.jpg" "${deepin-wallpapers}/share/backgrounds/deepin/desktop.jpg"
57+ done
58+
59+ # note: `dbus-send` path does not need to be hard coded because it is not used for dtkcore >= 2.0.8.0
60+ '';
61+
62+ postFixup = ''
63+ # debugging
64+ searchHardCodedPaths $out
65+ '';
66+
67+ passthru.updateScript = deepin.updateScript { inherit name; };
68+
69+ meta = with stdenv.lib; {
70+ description = "Deepin Desktop Environment launcher module";
71+ homepage = https://github.com/linuxdeepin/dde-launcher;
72+ license = licenses.gpl3;
73+ platforms = platforms.linux;
74+ maintainers = with maintainers; [ romildo ];
75+ };
76+}