1 { lib, stdenv, fetchFromGitHub, pkg-config, cmake, cereal, openmp
8 , enableShared ? !stdenv.hostPlatform.isStatic
9 , enableExamples ? false
10 , enableDocs ? false }:
12 stdenv.mkDerivation rec {
13 version = "unstable-2022-12-30";
16 src = fetchFromGitHub {
19 rev = "e1bbfe801986cd7171f36443a1573b0f69f3702d";
20 sha256 = "sha256-DngfmejNFw5pogTo7Ec5aUey2LUQIojvJybLmtCfvVY=";
21 fetchSubmodules = true;
24 buildInputs = [ libjpeg zlib libpng eigen libtiff cereal openmp ceres-solver ];
26 nativeBuildInputs = [ cmake pkg-config ];
29 "-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}"
30 "-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}"
31 "-DTARGET_ARCHITECTURE=generic"
32 ] ++ lib.optional enableShared "-DOpenMVG_BUILD_SHARED=ON";
36 dontUseCmakeBuildDir = true;
38 # This can be enabled, but it will exhause virtual memory on most machines.
39 enableParallelBuilding = false;
41 # Without hardeningDisable, certain flags are passed to the compile that break the build (primarily string format errors)
42 hardeningDisable = [ "all" ];
45 broken = stdenv.isDarwin && stdenv.isx86_64;
46 description = "A library for computer-vision scientists and targeted for the Multiple View Geometry community";
47 homepage = "https://openmvg.readthedocs.io/en/latest/";
48 license = lib.licenses.mpl20;
49 platforms = lib.platforms.unix;
50 maintainers = with lib.maintainers; [ mdaiter bouk ];