GNU bug report logs - #58952
[PATCH 0/3] gnu: meshlib: Unbundle some external libraries

Previous Next

Package: guix-patches;

Reported by: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Date: Tue, 1 Nov 2022 20:22:01 UTC

Severity: normal

Tags: moreinfo, patch

To reply to this bug, email your comments to 58952 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Tue, 01 Nov 2022 20:22:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sharlatan Hellseher <sharlatanus <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 01 Nov 2022 20:22:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: [PATCH 0/3] gnu: meshlib: Unbundle some external libraries
Date: Tue,  1 Nov 2022 20:21:06 +0000
Hi Guix team!

While fixing my patch for PLplot which does not see qhull library, I was
looking for example of where it's in use and found meshlab package.  Some
investigation showed me that it had some bundled external libraries which this
patches series splits.

> ./pre-inst-env guix build easyexif vcglib meshlab --rounds=2
> /gnu/store/88sa4hcplrjm3v72yq1sc71v0sdq7dxs-meshlab-2022.02
> /gnu/store/yz2460d8arhzdcs0q3wddh0jl87khqwz-vcglib-2022.02
> /gnu/store/faps3l08zhx04ppl0hp1jy2limiqd2ci-easyexif-1.0

Sharlatan Hellseher (3):
  gnu: Add easyexif
  gnu: Add vcglib
  gnu: meshlab: Unbundle vcglib and easyexif

 gnu/packages/engineering.scm | 134 +++++++++++++++++++++++++++++++----
 gnu/packages/photo.scm       |  44 ++++++++++++
 2 files changed, 166 insertions(+), 12 deletions(-)


base-commit: 08d60c8691f1ce2291c557022257170881567d76
-- 
2.37.3





Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Tue, 01 Nov 2022 20:23:01 GMT) Full text and rfc822 format available.

Message #8 received at 58952 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 58952 <at> debbugs.gnu.org
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: [PATCH 1/3] gnu: Add easyexif
Date: Tue,  1 Nov 2022 20:22:44 +0000
* gnu/packages/photo.scm (easyexif): New variable.
---
 gnu/packages/photo.scm | 44 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index 642694bda1..0df6c7f271 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -227,6 +227,50 @@ (define-public libexif
 data as produced by digital cameras.")
     (license license:lgpl2.1+)))
 
+(define-public easyexif
+  (package
+    (name "easyexif")
+    (version "1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/mayanklahiri/easyexif")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0l3zr2gzjw25k7gw8z7cpz4prqzfrrpqdqd8gqw2py8pbsxkx8ap"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (replace 'check
+                          (lambda* (#:key tests? #:allow-other-keys)
+                            (when tests?
+                              (invoke "./test.sh"))))
+                        (replace 'install
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (let* ((out (assoc-ref outputs "out"))
+                                   (bin (string-append out "/bin"))
+                                   (share (string-append out "/share"))
+                                   (include (string-append out
+                                                           "/include/easyexif")))
+                              (for-each (lambda (dir)
+                                          (mkdir-p dir))
+                                        (list bin include share))
+                              (install-file "demo" bin)
+                              (install-file "exif.cpp" include)
+                              (install-file "exif.h" include)
+                              (install-file "LICENSE" share)))))))
+    (home-page "https://github.com/mayanklahiri/easyexif")
+    (synopsis "ISO-compliant C++ EXIF parsing library")
+    (description
+     "EasyEXIF is a tiny, lightweight C++ library that parses basic information
+out of JPEG files.  It uses only the std::string library and is otherwise pure
+C++.  You pass it the binary contents of a JPEG file, and it parses several of
+the most important EXIF fields for you.")
+    (license license:bsd-0)))
+
 (define-public libgphoto2
   (package
     (name "libgphoto2")
-- 
2.37.3





Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Tue, 01 Nov 2022 20:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 58952 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 58952 <at> debbugs.gnu.org
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: [PATCH 2/3] gnu: Add vcglib
Date: Tue,  1 Nov 2022 20:22:45 +0000
* gnu/packages/engineering.scm (vcglib): New variable.
---
 gnu/packages/engineering.scm | 65 ++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 644c0f8ef9..4f705d4b9b 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2741,6 +2741,71 @@ (define-public lib3ds
 export filters.")
     (license license:lgpl2.1+)))
 
+(define-public vcglib
+  (package
+    (name "vcglib")
+    (version "2022.02")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/cnr-isti-vclab/vcglib")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1w9r22wg7452x4xald4frsq4vc03vbxf3qq3d9a2zl04b1bdna2w"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:tests? #f ;Has no tests
+           #:configure-flags
+           ;; Make sure we still can build examples which shows nothing major
+           ;; broken.
+           #~(list (string-append "-DVCG_BUILD_EXAMPLES=ON")
+                   (string-append "-DEIGEN3_INCLUDE_DIR="
+                                  #$(this-package-input "eigen")
+                                  "/include/eigen3"))
+           #:phases #~(modify-phases %standard-phases
+                        (replace 'install
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (let* ((out (assoc-ref outputs "out"))
+                                   (bin (string-append out "/bin"))
+                                   (include (string-append out
+                                                           "/include/vcglib"))
+                                   (wrap (string-append include "/wrap/"))
+                                   (vcg (string-append include "/vcg")))
+                              (for-each (lambda (dir)
+                                          (mkdir-p dir))
+                                        (list bin include wrap vcg))
+                              (install-file "apps/metro/metro" bin)
+                              (install-file "../source/CMakeLists.txt" include)
+                              (copy-recursively "../source/wrap/" wrap)
+                              (copy-recursively "../source/vcg/" vcg)))))))
+    (propagated-inputs (list eigen))
+    (synopsis "C++ library to work with triangle meshes")
+    (home-page "http://vcglib.net/")
+    (description
+     "This package provides @acronym{VCGlib, Visualization and Computer Graphics
+Library} The VCG library is tailored to mostly manage triangular meshes: offers
+many capabilities for processing meshes, such as:
+
+@itemize
+
+@item high quality quadric-error edge-collapse based simplfication
+@item efficient spatial query structures (uniform grids, hashed grids, kdtree,
+etc)
+@item advanced smoothing and fairing algorithms
+@item computation of curvature
+@item optimization of texture coordinates
+@item Hausdorff distance computation
+@item geodesic paths
+@item mesh repairing capabilities
+@item isosurface extraction and advancing front meshing algorithms
+@item Poisson Disk sampling and other tools to sample point distributions over
+meshes
+@item subdivision surfaces
+@end itemize")
+    (license license:gpl3+)))
+
 (define-public meshlab
   (package
     (name "meshlab")
-- 
2.37.3





Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Tue, 01 Nov 2022 20:24:02 GMT) Full text and rfc822 format available.

Message #14 received at 58952 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 58952 <at> debbugs.gnu.org
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: [PATCH 3/3] gnu: meshlab: Unbundle vcglib and easyexif
Date: Tue,  1 Nov 2022 20:22:46 +0000
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Thu, 03 Nov 2022 17:25:01 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Cc: guix-patches <at> gnu.org, 58952 <at> debbugs.gnu.org
Subject: Re: [bug#58952] [PATCH 1/3] gnu: Add easyexif
Date: Thu, 03 Nov 2022 18:24:01 +0100
[Message part 1 (text/plain, inline)]
Sharlatan Hellseher <sharlatanus <at> gmail.com> writes:

> * gnu/packages/photo.scm (easyexif): New variable.
> ---
>  gnu/packages/photo.scm | 44 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)

...

> +    (license license:bsd-0)))

Can you check this please, I think it's a different BSD licence variant.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Thu, 03 Nov 2022 17:25:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Thu, 03 Nov 2022 17:26:01 GMT) Full text and rfc822 format available.

Message #23 received at 58952 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Cc: guix-patches <at> gnu.org, 58952 <at> debbugs.gnu.org
Subject: Re: [bug#58952] [PATCH 2/3] gnu: Add vcglib
Date: Thu, 03 Nov 2022 18:24:37 +0100
[Message part 1 (text/plain, inline)]
Sharlatan Hellseher <sharlatanus <at> gmail.com> writes:

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

...

> +    (license license:gpl3+)))

This might be correct for some files, but I think I spotted a GPLv2
one. Also, some files just seem to state "all rights reserved", so maybe
some parts aren't free software?

Maybe try running licensecheck over the source code.

Thanks,

Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Thu, 03 Nov 2022 17:27:02 GMT) Full text and rfc822 format available.

Added tag(s) moreinfo. Request was from Christopher Baines <mail <at> cbaines.net> to control <at> debbugs.gnu.org. (Thu, 03 Nov 2022 17:27:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#58952; Package guix-patches. (Thu, 03 Nov 2022 22:59:02 GMT) Full text and rfc822 format available.

Message #31 received at 58952 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 58952 <at> debbugs.gnu.org
Cc: Christopher Baines <mail <at> cbaines.net>
Date: Thu, 3 Nov 2022 22:58:11 +0000
Hi Christopher,

It's a good point to double check the license as licensecheck gave me
wide range of possible options for vcglib. Packed MeshLab included
them for a long time as bundles.

I've open issues to each of the project to check license type with authors.

  - [ ] https://github.com/mayanklahiri/easyexif/issues/43
  - [ ] https://github.com/cnr-isti-vclab/vcglib/issues/206

Regards,
Oleg
-- 
… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.

This bug report was last modified 2 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.