From c7e08edcf0761463a2d89a9688c96fc07cb30de4 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Tue, 12 Aug 2025 20:08:59 +0200 Subject: [PATCH] freecad: enable gmsh integration --- pkgs/by-name/fr/freecad/package.nix | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/fr/freecad/package.nix b/pkgs/by-name/fr/freecad/package.nix index c7985971f325..49fa3eb7c0d6 100644 --- a/pkgs/by-name/fr/freecad/package.nix +++ b/pkgs/by-name/fr/freecad/package.nix @@ -31,6 +31,8 @@ zlib, qt6, nix-update-script, + gmsh, + which, }: let pythonDeps = with python3Packages; [ @@ -119,6 +121,11 @@ freecad-utils.makeCustomizable ( }) ]; + postPatch = '' + substituteInPlace src/Mod/Fem/femmesh/gmshtools.py \ + --replace-fail 'self.gmsh_bin = "gmsh"' 'self.gmsh_bin = "${lib.getExe gmsh}"' + ''; + cmakeFlags = [ "-Wno-dev" # turns off warnings which otherwise makes it hard to see what is going on "-DBUILD_DRAWING=ON" @@ -145,12 +152,19 @@ freecad-utils.makeCustomizable ( dontWrapGApps = true; - qtWrapperArgs = [ - "--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1" - "--prefix PATH : ${libredwg}/bin" - "--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}" - "\${gappsWrapperArgs[@]}" - ]; + qtWrapperArgs = + let + binPath = lib.makeBinPath [ + libredwg + which # for locating tools + ]; + in + [ + "--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1" + "--prefix PATH : ${binPath}" + "--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}" + "\${gappsWrapperArgs[@]}" + ]; postFixup = '' mv $out/share/doc $out