New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opencascade: enable macOS build and add features #97661
Conversation
pkgs/development/libraries/opencascade/opencascade-oce-vtk.patch
Outdated
Show resolved
Hide resolved
974b956
to
597b857
Compare
31193cf
to
a651029
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please mark as ready for review.
Could replace meta = with stdenv.lib; {
with meta = {
now.
a651029
to
0fcee10
Compare
Thanks.
Done. |
LGTM (aside from the fetchpatch failure).
I'm not 100% sure I understand you. |
@gebner I do, I wasn't sure which opencascade to choose so I made it so it compiled and worked with both. Default is OCCT though. Thanks for letting me know OCCT is preferred though. OCE might still be used for other software though. |
enable/fix macOS build and add options for TBB and GL2PS dependencies VTK integration needed a patch because implicit conversions in initializer lists are an error in C++11, which is the default in clang 7 used by nix.
0fcee10
to
80a6743
Compare
enable/fix macOS build and add options for TBB and GL2PS dependencies
VTK integration needed a patch because implicit conversions in initializer
lists are an error in C++11, which is the default in clang 7 used by nix.
Motivation for this change
I'm currently working on KiCad for macOS in nix. KiCad depends on Opencascade. Opencascade-occt works fine, but opencascade (OCE) was only enabled to build on Linux. I've enabled the build on macOS and it "works for me" on macOS 10.15.6, both building opencascade and using it as dependency in KiCad.
VTK-integration of opencascade threw 2 errors for me, both had to do with (implicit) conversions happening in initializer lists, which is illegal in C++11 (or 14?), which is the default in clang-7 (the compiler used by my nix). Upstream opencascade seemed to not have fixed that yet, but does also not include a specific C++ standard to compile with. I assumed this is a bug though and included a patch to make both those implicit conversion explicit, so it compiles fine. I'm not sure if this is the correct thing to do here, though, but, again it seems to work for me. I've enabled this patch only for macOS, since this seems to be not an issue on Linux for some reason, again, I'm not sure why.
I've also added options to build with TBB as parallelization/multithreading library, as well as GL2PS, which is an optional dependency of opencascade. Scripts to build KiCad had these options for opencascade enabled, which is why I added those options. The options are defaulted to
false
, to be backward compatible.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)