1{ lib
2, stdenv
3, mkDerivation
4, fetchFromGitHub
5, cmake
6, boost
7, cgal_5
8, eigen
9, flann
10, gdal
11, gmp
12, LASzip
13, mpfr
14, pdal
15, pcl
16, qtbase
17, qtsvg
18, qttools
19, tbb
20, xercesc
21, wrapGAppsHook
22}:
23
24mkDerivation rec {
25 pname = "cloudcompare";
26 version = "2.12.4";
27
28 src = fetchFromGitHub {
29 owner = "CloudCompare";
30 repo = "CloudCompare";
31 rev = "v${version}";
32 sha256 = "sha256-rQ9/vS/fyRWGBL4UGPNSeeNsDtnRHEp9NCViBtu/QEs=";
33 fetchSubmodules = true;
34 };
35
36 nativeBuildInputs = [
37 cmake
38 eigen # header-only
39 wrapGAppsHook
40 ];
41
42 buildInputs = [
43 boost
44 cgal_5
45 flann
46 gdal
47 gmp
48 LASzip
49 mpfr
50 pdal
51 pcl
52 qtbase
53 qtsvg
54 qttools
55 tbb
56 xercesc
57 ];
58
59 cmakeFlags = [
60 "-DCCCORELIB_USE_TBB=ON"
61 "-DOPTION_USE_DXF_LIB=ON"
62 "-DOPTION_USE_GDAL=ON"
63 "-DOPTION_USE_SHAPE_LIB=ON"
64
65 "-DPLUGIN_GL_QEDL=ON"
66 "-DPLUGIN_GL_QSSAO=ON"
67
68 "-DPLUGIN_IO_QADDITIONAL=ON"
69 "-DPLUGIN_IO_QCORE=ON"
70 "-DPLUGIN_IO_QCSV_MATRIX=ON"
71 "-DPLUGIN_IO_QE57=ON"
72 "-DPLUGIN_IO_QFBX=OFF" # Autodesk FBX SDK is gratis+proprietary; not packaged in nixpkgs
73 "-DPLUGIN_IO_QPDAL=ON" # required for .las/.laz support
74 "-DPLUGIN_IO_QPHOTOSCAN=ON"
75 "-DPLUGIN_IO_QRDB=OFF" # Riegl rdblib is proprietary; not packaged in nixpkgs
76
77 "-DCCCORELIB_USE_CGAL=ON" # enables Delauney triangulation support
78 "-DPLUGIN_STANDARD_QPCL=ON" # Adds PCD import and export support
79 "-DPLUGIN_STANDARD_QANIMATION=ON"
80 "-DPLUGIN_STANDARD_QBROOM=ON"
81 "-DPLUGIN_STANDARD_QCANUPO=ON"
82 "-DPLUGIN_STANDARD_QCOMPASS=ON"
83 "-DPLUGIN_STANDARD_QCSF=ON"
84 "-DPLUGIN_STANDARD_QFACETS=ON"
85 "-DPLUGIN_STANDARD_QHOUGH_NORMALS=ON"
86 "-DEIGEN_ROOT_DIR=${eigen}/include/eigen3" # needed for hough normals
87 "-DPLUGIN_STANDARD_QHPR=ON"
88 "-DPLUGIN_STANDARD_QM3C2=ON"
89 "-DPLUGIN_STANDARD_QMPLANE=ON"
90 "-DPLUGIN_STANDARD_QPOISSON_RECON=ON"
91 "-DPLUGIN_STANDARD_QRANSAC_SD=OFF" # not compatible with GPL, broken on non-x86
92 "-DPLUGIN_STANDARD_QSRA=ON"
93 "-DPLUGIN_STANDARD_QCLOUDLAYERS=ON"
94 ];
95
96 dontWrapGApps = true;
97
98 # fix file dialogs crashing on non-NixOS (and avoid double wrapping)
99 preFixup = ''
100 qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
101 '';
102
103 meta = with lib; {
104 description = "3D point cloud and mesh processing software";
105 homepage = "https://cloudcompare.org";
106 license = licenses.gpl2Plus;
107 maintainers = with maintainers; [ nh2 ];
108 platforms = with platforms; linux; # only tested here; might work on others
109 };
110}