1{
2 lib,
3 boost,
4 breakpad,
5 ceres-solver,
6 cgal,
7 cmake,
8 eigen,
9 fetchFromGitHub,
10 glfw,
11 gmp,
12 libjpeg,
13 libpng,
14 libtiff,
15 mpfr,
16 opencv,
17 openmp,
18 pkg-config,
19 stdenv,
20 vcg,
21 zstd,
22}:
23
24let
25 boostWithZstd = boost.overrideAttrs (old: {
26 buildInputs = old.buildInputs ++ [ zstd ];
27 });
28in
29stdenv.mkDerivation rec {
30 version = "2.2.0";
31 pname = "openmvs";
32
33 src = fetchFromGitHub {
34 owner = "cdcseacave";
35 repo = "openmvs";
36 rev = "v${version}";
37 hash = "sha256-j/tGkR73skZiU+bP4j6aZ5CxkbIcHtqKcaUTgNvj0C8=";
38 fetchSubmodules = true;
39 };
40
41 # SSE is enabled by default
42 cmakeFlags = lib.optional (!stdenv.hostPlatform.isx86_64) "-DOpenMVS_USE_SSE=OFF";
43
44 buildInputs = [
45 boostWithZstd
46 breakpad
47 ceres-solver
48 cgal
49 eigen
50 glfw
51 gmp
52 libjpeg
53 libpng
54 libtiff
55 mpfr
56 opencv
57 openmp
58 vcg
59 ];
60
61 nativeBuildInputs = [
62 cmake
63 pkg-config
64 ];
65
66 postInstall = ''
67 mv $out/bin/OpenMVS/* $out/bin
68 rmdir $out/bin/OpenMVS
69 rm $out/bin/Tests
70 '';
71
72 doCheck = true;
73 checkPhase = ''
74 runHook preCheck
75 ctest
76 runHook postCheck
77 '';
78
79 meta = {
80 description = "Open Multi-View Stereo reconstruction library";
81 homepage = "https://github.com/cdcseacave/openMVS";
82 license = lib.licenses.agpl3Only;
83 platforms = lib.platforms.unix;
84 maintainers = with lib.maintainers; [ bouk ];
85 };
86}