summary refs log tree commit diff
path: root/pkgs/desktops/deepin/deepin-anything/default.nix
blob: 184153a3981d95c2d98ab4222ded7316a2c13198 (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
61
62
63
{ stdenv, mkDerivation, fetchFromGitHub, pkgconfig, qtbase, udisks2-qt5, utillinux,
  dtkcore, deepin }:

mkDerivation rec {
  pname = "deepin-anything";
  version = "5.0.1";

  src = fetchFromGitHub {
    owner = "linuxdeepin";
    repo = pname;
    rev = version;
    sha256 = "1kvyffrii4b012f6ld1ih14qrn7gg5cxbdpbkac0wxb22hnz0azm";
  };

  outputs = [ "out" "modsrc" ];

  nativeBuildInputs = [
    pkgconfig
    deepin.setupHook
  ];

  buildInputs = [
    dtkcore
    qtbase
    udisks2-qt5
    utillinux
  ];

  enableParallelBuilding = true;

  makeFlags = [
    "DEB_HOST_MULTIARCH="
    "PREFIX=${placeholder "out"}"
  ];

  postPatch = ''
    searchHardCodedPaths  # for debugging
    fixPath $modsrc /usr/src Makefile
    fixPath $out /usr Makefile
    fixPath $out /usr server/tool/tool.pro
    fixPath $out /etc server/tool/tool.pro
    fixPath $out /usr/bin \
      server/tool/deepin-anything-tool.service \
      server/tool/com.deepin.anything.service \
      server/monitor/deepin-anything-monitor.service
    sed -e 's,/lib/systemd,$$PREFIX/lib/systemd,' -i server/monitor/src/src.pro server/tool/tool.pro
  '';

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

  passthru.updateScript = deepin.updateScript { name = "${pname}-${version}"; };

  meta = with stdenv.lib; {
    description = "Deepin file search tool";
    homepage = https://github.com/linuxdeepin/deepin-anything;
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ romildo ];
  };
}