nixos/java: No bashisms in `environment.shellInit` script (#294121)
[NixPkgs.git] / pkgs / applications / graphics / meshlab / default.nix
blob658e4b4e9c704558977e8a13614f15552687aa96
1 { mkDerivation
2 , lib
3 , fetchFromGitHub
4 , libGLU
5 , qtbase
6 , qtscript
7 , qtxmlpatterns
8 , lib3ds
9 , bzip2
10 , muparser
11 , eigen
12 , glew
13 , gmp
14 , levmar
15 , qhull
16 , cmake
17 , cgal
18 , boost
19 , mpfr
20 , xercesc
21 , tbb
22 , embree
23 , vcg
24 , libigl
25 , corto
26 , openctm
27 , structuresynth
30 mkDerivation rec {
31   pname = "meshlab";
32   version = "2023.12";
34   src = fetchFromGitHub {
35     owner = "cnr-isti-vclab";
36     repo = "meshlab";
37     rev = "MeshLab-${version}";
38     sha256 = "sha256-AdUAWS741RQclYaSE3Tz1/I0YSinNAnfSaqef+Tib8Y=";
39   };
41   buildInputs = [
42     libGLU
43     qtbase
44     qtscript
45     qtxmlpatterns
46     lib3ds
47     bzip2
48     muparser
49     eigen
50     glew
51     gmp
52     levmar
53     qhull
54     cgal
55     boost
56     mpfr
57     xercesc
58     tbb
59     embree
60     vcg
61     libigl
62     corto
63     openctm
64     structuresynth
65   ];
67   nativeBuildInputs = [ cmake ];
69   preConfigure = ''
70     substituteAll ${./meshlab.desktop} resources/linux/meshlab.desktop
71     substituteInPlace src/external/libigl.cmake \
72       --replace-fail '$'{MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libigl-2.4.0 ${libigl}
73     substituteInPlace src/external/nexus.cmake \
74       --replace-fail '$'{NEXUS_DIR}/src/corto ${corto.src}
75     substituteInPlace src/external/levmar.cmake \
76       --replace-fail '$'{LEVMAR_LINK} ${levmar.src} \
77       --replace-warn "MD5 ''${LEVMAR_MD5}" ""
78     substituteInPlace src/external/ssynth.cmake \
79       --replace-fail '$'{SSYNTH_LINK} ${structuresynth.src} \
80       --replace-warn "MD5 ''${SSYNTH_MD5}" ""
81     substituteInPlace src/common_gui/CMakeLists.txt \
82       --replace-warn "MESHLAB_LIB_INSTALL_DIR" "CMAKE_INSTALL_LIBDIR"
83   '';
85   cmakeFlags = [
86     "-DVCGDIR=${vcg.src}"
87   ];
89   postFixup = ''
90     patchelf --add-needed $out/lib/meshlab/libmeshlab-common.so $out/bin/.meshlab-wrapped
91   '';
93   meta = {
94     description = "System for processing and editing 3D triangular meshes";
95     mainProgram = "meshlab";
96     homepage = "https://www.meshlab.net/";
97     license = lib.licenses.gpl3Only;
98     maintainers = [ ];
99     platforms = with lib.platforms; linux;
100   };