tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
meshlab-unstable: add darwin support
Zexin Yuan
6 months ago
471f3e39
9f7318cc
+40
-5
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
me
meshlab-unstable
package.nix
top-level
all-packages.nix
+35
-5
pkgs/by-name/me/meshlab-unstable/package.nix
···
2
2
lib,
3
3
stdenv,
4
4
fetchFromGitHub,
5
5
+
llvmPackages,
5
6
libsForQt5,
6
7
libGLU,
7
8
lib3ds,
···
56
57
fetchSubmodules = true;
57
58
};
58
59
60
60
+
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
61
61
+
substituteInPlace src/meshlab/CMakeLists.txt \
62
62
+
--replace-fail "set_additional_settings_info_plist(" "# set_additional_settings_info_plist(" \
63
63
+
--replace-fail " TARGET meshlab" "# TARGET meshlab" \
64
64
+
--replace-fail " FILE \''${MESHLAB_BUILD_DISTRIB_DIR}/meshlab.app/Contents/Info.plist)" \
65
65
+
"# FILE \''${MESHLAB_BUILD_DISTRIB_DIR}/meshlab.app/Contents/Info.plist)"
66
66
+
'';
67
67
+
59
68
buildInputs = [
60
69
libGLU
61
70
libsForQt5.qtbase
···
79
88
corto
80
89
openctm
81
90
structuresynth
91
91
+
]
92
92
+
++ lib.optionals stdenv.cc.isClang [
93
93
+
llvmPackages.openmp
82
94
];
83
95
84
96
nativeBuildInputs = [
···
107
119
--replace-warn "MESHLAB_LIB_INSTALL_DIR" "CMAKE_INSTALL_LIBDIR"
108
120
'';
109
121
110
110
-
postFixup = ''
111
111
-
patchelf --add-needed $out/lib/meshlab/libmeshlab-common.so $out/bin/.meshlab-wrapped
112
112
-
patchelf --add-needed $out/lib/meshlab/lib3mf.so $out/lib/meshlab/plugins/libio_3mf.so
122
122
+
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
123
123
+
mkdir -p $out/{Applications,bin,lib}
124
124
+
mv $out/meshlab.app $out/Applications/
125
125
+
ln $out/Applications/meshlab.app/Contents/Frameworks/* $out/lib/
126
126
+
makeWrapper $out/{Applications/meshlab.app/Contents/MacOS,bin}/meshlab
113
127
'';
114
128
129
129
+
postFixup =
130
130
+
lib.optionalString stdenv.hostPlatform.isLinux ''
131
131
+
patchelf --add-needed $out/lib/meshlab/libmeshlab-common.so $out/bin/.meshlab-wrapped
132
132
+
patchelf --add-needed $out/lib/meshlab/lib3mf.so $out/lib/meshlab/plugins/libio_3mf.so
133
133
+
''
134
134
+
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
135
135
+
wrapQtApp "$out/Applications/meshlab.app/Contents/MacOS/meshlab"
136
136
+
install_name_tool -change libopenctm.dylib "${lib.getOutput "out" openctm}/lib/libopenctm.dylib" \
137
137
+
"$out/Applications/meshlab.app/Contents/PlugIns/libio_ctm.so"
138
138
+
'';
139
139
+
140
140
+
# The hook will wrap all the plugin binaries, make they are not a
141
141
+
# valid plugin. So we have to wrap the main app manually.
142
142
+
# See: https://github.com/NixOS/nixpkgs/pull/396295#issuecomment-3137779781
143
143
+
dontWrapQtApps = stdenv.hostPlatform.isDarwin;
144
144
+
115
145
# display a black screen on wayland, so force XWayland for now.
116
146
# Might be fixed when upstream will be ready for Qt6.
117
117
-
qtWrapperArgs = [
147
147
+
qtWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [
118
148
"--set QT_QPA_PLATFORM xcb"
119
149
];
120
150
···
124
154
homepage = "https://www.meshlab.net/";
125
155
license = lib.licenses.gpl3Only;
126
156
maintainers = with lib.maintainers; [ pca006132 ];
127
127
-
platforms = with lib.platforms; linux;
157
157
+
platforms = with lib.platforms; linux ++ darwin;
128
158
};
129
159
}
+5
pkgs/top-level/all-packages.nix
···
13013
13013
llvmPackages = llvmPackages_18;
13014
13014
};
13015
13015
13016
13016
+
meshlab-unstable = callPackage ../by-name/me/meshlab-unstable/package.nix {
13017
13017
+
stdenv = if stdenv.hostPlatform.isDarwin then llvmPackages_18.stdenv else stdenv;
13018
13018
+
llvmPackages = llvmPackages_18;
13019
13019
+
};
13020
13020
+
13016
13021
meshcentral = callPackage ../tools/admin/meshcentral { };
13017
13022
13018
13023
michabo = libsForQt5.callPackage ../applications/misc/michabo { };