summary refs log tree commit diff
path: root/pkgs/applications/misc/opentrack/aruco.nix
blob: 9a315a132073686ed0f0fb2a68229cb66f962296 (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
{ lib, stdenv, cmake, fetchFromGitHub, opencv4 }:

stdenv.mkDerivation {
  pname = "opentrack-aruco";
  version = "unstable-20190303";

  src = fetchFromGitHub {
    owner = "opentrack";
    repo = "aruco";
    rev = "12dc60efd61149227bd05c805208d9bcce308f6d";
    sha256 = "0gkrixgfbpg8pls4qqilphbz4935mg5z4p18a0vv6kclmfccw9ad";
  };

  nativeBuildInputs = [ cmake ];

  buildInputs = [ opencv4 ];

  NIX_CFLAGS_COMPILE = "-Wall -Wextra -Wpedantic -ffast-math -march=native -O3";

  preInstall = ''
    mkdir -p $out/include/aruco
  '';

  # copy headers required by main package
  postInstall = ''
    cp $src/src/*.h $out/include/aruco
  '';

  meta = with lib; {
    homepage = "https://github.com/opentrack/aruco";
    description = "C++ library for detection of AR markers based on OpenCV";
    license = licenses.isc;
    maintainers = with maintainers; [ zaninime ];
  };
}