Skip to content

meshlab{,-unstable}: add darwin support#396295

Merged
pyrox0 merged 9 commits intoNixOS:masterfrom
yzx9:feature/meshlab-darwin
Sep 18, 2025
Merged

meshlab{,-unstable}: add darwin support#396295
pyrox0 merged 9 commits intoNixOS:masterfrom
yzx9:feature/meshlab-darwin

Conversation

@yzx9
Copy link
Contributor

@yzx9 yzx9 commented Apr 5, 2025

This PR adds Darwin support for MeshLab.

  • I noticed that MeshLab 25.07 has been released — I can upgrade to it after this PR is merged.
  • LLVM 18 is a workaround for issues with vcglib (vcg: 2023.12 -> 2025.07 #427236) and some other parts of the code. It should work fine in the new version.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@yzx9
Copy link
Contributor Author

yzx9 commented Apr 5, 2025

I am working on adding Darwin support for meshlab, which is a Qt-based application that includes many plugins. I successfully built it and was able to run the application, but unfortunately, none of the plugins are loading.

Details The error messages I am encountering are as follows:
› QT_DEBUG_PLUGINS=1 ./result/Applications/meshlab.app/Contents/MacOS/meshlab
...
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so' is not a valid Mach-O binary (not a dynamic library)
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libdecorate_base.so' is not a valid Mach-O binary (not a dynamic library)
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libdecorate_raster_proj.so' is not a valid Mach-O binary (not a dynamic library)
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libdecorate_shadow.so' is not a valid Mach-O binary (not a dynamic library)
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libedit_align.so' is not a valid Mach-O binary (not a dynamic library)
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libedit_manipulators.so' is not a valid Mach-O binary (not a dynamic library)
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libedit_measure.so' is not a valid Mach-O binary (not a dynamic library)
QMachOParser: '/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/Applications/meshlab.app/Contents/PlugIns/libedit_paint.so' is not a valid Mach-O binary (not a dynamic library)
...

I don't see any dynamic dependency errors:

› otool -L result/Applications/meshlab.app/Contents/MacOS/.meshlab-wrapped 
result/Applications/meshlab.app/Contents/MacOS/.meshlab-wrapped:
	/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/lib/libmeshlab-common-gui.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/nix/store/rmzvmf0hplp85d43ngcsic84kcxlzmsw-meshlab-2023.12/lib/libmeshlab-common.dylib (compatibility version 0.0.0, current version 0.0.0)
	/nix/store/sxghqbd8n3dbqwj96kaa0a10y7rpj88b-qtbase-5.15.16/lib/libQt5Network.5.dylib (compatibility version 5.15.0, current version 5.15.16)
	/nix/store/sxghqbd8n3dbqwj96kaa0a10y7rpj88b-qtbase-5.15.16/lib/libQt5OpenGL.5.dylib (compatibility version 5.15.0, current version 5.15.16)
	/nix/store/sxghqbd8n3dbqwj96kaa0a10y7rpj88b-qtbase-5.15.16/lib/libQt5Widgets.5.dylib (compatibility version 5.15.0, current version 5.15.16)
	/nix/store/sxghqbd8n3dbqwj96kaa0a10y7rpj88b-qtbase-5.15.16/lib/libQt5Gui.5.dylib (compatibility version 5.15.0, current version 5.15.16)
	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
	/nix/store/sxghqbd8n3dbqwj96kaa0a10y7rpj88b-qtbase-5.15.16/lib/libQt5Xml.5.dylib (compatibility version 5.15.0, current version 5.15.16)
	/nix/store/sxghqbd8n3dbqwj96kaa0a10y7rpj88b-qtbase-5.15.16/lib/libQt5Core.5.dylib (compatibility version 5.15.0, current version 5.15.16)
	/nix/store/h9gjlmn79071nixwwdhi4rc86jbmir5d-openmp-18.1.8/lib/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)
	/nix/store/4lkjqxs6lwlzq10mirr8p17pl12mqlpy-glew-2.2.0/lib/libGLEW.2.2.dylib (compatibility version 2.2.0, current version 2.2.0)
	/nix/store/m1frh81sdsab2v03n49ai9l5yhzn8s2x-libcxx-18.1.8/lib/libc++.1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)

› otool -L result/Applications/meshlab.app/Contents/PlugIns/libio_base.so
result/Applications/meshlab.app/Contents/PlugIns/libio_base.so:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)

Is there any guidance for debugging or documentation regarding Qt on Nix? Any help would be appreciated!

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Apr 5, 2025
@yzx9 yzx9 added 6.topic: qt/kde Object-oriented framework for GUI creation 9.needs: help on darwin Also consider pinging @NixOS/darwin-maintainers. labels Apr 5, 2025
@yzx9 yzx9 force-pushed the feature/meshlab-darwin branch from 0bca27d to 996da13 Compare April 5, 2025 11:21
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 6.topic: qt/kde Object-oriented framework for GUI creation labels Apr 5, 2025
@dwt
Copy link
Contributor

dwt commented Apr 13, 2025

Maybe not something that helps you immediately, but those .so files should probably be .dylib files, as that is the darwin library format. I would start looking where they are built to see why you get .so files (as that usually indicates a linux build).

@yzx9
Copy link
Contributor Author

yzx9 commented Apr 13, 2025

@dwt Thanks for your help — it's never too late and always appreciated!
I'm not very familiar with shared library formats, but I noticed that the plugins also use the .so format in the official package. Interestingly, when I try to open the plugins from the official package from nix built meshlab, I get the same error.

@dwt
Copy link
Contributor

dwt commented Apr 14, 2025

Strange, they might do something mighty strange upstream to make .so files work? Maybe check with file what these files actually are, just to make sure the didn't just rename .dylib to .so to not have to change some other code?

@yzx9 yzx9 force-pushed the feature/meshlab-darwin branch from 996da13 to 415adf5 Compare April 18, 2025 13:43
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 17, 2025
@Rhys-T
Copy link
Contributor

Rhys-T commented Jul 30, 2025

Hmm. They're not actually in Linux ELF .so format - they just have that filename extension for some reason. They're Mach-O files, like they're supposed to be - sorta. If I look at the ones from the official release, they're classified as 'loadable bundles' rather than normal dylibs1, but that makes sense for plugins. If I look at the ones produced by this derivation, though, they're flagged as being full executables in their own right. They even have main functions!

$ # A normal library looks like this:
$ file /nix/store/ickjwia7gqgkcxgk8w2xqfnagys2si6c-lua-5.1.5/lib/liblua.dylib
/nix/store/ickjwia7gqgkcxgk8w2xqfnagys2si6c-lua-5.1.5/lib/liblua.dylib: Mach-O 64-bit dynamically linked shared library x86_64
$ # This is a plugin from the official MeshLab release:
$ file /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
/Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so: Mach-O 64-bit bundle x86_64
$ # And this is one from this derivation:
$ nix build 'github:yzx9/nixpkgs/feature/meshlab-darwin#meshlab'
$ file result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so
result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so: Mach-O 64-bit executable x86_64
$ # Wait, really? An executable?
$ nm -U result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so
0000000100003048 D _DOCSTRING
0000000100003040 d __dyld_private
0000000100000000 T __mh_execute_header
000000010000163a T _main
0000000100001569 T _set_env_prefix
$ # Yep, there's a `main()`… and not much else. What does it do?
$ result/Applications/meshlab.app/Contents/PlugIns/libdecorate_background.so; echo $?
255
$ # Not much. And the official plugin?
$ nm -U /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
[…way more symbols than that, none of which are `_main`…]
$ /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
zsh: exec format error: /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
$ # The list of dependencies is also much longer for the working plugins:
$ otool -L /Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so
/Volumes/MeshLab/MeshLab2023.12.app/Contents/PlugIns/libdecorate_background.so:
	@rpath/libmeshlab-common.dylib (compatibility version 0.0.0, current version 0.0.0)
	@loader_path/../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.15.0, current version 5.15.2)
	@loader_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.15.0, current version 5.15.2)
	@loader_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.15.0, current version 5.15.2)
	@loader_path/../Frameworks/QtXml.framework/Versions/5/QtXml (compatibility version 5.15.0, current version 5.15.2)
	@loader_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.15.0, current version 5.15.2)
	@loader_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.15.0, current version 5.15.2)
	@loader_path/../Frameworks/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)
	@rpath/libexternal-glew.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
$ otool -L result/Applications/meshlab.app/Contents/PlugIns/libio_base.so
result/Applications/meshlab.app/Contents/PlugIns/libio_base.so:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)

Footnotes

  1. The difference seems to be that a) you can't link against a bundle, only dynamically load it at runtime; and b) a bundle has a particular program that it expects to be loaded by.

@Rhys-T
Copy link
Contributor

Rhys-T commented Jul 30, 2025

Ah, I see what's happening! All the plugins are incorrectly getting wrapped by wrapQtAppsHook, even though they aren't actually executables!

$ ls -alh result/Applications/meshlab.app/Contents/PlugIns/
total 20M
dr-xr-xr-x 124 root wheel 3.9K Dec 31  1969 .
dr-xr-xr-x   8 root wheel  256 Dec 31  1969 ..
-r-xr-xr-x   1 root wheel  83K Dec 31  1969 .libdecorate_background.so-wrapped
-r-xr-xr-x   1 root wheel 263K Dec 31  1969 .libdecorate_base.so-wrapped
-r-xr-xr-x   1 root wheel 260K Dec 31  1969 .libdecorate_raster_proj.so-wrapped
-r-xr-xr-x   1 root wheel 193K Dec 31  1969 .libdecorate_shadow.so-wrapped
-r-xr-xr-x   1 root wheel 662K Dec 31  1969 .libedit_align.so-wrapped
-r-xr-xr-x   1 root wheel 114K Dec 31  1969 .libedit_manipulators.so-wrapped
-r-xr-xr-x   1 root wheel  76K Dec 31  1969 .libedit_measure.so-wrapped
-r-xr-xr-x   1 root wheel 284K Dec 31  1969 .libedit_paint.so-wrapped
-r-xr-xr-x   1 root wheel 204K Dec 31  1969 .libedit_pickpoints.so-wrapped
-r-xr-xr-x   1 root wheel 137K Dec 31  1969 .libedit_point.so-wrapped
-r-xr-xr-x   1 root wheel 233K Dec 31  1969 .libedit_quality.so-wrapped
-r-xr-xr-x   1 root wheel 261K Dec 31  1969 .libedit_referencing.so-wrapped
-r-xr-xr-x   1 root wheel  99K Dec 31  1969 .libedit_sample.so-wrapped
-r-xr-xr-x   1 root wheel 127K Dec 31  1969 .libedit_select.so-wrapped
-r-xr-xr-x   1 root wheel 145K Dec 31  1969 .libfilter_ao.so-wrapped
-r-xr-xr-x   1 root wheel 114K Dec 31  1969 .libfilter_camera.so-wrapped
-r-xr-xr-x   1 root wheel 321K Dec 31  1969 .libfilter_clean.so-wrapped
-r-xr-xr-x   1 root wheel 152K Dec 31  1969 .libfilter_color_projection.so-wrapped
-r-xr-xr-x   1 root wheel 246K Dec 31  1969 .libfilter_colorproc.so-wrapped
-r-xr-xr-x   1 root wheel 269K Dec 31  1969 .libfilter_create.so-wrapped
-r-xr-xr-x   1 root wheel 116K Dec 31  1969 .libfilter_createiso.so-wrapped
-r-xr-xr-x   1 root wheel 145K Dec 31  1969 .libfilter_developability.so-wrapped
-r-xr-xr-x   1 root wheel 232K Dec 31  1969 .libfilter_dirt.so-wrapped
-r-xr-xr-x   1 root wheel 100K Dec 31  1969 .libfilter_embree.so-wrapped
-r-xr-xr-x   1 root wheel 178K Dec 31  1969 .libfilter_fractal.so-wrapped
-r-xr-xr-x   1 root wheel 297K Dec 31  1969 .libfilter_func.so-wrapped
-r-xr-xr-x   1 root wheel 193K Dec 31  1969 .libfilter_geodesic.so-wrapped
-r-xr-xr-x   1 root wheel 440K Dec 31  1969 .libfilter_icp.so-wrapped
-r-xr-xr-x   1 root wheel 328K Dec 31  1969 .libfilter_img_patch_param.so-wrapped
-r-xr-xr-x   1 root wheel 214K Dec 31  1969 .libfilter_layer.so-wrapped
-r-xr-xr-x   1 root wheel 204K Dec 31  1969 .libfilter_measure.so-wrapped
-r-xr-xr-x   1 root wheel 1.3M Dec 31  1969 .libfilter_meshing.so-wrapped
-r-xr-xr-x   1 root wheel 290K Dec 31  1969 .libfilter_mls.so-wrapped
-r-xr-xr-x   1 root wheel 966K Dec 31  1969 .libfilter_plymc.so-wrapped
-r-xr-xr-x   1 root wheel 168K Dec 31  1969 .libfilter_qhull.so-wrapped
-r-xr-xr-x   1 root wheel  91K Dec 31  1969 .libfilter_quality.so-wrapped
-r-xr-xr-x   1 root wheel 159K Dec 31  1969 .libfilter_sample_gpu.so-wrapped
-r-xr-xr-x   1 root wheel  55K Dec 31  1969 .libfilter_sample.so-wrapped
-r-xr-xr-x   1 root wheel 607K Dec 31  1969 .libfilter_sampling.so-wrapped
-r-xr-xr-x   1 root wheel 559K Dec 31  1969 .libfilter_screened_poisson.so-wrapped
-r-xr-xr-x   1 root wheel 196K Dec 31  1969 .libfilter_sdfgpu.so-wrapped
-r-xr-xr-x   1 root wheel 229K Dec 31  1969 .libfilter_select.so-wrapped
-r-xr-xr-x   1 root wheel 253K Dec 31  1969 .libfilter_sketchfab.so-wrapped
-r-xr-xr-x   1 root wheel 1.7M Dec 31  1969 .libfilter_texture_defragmentation.so-wrapped
-r-xr-xr-x   1 root wheel 757K Dec 31  1969 .libfilter_texture.so-wrapped
-r-xr-xr-x   1 root wheel 265K Dec 31  1969 .libfilter_trioptimize.so-wrapped
-r-xr-xr-x   1 root wheel 331K Dec 31  1969 .libfilter_unsharp.so-wrapped
-r-xr-xr-x   1 root wheel 705K Dec 31  1969 .libfilter_voronoi.so-wrapped
-r-xr-xr-x   1 root wheel  96K Dec 31  1969 .libio_3ds.so-wrapped
-r-xr-xr-x   1 root wheel 1.1M Dec 31  1969 .libio_base.so-wrapped
-r-xr-xr-x   1 root wheel 121K Dec 31  1969 .libio_bre.so-wrapped
-r-xr-xr-x   1 root wheel 366K Dec 31  1969 .libio_collada.so-wrapped
-r-xr-xr-x   1 root wheel  89K Dec 31  1969 .libio_ctm.so-wrapped
-r-xr-xr-x   1 root wheel  95K Dec 31  1969 .libio_expe.so-wrapped
-r-xr-xr-x   1 root wheel  96K Dec 31  1969 .libio_json.so-wrapped
-r-xr-xr-x   1 root wheel 207K Dec 31  1969 .libio_pdb.so-wrapped
-r-xr-xr-x   1 root wheel  84K Dec 31  1969 .libio_tri.so-wrapped
-r-xr-xr-x   1 root wheel  80K Dec 31  1969 .libio_txt.so-wrapped
-r-xr-xr-x   1 root wheel 441K Dec 31  1969 .libio_x3d.so-wrapped
-r-xr-xr-x   1 root wheel 144K Dec 31  1969 .librender_gdp.so-wrapped
-r-xr-xr-x   1 root wheel 161K Dec 31  1969 .librender_radiance_scaling.so-wrapped
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libdecorate_background.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libdecorate_base.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libdecorate_raster_proj.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libdecorate_shadow.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_align.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_manipulators.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_measure.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_paint.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_pickpoints.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_point.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_quality.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_referencing.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_sample.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libedit_select.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_ao.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_camera.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_clean.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_color_projection.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_colorproc.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_create.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_createiso.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_developability.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_dirt.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_embree.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_fractal.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_func.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_geodesic.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_icp.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_img_patch_param.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_layer.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_measure.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_meshing.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_mls.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_plymc.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_qhull.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_quality.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_sample_gpu.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_sample.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_sampling.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_screened_poisson.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_sdfgpu.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_select.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_sketchfab.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_texture_defragmentation.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_texture.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_trioptimize.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_unsharp.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libfilter_voronoi.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_3ds.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_base.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_bre.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_collada.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_ctm.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_expe.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_json.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_pdb.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_tri.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_txt.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 libio_x3d.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 librender_gdp.so
-r-xr-xr-x   1 root wheel  17K Dec 31  1969 librender_radiance_scaling.so

The hook is looking for anything that has execute permission and is either an ELF or Mach-O file. Libraries have execute permission too, but normally that isn't an issue since the hook looks in $out/bin and not $out/lib… except that it also looks inside the entirety of $out/Applications, and doesn't limit itself to the app's Contents/MacOS subfolder.

Ideally the hook should probably be updated to make sure it's looking at actual executables, or at least limit itself to the MacOS folders of apps. But that's going to be somewhat more involved, and will cause rebuilds for everything using the hook. Best bet for now is probably to set dontWrapQtApps and manually wrapQtApp just the actual program, at least on macOS/Darwin.

@yzx9
Copy link
Contributor Author

yzx9 commented Jul 31, 2025

@Rhys-T Wow, great job! I gave your solution a quick try, and I can confirm it works perfectly!
I’ll take care of resolving the conflicts and finishing up the remaining tasks later.

@yzx9 yzx9 force-pushed the feature/meshlab-darwin branch from 415adf5 to 92751fb Compare July 31, 2025 13:43
@nixpkgs-ci nixpkgs-ci bot removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Jul 31, 2025
@yzx9 yzx9 marked this pull request as ready for review July 31, 2025 14:29
@nixpkgs-ci nixpkgs-ci bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 31, 2025
@nix-owners nix-owners bot requested a review from pca006132 August 1, 2025 02:03
@yzx9 yzx9 force-pushed the feature/meshlab-darwin branch from 13cb8a9 to f0a0880 Compare August 1, 2025 02:26
@yzx9 yzx9 changed the title meshlab: add darwin support meshlab{,-unstable}: add darwin support Aug 1, 2025
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Aug 1, 2025
@yzx9 yzx9 force-pushed the feature/meshlab-darwin branch 2 times, most recently from a933665 to 3bc6ada Compare August 8, 2025 02:42
@yzx9 yzx9 force-pushed the feature/meshlab-darwin branch from 3bc6ada to 831e9ed Compare August 8, 2025 02:44
@yzx9
Copy link
Contributor Author

yzx9 commented Aug 8, 2025

@SuperSandro2000 Thanks for your review! I have change all the patchPhase to postPatch, and remove the finalAttrs.pname.

@yzx9 yzx9 requested a review from SuperSandro2000 August 8, 2025 02:45
@yzx9
Copy link
Contributor Author

yzx9 commented Aug 24, 2025

Hi @SuperSandro2000, may I ask for your review once more?

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Sep 1, 2025
@SuperSandroBot
Copy link

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 396295
Commit: 831e9edf99bf394250808d164d0a931769bd93c7 (subsequent changes)
Merge: be756fc9d1129446188e34c7103720b9496217c1

Logs: https://github.com/SuperSandro2000/nixpkgs-review-gha/actions/runs/17381787424


x86_64-linux

✅ 4 packages built:
  • levmar
  • meshlab
  • meshlab-unstable
  • python312Packages.pymeshlab (python313Packages.pymeshlab)

aarch64-linux

✅ 4 packages built:
  • levmar
  • meshlab
  • meshlab-unstable
  • python312Packages.pymeshlab (python313Packages.pymeshlab)

x86_64-darwin (sandbox = true)

❌ 2 packages failed to build:
  • meshlab
  • meshlab-unstable
✅ 1 package built:
  • levmar

aarch64-darwin (sandbox = true)

❌ 2 packages failed to build:
  • meshlab
  • meshlab-unstable
✅ 1 package built:
  • levmar

@yzx9
Copy link
Contributor Author

yzx9 commented Sep 2, 2025

@SuperSandro2000 The build failed due to the sandbox on Darwin. QT applications on Darwin require a sandbox profile, which blocks the sandboxed build. I was able to build the application before, but unfortunately it’s not easy to build again today since the LLVM cache is missing.

@yzx9
Copy link
Contributor Author

yzx9 commented Sep 2, 2025

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 396295
Commit: 831e9edf99bf394250808d164d0a931769bd93c7 (subsequent changes)
Merge: e2ba9ace2396c2783255a785e6a471d213866fb9

Logs: https://github.com/yzx9/nixpkgs-review-gha/actions/runs/17395010498


x86_64-linux

✅ 4 packages built:
  • levmar
  • meshlab
  • meshlab-unstable
  • python312Packages.pymeshlab (python313Packages.pymeshlab)

aarch64-linux

✅ 4 packages built:
  • levmar
  • meshlab
  • meshlab-unstable
  • python312Packages.pymeshlab (python313Packages.pymeshlab)

x86_64-darwin (sandbox = relaxed)

❌ 2 packages failed to build:
  • meshlab
  • meshlab-unstable
✅ 1 package built:
  • levmar

aarch64-darwin (sandbox = relaxed)

✅ 3 packages built:
  • levmar
  • meshlab
  • meshlab-unstable

x86_64-linux was broken by ispc

error

ispc> Running: ./tests/func-tests/reduce-add-float16.ispc.run
ispc> Done 1576 / 1576
ispc>
ispc> Executed 1567 / 1576 (9 skipped)
ispc>
ispc> PASSRATE (1565/1567) = 99%
ispc>
ispc> 1565 / 1576 tests PASSED
ispc> 2 / 1576 tests FAILED compilation
ispc> ./tests/func-tests/round-float16-uniform.ispc
ispc> ./tests/func-tests/round-float16-varying.ispc
ispc> 0 / 1576 tests FAILED execution
ispc> 9 / 1576 tests SKIPPED
ispc> ./tests/func-tests/select-short-vec-func.ispc
ispc> ./tests/func-tests/transcendentals-10-0.ispc
ispc> ./tests/func-tests/transcendentals-sincos-uniform-float16.ispc
ispc> ./tests/func-tests/transcendentals-sincos-uniform.ispc
ispc> ./tests/func-tests/transcendentals-sincos-varying-float16.ispc
ispc> ./tests/func-tests/transcendentals-sincos-varying.ispc
ispc> ./tests/func-tests/xe-task-count.ispc
ispc> ./tests/func-tests/xe-task-index-1.ispc
ispc> ./tests/func-tests/xe-task-index.ispc
ispc> NEW COMPFAILS:
ispc> ./tests/func-tests/round-float16-uniform.ispc
ispc> ./tests/func-tests/round-float16-varying.ispc
error: Cannot build '/nix/store/22i6kfi7p37l1fh5y0ajqx99khz4gmd9-ispc-1.28.1.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/g8clr0xwp70zw5bs27p9g9y1p3ziz8x7-ispc-1.28.1
Last 25 log lines:
> Running: ./tests/func-tests/reduce-add-float16.ispc.run
> Done 1576 / 1576
>
> Executed 1567 / 1576 (9 skipped)
>
> PASSRATE (1565/1567) = 99%
>
> 1565 / 1576 tests PASSED
> 2 / 1576 tests FAILED compilation
> ./tests/func-tests/round-float16-uniform.ispc
> ./tests/func-tests/round-float16-varying.ispc
> 0 / 1576 tests FAILED execution
> 9 / 1576 tests SKIPPED
> ./tests/func-tests/select-short-vec-func.ispc
> ./tests/func-tests/transcendentals-10-0.ispc
> ./tests/func-tests/transcendentals-sincos-uniform-float16.ispc
> ./tests/func-tests/transcendentals-sincos-uniform.ispc
> ./tests/func-tests/transcendentals-sincos-varying-float16.ispc
> ./tests/func-tests/transcendentals-sincos-varying.ispc
> ./tests/func-tests/xe-task-count.ispc
> ./tests/func-tests/xe-task-index-1.ispc
> ./tests/func-tests/xe-task-index.ispc
> NEW COMPFAILS:
> ./tests/func-tests/round-float16-uniform.ispc
> ./tests/func-tests/round-float16-varying.ispc
For full logs, run:
nix log /nix/store/22i6kfi7p37l1fh5y0ajqx99khz4gmd9-ispc-1.28.1.drv
error: Cannot build '/nix/store/a9jc743m80fg99jjl93v2qdvc6jhh7nn-embree-4.4.0.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/6ajdkq69gafdd5wdwzrwzxi5h5rg8zqh-embree-4.4.0
error: Cannot build '/nix/store/3d7npiy3siqyz60bba9ja7i7451dysrl-meshlab-2023.12.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/bvxav55bg2cxsymfldrghvxr1yg8lsl2-meshlab-2023.12
error: Cannot build '/nix/store/pidrwb4v1lvm9d34mqc31a2qakf17im8-meshlab-unstable-2023.12-unstable-2025-02-21.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/bhx6niyrs7qfsxfyrdcbbmrp0ri0bld6-meshlab-unstable-2023.12-unstable-2025-02-21
error: Cannot build '/nix/store/2ki4j7k296wggbljmllsdsqrhkkxwd0r-review-shell.drv'.
Reason: 2 dependencies failed.
Output paths:
/nix/store/nndx3xvz4a7yyqkmw5lc7zpk77zhhc2g-review-shell
2 packages failed to build:
meshlab meshlab-unstable

got build log for '/nix/store/czyvy3zd1cfxagar5wirjgmghy2l4zyp-levmar-2.6.drv^' from 'daemon'
error: build log of '/nix/store/3d7npiy3siqyz60bba9ja7i7451dysrl-meshlab-2023.12.drv^
' is not available
error: build log of '/nix/store/pidrwb4v1lvm9d34mqc31a2qakf17im8-meshlab-unstable-2023.12-unstable-2025-02-21.drv^*' is not available
error: build log of '/nix/store/bvxav55bg2cxsymfldrghvxr1yg8lsl2-meshlab-2023.12' is not available
error: build log of '/nix/store/bhx6niyrs7qfsxfyrdcbbmrp0ri0bld6-meshlab-unstable-2023.12-unstable-2025-02-21' is not available

@yzx9 yzx9 requested a review from SuperSandro2000 September 2, 2025 07:23
@pyrox0 pyrox0 added this pull request to the merge queue Sep 18, 2025
Merged via the queue into NixOS:master with commit 66b6862 Sep 18, 2025
28 checks passed
@yzx9 yzx9 deleted the feature/meshlab-darwin branch September 18, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 9.needs: help on darwin Also consider pinging @NixOS/darwin-maintainers. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants