about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/aitrack/default.nix
blob: 48e0afe13ebd271f987b3eb3cfb7fcea902dce3a (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
{ stdenv
, lib
, fetchFromGitHub
, pkg-config
, qmake
, wrapQtAppsHook
, opencv
, spdlog
, onnxruntime
, qtx11extras
}: stdenv.mkDerivation {
  pname = "aitrack";
  version = "0.6.5";

  src = fetchFromGitHub {
    owner = "mdk97";
    repo = "aitrack-linux";
    rev = "00bcca9b685abf3a19e4eab653198ca2b1895ae4";
    sha256 = "sha256-pPvYVLUPYdjtJKdxqZI+JN7OZ4xw9gZ3baYTnJUSTGE=";
  };

  nativeBuildInputs = [
    pkg-config
    qmake
    wrapQtAppsHook
  ];

  buildInputs = [
    opencv
    spdlog
    qtx11extras
    onnxruntime
  ];

  postPatch = ''
    substituteInPlace Client/src/Main.cpp \
      --replace "/usr/share/" "$out/share/"
  '';

  postInstall = ''
    install -Dt $out/bin aitrack
    install -Dt $out/share/aitrack/models models/*
  '';

  meta = with lib; {
    description = "6DoF Head tracking software";
    maintainers = with maintainers; [ ck3d ];
    platforms = platforms.linux;
    license = licenses.mit;
  };
}