1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 pkg-config,
6 cmake,
7 doxygen,
8 libsForQt5,
9 dtkcore,
10 lxqt,
11 librsvg,
12}:
13
14stdenv.mkDerivation rec {
15 pname = "dtkgui";
16 version = "5.6.32";
17
18 src = fetchFromGitHub {
19 owner = "linuxdeepin";
20 repo = pname;
21 rev = version;
22 hash = "sha256-F3tuLV1hWoUZle0O66MQ+Ew9LRnP6N++HaqS88xBLRY=";
23 };
24
25 patches = [
26 ./fix-pkgconfig-path.patch
27 ./fix-pri-path.patch
28 ];
29
30 postPatch = ''
31 substituteInPlace src/util/dsvgrenderer.cpp \
32 --replace-fail 'QLibrary("rsvg-2", "2")' 'QLibrary("${lib.getLib librsvg}/lib/librsvg-2.so")'
33 '';
34
35 nativeBuildInputs = [
36 cmake
37 doxygen
38 pkg-config
39 libsForQt5.qttools
40 libsForQt5.wrapQtAppsHook
41 ];
42
43 buildInputs = [
44 libsForQt5.qtbase
45 lxqt.libqtxdg
46 librsvg
47 ];
48
49 propagatedBuildInputs = [
50 dtkcore
51 libsForQt5.qtimageformats
52 ];
53
54 cmakeFlags = [
55 "-DDTK_VERSION=${version}"
56 "-DBUILD_DOCS=ON"
57 "-DMKSPECS_INSTALL_DIR=${placeholder "out"}/mkspecs/modules"
58 "-DQCH_INSTALL_DESTINATION=${placeholder "doc"}/${libsForQt5.qtbase.qtDocPrefix}"
59 ];
60
61 preConfigure = ''
62 # qt.qpa.plugin: Could not find the Qt platform plugin "minimal"
63 # A workaround is to set QT_PLUGIN_PATH explicitly
64 export QT_PLUGIN_PATH=${libsForQt5.qtbase.bin}/${libsForQt5.qtbase.qtPluginPrefix}
65 '';
66
67 outputs = [
68 "out"
69 "dev"
70 "doc"
71 ];
72
73 postFixup = ''
74 for binary in $out/libexec/dtk5/DGui/bin/*; do
75 wrapQtApp $binary
76 done
77 '';
78
79 meta = with lib; {
80 description = "Deepin Toolkit, gui module for DDE look and feel";
81 homepage = "https://github.com/linuxdeepin/dtkgui";
82 license = licenses.lgpl3Plus;
83 platforms = platforms.linux;
84 teams = [ teams.deepin ];
85 };
86}