about summary refs log tree commit diff
path: root/pkgs/desktops/deepin/library/deepin-ocr-plugin-manager/default.nix
blob: f5da5c8fee71a43df178e66d15899f138ae4f080 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  stdenv,
  lib,
  fetchFromGitHub,
  pkg-config,
  cmake,
  qttools,
  wrapQtAppsHook,
  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;
  };
}