Cannot install via opam on FreeBSD
Hello mister Garrigue,
While trying to install labltk via opam, I received this error message :
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of conf-tcl failed at "/bin/sh check.sh".
#=== ERROR while compiling conf-tcl.1 =========================================#
# context 2.0.0 | freebsd/x86_64 | ocaml-system.4.02.3 | https://opam.ocaml.org#1b1f3945
# path /usr/home/emmanuel/.opam/default/.opam-switch/build/conf-tcl.1
# command /bin/sh check.sh
# exit-code 1
# env-file /usr/home/emmanuel/.opam/log/conf-tcl-1714-9b8556.env
# output-file /usr/home/emmanuel/.opam/log/conf-tcl-1714-9b8556.out
### output ###
# compiletest.c:2:10: fatal error: 'tcl.h' file not found
# #include <tcl.h>
# ^~~~~~~
# 1 error generated.
My FreeBSD version is 11.1-RELEASE
For information, the file tcl.h does exists in my PC, at /usr/local/include/tcl8.6/generic/tcl.h. There's a symbolic link pointing to it at : /usr/local/include/tcl8.6/tcl.h
I've used this workaround to solve the problem : I edited my .profile and added this line :
export C_INCLUDE_PATH=/usr/local/include/:/usr/local/include/tcl8.6/:/usr/local/include/tk8.6/
But it seems to me that it's only a workaround :-)
According to the opam file, conf-tcl is maintained by the Tcl core team, and issues should go directly to the opam-repository database.
Looking at the package itself, it seems that on your machine pkg-config tcl requires setting the above path to work properly, which is strange.
Since the C_INCLUDE_PATH variable is not used by LablTk, which has already logic for looking in /usr/local/tcl8.6 and /usr/local/include/tk8.6, there is no problem in LablTk itself. But it might actually be better to use the same method as conf-tcl, if it proves robust enough.