diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2024-04-20 19:23:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-20 19:23:46 +0200 |
commit | 3773b498fef7b207b486a6e79c453fb136d902a1 (patch) | |
tree | 8bb1f7b7f0b15aa135e057a000de4f40cbb002a6 /pkgs/applications/graphics | |
parent | fca59efa1e9fc623157b874813e917463edf4c25 (diff) | |
parent | fc7d8b347a6d3deb8dd765e8bc026cdcaf0eed1f (diff) |
Merge pull request #299049 from nim65s/meshlab
meshlab: 2022.02 -> 2023.12
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r-- | pkgs/applications/graphics/meshlab/default.nix | 58 | ||||
-rw-r--r-- | pkgs/applications/graphics/pymeshlab/default.nix | 107 |
2 files changed, 139 insertions, 26 deletions
diff --git a/pkgs/applications/graphics/meshlab/default.nix b/pkgs/applications/graphics/meshlab/default.nix index 32d5288315395..a77a39445c045 100644 --- a/pkgs/applications/graphics/meshlab/default.nix +++ b/pkgs/applications/graphics/meshlab/default.nix @@ -15,21 +15,27 @@ , qhull , cmake , cgal -, boost179 +, boost , mpfr , xercesc +, tbb +, embree +, vcg +, libigl +, corto +, openctm +, structuresynth }: mkDerivation rec { pname = "meshlab"; - version = "2022.02"; + version = "2023.12"; src = fetchFromGitHub { owner = "cnr-isti-vclab"; repo = "meshlab"; rev = "MeshLab-${version}"; - sha256 = "sha256-jcc3PfsiIeYyipteZgzd0NwZgFFgR/mMBiaInzhOcDY="; - fetchSubmodules = true; # for vcglib + sha256 = "sha256-AdUAWS741RQclYaSE3Tz1/I0YSinNAnfSaqef+Tib8Y="; }; buildInputs = [ @@ -46,38 +52,38 @@ mkDerivation rec { levmar qhull cgal - boost179 + boost mpfr xercesc + tbb + embree + vcg + libigl + corto + openctm + structuresynth ]; nativeBuildInputs = [ cmake ]; preConfigure = '' - substituteAll ${./meshlab.desktop} scripts/Linux/resources/meshlab.desktop - cmakeDir=$PWD/src - mkdir ../build - cd ../build + substituteAll ${./meshlab.desktop} resources/linux/meshlab.desktop + substituteInPlace src/external/libigl.cmake \ + --replace-fail '$'{MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libigl-2.4.0 ${libigl} + substituteInPlace src/external/nexus.cmake \ + --replace-fail '$'{NEXUS_DIR}/src/corto ${corto.src} + substituteInPlace src/external/levmar.cmake \ + --replace-fail '$'{LEVMAR_LINK} ${levmar.src} \ + --replace-warn "MD5 ''${LEVMAR_MD5}" "" + substituteInPlace src/external/ssynth.cmake \ + --replace-fail '$'{SSYNTH_LINK} ${structuresynth.src} \ + --replace-warn "MD5 ''${SSYNTH_MD5}" "" + substituteInPlace src/common_gui/CMakeLists.txt \ + --replace-warn "MESHLAB_LIB_INSTALL_DIR" "CMAKE_INSTALL_LIBDIR" ''; cmakeFlags = [ - "-DALLOW_BUNDLED_EIGEN=OFF" - "-DALLOW_BUNDLED_GLEW=OFF" - "-DALLOW_BUNDLED_LIB3DS=OFF" - "-DALLOW_BUNDLED_MUPARSER=OFF" - "-DALLOW_BUNDLED_QHULL=OFF" - # disable when available in nixpkgs - "-DALLOW_BUNDLED_OPENCTM=ON" - "-DALLOW_BUNDLED_SSYNTH=ON" - "-DALLOW_BUNDLED_BOOST=OFF" - # some plugins are disabled unless these are on - "-DALLOW_BUNDLED_NEWUOA=ON" - "-DALLOW_BUNDLED_LEVMAR=ON" - ]; - - CXXFLAGS = [ - # GCC 13: error: 'int16_t' has not been declared in 'std' - "-include cstdint" + "-DVCGDIR=${vcg.src}" ]; postFixup = '' diff --git a/pkgs/applications/graphics/pymeshlab/default.nix b/pkgs/applications/graphics/pymeshlab/default.nix new file mode 100644 index 0000000000000..5bf8339797b42 --- /dev/null +++ b/pkgs/applications/graphics/pymeshlab/default.nix @@ -0,0 +1,107 @@ +{ stdenv +, lib +, fetchFromGitHub +, libGLU +, qtbase +, qtscript +, qtxmlpatterns +, lib3ds +, bzip2 +, muparser +, eigen +, glew +, gmp +, levmar +, qhull +, cmake +, cgal +, boost +, mpfr +, xercesc +, tbb +, embree +, vcg +, libigl +, corto +, openctm +, structuresynth +, wrapQtAppsHook +, python3Packages +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "pymeshlab"; + version = "2023.12"; + + src = fetchFromGitHub { + owner = "cnr-isti-vclab"; + repo = "pymeshlab"; + rev = "v${finalAttrs.version}"; + hash = "sha256-IOlRdXoUPOJt67g3HqsLchV5aL+JUEks2y1Sy+wpwsg="; + fetchSubmodules = true; + }; + + buildInputs = [ + libGLU + qtbase + qtscript + qtxmlpatterns + lib3ds + bzip2 + muparser + eigen + glew + gmp + levmar + qhull + cgal + boost + mpfr + xercesc + tbb + embree + vcg + libigl + corto + structuresynth + openctm + ]; + + nativeBuildInputs = [ + cmake + wrapQtAppsHook + python3Packages.pybind11 + ]; + + propagatedBuildInputs = [ + python3Packages.numpy + ]; + + preConfigure = '' + substituteInPlace src/meshlab/src/external/libigl.cmake \ + --replace-fail '$'{MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libigl-2.4.0 ${libigl} + substituteInPlace src/meshlab/src/external/nexus.cmake \ + --replace-fail '$'{NEXUS_DIR}/src/corto ${corto.src} + substituteInPlace src/meshlab/src/external/levmar.cmake \ + --replace-fail '$'{LEVMAR_LINK} ${levmar.src} \ + --replace-warn "MD5 ''${LEVMAR_MD5}" "" + substituteInPlace src/meshlab/src/external/ssynth.cmake \ + --replace-fail '$'{SSYNTH_LINK} ${structuresynth.src} \ + --replace-warn "MD5 ''${SSYNTH_MD5}" "" + export cmakeFlags="cmakeFlags + -DCMAKE_INSTALL_PREFIX=$out/${python3Packages.python.sitePackages}/pymeshlab + " + ''; + + cmakeFlags = [ + "-DVCGDIR=${vcg.src}" + ]; + + meta = { + description = "The open source mesh processing python library"; + homepage = "https://github.com/cnr-isti-vclab/PyMeshLab"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ nim65s ]; + platforms = with lib.platforms; linux; + }; +}) |