2020-04-15 22:00:47 +01:00
|
|
|
{ stdenv, fetchFromGitHub, pkgconfig, cmake
|
2017-05-03 13:55:06 +01:00
|
|
|
, libjpeg ? null
|
|
|
|
, zlib ? null
|
|
|
|
, libpng ? null
|
|
|
|
, eigen ? null
|
|
|
|
, libtiff ? null
|
|
|
|
, enableExamples ? false
|
|
|
|
, enableDocs ? false }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-15 22:00:47 +01:00
|
|
|
version = "1.6";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "openmvg";
|
2017-05-03 13:55:06 +01:00
|
|
|
|
2020-04-15 22:00:47 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openmvg";
|
|
|
|
repo = "openmvg";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0mrsi0dzgi7cjzn13r9xv7rnc8c9a4h8ip78xy88m9xsyr21wd1h";
|
2017-05-03 13:55:06 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libjpeg zlib libpng eigen libtiff ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
|
|
|
"-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}"
|
|
|
|
"-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeDir = "./src";
|
|
|
|
|
|
|
|
dontUseCmakeBuildDir = true;
|
|
|
|
|
|
|
|
# This can be enabled, but it will exhause virtual memory on most machines.
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
|
|
|
# Without hardeningDisable, certain flags are passed to the compile that break the build (primarily string format errors)
|
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A library for computer-vision scientists and targeted for the Multiple View Geometry community";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://openmvg.readthedocs.io/en/latest/";
|
2017-05-03 13:55:06 +01:00
|
|
|
license = stdenv.lib.licenses.mpl20;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ mdaiter ];
|
|
|
|
};
|
|
|
|
}
|