2021-11-07 14:50:48 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, cmake
|
|
|
|
, eigen
|
|
|
|
, opencv
|
|
|
|
, ceres-solver
|
|
|
|
, cgal
|
|
|
|
, boost
|
|
|
|
, vcg
|
|
|
|
, gmp
|
|
|
|
, mpfr
|
|
|
|
, glog
|
|
|
|
, gflags
|
|
|
|
, libjpeg_turbo
|
|
|
|
}:
|
2017-05-12 21:07:11 +02:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2021-11-07 14:50:48 +01:00
|
|
|
pname = "openmvs";
|
|
|
|
version = "unstable-2018-05-26";
|
2017-05-12 21:07:11 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cdcseacave";
|
|
|
|
repo = "openmvs";
|
2018-04-08 11:34:25 +02:00
|
|
|
rev = "939033c55b50478339084431aac2c2318041afad";
|
|
|
|
sha256 = "12dgkwwfdp24581y3i41gsd1k9hq0aw917q0ja5s0if4qbmc8pni";
|
2017-05-12 21:07:11 +02:00
|
|
|
};
|
|
|
|
|
2019-07-25 11:04:55 +02:00
|
|
|
buildInputs = [ eigen opencv ceres-solver cgal boost vcg gmp mpfr glog gflags libjpeg_turbo ];
|
2017-05-12 21:07:11 +02:00
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2017-05-12 21:07:11 +02:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cmakeFlagsArray=(
|
|
|
|
$cmakeFlagsArray
|
|
|
|
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
|
|
|
"-DBUILD_STATIC_RUNTIME=ON"
|
|
|
|
"-DINSTALL_BIN_DIR=$out/bin"
|
|
|
|
"-DVCG_DIR=${vcg}"
|
2018-06-26 00:34:54 +02:00
|
|
|
"-DCGAL_ROOT=${cgal}/lib/cmake/CGAL"
|
2017-05-12 21:07:11 +02:00
|
|
|
"-DCERES_DIR=${ceres-solver}/lib/cmake/Ceres/"
|
|
|
|
)
|
|
|
|
'';
|
2019-07-25 11:04:55 +02:00
|
|
|
|
2018-06-26 00:34:54 +02:00
|
|
|
postFixup = ''
|
|
|
|
rp=$(patchelf --print-rpath $out/bin/DensifyPointCloud)
|
|
|
|
patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/DensifyPointCloud
|
2017-05-12 21:07:11 +02:00
|
|
|
|
2018-06-26 00:34:54 +02:00
|
|
|
rp=$(patchelf --print-rpath $out/bin/InterfaceVisualSFM)
|
|
|
|
patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/InterfaceVisualSFM
|
|
|
|
|
|
|
|
rp=$(patchelf --print-rpath $out/bin/ReconstructMesh)
|
|
|
|
patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/ReconstructMesh
|
|
|
|
|
|
|
|
rp=$(patchelf --print-rpath $out/bin/RefineMesh)
|
|
|
|
patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/RefineMesh
|
|
|
|
|
|
|
|
rp=$(patchelf --print-rpath $out/bin/TextureMesh)
|
|
|
|
patchelf --set-rpath $rp:$out/lib/OpenMVS $out/bin/TextureMesh
|
|
|
|
'';
|
2019-07-25 11:04:55 +02:00
|
|
|
|
2017-05-12 21:07:11 +02:00
|
|
|
cmakeDir = "./";
|
|
|
|
|
|
|
|
dontUseCmakeBuildDir = true;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-05-12 21:07:11 +02:00
|
|
|
description = "A library for computer-vision scientists and especially targeted to the Multi-View Stereo reconstruction community";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://cdcseacave.github.io/openMVS/";
|
2017-05-12 21:07:11 +02:00
|
|
|
license = licenses.agpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ mdaiter ];
|
2019-04-14 17:41:56 +02:00
|
|
|
# 20190414-174115: CMake cannot find CGAL which is passed as build input
|
|
|
|
broken = true;
|
2017-05-12 21:07:11 +02:00
|
|
|
};
|
|
|
|
}
|