unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Sharlatan Hellseher <sharlatanus@gmail.com>
To: 58952@debbugs.gnu.org
Cc: Sharlatan Hellseher <sharlatanus@gmail.com>
Subject: [bug#58952] [PATCH 3/3] gnu: meshlab: Unbundle vcglib and easyexif
Date: Tue,  1 Nov 2022 20:22:46 +0000	[thread overview]
Message-ID: <20221101202246.17659-3-sharlatanus@gmail.com> (raw)
In-Reply-To: <20221101202246.17659-1-sharlatanus@gmail.com>

* gnu/packages/engineering.scm (meshlab):
  [source]: Do not clone the project recursively. Add clean up procedure
  to remove any bundled libraries and external sources.
  [inputs]: Add vcglib and easyexif. Sort list alphabetically.
  [phases]{set-external-libraries}: New phase.
---
 gnu/packages/engineering.scm | 69 +++++++++++++++++++++++++++++-------
 1 file changed, 57 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 4f705d4b9b..41ed010d6e 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -126,6 +126,7 @@ (define-module (gnu packages engineering)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
@@ -2814,28 +2815,61 @@ (define-public meshlab
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/cnr-isti-vclab/meshlab")
-                    (commit (string-append "MeshLab-" version))
-                    (recursive? #t)))
+                    (commit (string-append "MeshLab-" version))))
               (file-name (git-file-name name version))
               (sha256
-               (base32 "0dkh9qw9z2160s6gjiv0a601kp6hvl66cplvi8rfc892zcykgiwd"))))
+               (base32 "0dkh9qw9z2160s6gjiv0a601kp6hvl66cplvi8rfc892zcykgiwd"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Remove bundeled libraries and prebuilt binaries, check if
+                  ;; the list is changed in the next release.
+                  (for-each (lambda (dir)
+                              (delete-file-recursively dir))
+                            (list "src/external/OpenCTM-1.0.3"
+                                  "src/external/e57"
+                                  "src/external/easyexif"
+                                  "src/external/glew-2.1.0"
+                                  "src/external/levmar-2.3"
+                                  "src/external/lib3ds-1.3.0"
+                                  "src/external/libigl-2.3.0"
+                                  "src/external/muparser_v225"
+                                  "src/external/nexus"
+                                  "src/external/openkinect"
+                                  "src/external/qhull-2020.2"
+                                  "src/external/structuresynth-1.5"
+                                  "src/external/tinygltf"
+                                  "src/external/u3d"
+                                  "src/external/xerces"
+                                  "src/vcglib"
+                                  ;; XXX: Remove this in future release
+                                  ;; they are present in master and contains
+                                  ;; prebuilt libraries
+                                  ;;
+                                  ;; "resources/linux"
+                                  ;; "resources/windows"
+                                  ;; "resources/macos"
+                                  ))))))
     (build-system cmake-build-system)
     (inputs
-     (list qtbase-5
-           mesa
-           glu
+     (list easyexif
+           eigen
            glew
-           muparser
+           glu
            gmp
-           eigen
-           libfreenect
            lib3ds
+           libfreenect
+           mesa
+           muparser
            openctm
-           qhull))
+           qhull
+           qtbase-5
+           vcglib))
     (arguments
      (list #:tests? #f                  ; Has no tests
            #:configure-flags
-           #~(list (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
+           #~(list (string-append "-DVCGDIR=" #$(this-package-input "vcglib") "/include/vcglib")
+                   (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
                                   #$output "/lib/meshlab")
                    (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath="
                                   #$output "/lib/meshlab")
@@ -2844,7 +2878,18 @@ (define-public meshlab
            #:phases
            #~(modify-phases %standard-phases
                (add-after 'unpack 'go-to-source-dir
-                 (lambda _ (chdir "src"))))))
+                 (lambda _ (chdir "src")))
+               ;; XXX: Add more substitutions to CMake files if building start
+               ;; failing. GLEW and easyexif comes as hard dependencies for
+               ;; MashLab missing them prevent core built.
+               (add-before 'configure 'set-external-libraries
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "external/easyexif.cmake"
+                     ((".*set.EXIF_DIR.*")
+                      (string-append
+                       "set(EXIF_DIR "
+                       (search-input-directory inputs "/include/easyexif")
+                       ")"))))))))
     (synopsis "3D triangular mesh processing and editing software")
     (home-page "https://www.meshlab.net/")
     (description "MeshLab is a system for the processing and editing of large,
-- 
2.37.3





  parent reply	other threads:[~2022-11-01 20:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 20:21 [bug#58952] [PATCH 0/3] gnu: meshlib: Unbundle some external libraries Sharlatan Hellseher
2022-11-01 20:22 ` [bug#58952] [PATCH 1/3] gnu: Add easyexif Sharlatan Hellseher
2022-11-01 20:22   ` [bug#58952] [PATCH 2/3] gnu: Add vcglib Sharlatan Hellseher
2022-11-03 17:24     ` Christopher Baines
2022-11-01 20:22   ` Sharlatan Hellseher [this message]
2022-11-03 17:24   ` [bug#58952] [PATCH 1/3] gnu: Add easyexif Christopher Baines
2022-11-03 22:58 ` [bug#58952] Sharlatan Hellseher

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20221101202246.17659-3-sharlatanus@gmail.com \
    --to=sharlatanus@gmail.com \
    --cc=58952@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).