nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7 pkg-config,
8 doxygen,
9 qt6Packages,
10 lshw,
11 libuchardet,
12 dtkcommon,
13 dtk6log,
14}:
15
16stdenv.mkDerivation (finalAttrs: {
17 pname = "dtk6core";
18 version = "6.0.33";
19
20 src = fetchFromGitHub {
21 owner = "linuxdeepin";
22 repo = "dtk6core";
23 rev = finalAttrs.version;
24 hash = "sha256-AmGQoDt9qp0m0iV7WrR16DPTt80Y5leRUVXPOtHeugs=";
25 };
26
27 patches = [
28 ./fix-pkgconfig-path.patch
29 ./fix-pri-path.patch
30 (fetchpatch {
31 name = "resolve-compilation-issues-on-Qt-6_9.patch";
32 url = "https://github.com/linuxdeepin/dtkcore/commit/8f523a8b387a006b942268e2143d0d58c574f7c5.patch";
33 hash = "sha256-x8BfWCdsz8Bf/sAM7PymZWqlPyEabwP0e6ybfz/2oZ4=";
34 })
35 ];
36
37 postPatch = ''
38 substituteInPlace misc/DtkCoreConfig.cmake.in \
39 --subst-var-by PACKAGE_TOOL_INSTALL_DIR ${placeholder "out"}/libexec/dtk6/DCore/bin
40 '';
41
42 nativeBuildInputs = [
43 cmake
44 pkg-config
45 doxygen
46 qt6Packages.qttools
47 qt6Packages.wrapQtAppsHook
48 ];
49
50 dontWrapQtApps = true;
51
52 buildInputs = [
53 qt6Packages.qtbase
54 lshw
55 libuchardet
56 ];
57
58 propagatedBuildInputs = [
59 dtkcommon
60 dtk6log
61 ];
62
63 cmakeFlags = [
64 "-DDTK_VERSION=${finalAttrs.version}"
65 "-DBUILD_DOCS=ON"
66 "-DBUILD_EXAMPLES=OFF"
67 "-DQCH_INSTALL_DESTINATION=${placeholder "doc"}/share/doc"
68 "-DDSG_PREFIX_PATH='/run/current-system/sw'"
69 "-DMKSPECS_INSTALL_DIR=${placeholder "out"}/mkspecs/modules"
70 "-DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata"
71 ];
72
73 preConfigure = ''
74 # qt.qpa.plugin: Could not find the Qt platform plugin "minimal"
75 # A workaround is to set QT_PLUGIN_PATH explicitly
76 export QT_PLUGIN_PATH=${lib.getBin qt6Packages.qtbase}/${qt6Packages.qtbase.qtPluginPrefix}
77 '';
78
79 outputs = [
80 "out"
81 "dev"
82 "doc"
83 ];
84
85 postFixup = ''
86 for binary in $out/libexec/dtk6/DCore/bin/*; do
87 wrapQtApp $binary
88 done
89 '';
90
91 meta = {
92 description = "Deepin tool kit core library";
93 homepage = "https://github.com/linuxdeepin/dtk6core";
94 license = lib.licenses.lgpl3Plus;
95 platforms = lib.platforms.linux;
96 teams = [ lib.teams.deepin ];
97 };
98})