Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meshlab: 1.3.3 -> 2016.12 #26680

Closed
wants to merge 1 commit into from
Closed

meshlab: 1.3.3 -> 2016.12 #26680

wants to merge 1 commit into from

Conversation

nh2
Copy link
Contributor

@nh2 nh2 commented Jun 17, 2017

Motivation for this change

Meshlab 2016.12 is significantly improved vs Meshlab 1.3.3.

Apparently we need way less patches here than Arch Linux to make things compile; I haven't yet found something that breaks without them.

Not all contents of the QMAKE_FLAGS may be needed, but I stuck close to the ones given in cnr-isti-vclab/meshlab#68 (comment). If somebody wants to make the effort and find which ones are truly not needed, I'd welcome it.

Note for non-NixOS users (for example, when you run nix on Ubuntu or Debian), you need to use LD_PRELOAD or LD_LIBRARY_PATH so that your system libGL.so.1 can be found.
For example, on my Nvidia system I use this to run: nix-shell --pure -p meshlab --run 'LD_LIBRARY_PATH=/usr/lib/nvidia-375 meshlab'.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@nh2, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bjornfor, @abbradar and @7c6f434c to be potential reviewers.

@bennofs
Copy link
Contributor

bennofs commented Jul 15, 2017

@nh2: I get the following error when I try to nix-build this:

RPATH of binary /nix/store/rhp66hl8ws6zis2ph6qyfpigfvzsbbhs-meshlab-2016.12/opt/meshlab/libcommon.so.1.0.0 contains a forbidden reference to /tmp/nix-build-meshlab-2016.12.drv-0

@nh2
Copy link
Contributor Author

nh2 commented Jul 20, 2017

Hmm, you're right, I get something similar (but not the same):

+++ patchelf --print-rpath /nix/store/rhp66hl8ws6zis2ph6qyfpigfvzsbbhs-meshlab-2016.12/opt/meshlab/plugins/libfilter_ssynth.so
+++ grep -q -F /tmp/nix-build-meshlab-2016.12.drv-0
+++ echo 'RPATH of binary /nix/store/rhp66hl8ws6zis2ph6qyfpigfvzsbbhs-meshlab-2016.12/opt/meshlab/plugins/libfilter_ssynth.so contains a forbidden reference to /tmp/nix-build-meshlab-2016.12.drv-0'
RPATH of binary /nix/store/rhp66hl8ws6zis2ph6qyfpigfvzsbbhs-meshlab-2016.12/opt/meshlab/plugins/libfilter_ssynth.so contains a forbidden reference to /tmp/nix-build-meshlab-2016.12.drv-0

It must depend on the nixpkgs base. On the commit in my PR, d9ac066f24c89fd5e6a577e50063dba699cb6a11, I get that. But I didn't (and still don't) get this error on my own branch from which I extracted this commit.

I'll try to reproduce the build success on top of an appropriate nixpkgs commit.

@nh2
Copy link
Contributor Author

nh2 commented Jul 20, 2017

@bennofs Can you try my commit cherry-picked on top of f93654c492526f4d527fa285ac9646fb29e3c251? It builds for me on that.

@nh2
Copy link
Contributor Author

nh2 commented Jul 20, 2017

I've rebased now on latest master and am currently trying to build it there.

@nh2
Copy link
Contributor Author

nh2 commented Jul 21, 2017

I think it's because the feature that detects this problem wasn't there on the commit on which I based the original patch; feature introduced on May 4 here: 94d164d

@nh2
Copy link
Contributor Author

nh2 commented Jul 21, 2017

OK so the problem is:

[/tmp/nix-build-meshlab-2016.12.drv-0]$ ldd ./meshlab-v2016.12-src/src/distrib/plugins/libfilter_ssynth.so | grep tmp
	libQt5OpenGL.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5OpenGL.so.5 (0x00007f6b1d3b2000)
	libQt5Widgets.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5Widgets.so.5 (0x00007f6b1cd55000)
	libQt5Gui.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5Gui.so.5 (0x00007f6b1c8a1000)
	libQt5Xml.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5Xml.so.5 (0x00007f6b1c865000)
	libQt5XmlPatterns.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5XmlPatterns.so.5 (0x00007f6b1c479000)
	libQt5Network.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5Network.so.5 (0x00007f6b1c2e2000)
	libQt5Script.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5Script.so.5 (0x00007f6b1c04d000)
	libQt5Core.so.5 => /tmp/nix-build-meshlab-2016.12.drv-0/__nix_qt5__/lib/libQt5Core.so.5 (0x00007f6b1bbaf000)

I don't know why this is. I don't even know why that directory is there or where it should be instead. "I just want to build a QT app" :D

But this looks similar to #27174.

So maybe @ttuegel knows how to do this correctly?

@nh2
Copy link
Contributor Author

nh2 commented Jul 21, 2017

Also CC @avnik because that __nix_qt5__ thing comes from #20856

@ttuegel
Copy link
Member

ttuegel commented Jul 21, 2017

Whenever you override a phase, you must call the pre- and post-hooks. For example,

{
  installPhase = ''
    runHook preInstall

    # actual installPhase here

    runHook postInstall
  '';
}

@nh2
Copy link
Contributor Author

nh2 commented Jul 22, 2017

Whenever you override a phase, you must call the pre- and post-hooks

OK, I've pushe a fix to call the hooks, and with that it builds without error.

But I get this new error when trying to run it:

$ meshlab
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

@nh2
Copy link
Contributor Author

nh2 commented Jul 22, 2017

OK looks like I'm missing some env var to be set; I can launch it successfully like this:

LD_LIBRARY_PATH=/usr/lib/nvidia-375 QT_QPA_PLATFORM_PLUGIN_PATH=/nix/store/rbjqcm462frk7qqydcij91gxk3m6md8w-qtbase-5.9.0-bin/lib/qt-5.9/plugins/ /nix/store/r5bj4xzkz0nynznwmsgh2yia0bgz5x1h-meshlab-2016.12/bin/meshlab

So it seems like I'm missing QT_QPA_PLATFORM_PLUGIN_PATH.

@nh2
Copy link
Contributor Author

nh2 commented Jul 22, 2017

@ttuegel Do you have another tip of how I can set QT_QPA_PLATFORM_PLUGIN_PATH correctly?

@nh2
Copy link
Contributor Author

nh2 commented Sep 5, 2017

@ttuegel Short ping because Meshlab 2016 is pretty useful

@ttuegel
Copy link
Member

ttuegel commented Sep 5, 2017

Do you have another tip of how I can set QT_QPA_PLATFORM_PLUGIN_PATH correctly?

That variable should not need to be set, but you also cannot run Qt 5 packages from nix-shell or store paths. Is it installed into a profile somewhere?

@nh2 nh2 mentioned this pull request Dec 4, 2017
8 tasks
@nh2
Copy link
Contributor Author

nh2 commented Dec 6, 2017

Issues seem fixed and merged in #32309

@nh2 nh2 closed this Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants