garrigue / lablgtk

LablGTK 2 and 3: an interface to the GIMP Tool Kit
https://garrigue.github.io/lablgtk
Other
89 stars 40 forks source link

Various installation issues #87

Closed FrankRuben closed 2 years ago

FrankRuben commented 4 years ago

Hi,

I tried to build the library and run the examples and got various compile errors.

First set could be solved by installing the following packages using the Linux package manager - in my case for Ubuntu, using apt:

sudo apt install libexpat1-dev libgtk2.0-dev 

Second set could be solved by installing the following OCaml packages using opam:

opam install lablgtk
opam install cairo2
opam install camlp4 # fixing: camlp4o: command not found

Then I got the following issues:

dune_config src/cflag-gtkspell3-3.0.sexp,src/clink-gtkspell3-3.0.sexp (exit 1)
(cd _build/default/src && ./dune_config.exe -pkg gtkspell3-3.0 -version 3.0.4)
Warning: Package name "gtkspell3-3.0 >= 3.0.4" contains invalid characters. Use Pkg_config.query_expr to construct proper queries
configure error: gtkspell3-3.0 >= 3.0.4 not found.

dune_config src/cflag-gtksourceview-3.0.sexp,src/clink-gtksourceview-3.0.sexp (exit 1)
(cd _build/default/src && ./dune_config.exe -pkg gtksourceview-3.0 -version 3.18)
Warning: Package name "gtksourceview-3.0 >= 3.18" contains invalid characters. Use Pkg_config.query_expr to construct proper queries
configure error: gtksourceview-3.0 >= 3.18 not found.

What I did is probably just a workaround and it might be necessary to fix the package definition (I know next to nothing about dune...):

sudo apt install libgtkspell3-3-dev libgtksourceview-3.0-dev

Thanks for your efforts, Frank

ejgallego commented 4 years ago

Hi @FrankRuben , this is a common issue with dune, we will try to improve the documentation.

Dune can build in both "release mode" or "development mode". What you are doing is a "developer" build, thus it requires the dependencies for all the packages, including gtkspell etc...

garrigue commented 4 years ago

If I understand correctly, neither opam not dune will install the external dependencies for you. You must install them by hand, so your sudo apt lines are correct. Looking at the depexts field in the opam files gives you hint about what is needed, and I wish it would display them automatically when not installed.

As for what exactly is needed, it depends on the packages you are installing. If you use opam to install lablgtk3, it requires none of camlp4, gtksourceview or gtkspell.

ejgallego commented 4 years ago

Looking at the depexts field in the opam files gives you hint about what is needed, and I wish it would display them automatically when not installed.

We didn't add depexts to labglgtk3, if we do indeed it would be displayed.

garrigue commented 4 years ago

But shouldn't the message appear with conf-gtk3 ?

ejgallego commented 4 years ago

I guess @FrankRuben is building directly, indeed the dependency conf-gtk3 was not installed, and it is a "virtual" dep it is not registered with Dune so it doesn't complain.