2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
, libjpeg ? null
|
|
|
|
, zlib ? null
|
|
|
|
, libpng ? null
|
|
|
|
, eigen ? null
|
|
|
|
, libtiff ? null
|
|
|
|
, enableExamples ? false
|
|
|
|
, enableDocs ? false }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "1.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "openmvg";
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openmvg";
|
|
|
|
repo = "openmvg";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0mrsi0dzgi7cjzn13r9xv7rnc8c9a4h8ip78xy88m9xsyr21wd1h";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libjpeg zlib libpng eigen libtiff ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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";
|
|
|
|
homepage = "https://openmvg.readthedocs.io/en/latest/";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.mpl20;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ mdaiter ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|