Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / science / misc / colmap / default.nix
bloba029f5440b251a27a7241f50e7fe2325634d081c
1 { mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen,
2   freeimage, glog, libGLU, glew, qtbase,
3   config,
4   cudaSupport ? config.cudaSupport, cudaPackages }:
6 assert cudaSupport -> cudaPackages != { };
8 let
9   boost_static = boost179.override { enableStatic = true; };
11   # TODO: migrate to redist packages
12   inherit (cudaPackages) cudatoolkit;
14 mkDerivation rec {
15   version = "3.7";
16   pname = "colmap";
17   src = fetchFromGitHub {
18      owner = "colmap";
19      repo = "colmap";
20      rev = version;
21      hash = "sha256-uVAw6qwhpgIpHkXgxttKupU9zU+vD0Za0maw2Iv4x+I=";
22   };
24   # TODO: rm once the gcc11 issue is closed, https://github.com/colmap/colmap/issues/1418#issuecomment-1049305256
25   cmakeFlags = lib.optionals cudaSupport [
26     "-DCUDA_ENABLED=ON"
27     "-DCUDA_NVCC_FLAGS=--std=c++14"
28   ];
30   buildInputs = [
31     boost_static ceres-solver eigen
32     freeimage glog libGLU glew qtbase
33   ] ++ lib.optionals cudaSupport [
34     cudatoolkit
35   ];
37   nativeBuildInputs = [
38     cmake
39   ] ++ lib.optionals cudaSupport [
40     cudaPackages.autoAddOpenGLRunpathHook
41   ];
43   meta = with lib; {
44     description = "COLMAP - Structure-From-Motion and Multi-View Stereo pipeline";
45     longDescription = ''
46        COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline
47        with a graphical and command-line interface.
48     '';
49     homepage = "https://colmap.github.io/index.html";
50     license = licenses.bsd3;
51     platforms = platforms.linux;
52     maintainers = with maintainers; [ lebastr ];
53   };