Skip to content

Commit 02e44a7

Browse files
LordGrimmauldmdaniels5757
authored andcommitted
freecad: enable gmsh integration
(cherry picked from commit c7e08ed)
1 parent 07cfe2f commit 02e44a7

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

pkgs/by-name/fr/freecad/package.nix

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
qt5,
3838
qt6,
3939
nix-update-script,
40+
gmsh,
41+
which,
4042
}:
4143
let
4244
pythonDeps =
@@ -151,6 +153,11 @@ freecad-utils.makeCustomizable (
151153
})
152154
];
153155

156+
postPatch = ''
157+
substituteInPlace src/Mod/Fem/femmesh/gmshtools.py \
158+
--replace-fail 'self.gmsh_bin = "gmsh"' 'self.gmsh_bin = "${lib.getExe gmsh}"'
159+
'';
160+
154161
cmakeFlags = [
155162
"-Wno-dev" # turns off warnings which otherwise makes it hard to see what is going on
156163
"-DBUILD_DRAWING=ON"
@@ -191,13 +198,20 @@ freecad-utils.makeCustomizable (
191198

192199
dontWrapGApps = true;
193200

194-
qtWrapperArgs = [
195-
"--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
196-
"--prefix PATH : ${libredwg}/bin"
197-
"--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}"
198-
"\${gappsWrapperArgs[@]}"
199-
]
200-
++ lib.optionals (!withWayland) [ "--set QT_QPA_PLATFORM xcb" ];
201+
qtWrapperArgs =
202+
let
203+
binPath = lib.makeBinPath [
204+
libredwg
205+
which # for locating tools
206+
];
207+
in
208+
[
209+
"--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
210+
"--prefix PATH : ${binPath}"
211+
"--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}"
212+
"\${gappsWrapperArgs[@]}"
213+
]
214+
++ lib.optionals (!withWayland) [ "--set QT_QPA_PLATFORM xcb" ];
201215

202216
postFixup = ''
203217
mv $out/share/doc $out

0 commit comments

Comments
 (0)