I am unable to opam install lablgtk on MacOS 10.14.5 with homebrew. I believe the problem might be due to some confusion/mismatch for the name of the gtk package. I see it variously given as gtk, gtk+ and gtk+-2.0.
rm:~\> # MacOS Mojave 10.14.5
rm:~\> brew --version
Homebrew 2.1.9
Homebrew/homebrew-core (git revision c9f34; last commit 2019-08-02)
Homebrew/homebrew-cask (git revision 2e02d; last commit 2019-08-02)
rm:~\> brew list | grep gtk
gtk+
rm:~\> brew list | grep expat
expat
rm:~\> ls /usr/local/Cellar/expat/2.2.7/lib/pkgconfig/
expat.pc
rm:~\> echo $PKG_CONFIG_PATH
/opt/X11/lib/pkgconfig/
rm:~\> export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/expat/2.2.7/lib/pkgconfig/
rm:~\> pkg-config --modversion expat
2.2.7
rm:~\> ls /usr/local/Cellar/gtk+/2.24.32_3/lib/pkgconfig/
gail.pc gdk-quartz-2.0.pc gtk+-quartz-2.0.pc
gdk-2.0.pc gtk+-2.0.pc gtk+-unix-print-2.0.pc
rm:~\> export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/gtk+/2.24.32_3/lib/pkgconfig/
rm:~\> pkg-config --modversion gtk+-2.0
2.24.32
rm:~\> opam depext lablgtk
# Detecting depexts using vars: arch=x86_64, os=macos, os-distribution=homebrew, os-family=homebrew
# The following system packages are needed:
expat
gtk
# The following new OS packages need to be installed: gtk
Updating Homebrew...
Warning: gtk+ 2.24.32_3 is already installed and up-to-date
To reinstall 2.24.32_3, run `brew reinstall gtk+`
# OS packages installation successful
rm:~\> opam install lablgtk
The following actions will be performed:
∗ install lablgtk 2.18.8
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[lablgtk.2.18.8] downloaded from cache at
https://opam.ocaml.org/cache<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ERROR] The compilation of lablgtk failed at "/Users/muller/.opam/opam-init/hooks/sandbox.sh build ./configure --prefix
/Users/muller/.opam/default LABLGLDIR=/Users/muller/.opam/default/lib/lablgl".
#=== ERROR while compiling lablgtk.2.18.8 =====================================#
# context 2.0.5 | macos/x86_64 | ocaml-base-compiler.4.08.0 |
https://opam.ocaml.org#8355f6b0# path ~/.opam/default/.opam-switch/build/lablgtk.2.18.8
# command ~/.opam/opam-init/hooks/sandbox.sh build ./configure --prefix /Users/muller/.opam/default LABLGLDIR=/Users/muller/.opam/default/lib/lablgl
# exit-code 1
# env-file ~/.opam/log/lablgtk-45226-c743ac.env
# output-file ~/.opam/log/lablgtk-45226-c743ac.out
### output ###
# [...]
# checking for suffix of object files... o
# checking whether we are using the GNU C compiler... yes
# checking whether cc accepts -g... yes
# checking for cc option to accept ISO C89... none needed
# checking whether C compiler accepts -fno-unwind-tables... yes
# checking platform... Unix
# checking native dynlink... checking for pkg-config... /usr/local/bin/pkg-config
# checking for GTK+ - version >= 2.0.0... no
# *** Could not run GTK+ test program, checking why...
# *** The test program failed to compile or link. See the file config.log for the
# *** exact error that occured. This usually means GTK+ is incorrectly installed.
# configure: error: GTK+ is required
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build lablgtk 2.18.8
└─
╶─ No changes have been performed
<><> lablgtk.2.18.8 troubleshooting <><><><><><><><><><><><><><><><><><><><> 🐫
=> This package requires gtk+ 2.0 development packages installed on your system
=> To solve pkg-config issues, you may need to do
'export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig' and retry
The packages you requested declare the following system dependencies. Please make sure they are installed before retrying:
expat gtk
rm:~\>