about summary refs log tree commit diff
path: root/pkgs/desktops/deepin/library/dtk6gui
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/desktops/deepin/library/dtk6gui')
-rw-r--r--pkgs/desktops/deepin/library/dtk6gui/default.nix74
-rw-r--r--pkgs/desktops/deepin/library/dtk6gui/fix-pkgconfig-path.patch16
-rw-r--r--pkgs/desktops/deepin/library/dtk6gui/fix-pri-path.patch17
3 files changed, 107 insertions, 0 deletions
diff --git a/pkgs/desktops/deepin/library/dtk6gui/default.nix b/pkgs/desktops/deepin/library/dtk6gui/default.nix
new file mode 100644
index 0000000000000..2b8de231eb514
--- /dev/null
+++ b/pkgs/desktops/deepin/library/dtk6gui/default.nix
@@ -0,0 +1,74 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, pkg-config
+, doxygen
+, qt6Packages
+, dtk6core
+, librsvg
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "dtk6gui";
+  version = "6.0.16";
+
+  src = fetchFromGitHub {
+    owner = "linuxdeepin";
+    repo = "dtk6gui";
+    rev = finalAttrs.version;
+    hash = "sha256-fnbCKqeeQE5WBnNJ0D1ihsZswDSJ/Oj98eUXFrOuk+w=";
+  };
+
+  patches = [
+    ./fix-pkgconfig-path.patch
+    ./fix-pri-path.patch
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    doxygen
+    qt6Packages.qttools
+    qt6Packages.wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    qt6Packages.qtbase
+    librsvg
+  ];
+
+  propagatedBuildInputs = [
+    dtk6core
+    qt6Packages.qtimageformats
+  ];
+
+  cmakeFlags = [
+    "-DDTK_VERSION=${finalAttrs.version}"
+    "-DBUILD_DOCS=ON"
+    "-DMKSPECS_INSTALL_DIR=${placeholder "out"}/mkspecs/modules"
+    "-DQCH_INSTALL_DESTINATION=${placeholder "doc"}/share/doc"
+  ];
+
+  preConfigure = ''
+    # qt.qpa.plugin: Could not find the Qt platform plugin "minimal"
+    # A workaround is to set QT_PLUGIN_PATH explicitly
+    export QT_PLUGIN_PATH=${lib.getBin qt6Packages.qtbase}/${qt6Packages.qtbase.qtPluginPrefix}
+  '';
+
+  outputs = [ "out" "dev" "doc" ];
+
+  postFixup = ''
+    for binary in $out/libexec/dtk6/DGui/bin/*; do
+      wrapQtApp $binary
+    done
+  '';
+
+  meta = {
+    description = "Deepin Toolkit, gui module for DDE look and feel";
+    homepage = "https://github.com/linuxdeepin/dtk6gui";
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = lib.teams.deepin.members;
+  };
+})
diff --git a/pkgs/desktops/deepin/library/dtk6gui/fix-pkgconfig-path.patch b/pkgs/desktops/deepin/library/dtk6gui/fix-pkgconfig-path.patch
new file mode 100644
index 0000000000000..1485baccc2044
--- /dev/null
+++ b/pkgs/desktops/deepin/library/dtk6gui/fix-pkgconfig-path.patch
@@ -0,0 +1,16 @@
+diff --git a/misc/dtkgui.pc.in b/misc/dtkgui.pc.in
+index 89fdbbf..ad817c4 100644
+--- a/misc/dtkgui.pc.in
++++ b/misc/dtkgui.pc.in
+@@ -1,8 +1,8 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${prefix}/@LIBRARY_INSTALL_DIR@
+-includedir=${prefix}/@INCLUDE_INSTALL_DIR@
+-tooldir=${prefix}/@PACKAGE_TOOL_INSTALL_DIR@
++libdir=@LIBRARY_INSTALL_DIR@
++includedir=@INCLUDE_INSTALL_DIR@
++tooldir=@PACKAGE_TOOL_INSTALL_DIR@
+ 
+ Name: dtk@DTK_VERSION_MAJOR@gui
+ Description: Deepin Tool Kit dtkgui header files
diff --git a/pkgs/desktops/deepin/library/dtk6gui/fix-pri-path.patch b/pkgs/desktops/deepin/library/dtk6gui/fix-pri-path.patch
new file mode 100644
index 0000000000000..b746d34b1c79a
--- /dev/null
+++ b/pkgs/desktops/deepin/library/dtk6gui/fix-pri-path.patch
@@ -0,0 +1,17 @@
+diff --git a/misc/qt_lib_dtkgui.pri.in b/misc/qt_lib_dtkgui.pri.in
+index 28308ee..9fb25e6 100644
+--- a/misc/qt_lib_dtkgui.pri.in
++++ b/misc/qt_lib_dtkgui.pri.in
+@@ -4,9 +4,9 @@ QT.dtkgui.MINOR_VERSION = @PROJECT_VERSION_MINOR@
+ QT.dtkgui.PATCH_VERSION = @PROJECT_VERSION_PATCH@
+ QT.dtkgui.name = dtkgui
+ QT.dtkgui.module = dtk@DTK_VERSION_MAJOR@gui
+-QT.dtkgui.tools = @CMAKE_INSTALL_PREFIX@/@TOOL_INSTALL_DIR@
+-QT.dtkgui.libs = @CMAKE_INSTALL_PREFIX@/@LIBRARY_INSTALL_DIR@
+-QT.dtkgui.includes = @CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@
++QT.dtkgui.tools = @TOOL_INSTALL_DIR@
++QT.dtkgui.libs = @LIBRARY_INSTALL_DIR@
++QT.dtkgui.includes = @INCLUDE_INSTALL_DIR@
+ QT.dtkgui.frameworks =
+ QT.dtkgui.depends = core gui dtkcore gui_private dbus network
+ QT.dtkgui.module_config = v2 internal_module ltcg