aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/desktops/deepin/deepin-editor/default.nix
blob: 0124ca8cc9e23ba86cb49fa08c2027db0fe0da46 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
{ stdenv
, mkDerivation
, fetchFromGitHub
, pkgconfig
, cmake
, deepin
, dtkcore
, dtkwidget
, kcodecs
, qttools
, syntax-highlighting
, wrapQtAppsHook
}:

stdenv.mkDerivation rec {
  pname = "deepin-editor";
  version = "1.2.9.1";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = pname;
    rev = version;
    sha256 = "0g7c3adqwn8i4ndxdrzibahr75dddz1fiqnsh3bjj1jjr86rv4ks";
  };

  nativeBuildInputs = [
    cmake
    pkgconfig
    qttools
    wrapQtAppsHook
    deepin.setupHook
  ];

  buildInputs = [
    dtkcore
    dtkwidget
    kcodecs
    syntax-highlighting
  ];

  postPatch = ''
    searchHardCodedPaths  # debugging

    patchShebangs translate_generation.sh

    fixPath $out /usr \
      CMakeLists.txt \
      dedit/main.cpp \
      src/resources/settings.json \
      src/thememodule/themelistmodel.cpp

    substituteInPlace deepin-editor.desktop \
      --replace "Exec=deepin-editor" "Exec=$out/bin/deepin-editor"

    substituteInPlace src/editwrapper.cpp \
      --replace "appExec = \"deepin-editor\"" "appExec = \"$out/bin/deepin-editor\""
  '';

  postFixup = ''
    searchHardCodedPaths $out  # debugging
  '';

  passthru.updateScript = deepin.updateScript { inherit pname version src; };

  meta = with stdenv.lib; {
    description = "Simple editor for Deepin Desktop Environment";
    homepage = "https://github.com/linuxdeepin/deepin-editor";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ romildo worldofpeace ];
  };
}