Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions pkgs/by-name/fr/freecad/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
libspnav,
libXmu,
medfile,
mpi,
ninja,
ode,
opencascade-occt,
Expand All @@ -32,6 +31,8 @@
zlib,
qt6,
nix-update-script,
gmsh,
which,
}:
let
pythonDeps = with python3Packages; [
Expand All @@ -57,13 +58,13 @@ in
freecad-utils.makeCustomizable (
stdenv.mkDerivation (finalAttrs: {
pname = "freecad";
version = "1.0.1";
version = "1.0.2";

src = fetchFromGitHub {
owner = "FreeCAD";
repo = "FreeCAD";
tag = finalAttrs.version;
hash = "sha256-VFTNawXxu2ofjj2Frg4OfVhiMKFywBhm7lZunP85ZEQ=";
hash = "sha256-J//O/ABMFa3TFYwR0wc8d1UTA5iSFnEP2thOjuCN+uE=";
fetchSubmodules = true;
};

Expand All @@ -87,7 +88,6 @@ freecad-utils.makeCustomizable (
libGLU
libXmu
medfile
mpi
ode
vtk
xercesc
Expand All @@ -113,11 +113,6 @@ freecad-utils.makeCustomizable (
url = "https://github.com/FreeCAD/FreeCAD/commit/8e04c0a3dd9435df0c2dec813b17d02f7b723b19.patch?full_index=1";
hash = "sha256-H6WbJFTY5/IqEdoi5N+7D4A6pVAmZR4D+SqDglwS18c=";
})
# https://github.com/FreeCAD/FreeCAD/pull/22221
(fetchpatch {
url = "https://github.com/FreeCAD/FreeCAD/commit/3d2b7dc9c7ac898b30fe469b7cbd424ed1bca0a2.patch?full_index=1";
hash = "sha256-XCQdv/+dYdJ/ptA2VKrD63qYILyaP276ISMkmWLtT30=";
})
# Inform Coin to use EGL when on Wayland
# https://github.com/FreeCAD/FreeCAD/pull/21917
(fetchpatch {
Expand All @@ -126,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"
Expand All @@ -152,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
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about adding gmsh in binPath, can avoid patch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried, not quite - it will make the "get gmsh version" popup dialog fail with a nasty error message, despite gmsh actually being present. Because that checks whether it has an absolute path.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(gmsh is also probably not reproducible considering the info it collects here. But that is not my concern currently.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake respect SOURCE_DATE_EPOCH which will be set by set-source-date-epoch-to-latest.sh in stdenv.
2025-07-03 is right the time when gmsh-1.14.0 was released.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I install gmsh via nix profile install nixpkgs#gmsh in my path and i can use the gmsh plugin in freecad.
IMO we don't have to bundle gmsh and we can leave the choice to users.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i disagree. We should supply the plugin things and make them explicitly available. Otherwise these aren't at all discoverable. The compromise would be adding a freecad wrapper package that supplies these plugins without a full rebuild, that i could agree with. With the smesh thing segfaulting (#408577), we should imo provide an easy alternative.

in
[
"--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
"--prefix PATH : ${binPath}"
"--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}"
"\${gappsWrapperArgs[@]}"
];

postFixup = ''
mv $out/share/doc $out
Expand Down
Loading