anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / cctag / default.nix
blob8b37633acfcb93239d001705cc106aa2f6beeb95
1 { lib
2 , stdenv
3 , fetchFromGitHub
5 , cmake
6 , boost179
7 , eigen
8 , opencv
9 , tbb
11 , avx2Support ? stdenv.hostPlatform.avx2Support
14 stdenv.mkDerivation rec {
15   pname = "cctag";
16   version = "1.0.3";
18   outputs = [ "lib" "dev" "out" ];
20   src = fetchFromGitHub {
21     owner = "alicevision";
22     repo = "CCTag";
23     rev = "v${version}";
24     hash = "sha256-foB+e7BCuUucyhN8FsI6BIT3/fsNLTjY6QmjkMWZu6A=";
25   };
27   cmakeFlags = [
28     # Feel free to create a PR to add CUDA support
29     "-DCCTAG_WITH_CUDA=OFF"
31     "-DCCTAG_ENABLE_SIMD_AVX2=${if avx2Support then "ON" else "OFF"}"
33     "-DCCTAG_BUILD_TESTS=${if doCheck then "ON" else "OFF"}"
34     "-DCCTAG_BUILD_APPS=OFF"
35   ];
37   patches = [
38     ./cmake-install-include-dir.patch
39   ];
41   nativeBuildInputs = [
42     cmake
43   ];
45   propagatedBuildInputs = [
46     tbb
47   ];
49   buildInputs = [
50     boost179
51     eigen
52     opencv.cxxdev
53   ];
55   # Tests are broken on Darwin (linking issue)
56   doCheck = !stdenv.hostPlatform.isDarwin;
58   meta = with lib; {
59     description = "Detection of CCTag markers made up of concentric circles";
60     homepage = "https://cctag.readthedocs.io";
61     downloadPage = "https://github.com/alicevision/CCTag";
62     license = licenses.mpl20;
63     platforms = platforms.all;
64     maintainers = with maintainers; [ tmarkus ];
65   };