Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / science / misc / openmvg / default.nix
blobc5434c86990933adb0d4c8edf103fcb1c2161f8a
1 { lib, stdenv, fetchFromGitHub, pkg-config, cmake, cereal, openmp
2 , libjpeg ? null
3 , zlib ? null
4 , libpng ? null
5 , eigen ? null
6 , libtiff ? null
7 , ceres-solver
8 , enableShared ? !stdenv.hostPlatform.isStatic
9 , enableExamples ? false
10 , enableDocs ? false }:
12 stdenv.mkDerivation rec {
13   version = "unstable-2022-12-30";
14   pname = "openmvg";
16   src = fetchFromGitHub {
17     owner = "openmvg";
18     repo = "openmvg";
19     rev = "e1bbfe801986cd7171f36443a1573b0f69f3702d";
20     sha256 = "sha256-DngfmejNFw5pogTo7Ec5aUey2LUQIojvJybLmtCfvVY=";
21     fetchSubmodules = true;
22   };
24   buildInputs = [ libjpeg zlib libpng eigen libtiff cereal openmp ceres-solver ];
26   nativeBuildInputs = [ cmake pkg-config ];
28   cmakeFlags = [
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";
34   cmakeDir = "./src";
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" ];
44   meta = {
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 ];
51   };