unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#58952] [PATCH 0/3] gnu: meshlib: Unbundle some external libraries
@ 2022-11-01 20:21 Sharlatan Hellseher
  2022-11-01 20:22 ` [bug#58952] [PATCH 1/3] gnu: Add easyexif Sharlatan Hellseher
  2022-11-03 22:58 ` [bug#58952] Sharlatan Hellseher
  0 siblings, 2 replies; 7+ messages in thread
From: Sharlatan Hellseher @ 2022-11-01 20:21 UTC (permalink / raw)
  To: 58952; +Cc: Sharlatan Hellseher

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#58952] [PATCH 1/3] gnu: Add easyexif
  2022-11-01 20:21 [bug#58952] [PATCH 0/3] gnu: meshlib: Unbundle some external libraries Sharlatan Hellseher
@ 2022-11-01 20:22 ` Sharlatan Hellseher
  2022-11-01 20:22   ` [bug#58952] [PATCH 2/3] gnu: Add vcglib Sharlatan Hellseher
                     ` (2 more replies)
  2022-11-03 22:58 ` [bug#58952] Sharlatan Hellseher
  1 sibling, 3 replies; 7+ messages in thread
From: Sharlatan Hellseher @ 2022-11-01 20:22 UTC (permalink / raw)
  To: 58952; +Cc: Sharlatan Hellseher

* 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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#58952] [PATCH 2/3] gnu: Add vcglib
  2022-11-01 20:22 ` [bug#58952] [PATCH 1/3] gnu: Add easyexif Sharlatan Hellseher
@ 2022-11-01 20:22   ` Sharlatan Hellseher
  2022-11-03 17:24     ` Christopher Baines
  2022-11-01 20:22   ` [bug#58952] [PATCH 3/3] gnu: meshlab: Unbundle vcglib and easyexif Sharlatan Hellseher
  2022-11-03 17:24   ` [bug#58952] [PATCH 1/3] gnu: Add easyexif Christopher Baines
  2 siblings, 1 reply; 7+ messages in thread
From: Sharlatan Hellseher @ 2022-11-01 20:22 UTC (permalink / raw)
  To: 58952; +Cc: Sharlatan Hellseher

* 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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#58952] [PATCH 3/3] gnu: meshlab: Unbundle vcglib and easyexif
  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-01 20:22   ` Sharlatan Hellseher
  2022-11-03 17:24   ` [bug#58952] [PATCH 1/3] gnu: Add easyexif Christopher Baines
  2 siblings, 0 replies; 7+ messages in thread
From: Sharlatan Hellseher @ 2022-11-01 20:22 UTC (permalink / raw)
  To: 58952; +Cc: Sharlatan Hellseher

* 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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#58952] [PATCH 1/3] gnu: Add easyexif
  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-01 20:22   ` [bug#58952] [PATCH 3/3] gnu: meshlab: Unbundle vcglib and easyexif Sharlatan Hellseher
@ 2022-11-03 17:24   ` Christopher Baines
  2 siblings, 0 replies; 7+ messages in thread
From: Christopher Baines @ 2022-11-03 17:24 UTC (permalink / raw)
  To: Sharlatan Hellseher; +Cc: 58952

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]


Sharlatan Hellseher <sharlatanus@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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#58952] [PATCH 2/3] gnu: Add vcglib
  2022-11-01 20:22   ` [bug#58952] [PATCH 2/3] gnu: Add vcglib Sharlatan Hellseher
@ 2022-11-03 17:24     ` Christopher Baines
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher Baines @ 2022-11-03 17:24 UTC (permalink / raw)
  To: Sharlatan Hellseher; +Cc: 58952

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]


Sharlatan Hellseher <sharlatanus@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#58952]
  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-03 22:58 ` Sharlatan Hellseher
  1 sibling, 0 replies; 7+ messages in thread
From: Sharlatan Hellseher @ 2022-11-03 22:58 UTC (permalink / raw)
  To: 58952; +Cc: Christopher Baines

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
-- 
… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-03 23:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` [bug#58952] [PATCH 3/3] gnu: meshlab: Unbundle vcglib and easyexif Sharlatan Hellseher
2022-11-03 17:24   ` [bug#58952] [PATCH 1/3] gnu: Add easyexif Christopher Baines
2022-11-03 22:58 ` [bug#58952] Sharlatan Hellseher

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).