about summary refs log tree commit diff
path: root/pkgs/desktops/deepin/library/deepin-ocr-plugin-manager/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/desktops/deepin/library/deepin-ocr-plugin-manager/default.nix')
-rw-r--r--pkgs/desktops/deepin/library/deepin-ocr-plugin-manager/default.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/desktops/deepin/library/deepin-ocr-plugin-manager/default.nix b/pkgs/desktops/deepin/library/deepin-ocr-plugin-manager/default.nix
new file mode 100644
index 000000000000..3db5f0a0bd34
--- /dev/null
+++ b/pkgs/desktops/deepin/library/deepin-ocr-plugin-manager/default.nix
@@ -0,0 +1,60 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, pkg-config
+, cmake
+, qttools
+, wrapQtAppsHook
+, libisoburn
+, ncnn
+, opencv
+, vulkan-headers
+}:
+
+stdenv.mkDerivation rec {
+  pname = "deepin-ocr-plugin-manager";
+  version = "unstable-2023-07-10";
+
+  src = fetchFromGitHub {
+    owner = "linuxdeepin";
+    repo = pname;
+    rev = "9b5c9e57c83b5adde383ed404b73f9dcbf5e6a48";
+    hash = "sha256-U5lxAKTaQvvlqbqRezPIcBGg+DpF1hZ204Y1+8dt14U=";
+  };
+
+  # don't use vendored opencv
+  postPatch = ''
+    substituteInPlace src/CMakeLists.txt \
+      --replace "opencv_mobile" "opencv4"
+    substituteInPlace src/paddleocr-ncnn/paddleocr.cpp \
+      --replace "/usr" "$out"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    qttools
+    pkg-config
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    ncnn
+    opencv
+    vulkan-headers
+  ];
+
+  strictDeps = true;
+
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DCMAKE_INSTALL_INCLUDEDIR=include"
+  ];
+
+  meta = with lib; {
+    description = "Plugin manager of optical character recognition for DDE";
+    homepage = "https://github.com/linuxdeepin/deepin-ocr-plugin-manager";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = teams.deepin.members;
+  };
+}