1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 doxygen,
8 qt6Packages,
9 dtk6gui,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "dtk6declarative";
14 version = "6.0.33";
15
16 src = fetchFromGitHub {
17 owner = "linuxdeepin";
18 repo = "dtk6declarative";
19 rev = finalAttrs.version;
20 hash = "sha256-hFH5XCeNs31hslaPMyuXBLe0Du3s6STs9kltwL+/F1s=";
21 };
22
23 patches = [
24 ./fix-pkgconfig-path.patch
25 ./fix-pri-path.patch
26 ];
27
28 nativeBuildInputs = [
29 cmake
30 pkg-config
31 doxygen
32 qt6Packages.qttools
33 qt6Packages.wrapQtAppsHook
34 ];
35
36 propagatedBuildInputs = [
37 dtk6gui
38 ]
39 ++ (with qt6Packages; [
40 qtbase
41 qtdeclarative
42 qtshadertools
43 qt5compat
44 ]);
45
46 cmakeFlags = [
47 "-DDTK_VERSION=${finalAttrs.version}"
48 "-DBUILD_DOCS=ON"
49 "-DBUILD_EXAMPLES=ON"
50 "-DMKSPECS_INSTALL_DIR=${placeholder "dev"}/mkspecs/modules"
51 "-DQCH_INSTALL_DESTINATION=${placeholder "doc"}/share/doc"
52 "-DQML_INSTALL_DIR=${placeholder "out"}/${qt6Packages.qtbase.qtQmlPrefix}"
53 ];
54
55 preConfigure = ''
56 # qt.qpa.plugin: Could not find the Qt platform plugin "minimal"
57 # A workaround is to set QT_PLUGIN_PATH explicitly
58 export QT_PLUGIN_PATH=${lib.getBin qt6Packages.qtbase}/${qt6Packages.qtbase.qtPluginPrefix}
59 export QML2_IMPORT_PATH=${lib.getBin qt6Packages.qtdeclarative}/${qt6Packages.qtbase.qtQmlPrefix}
60 '';
61
62 outputs = [
63 "out"
64 "dev"
65 "doc"
66 ];
67
68 meta = {
69 description = "Widget development toolkit based on QtQuick/QtQml";
70 mainProgram = "dtk-exhibition";
71 homepage = "https://github.com/linuxdeepin/dtk6declarative";
72 license = lib.licenses.lgpl3Plus;
73 platforms = lib.platforms.linux;
74 teams = [ lib.teams.deepin ];
75 };
76})