OCamlPro / ocaml-top

A simple cross-platform OCaml code editor built for top-level evaluation.
http://typerex.org/ocaml-top.html
GNU General Public License v3.0
64 stars 8 forks source link

OPAM install ocaml-top Error #46

Closed omrigildor closed 9 years ago

omrigildor commented 10 years ago

MacBook-Air:~ $ opam install ocaml-top The following actions will be performed:

=-=-= Installing conf-gtksourceview.2 =-=-= Building conf-gtksourceview.2: pkg-config gtksourceview-2.0 The compilation of conf-gtksourceview.2 failed. Uninstalling conf-gtksourceview.2.

Due to some errors while processing conf-gtksourceview.2, the following actions will NOT be proceeded:

==== ERROR [while installing conf-gtksourceview.2] ==== Internal error: "pkg-config": command not found. 'opam install ocaml-top' failed.

I installed this using homebrew if that helps at all.

omrigildor commented 10 years ago

I looked at the other errors and I'm really confused. I am also unsure how to delete the other packages of ocaml-top so I can restart the download process. If you have any advice that would be amazing.

AltGr commented 10 years ago

conf-gtksourceview2 relies on the system library gtksourceview to be installed ; the problem is probably related to what is explained here: https://github.com/ocaml/opam-repository/commit/ef32f0f8b2639f75e380c4e32c010266e342ead1

omrigildor commented 10 years ago

This is after running the commands from the link using brew and opam

Omris-MacBook-Air:~ omrigildor$ export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
Omris-MacBook-Air:~ omrigildor$ opam install lablgtk
The following actions will be performed:
 - install lablgtk.2.16.0
1 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove

=-=-= Installing lablgtk.2.16.0 =-=-=
The archive for lablgtk.2.16.0 is in the local cache.
Extracting /Users/omrigildor/.opam/archives/lablgtk.2.16.0+opam.tar.gz.
Applying lablgldir.patch.
Building lablgtk.2.16.0:
  ./configure --prefix /Users/omrigildor/.opam/system LABLGLDIR=/Users/omrigildor/.opam/system/lib/lablgl
  make world
  make install
Installing lablgtk.2.16.0.
Omris-MacBook-Air:~ omrigildor$ opam install ocaml-top
The following actions will be performed:
 - install conf-gtksourceview.2 [required by ocaml-top]
 - recompile lablgtk.2.16.0 [use conf-gtksourceview]
 - install ocaml-top.1.1.0
2 to install | 1 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n] y

=-=-= Removing Packages =-=-=
Uninstalling lablgtk.2.16.0:
  ocamlfind remove lablgtk2

=-=-= Installing conf-gtksourceview.2 =-=-=
Building conf-gtksourceview.2:
  pkg-config gtksourceview-2.0
The compilation of conf-gtksourceview.2 failed.
Uninstalling conf-gtksourceview.2.

Due to some errors while processing conf-gtksourceview.2, the following actions will NOT be proceeded:
 - install ocaml-top.1.1.0
 - recompile lablgtk.2.16.0

==== ERROR [while installing conf-gtksourceview.2] ====
# opam-version    1.0.0
# os              darwin
# command         pkg-config gtksourceview-2.0
# path            /Users/omrigildor/.opam/system/build/conf-gtksourceview.2
# exit-code       1
# env-file        /Users/omrigildor/.opam/system/build/conf-gtksourceview.2/conf-gtksourceview-5f1023.env
# stdout-file     /Users/omrigildor/.opam/system/build/conf-gtksourceview.2/conf-gtksourceview-5f1023.out
# stderr-file     /Users/omrigildor/.opam/system/build/conf-gtksourceview.2/conf-gtksourceview-5f1023.err

'opam install ocaml-top' failed.
Omris-MacBook-Air:~ omrigildor$ 

I Still get an error about installing.

AltGr commented 10 years ago

Sorry for the lag It seems that you still miss the gtksourceview development package on your system.

JonyEpsilon commented 10 years ago

I see the same error as above. I have gtk+ and gtksourceview installed through brew on a MacOS system. Setting the PKG_CONFIG_PATH doesn't seem to help.

AltGr commented 10 years ago

I just improved the hint message, with correct PKG_CONFIG_PATH for both macports and homebrew: https://github.com/ocaml/opam-repository/pull/1435/files

Does the hint given there resolve your issue ?

JonyEpsilon commented 10 years ago

Thanks, that seems to resolve the pkgconfig error, but I now get a different error, attached:

===== ERROR while installing lablgtk.2.16.0 =====
# opam-version 1.1.0
# os           darwin
# command      ./configure --prefix /Users/jony/.opam/system LABLGLDIR=/Users/jony/.opam/system/lib/lablgl
# path         /Users/jony/.opam/system/build/lablgtk.2.16.0
# compiler     system (4.01.0)
# exit-code    1
# env-file     /Users/jony/.opam/system/build/lablgtk.2.16.0/lablgtk-30171-c61e7b.env
# stdout-file  /Users/jony/.opam/system/build/lablgtk.2.16.0/lablgtk-30171-c61e7b.out
# stderr-file  /Users/jony/.opam/system/build/lablgtk.2.16.0/lablgtk-30171-c61e7b.err
### stdout ###
# ...[truncated]
# checking for suffix of object files... o
# checking whether we are using the GNU C compiler... yes
# checking whether clang accepts -g... yes
# checking for clang option to accept ISO C89... none needed
# 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.
### stderr ###
# configure: error: GTK+ is required

=-=-= lablgtk.2.16.0 troobleshooting =-=-=
This package requires gtk+ 2.0 development packages installed on your system.

=-=-= lablgtk.2.16.0 troobleshooting =-=-=
To solve pkg-config issues, you may need to do
'export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig' (macports)
or 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig' (homebrew)
and retry.
'opam install lablgtk' failed.

Homebrew seems to think it has gtk+ (and gtksourceview) installed:

~ jony$ brew info gtk+
gtk+: stable 2.24.22
http://gtk.org/
/usr/local/Cellar/gtk+/2.24.22 (1184 files, 52M) *
  Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/gtk+.rb
==> Dependencies
Build: xz ✔, pkg-config ✔
Required: glib ✔, jpeg ✔, libtiff ✔, gdk-pixbuf ✔, pango ✔, atk ✔, cairo ✔
Optional: jasper ✘
==> Options
--with-jasper
    Build with jasper support

Apologies if this is something silly - I'm afraid I'm not very knowledgeable with troubleshooting this sort of thing.

panchagil commented 10 years ago

@AltGr your hint fix it for me. Thanks!

liaoarden commented 10 years ago

@JonyEpsilon , change my PKG_CONFIG_PATH to /opt/x11/lib/pkgconfig seemed to do the trick for me after installing gtk+ and gtksourceview via brew.