tjammer / raylib-ocaml

OCaml bindings for raylib and raygui
https://tjammer.github.io/raylib-ocaml/
MIT License
175 stars 14 forks source link

Package `raylib_c' not found #19

Closed rawburt closed 3 years ago

rawburt commented 3 years ago

Any pointers on resolving this issue?

[22:04] ~/Code/fun/ocaml/raylib $ opam install raylib
[NOTE] Package raylib is already installed (current version is 0.3.2).
[22:04] ~/Code/fun/ocaml/raylib $ ocamlfind list | grep raylib
raylib              (version: 0.4.0)
raylib-gen          (version: n/a)
raylib.__private__  (version: 0.4.0-12-gf4f7e52)
raylib.__private__.raylib_c (version: 0.4.0)
raylib.__private__.raylib_functions (version: 0.4.0)
raylib.__private__.raylib_generated_constants (version: 0.4.0)
raylib.__private__.raylib_generated_types (version: 0.4.0)
raylib.__private__.raylib_math (version: 0.4.0)
[22:04] ~/Code/fun/ocaml/raylib $ ocamlbuild -pkg raylib raylib.ml
ocamlfind: Package `raylib_c' not found - required by `raylib'
Cannot run Ocamlfind.
tjammer commented 3 years ago

This is a strange one. The package raylib.c does not really exist anymore in the current implementation. Instead, I've used a private module for it, which is a relatively new dune feature. I suspect there's a bug in there somewhere, I'll open an issue for this in the dune repo.

Meanwhile, the issue goes away if instead of using dune's private modules, one declares each module by hand. I've pushed these changes to a new branch https://github.com/tjammer/raylib-ocaml/tree/findlib. There, raylib works with ocamlbuild

$ ocamlbuild -pkg raylib example.native
Finished, 4 targets (4 cached) in 00:00:00.

I won't commit these changes to master just yet, because I like how private modules clean up the documentation. Still, the 'findlib' branch should work for you

tjammer commented 3 years ago

It seems the issue is solved already in upstream dune, but the fix has not made it into a release yet https://github.com/ocaml/dune/issues/4839.

rawburt commented 3 years ago

Thanks @tjammer ! I appreciate the quick turn around and the workaround 😄 I'm unblocked in exploring raylib-ocaml so feel free to close the issue or do whatever you need to do 👍 Thanks again!