Skip to content
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

Nix Integration #9

Open
joe-warren opened this issue Jul 17, 2024 · 5 comments
Open

Nix Integration #9

joe-warren opened this issue Jul 17, 2024 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@joe-warren
Copy link
Owner

At present, the hackage2Nix export of this project doesn't compile, because the opencascade occt libraries are missing (logs here).

opencascade-occt is packaged for nix (see here). So this should just require setting that package as a dependency.

I am however, reluctant to do this in such a way that it prevents building this project without using nix.

@joe-warren joe-warren added the help wanted Extra attention is needed label Jul 18, 2024
@KMIJPH
Copy link

KMIJPH commented Jul 18, 2024

I am unfortunately unable to build this on NixOS using the packaged opencascade-occt.

cpp/hs_Bnd_Box.cpp:1:10: error:
     fatal error: Bnd_Box.hxx: No such file or directory
        1 | #include <Bnd_Box.hxx>
          |          ^~~~~~~~~~~~~
  |
1 | #include <Bnd_Box.hxx>
  |          ^
compilation terminated.
`c++' failed in phase `C++ Compiler'. (Exit code: 1)

@joe-warren
Copy link
Owner Author

Ah, thanks, looks like it's failing to pick up the header files, which opencascade-hs assumes should be in /usr/include/opencascade.

If you can figure out where these are placed by the nix package, you could try setting either CPATH, or extra-include-dirs?

Thanks a lot for your help: much appreciated

@KMIJPH
Copy link

KMIJPH commented Jul 19, 2024

It does work by setting --extra-include-dirs.

cabal.project:

packages: *.cabal

package opencascade-hs
    extra-include-dirs: (output of find /nix/store -maxdepth 1 -name "*opencascade-occt-7.8.1")/include/opencascade

Unfortunately I am not the best with Haskell's tooling (and/or nix), so I have no idea how to integrate it elegantly in a nix package. Locally, for me this works well enough.

@KMIJPH
Copy link

KMIJPH commented Jul 19, 2024

Thanks for the lovely project :)

@joe-warren
Copy link
Owner Author

I built a minimal example of a waterfall-cad based project building within Nix

This should hopefully give Nix users a starting point

I'm still keeping this issue open; I'd like to get to the point where the package in haskellPackages just works, as opposed to at the moment, where you need to "do a bunch of nix stuff" to get the opencascade-hs package to build against the Nix packaged version of OpenCascade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants