facebookarchive / pfff

Tools for code analysis, visualizations, or style-preserving source transformation.
http://github.com/facebook/pfff/wiki/Main
Other
2.44k stars 204 forks source link

OSX Yosemite 10.10.2 + Homebrew #114

Open ckhk212 opened 9 years ago

ckhk212 commented 9 years ago

I am trying to install this, and I ran into the following issue regardless pkg-config gtk+-2.0 --cflags seems to execute correctly. According to the install_macos.txt, I still need to "force to link with the new cairo library". Is it still true?

I saw the following

Checking your configuration.

OCaml (the wonderful language) is present.
make (gnu version) is present.
Configuring ocamlgtk (see /tmp/ocamlgtk.log).
configure: error: GTK+ is required
Configuring ocamlcairo (see /tmp/ocamlcairo.log).
configure: error: Package requirements (cairo >= 1.2 freetype2) were not met:

Package 'xcb-shm', required by 'cairo', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables CAIRO_CFLAGS
and CAIRO_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

pfff target prefix: /usr/local (you can use --prefix to override it)
Generating Makefile.config (VISUAL=0, BYTECODE=1, CMT=0) (see also configure --help)
Generating commons/features.ml
Generating globals/config_pfff.ml
!!Problems during ./configure!!

----------------------------------------------------------------------
!!!! You can try to compile and test pfff, 
but some features or plugins may be missing. !!!!

We have found 2 missing packages. 
Have a look at the install_xxx.txt corresponding to your OS. 

To compile pfff type:
  $ make depend
  $ make 
Then, to test pfff simply type:
  $ ./pfff -dump_php demos/foo.php

If you want to use the analysis framework and code visualization tools
see install.txt or type ./configure --help

Then I export PKG_CONFIG_PATH with the new path

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig
echo $PKG_CONFIG_PATH
/opt/X11/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig

pkg-config gtk+-2.0 --cflags execute correctly

pkg-config gtk+-2.0 --cflags
-D_REENTRANT -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I/opt/X11/include/libpng15 -I/opt/X11/include -I/opt/X11/include/freetype2 -I/usr/local/Cellar/libpng/1.6.16/include/libpng16 -I/usr/local/Cellar/gtk+/2.24.25/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.25/lib/gtk-2.0/include -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/atk/2.14.0/include/atk-1.0 -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/0.9.38/include/harfbuzz -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/glib/2.42.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include 

But Package 'xcb-shm', required by 'cairo', not found remains

phooji commented 9 years ago

I'm not familiar with that particular bit of the codebase; @aryx ?

aryx commented 9 years ago

Can you copy paste the /tmp/ocamlcairo.log file.

My recent experience compiling pfff with macos is written in install_macos.txt. I had problems with old version of MacOS and recent version of brew, but recent version of MacOS (Yosemite) and recent version of xquartz and brew should work fine.

ckhk212 commented 9 years ago

@aryx Thanks for your help, here is what I have under /tmp/ocamlcairo.log

checking for ocamlc... ocamlc
OCaml version is 4.02.1
OCaml library path is /usr/local/lib/ocaml
checking for ocamlopt... ocamlopt
checking for ocamlc.opt... ocamlc.opt
checking for ocamlopt.opt... ocamlopt.opt
checking for ocamldep... ocamldep
checking for ocamlmktop... ocamlmktop
checking for ocamlmklib... ocamlmklib
checking for ocamldoc... ocamldoc
OCaml uses clang to compile C files
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for CAIRO... 

I've tried re-intall the following: $ brew reinstall objective-caml camlp4 $ brew reinstall gtk+ $ brew reinstall cairo $ brew reinstall swi-prolog

Then I ran $ ./configure

And I get this:

Checking your configuration.

OCaml (the wonderful language) is present.
make (gnu version) is present.
Configuring ocamlgtk (see /tmp/ocamlgtk.log).
configure: error: GTK+ is required
Configuring ocamlcairo (see /tmp/ocamlcairo.log).
configure: error: Package requirements (cairo >= 1.2 freetype2) were not met:

Package 'xcb-shm', required by 'cairo', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables CAIRO_CFLAGS
and CAIRO_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

pfff target prefix: /usr/local (you can use --prefix to override it)
Generating Makefile.config (VISUAL=0, BYTECODE=1, CMT=0) (see also configure --help)
Generating commons/features.ml
Generating globals/config_pfff.ml
!!Problems during ./configure!!

----------------------------------------------------------------------
!!!! You can try to compile and test pfff, 
but some features or plugins may be missing. !!!!

We have found 2 missing packages. 
Have a look at the install_xxx.txt corresponding to your OS. 

To compile pfff type:
  $ make depend
  $ make 

Then, to test pfff simply type:
  $ ./pfff -dump_php demos/foo.php

If you want to use the analysis framework and code visualization tools
see install.txt or type ./configure --help

Installed specs: MacOS 10.10.3 Homebrew 0.9.5

aryx commented 9 years ago

I've put precompiled binaries of pfff here: https://github.com/aryx/pfff-binaries/tree/master/mac

can you let me know if they work? Or does it say that a library is not present?

ckhk212 commented 9 years ago

O awesome. IT works! 👏 Thanks @aryx Now I need to figure out how to use them properly! 😏

ghost commented 9 years ago

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.