guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#49713] [PATCH 2/3 v2] gnu: Add libigl.


From: Ivan Gankevich
Subject: [bug#49713] [PATCH 2/3 v2] gnu: Add libigl.
Date: Sun, 19 Sep 2021 23:18:32 +0300

* gnu/packages/engineering.scm (libigl): New variable.
---
 gnu/packages/engineering.scm | 88 ++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 46622f3a1f..2c22cc3278 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2863,3 +2863,91 @@ for hooking Linux system calls in user space.  This is 
achieved by
 hot-patching the machine code of the standard C library in the memory of
 a process.")
       (license license:bsd-2))))
+
+(define-public libigl
+  (package
+    (name "libigl")
+    (version "2.3.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/libigl/libigl";)
+               (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+          (base32
+            "004a22ifq2vibgkgvrlyihqimpsfizvq5l448204kwfg3lkycajj"))))
+    (build-system cmake-build-system)
+    (arguments
+      `(#:configure-flags
+        (list "-DLIBIGL_USE_STATIC_LIBRARY=OFF"
+              "-DLIBIGL_BUILD_TESTS=ON"
+              "-DLIBIGL_BUILD_TUTORIALS=OFF"
+              "-DLIBIGL_EXPORT_TARGETS=ON"
+              "-DLIBIGL_WITH_CGAL=ON"
+              "-DLIBIGL_WITH_COMISO=OFF"
+              "-DLIBIGL_WITH_CORK=OFF"
+              "-DLIBIGL_WITH_EMBREE=OFF"
+              "-DLIBIGL_WITH_MATLAB=OFF"
+              "-DLIBIGL_WITH_MOSEK=OFF"
+              "-DLIBIGL_WITH_OPENGL=OFF"
+              "-DLIBIGL_WITH_OPENGL_GLFW=OFF"
+              "-DLIBIGL_WITH_OPENGL_GLFW_IMGUI=OFF"
+              "-DLIBIGL_WITH_PNG=OFF"
+              "-DLIBIGL_WITH_TETGEN=OFF"
+              "-DLIBIGL_WITH_TRIANGLE=OFF"
+              "-DLIBIGL_WITH_PREDICATES=OFF"
+              "-DLIBIGL_WITH_XML=ON")
+        #:phases
+        (modify-phases %standard-phases
+          (add-before 'configure 'do-not-download-dependencies
+            (lambda _
+              (setenv "HOME" (getcwd)) ;; cmake needs this to export modules
+              (substitute* "cmake/libigl.cmake"
+                (("if\\(NOT TARGET Eigen3::Eigen\\)" all)
+                 (string-append "find_package(Eigen3 CONFIG REQUIRED)\n" all))
+                (("if\\(NOT TARGET CGAL::CGAL\\)" all)
+                 (string-append "find_package(CGAL CONFIG COMPONENTS Core)\n" 
all))
+                (("if\\(NOT TARGET tinyxml2\\)" all)
+                 (string-append "find_package(tinyxml2 CONFIG REQUIRED)\n"
+                                "if (NOT TARGET tinyxml2::tinyxml2)"))
+                )
+              (substitute* "tests/CMakeLists.txt"
+                (("igl_download_test_data\\(\\)") "")
+                (("set\\(IGL_TEST_DATA.*")
+                 (format #f "set(IGL_TEST_DATA ~a)\n"
+                         (assoc-ref %build-inputs "libigl-test-data")))
+                (("igl_download_catch2\\(\\)") "find_package(Catch2 CONFIG 
REQUIRED)")
+                (("list\\(APPEND CMAKE_MODULE_PATH 
\\$\\{LIBIGL_EXTERNAL\\}/catch2/contrib\\)")
+                 "")
+                (("add_subdirectory\\(\\$\\{LIBIGL_EXTERNAL\\}/catch2 
catch2\\)") ""))))
+          (add-after 'install 'install-all-subdirs
+            (lambda _
+              (copy-recursively
+                "../source/include"
+                (string-append (assoc-ref %outputs "out") "/include")))))))
+    (inputs
+      `(("eigen" ,eigen)
+        ("gmp" ,gmp)
+        ("mpfr" ,mpfr)
+        ("boost" ,boost)))
+    (native-inputs
+      `(("cgal" ,cgal)
+        ("tinyxml2" ,tinyxml2)
+        ("catch2" ,catch-framework2)
+        ("libigl-test-data"
+         ,(origin
+            (method git-fetch)
+            (uri (git-reference
+                   (url "https://github.com/libigl/libigl-tests-data";)
+                   ;; This commit should be updated for each version
+                   ;; from "cmake/LibiglDownloadExternal.cmake".
+                   (commit "19cedf96d70702d8b3a83eb27934780c542356fe")))
+            (file-name (git-file-name "libigl-test-data" version))
+            (sha256 (base32 
"1wxglrxw74xw4a4jmmjpm8719f3mnlbxbwygjb4ddfixxxyya4i2"))))))
+    (home-page "https://libigl.github.io/";)
+    (synopsis "Simple C++ geometry processing library")
+    (description "This library provides functionality for shape modelling,
+visualization, matrix manipulation.")
+    (license (list license:gpl3 license:mpl2.0))))
-- 
2.32.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]