forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / desktops / deepin / library / dtk6gui / default.nix
blob99888c90e066f9d14682783766b5a873b4082538
2   stdenv,
3   lib,
4   fetchFromGitHub,
5   fetchpatch,
6   cmake,
7   pkg-config,
8   doxygen,
9   qt6Packages,
10   dtk6core,
11   librsvg,
14 stdenv.mkDerivation (finalAttrs: {
15   pname = "dtk6gui";
16   version = "6.0.19";
18   src = fetchFromGitHub {
19     owner = "linuxdeepin";
20     repo = "dtk6gui";
21     rev = finalAttrs.version;
22     hash = "sha256-nqwkBMcCQiW4iqYhceTaSNNxoR5tvCNfjKUVVHkzN3A=";
23   };
25   patches = [
26     ./fix-pkgconfig-path.patch
27     ./fix-pri-path.patch
28     (fetchpatch {
29       name = "fix-build-on-qt-6.8.patch";
30       url = "https://gitlab.archlinux.org/archlinux/packaging/packages/dtk6gui/-/raw/b6b8521fd69c28dbca5f6e8d1d8258c904b6caf1/qt-6.8.patch";
31       hash = "sha256-Fu5vwvKJGMW94JYoIPvDCeXs8WrAskQlVRX/3FYQFGY=";
32     })
33   ];
35   postPatch = ''
36     substituteInPlace src/util/dsvgrenderer.cpp \
37       --replace-fail 'QLibrary("rsvg-2", "2")' 'QLibrary("${lib.getLib librsvg}/lib/librsvg-2.so")'
38   '';
40   nativeBuildInputs = [
41     cmake
42     pkg-config
43     doxygen
44     qt6Packages.qttools
45     qt6Packages.wrapQtAppsHook
46   ];
48   buildInputs = [
49     qt6Packages.qtbase
50     librsvg
51   ];
53   propagatedBuildInputs = [
54     dtk6core
55     qt6Packages.qtimageformats
56   ];
58   cmakeFlags = [
59     "-DDTK_VERSION=${finalAttrs.version}"
60     "-DBUILD_DOCS=ON"
61     "-DMKSPECS_INSTALL_DIR=${placeholder "out"}/mkspecs/modules"
62     "-DQCH_INSTALL_DESTINATION=${placeholder "doc"}/share/doc"
63   ];
65   preConfigure = ''
66     # qt.qpa.plugin: Could not find the Qt platform plugin "minimal"
67     # A workaround is to set QT_PLUGIN_PATH explicitly
68     export QT_PLUGIN_PATH=${lib.getBin qt6Packages.qtbase}/${qt6Packages.qtbase.qtPluginPrefix}
69   '';
71   outputs = [
72     "out"
73     "dev"
74     "doc"
75   ];
77   postFixup = ''
78     for binary in $out/libexec/dtk6/DGui/bin/*; do
79       wrapQtApp $binary
80     done
81   '';
83   meta = {
84     description = "Deepin Toolkit, gui module for DDE look and feel";
85     homepage = "https://github.com/linuxdeepin/dtk6gui";
86     license = lib.licenses.lgpl3Plus;
87     platforms = lib.platforms.linux;
88     maintainers = lib.teams.deepin.members;
89   };