python3Packages.pymeshlab: fix on darwin

This commit is contained in:
Guilhem Saurel
2025-10-28 19:55:40 +01:00
parent 3994ebf8cc
commit 034b8dd615
@@ -14,6 +14,7 @@
# buildInputs
libsForQt5,
llvmPackages,
glew,
vcg,
}:
@@ -54,6 +55,9 @@ stdenv.mkDerivation (finalAttrs: {
glew
libsForQt5.qtbase
vcg
]
++ lib.optionals stdenv.cc.isClang [
llvmPackages.openmp
];
dontWrapQtApps = true;
@@ -63,13 +67,22 @@ stdenv.mkDerivation (finalAttrs: {
];
# Get io & filter plugins from meshlab, to avoild render, decorate & edit ones
postInstall = ''
install -D -t $out/${python3Packages.python.sitePackages}/pymeshlab/lib/plugins \
${meshlab}/lib/meshlab/plugins/libio_* \
${meshlab}/lib/meshlab/plugins/libfilter_*
'';
postInstall =
let
plugins =
if stdenv.hostPlatform.isDarwin then
"Applications/meshlab.app/Contents/PlugIns"
else
"lib/meshlab/plugins";
pyPlugins = if stdenv.hostPlatform.isDarwin then "PlugIns" else "lib/plugins";
in
''
install -D -t $out/${python3Packages.python.sitePackages}/pymeshlab/${pyPlugins} \
${meshlab}/${plugins}/libio_* \
${meshlab}/${plugins}/libfilter_*
'';
postFixup = ''
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf \
--add-needed ${meshlab}/lib/meshlab/libmeshlab-common.so \
$out/${python3Packages.python.sitePackages}/pymeshlab/pmeshlab.*.so