all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Gankevich <i.gankevich@spbu.ru>
To: 49713@debbugs.gnu.org
Cc: Ivan Gankevich <i.gankevich@spbu.ru>
Subject: [bug#49713] [PATCH v3 2/3] gnu: Add libigl.
Date: Tue, 21 Sep 2021 01:15:50 +0300	[thread overview]
Message-ID: <20210920221549.14678-2-i.gankevich@spbu.ru> (raw)
In-Reply-To: <20210920221549.14678-1-i.gankevich@spbu.ru>

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

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 46622f3a1f..421a10292a 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2863,3 +2863,142 @@ 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"
+              ;; The following options disable tests for the corresponding libraries.
+              ;; The options do not affect whether the libraries are linked to libigl or not,
+              ;; they are used for tests.
+              "-DLIBIGL_WITH_COMISO=OFF"
+              "-DLIBIGL_WITH_CORK=OFF"
+              "-DLIBIGL_WITH_MATLAB=OFF"
+              "-DLIBIGL_WITH_MOSEK=OFF"
+              "-DLIBIGL_WITH_TRIANGLE=OFF" ;; Undefined reference to "triangulate".
+              "-DLIBIGL_WITH_OPENGL_GLFW_IMGUI=OFF")
+        #:phases
+        (modify-phases %standard-phases
+          (add-before 'configure 'do-not-download-dependencies
+            (lambda _
+              (setenv "HOME" (getcwd)) ;; cmake needs this to export modules
+              (mkdir "external")
+              (copy-recursively (assoc-ref %build-inputs "libigl-glad") "external/glad")
+              (copy-recursively (assoc-ref %build-inputs "libigl-stb") "external/stb")
+              (copy-recursively (assoc-ref %build-inputs "libigl-tetgen") "external/tetgen")
+              (copy-recursively (assoc-ref %build-inputs "libigl-predicates") "external/predicates")
+              (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)"))
+                (("if\\(NOT TARGET embree\\)" all)
+                 (string-append "find_package(embree 3 CONFIG REQUIRED)\n" all))
+                (("if\\(NOT TARGET glfw\\)" all)
+                 (string-append "find_package(glfw3 CONFIG REQUIRED)\n" all))
+                (("igl_download_glad\\(\\)" all) "")
+                (("igl_download_stb\\(\\)" all) "")
+                (("igl_download_tetgen\\(\\)" all) "")
+                (("igl_download_triangle\\(\\)" all) "")
+                (("igl_download_predicates\\(\\)" all) ""))
+              (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
+      `(("catch2" ,catch-framework2)
+        ("cgal" ,cgal)
+        ("embree" ,embree)
+        ("mesa" ,mesa)
+        ("glfw" ,glfw)
+        ("tinyxml2" ,tinyxml2)
+        ("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"))))
+        ("libigl-glad"
+         ,(origin
+            (method git-fetch)
+            (uri (git-reference
+                   (url "https://github.com/libigl/libigl-glad")
+                   ;; This commit should be updated for each version
+                   ;; from "cmake/LibiglDownloadExternal.cmake".
+                   (commit "09b4969c56779f7ddf8e6176ec1873184aec890f")))
+            (file-name (git-file-name "libigl-glad" version))
+            (sha256 (base32 "0rwrs7513ylp6gxv7crjzflapcg9p7x04nzfvywgl665vl53rawk"))))
+        ("libigl-stb"
+         ,(origin
+            (method git-fetch)
+            (uri (git-reference
+                   (url "https://github.com/libigl/libigl-stb.git")
+                   ;; This commit should be updated for each version
+                   ;; from "cmake/LibiglDownloadExternal.cmake".
+                   (commit "cd0fa3fcd90325c83be4d697b00214e029f94ca3")))
+            (file-name (git-file-name "libigl-stb" version))
+            (sha256 (base32 "0wwlb370z40y63ic3ny6q7lxibhixg2k1pjdkl4ymzv79zld28kj"))))
+        ("libigl-tetgen"
+         ,(origin
+            (method git-fetch)
+            (uri (git-reference
+                   (url "https://github.com/libigl/tetgen.git")
+                   ;; This commit should be updated for each version
+                   ;; from "cmake/LibiglDownloadExternal.cmake".
+                   (commit "4f3bfba3997f20aa1f96cfaff604313a8c2c85b6")))
+            (file-name (git-file-name "libigl-tetgen" version))
+            (sha256 (base32 "1k724syssw37py7kwmibk3sfwkkgyjyy7qkijnhn6rjm91g8qxsg"))))
+        ("libigl-predicates"
+         ,(origin
+            (method git-fetch)
+            (uri (git-reference
+                   (url "https://github.com/libigl/libigl-predicates.git")
+                   ;; This commit should be updated for each version
+                   ;; from "cmake/LibiglDownloadExternal.cmake".
+                   (commit "488242fa2b1f98a9c5bd1441297fb4a99a6a9ae4")))
+            (file-name (git-file-name "libigl-predicates" version))
+            (sha256 (base32 "13bd98g8lgcq37i3crj66433z09grnb2xjrcqpwqmyn147rp5wyh"))))))
+    (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	other threads:[~2021-09-20 22:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 21:00 [bug#49713] [PATCH 1/3] gnu: cereal: Use cmake to build and install the library Ivan Gankevich
2021-07-23 21:07 ` [bug#49713] [PATCH 2/3] gnu: Add libigl Ivan Gankevich
2021-09-18 17:17   ` Liliana Marie Prikler
2021-09-19 20:18     ` Ivan Gankevich
2021-07-23 21:08 ` [bug#49713] [PATCH 3/3] gnu: Add prusa-slicer Ivan Gankevich
2021-09-18 17:26   ` Liliana Marie Prikler
2021-09-19 21:39     ` Ivan Gankevich
2021-09-19 21:53       ` Liliana Marie Prikler
2021-09-20 22:17         ` Ivan Gankevich
2021-09-21 12:12           ` bug#49713: " Liliana Marie Prikler
2021-09-18 15:53 ` [bug#49713] Patches work, how to upstream them phodina via Guix-patches via
2021-09-18 17:13 ` [bug#49713] [PATCH 1/3] gnu: cereal: Use cmake to build and install the library Liliana Marie Prikler
2021-09-19 18:27   ` Ivan Gankevich
2021-09-19 18:26 ` [bug#49713] [PATCH 1/3 v2] " Ivan Gankevich
2021-09-19 20:18 ` [bug#49713] [PATCH 2/3 v2] gnu: Add libigl Ivan Gankevich
2021-09-19 21:38 ` [bug#49713] [PATCH 3/3 v2] gnu: Add prusa-slicer Ivan Gankevich
2021-09-20 22:15 ` [bug#49713] [PATCH v3 1/3] gnu: cereal: Use cmake to build and install the library Ivan Gankevich
2021-09-20 22:15   ` Ivan Gankevich [this message]
2021-09-20 22:15   ` [bug#49713] [PATCH v3 3/3] gnu: Add prusa-slicer Ivan Gankevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920221549.14678-2-i.gankevich@spbu.ru \
    --to=i.gankevich@spbu.ru \
    --cc=49713@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.