diff mbox series

[bug#40492] gnu: Add meshlab

Message ID _UXapokzwPRYl41j0bjkPGSDUNXahWNWsEn72py7ch7Rd6DBsxW9B8rw8wTbmzj1O2HfWXz7XLbEdWCYQsFCa5DgMlGn0CKVPr779J2PFuo=@elenq.tech
State Accepted
Headers show
Series [bug#40492] gnu: Add meshlab | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Ekaitz Zarraga April 7, 2020, 5:08 p.m. UTC
Hi everyone,

I wrote a package to add meshlab but I'm not sure if I did it right:
- It doesn't have tests so I removed the testing.
- It fails to check RUNPATH, but I don't really know why so I disabled
  it at the moment. It fails while searching for meshlab core libraries
  but the search path is correct (it misses a /meshlab at the end).

Can you please check it and suggest a solution?

It works as it is but the runpath checks should pass...

Thanks!
Ekaitz

---


From d9020d7e64020dc7eea1bd46af184856d568ca7d Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz@elenq.tech>
Date: Tue, 7 Apr 2020 18:56:06 +0200
Subject: [PATCH] gnu: Add meshlab

---
 gnu/packages/engineering.scm | 39 ++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

--
2.25.1

Comments

Ludovic Courtès April 22, 2020, 5:23 p.m. UTC | #1
Hi,

Ekaitz Zarraga <ekaitz@elenq.tech> skribis:

> I wrote a package to add meshlab but I'm not sure if I did it right:
> - It doesn't have tests so I removed the testing.

Please add a short comment in the code saying this so that people
touching the package in the future will know.

> - It fails to check RUNPATH, but I don't really know why so I disabled
>   it at the moment. It fails while searching for meshlab core libraries
>   but the search path is correct (it misses a /meshlab at the end).

Could you show the error message?  It may be that the build system fails
to pass the right -Wl,-rpath or even the right -L/-l flags at link time.

>>From d9020d7e64020dc7eea1bd46af184856d568ca7d Mon Sep 17 00:00:00 2001
> From: Ekaitz Zarraga <ekaitz@elenq.tech>
> Date: Tue, 7 Apr 2020 18:56:06 +0200
> Subject: [PATCH] gnu: Add meshlab
>
> ---
>  gnu/packages/engineering.scm | 39 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)

Bonus points if you can provide a commit log that follows our
conventions.  :-)  See
<https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html> and
‘git log’ for examples.

> +(define-public meshlab
> +  (let ((commit-ref "Meshlab-2020.04"))
> +    (package
> +      (name "meshlab")
> +      (version commit-ref)

The version field should be “2020.04”.  You can construct the commit
from that:

  (string-append "Meshlab-" version)

> +      (synopsis
> +        "The open source system for processing and editing 3D triangular meshes.")
> +      (home-page "http://www.meshlab.net/")
> +      (description "MeshLab is an open source, portable, and extensible system

Two comments:

  1. Everything in Guix is free software, you can remove the “open
     source” mention.

  2. Please make sure to run ‘guix lint’ and check the guidelines at
     <https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.html>.

Could you send an updated patch?

Thanks in advance!

Ludo’.
Ekaitz Zarraga April 22, 2020, 6:40 p.m. UTC | #2
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, April 22, 2020 7:23 PM, Ludovic Courtès <ludo@gnu.org> wrote:

> Hi,
>
> Ekaitz Zarraga ekaitz@elenq.tech skribis:
>
> > I wrote a package to add meshlab but I'm not sure if I did it right:
> >
> > -   It doesn't have tests so I removed the testing.
>
> Please add a short comment in the code saying this so that people
> touching the package in the future will know.
>
> > -   It fails to check RUNPATH, but I don't really know why so I disabled
> >     it at the moment. It fails while searching for meshlab core libraries
> >     but the search path is correct (it misses a /meshlab at the end).
> >
>
> Could you show the error message? It may be that the build system fails
> to pass the right -Wl,-rpath or even the right -L/-l flags at link time.
>
> > > From d9020d7e64020dc7eea1bd46af184856d568ca7d Mon Sep 17 00:00:00 2001
> > > From: Ekaitz Zarraga ekaitz@elenq.tech
> > > Date: Tue, 7 Apr 2020 18:56:06 +0200
> > > Subject: [PATCH] gnu: Add meshlab
> >
> > gnu/packages/engineering.scm | 39 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 39 insertions(+)
>
> Bonus points if you can provide a commit log that follows our
> conventions. :-) See
> https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html and
> ‘git log’ for examples.
>
> > +(define-public meshlab
> >
> > -   (let ((commit-ref "Meshlab-2020.04"))
> > -   (package
> > -        (name "meshlab")
> >
> >
> > -        (version commit-ref)
> >
> >
>
> The version field should be “2020.04”. You can construct the commit
> from that:
>
> (string-append "Meshlab-" version)
>
> > -        (synopsis
> >
> >
> > -          "The open source system for processing and editing 3D triangular meshes.")
> >
> >
> > -        (home-page "http://www.meshlab.net/")
> >
> >
> > -        (description "MeshLab is an open source, portable, and extensible system
> >
> >
>
> Two comments:
>
> 1.  Everything in Guix is free software, you can remove the “open
>     source” mention.
>
> 2.  Please make sure to run ‘guix lint’ and check the guidelines at
>     https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.html.
>
>
> Could you send an updated patch?
>
> Thanks in advance!
>
> Ludo’.

Hi Ludo,

Thanks for the detailed answer. I'll check the formatting errors.
About the RUNPATH checks, I isolated one of the errors and I don't know what to change.

This is the error of the file libsamplefilter.so during the runpath check:

/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib/meshlab/plugins/libsamplefilter.so: error: depends on 'libmeshlab-common.so', which cannot be found in RUNPATH ("/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib" "/gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib" "/gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib" "/gnu/store/qbq794vbw5scpxvnzlnyvdkqfr9163rk-qtscript-5.12.7/lib" "/gnu/store/2k1bsh663bilxndca4gx4zrdp7m63fjb-qtxmlpatterns-5.12.7/lib" "/gnu/store/2mf0clz9w64diy0kz11qcs4q5wg9hc6z-mesa-19.3.4/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../..")
/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib/meshlab/plugins/libsamplefilterdyn.so: error: depends on 'libmeshlab-common.so', which cannot be found in RUNPATH ("/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib" "/gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib" "/gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib" "/gnu/store/qbq794vbw5scpxvnzlnyvdkqfr9163rk-qtscript-5.12.7/lib" "/gnu/store/2k1bsh663bilxndca4gx4zrdp7m63fjb-qtxmlpatterns-5.12.7/lib" "/gnu/store/2mf0clz9w64diy0kz11qcs4q5wg9hc6z-mesa-19.3.4/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../..")
validating RUNPATH of 2 binaries in "/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/bin"...

But the first element in the RUNPATH is the place where the library is. This is the library's path:

/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib/meshlab/libmeshlab-common.so


This is the linking of the libsamplefilter.so file:

[ 98%] Linking CXX shared module ../../distrib/plugins/libsamplefilter.so
cd /tmp/guix-build-meshlab-Meshlab-2020.04.drv-0/source/build/sampleplugins/samplefilter && /gnu/store/iz9500ssxcqlyr74hg1jq10ycrh42yq1-cmake-minimal-3.15.1/bin/cmake -E cmake_link_script CMakeFiles/samplefilter.dir/link.txt --verbose=1
/gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/c++ -fPIC -O2 -g -DNDEBUG  -Wl,--no-undefined -shared  -o ../../distrib/plugins/libsamplefilter.so CMakeFiles/samplefilter.dir/samplefilter_autogen/mocs_compilation.cpp.o CMakeFiles/samplefilter.dir/samplefilter.cpp.o -Wl,-rpath,/tmp/guix-build-meshlab-Meshlab-2020.04.drv-0/source/build/common:::::: ../../common/libmeshlab-common.so /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5OpenGL.so.5.12.7 /gnu/store/qbq794vbw5scpxvnzlnyvdkqfr9163rk-qtscript-5.12.7/lib/libQt5Script.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Widgets.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Gui.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Xml.so.5.12.7 /gnu/store/2k1bsh663bilxndca4gx4zrdp7m63fjb-qtxmlpatterns-5.12.7/lib/libQt5XmlPatterns.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Network.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Core.so.5.12.7 ../../libexternal-glew.a /gnu/store/2mf0clz9w64diy0kz11qcs4q5wg9hc6z-mesa-19.3.4/lib/libGL.so

The -rpath and -Wl are set to /tmp/guix-build-meshlab-Meshlab-2020.04.drv-0/source/build/common
but it should be set to the directory it showed previously, right?

If I need to change that, what do I have to do?

Sorry for the inconvenience, but I'm a little bit lost on this.

Thank you,

Ekaitz
Ludovic Courtès April 22, 2020, 7:52 p.m. UTC | #3
Egun on,  :-)

Ekaitz Zarraga <ekaitz@elenq.tech> skribis:

> Thanks for the detailed answer. I'll check the formatting errors.
> About the RUNPATH checks, I isolated one of the errors and I don't know what to change.
>
> This is the error of the file libsamplefilter.so during the runpath check:
>
> /gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib/meshlab/plugins/libsamplefilter.so: error: depends on 'libmeshlab-common.so', which cannot be found in RUNPATH ("/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib" "/gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib" "/gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib" "/gnu/store/qbq794vbw5scpxvnzlnyvdkqfr9163rk-qtscript-5.12.7/lib" "/gnu/store/2k1bsh663bilxndca4gx4zrdp7m63fjb-qtxmlpatterns-5.12.7/lib" "/gnu/store/2mf0clz9w64diy0kz11qcs4q5wg9hc6z-mesa-19.3.4/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../..")
> /gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib/meshlab/plugins/libsamplefilterdyn.so: error: depends on 'libmeshlab-common.so', which cannot be found in RUNPATH ("/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib" "/gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib" "/gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib" "/gnu/store/qbq794vbw5scpxvnzlnyvdkqfr9163rk-qtscript-5.12.7/lib" "/gnu/store/2k1bsh663bilxndca4gx4zrdp7m63fjb-qtxmlpatterns-5.12.7/lib" "/gnu/store/2mf0clz9w64diy0kz11qcs4q5wg9hc6z-mesa-19.3.4/lib" "/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../..")
> validating RUNPATH of 2 binaries in "/gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/bin"...
>
> But the first element in the RUNPATH is the place where the library is. This is the library's path:
>
> /gnu/store/lcpp0gpispfqw8zna2mjrr6cwj3ih133-meshlab-Meshlab-2020.04/lib/meshlab/libmeshlab-common.so
>
>
> This is the linking of the libsamplefilter.so file:
>
> [ 98%] Linking CXX shared module ../../distrib/plugins/libsamplefilter.so
> cd /tmp/guix-build-meshlab-Meshlab-2020.04.drv-0/source/build/sampleplugins/samplefilter && /gnu/store/iz9500ssxcqlyr74hg1jq10ycrh42yq1-cmake-minimal-3.15.1/bin/cmake -E cmake_link_script CMakeFiles/samplefilter.dir/link.txt --verbose=1
> /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/c++ -fPIC -O2 -g -DNDEBUG  -Wl,--no-undefined -shared  -o ../../distrib/plugins/libsamplefilter.so CMakeFiles/samplefilter.dir/samplefilter_autogen/mocs_compilation.cpp.o CMakeFiles/samplefilter.dir/samplefilter.cpp.o -Wl,-rpath,/tmp/guix-build-meshlab-Meshlab-2020.04.drv-0/source/build/common:::::: ../../common/libmeshlab-common.so /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5OpenGL.so.5.12.7 /gnu/store/qbq794vbw5scpxvnzlnyvdkqfr9163rk-qtscript-5.12.7/lib/libQt5Script.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Widgets.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Gui.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Xml.so.5.12.7 /gnu/store/2k1bsh663bilxndca4gx4zrdp7m63fjb-qtxmlpatterns-5.12.7/lib/libQt5XmlPatterns.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Network.so.5.12.7 /gnu/store/n6ji2fxg1cn6abd2bn2jd14pglyblysr-qtbase-5.12.7/lib/libQt5Core.so.5.12.7 ../../libexternal-glew.a /gnu/store/2mf0clz9w64diy0kz11qcs4q5wg9hc6z-mesa-19.3.4/lib/libGL.so
>
> The -rpath and -Wl are set to /tmp/guix-build-meshlab-Meshlab-2020.04.drv-0/source/build/common
> but it should be set to the directory it showed previously, right?

Not really, I think CMake initially sets the RUNPATH to the build tree,
as shown above, that’s OK.  I think it changes it upon “make install”.

> If I need to change that, what do I have to do?

One way to fix it would be to arrange to pass ‘-Wl,-rpath,'$ORIGIN'’ on
the link command line of the plugins.

Another solution would be to add a post-install phase to move
libmeshlab-common.so* to $output/lib, which seems more conventional,
though perhaps upstream had good reasons not to do that.

HTH!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 5405db762c..85efc01c4c 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2491,3 +2491,42 @@  without any changes.  And programmers that are familiar with the magellan API
 can continue using it with a free library without the restrictions of the
 official SDK.")
     (license license:bsd-3)))
+
+(define-public meshlab
+  (let ((commit-ref "Meshlab-2020.04"))
+    (package
+      (name "meshlab")
+      (version commit-ref)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                       (url "https://github.com/cnr-isti-vclab/meshlab")
+                       (commit commit-ref)
+                       (recursive? #t)))
+                (sha256
+                  (base32 "1vx9jcsnnxvzi90pcxpp7p72cqg3cm6jiivdmrxkzhr2fiz3pfvr"))))
+      (build-system cmake-build-system)
+      (native-inputs
+        `(("qtbase" ,qtbase)
+          ("qtscript" ,qtscript)
+          ("qtxmlpatterns" ,qtxmlpatterns)
+          ("mesa", mesa)
+          ("glu", glu)))
+      (arguments
+        `(#:tests? #f
+          #:validate-runpath? #f
+          #:phases (modify-phases %standard-phases
+                                  (add-after 'unpack 'go-to-source-dir
+                                             (lambda _ (chdir "src") #t)))))
+      (synopsis
+        "The open source system for processing and editing 3D triangular meshes.")
+      (home-page "http://www.meshlab.net/")
+      (description "MeshLab is an open source, portable, and extensible system
+for the processing and editing of unstructured large 3D triangular meshes.  It
+is aimed to help the processing of the typical not-so-small unstructured models
+arising in 3D scanning, providing a set of tools for editing, cleaning,
+healing, inspecting, rendering and converting this kind of meshes.  These tools
+include MeshLab proper, a versatile program with a graphical user interface,
+and meshlabserver, a program that can perform mesh
+processing tasks in batch mode, without a GUI.")
+      (license license:gpl3+))))