[PATCH 0/3] gnu: meshlib: Unbundle some external libraries

  • Open
  • quality assurance status badge
Details
2 participants
  • Christopher Baines
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Sharlatan Hellseher
Severity
normal

Debbugs page

S
S
Sharlatan Hellseher wrote on 1 Nov 2022 13:21
(address . guix-patches@gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
20221101202106.17518-1-sharlatanus@gmail.com
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.

Toggle quote (5 lines)
> ./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
S
S
Sharlatan Hellseher wrote on 1 Nov 2022 13:22
[PATCH 1/3] gnu: Add easyexif
(address . 58952@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
20221101202246.17659-1-sharlatanus@gmail.com
* gnu/packages/photo.scm (easyexif): New variable.
---
gnu/packages/photo.scm | 44 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (57 lines)
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
S
S
Sharlatan Hellseher wrote on 1 Nov 2022 13:22
[PATCH 2/3] gnu: Add vcglib
(address . 58952@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
20221101202246.17659-2-sharlatanus@gmail.com
* gnu/packages/engineering.scm (vcglib): New variable.
---
gnu/packages/engineering.scm | 65 ++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)

Toggle diff (78 lines)
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
S
S
Sharlatan Hellseher wrote on 1 Nov 2022 13:22
[PATCH 3/3] gnu: meshlab: Unbundle vcglib and easyexif
(address . 58952@debbugs.gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
20221101202246.17659-3-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(-)

Toggle diff (107 lines)
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
C
C
Christopher Baines wrote on 3 Nov 2022 10:24
Re: [bug#58952] [PATCH 1/3] gnu: Add easyexif
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
8735b0lzn2.fsf@cbaines.net
Sharlatan Hellseher <sharlatanus@gmail.com> writes:

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

...

Toggle quote (2 lines)
> + (license license:bsd-0)))

Can you check this please, I think it's a different BSD licence variant.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmNj+VFfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcH7BAAi4ZeXMeb0En7w7oIT7fUrOufLpv2i92e
darA9MhCnkEWMZ0pWnQ4LLHzOqCkWtslEOdMBo7R9OEe6N1FunOTVc68pWJJ6tc/
IrYaH2Cb4YqLR4UhfF1JR84B0OKbk18jvCwSyIMPyV7BAEqj7AVlxYOhott9CQZf
IkFTfuUpl+F4NPTbMGNrwtQEHgTwUSQaE7/VwObQPwS0P1Tezyib1ovxDOG9Mti2
mR3ca79nFevUjvJ31ot3nUyUWrfd7bJq1UiJE3J8fUEE7uJ+b9KZxDCwCr9k0R+B
HVfvdQAaGjHwZZsTSJoiYX3qlyBbpLd+h5vT/not9PsmsIjZqwDZ++I2FjuER5fa
KKy67aiM33ik0r0KflIHVGxmkvLjsxRftKcEouIXEZ4Y+zvZpl0sYNDbFuNhfJKI
HnLjuuTUJFpFCDdnEHUJUkdayEJxYNvLQVUIHxHR67YXfaw9CbAGPLufOA9NzRlr
sm9HxjJcwja7aW5gjj663Vr4vnSuc65hqtnIyaUXUJAJQpozIMZiOvxVK4EvTqnD
NfXia0fK21T9g6AJiW0hg2BLYu0syA4mckHr2k22n+QxGJrqM1OeCNhf4UZ/t2Q1
kKJkeluJtPzMIQXuv1TC0YWctXkx7HK1jYDK6yPHoNylk462bY7ZTU3sKfRSc81H
oSe5QxkWD/4=
=lv85
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 3 Nov 2022 10:24
Re: [bug#58952] [PATCH 2/3] gnu: Add vcglib
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
87y1sskl0i.fsf@cbaines.net
Sharlatan Hellseher <sharlatanus@gmail.com> writes:

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

...

Toggle quote (2 lines)
> + (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
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmNj+Z1fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XddqhAAojmPVxlmvHtTXoa5Snssjx9XDcRG1KPy
x4uG9O6K0al9YOOJyyO3xTglE03zKCV1acZYyHMmVQ7ddFaSyMIFVjJrKvr+0Oax
0LoZHuG/YAxgrnmNqXh5F+BaYazBnSmcpIQLKNxo8BG9zoYclS9W7MyNQibAxZZM
JLHvoO0BQ4I2MTG93U0Nayr4rtB890vf4/IeRXiXPVMMiGq0a8ZmRfWpHr6ZyCED
3CqVWQOExiNbPEiaPCyk1mvBOhHkYDUfmTodfsGxA16Ox8xdd4ol3MDo0ipFFVkl
GlWGHGri6/TGLE+UNKrPX/EX03W+0kRkKar6GmZRl36127vTxky8vyCKHwxShqA/
OjlDc29Md0TxrhOZ6ULgMuzlH3e+rHHqRJcxP3lpxBcQc+72VbPr+XfH6MhMT4tq
6Tw07JVtlJYZoaZCBABMvlC9Wu7f/cU6QsbmnKPawEhm2OcMaOmtrNYIkc21HlMc
zAXe9+nEZYQzOxueKGFUnxhxyR9Xs35rqBt4dPSLuhf/3F5IK/QvZRbrozsFQA38
Jd7HkP2RPwZVpv7tq4wXosKvB/BJOVbezc8/B9dfqIRfncwFixyNQCy2kThRzVLm
/1s3JXGCVVYegDfX+vvQuuNSEy2zR7RIEBwM5Phmdd9Xa1qPeKNolzb6FXgVaBhy
ECCjIwrrt5U=
=vokb
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 3 Nov 2022 10:26
tag 58952 moreinfo
(address . control@debbugs.gnu.org)
87r0yklzkn.fsf@cbaines.net
tags 58952 + moreinfo
quit
S
S
Sharlatan Hellseher wrote on 3 Nov 2022 15:58
(address . 58952@debbugs.gnu.org)(name . Christopher Baines)(address . mail@cbaines.net)
CAO+9K5o56c346vjgBcoOuD06kr+bvxZk2QLg8JBen33hih85=w@mail.gmail.com
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.
Regards,
Oleg
--
… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 58952@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 58952
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch