On Mac OS X 1.7.5 / Lion
I am trying to install cairo package using homebrew
brew install cairo => PASSED
==> Downloading http://cairographics.org/releases/cairo-1.12.16.tar.xz
Already downloaded: /Library/Caches/Homebrew/cairo-1.12.16.tar.xz
==> ./configure --prefix=/usr/local/Cellar/cairo/1.12.16 --with-x --enable-gobject=yes
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.
Mac OS X already provides this software in versions before Mountain Lion.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/cairo/lib
CPPFLAGS: -I/usr/local/opt/cairo/include
==> Summary
🍺 /usr/local/Cellar/cairo/1.12.16: 105 files, 8.0M, built in 2.5 minutes
When I try to compile my code I still get this:
+++ Precompile
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
Package 'cairo', required by 'pangocairo', not found
So I adjusted my PKG_CONFIG_PATH accordingly
PKG_CONFIG_PATH=/usr/local/opt/cairo/lib/pkgconfig/:/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig/:
(source .bash_profile)
Tried to compile again, but I get the exact same error.
Verified that the file was present in that pkgconfig directory ... it is.
ls /usr/local/opt/cairo/lib/pkgconfig/
cairo-fc.pc cairo-gobject.pc cairo-png.pc cairo-quartz-font.pc cairo-script.pc cairo-xcb-shm.pc cairo-xlib-xrender.pc cairo.pc
cairo-ft.pc cairo-pdf.pc cairo-ps.pc cairo-quartz.pc cairo-svg.pc cairo-xcb.pc cairo-xlib.pc
Any leads on what is going wrong here?
UPDATE
cairo.pc is located in too places in my system. I have tried using each location in my pgg config path without success
find /usr -name cairo.pc
/usr/local/Cellar/cairo/1.12.16/lib/pkgconfig/cairo.pc
/usr/X11/lib/pkgconfig/cairo.pc
pkg-config --variable pc_path pkg-config
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig
NOTE: only for Ubuntu.
Solving my problem was easier. The Ubuntu dependencies were just not installed properly, and you can find instructions here:
https://github.com/LearnBoost/node-canvas/wiki
This is what worked for me:
sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
ln -s /usr/local/Cellar/cairo/1.12.16/lib/pkgconfig/cairo.pc /usr/local/lib/pkgconfig/cairo.pc
resolved my issue
I had this problem on Yosemite, and fixed it by reinstalling cairo.
$ brew unlink cairo
Unlinking /usr/local/Cellar/cairo/1.14.2... 30 symlinks removed
$ brew install cairo
You can use PKG_CONFIG_PATH
for the same. I.e.:
PKG_CONFIG_PATH=/usr/local/Cellar/cairo/1.12.16/lib/pkgconfig ./configure ....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With