forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / desktops / deepin / library / dtk6core / default.nix
bloba665236714270588d93196a41d2c53f94152fcf0
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,
16 stdenv.mkDerivation (finalAttrs: {
17   pname = "dtk6core";
18   version = "6.0.19";
20   src = fetchFromGitHub {
21     owner = "linuxdeepin";
22     repo = "dtk6core";
23     rev = finalAttrs.version;
24     hash = "sha256-3MwvTnjtVVcMjQa1f4UdagEtWhJj8aDgfUlmnGo/R7s=";
25   };
27   patches = [
28     ./fix-pkgconfig-path.patch
29     ./fix-pri-path.patch
30     (fetchpatch {
31       name = "fix-build-on-qt-6.8.patch";
32       url = "https://gitlab.archlinux.org/archlinux/packaging/packages/dtk6core/-/raw/d2e991f96b2940e8533b7e944bab5a7dd6aa0fb7/qt-6.8.patch";
33       hash = "sha256-HZxUrtUmVwnNUwcBoU7ewb+McsRkALQglPBbJU8HTkk=";
34     })
35   ];
37   postPatch = ''
38     substituteInPlace misc/DtkCoreConfig.cmake.in \
39       --subst-var-by PACKAGE_TOOL_INSTALL_DIR ${placeholder "out"}/libexec/dtk6/DCore/bin
40   '';
42   nativeBuildInputs = [
43     cmake
44     pkg-config
45     doxygen
46     qt6Packages.qttools
47     qt6Packages.wrapQtAppsHook
48   ];
50   dontWrapQtApps = true;
52   buildInputs = [
53     qt6Packages.qtbase
54     lshw
55     libuchardet
56   ];
58   propagatedBuildInputs = [
59     dtkcommon
60     dtk6log
61   ];
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   ];
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   '';
79   outputs = [
80     "out"
81     "dev"
82     "doc"
83   ];
85   postFixup = ''
86     for binary in $out/libexec/dtk6/DCore/bin/*; do
87       wrapQtApp $binary
88     done
89   '';
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     maintainers = lib.teams.deepin.members;
97   };