This repository has been archived by the owner. It is now read-only.

Cairo pkgconfig requires xcb-shm package which is not installed #14123

Closed
adammw opened this Issue Aug 11, 2012 · 22 comments

Comments

Projects
None yet
@adammw
Contributor

adammw commented Aug 11, 2012

Running PKG_CONFIG_PATH=brew --prefix cairo/lib/pkgconfig pkg-config --cflags --print-errors cairo produces:

Package xcb-shm was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcb-shm.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcb-shm', required by 'cairo', not found
@adammw

This comment has been minimized.

Show comment
Hide comment
@adammw

adammw Aug 11, 2012

Contributor

My bad. They're in /opt/X11/lib/pkgconfig

Contributor

adammw commented Aug 11, 2012

My bad. They're in /opt/X11/lib/pkgconfig

@adammw adammw closed this Aug 11, 2012

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Aug 11, 2012

Member

Does this break any software?

Member

MikeMcQuaid commented Aug 11, 2012

Does this break any software?

@adammw

This comment has been minimized.

Show comment
Hide comment
@adammw

adammw Aug 11, 2012

Contributor

Not that I know of. I was writing a new formula, so I was getting this error and not understanding what's going on. Then I figured out that xcb-shm and other similar things have their pkg-config not on the default pkg-config search path, and that the proper way to get them included in the search path is to depends_on :x11

Contributor

adammw commented Aug 11, 2012

Not that I know of. I was writing a new formula, so I was getting this error and not understanding what's going on. Then I figured out that xcb-shm and other similar things have their pkg-config not on the default pkg-config search path, and that the proper way to get them included in the search path is to depends_on :x11

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Aug 12, 2012

Member

Can you see if this was fixed by by c21552a by any chance? It doesn't matter if it wasn't but just curious.

Member

MikeMcQuaid commented Aug 12, 2012

Can you see if this was fixed by by c21552a by any chance? It doesn't matter if it wasn't but just curious.

@Nek

This comment has been minimized.

Show comment
Hide comment
@Nek

Nek Sep 5, 2012

It does break compilation of mypaint from sources (it is not on brew yet).

Nek commented Sep 5, 2012

It does break compilation of mypaint from sources (it is not on brew yet).

@jacknagel

This comment has been minimized.

Show comment
Hide comment
@jacknagel

jacknagel Sep 5, 2012

Contributor

If cairo is built with X support (the default), it will require this package. You can put your X11 pkgconfig directory (either /opt/X11/libpkgconfig or /usr/X11/lib/pkgconfig) on PKG_CONFIG_PATH as well so that it can find the libs. This is done automatically by Homebrew, but you'll have to do it manually if your are using cairo in your own software. You can also build it with "--without-x" if you don't need it, though e.g. gtk+ requires it.

Eventually the default will be flipped to "without-x", when my deps branch lands with support for passing options to deps.

Contributor

jacknagel commented Sep 5, 2012

If cairo is built with X support (the default), it will require this package. You can put your X11 pkgconfig directory (either /opt/X11/libpkgconfig or /usr/X11/lib/pkgconfig) on PKG_CONFIG_PATH as well so that it can find the libs. This is done automatically by Homebrew, but you'll have to do it manually if your are using cairo in your own software. You can also build it with "--without-x" if you don't need it, though e.g. gtk+ requires it.

Eventually the default will be flipped to "without-x", when my deps branch lands with support for passing options to deps.

@Nek

This comment has been minimized.

Show comment
Hide comment
@Nek

Nek Sep 5, 2012

I've tried doing this but it didn't help.

But thanks for the info. At least I know the problem is outside brew's packages handling.
Looks like the cause lies within mypaint's scons configuration.

On Wednesday, September 5, 2012 at 21:23 , Jack Nagel wrote:

If cairo is built with X support (the default), it will require this package. You can put your X11 pkgconfig directory (either /opt/X11/libpkgconfig or /usr/X11/lib/pkgconfig) on PKG_CONFIG_PATH as well so that it can find the libs. This is done automatically by Homebrew, but you'll have to do it manually if your are using cairo in your own software. You can also build it with "--without-x" if you don't need it, though e.g. gtk+ requires it.
Eventually the default will be flipped to "without-x", when my deps branch lands with support for passing options to deps.


Reply to this email directly or view it on GitHub (#14123 (comment)).

Nek commented Sep 5, 2012

I've tried doing this but it didn't help.

But thanks for the info. At least I know the problem is outside brew's packages handling.
Looks like the cause lies within mypaint's scons configuration.

On Wednesday, September 5, 2012 at 21:23 , Jack Nagel wrote:

If cairo is built with X support (the default), it will require this package. You can put your X11 pkgconfig directory (either /opt/X11/libpkgconfig or /usr/X11/lib/pkgconfig) on PKG_CONFIG_PATH as well so that it can find the libs. This is done automatically by Homebrew, but you'll have to do it manually if your are using cairo in your own software. You can also build it with "--without-x" if you don't need it, though e.g. gtk+ requires it.
Eventually the default will be flipped to "without-x", when my deps branch lands with support for passing options to deps.


Reply to this email directly or view it on GitHub (#14123 (comment)).

@alaboszhang

This comment has been minimized.

Show comment
Hide comment
@alaboszhang

alaboszhang Sep 12, 2012

thanks adammw!!!

i coyped all /opt/X11/lib/pkgconfig/*.pc to /usr/local/lib/pkgconfig on my mac

then be ok!

alaboszhang commented Sep 12, 2012

thanks adammw!!!

i coyped all /opt/X11/lib/pkgconfig/*.pc to /usr/local/lib/pkgconfig on my mac

then be ok!

@eelcocramer

This comment has been minimized.

Show comment
Hide comment
@eelcocramer

eelcocramer Sep 20, 2012

Contributor

I was trying to 'npm install canvas' (https://github.com/LearnBoost/node-canvas/wiki/Installation---OSX). Canvas requires cairo. The installation of canvas fails because of the package 'xcb-shm', required by 'cairo', was not found.

I fixed this issue by copying the files like the above comment suggests and this fixes the issue but this isn't an elegant solution.

Contributor

eelcocramer commented Sep 20, 2012

I was trying to 'npm install canvas' (https://github.com/LearnBoost/node-canvas/wiki/Installation---OSX). Canvas requires cairo. The installation of canvas fails because of the package 'xcb-shm', required by 'cairo', was not found.

I fixed this issue by copying the files like the above comment suggests and this fixes the issue but this isn't an elegant solution.

@adammw

This comment has been minimized.

Show comment
Hide comment
@adammw

adammw Sep 21, 2012

Contributor

Copying pkgconfig files is not a good idea. Symlinking is better but still not brilliant. I've just exported /opt/X11/lib/pkgconfig in my PKG_CONFIG_PATH in .bashrc and it seems to work fine now when manually building things.

Contributor

adammw commented Sep 21, 2012

Copying pkgconfig files is not a good idea. Symlinking is better but still not brilliant. I've just exported /opt/X11/lib/pkgconfig in my PKG_CONFIG_PATH in .bashrc and it seems to work fine now when manually building things.

@eelcocramer

This comment has been minimized.

Show comment
Hide comment
@eelcocramer

eelcocramer Sep 21, 2012

Contributor

Much better. Thanks.

Contributor

eelcocramer commented Sep 21, 2012

Much better. Thanks.

@ozataman

This comment has been minimized.

Show comment
Hide comment
@ozataman

ozataman Oct 18, 2012

@alaboszhang thanks for that pkgconfig tip - helped me finish "waf configure" step when installing py2cairo

ozataman commented Oct 18, 2012

@alaboszhang thanks for that pkgconfig tip - helped me finish "waf configure" step when installing py2cairo

@JoeOsborn

This comment has been minimized.

Show comment
Hide comment
@JoeOsborn

JoeOsborn Oct 30, 2012

The fceux formula wants /opt/X11/lib/pkgconfig in PKG_CONFIG_PATH too. Should that be part of the X11 installation process, or something? An advice, at least (if it's not already)?

JoeOsborn commented Oct 30, 2012

The fceux formula wants /opt/X11/lib/pkgconfig in PKG_CONFIG_PATH too. Should that be part of the X11 installation process, or something? An advice, at least (if it's not already)?

@jhgorse

This comment has been minimized.

Show comment
Hide comment
@jhgorse

jhgorse Apr 11, 2013

Contributor

Just for the record, the pkg-config path for linking to Cairo things, such as for a gtk-engine for a theme, went a little like this before running ./configure

setenv PKG_CONFIG_PATH "brew --prefix cairo/lib/pkgconfig:/usr/local/opt/pixman/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/X11/lib/pkgconfig"

This thread popped up on Google when I got stumped on xcb-shm. Cheers.

Contributor

jhgorse commented Apr 11, 2013

Just for the record, the pkg-config path for linking to Cairo things, such as for a gtk-engine for a theme, went a little like this before running ./configure

setenv PKG_CONFIG_PATH "brew --prefix cairo/lib/pkgconfig:/usr/local/opt/pixman/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/X11/lib/pkgconfig"

This thread popped up on Google when I got stumped on xcb-shm. Cheers.

@MerelyAPseudonym

This comment has been minimized.

Show comment
Hide comment
@MerelyAPseudonym

MerelyAPseudonym Jun 19, 2013

Contributor

+1 for "This thread popped up on Google when I got stumped on xcb-shm."
And —what the heck— +1 for the "Cheers." too. =P

(I, too, was briefly baffled by an error, but this page proved useful to me and I solved the problem.)

Specifically, I was trying to install the supporting software for The Haskell School of Expression with cabal install soegtk. I mention that only to lay a Google breadcrumb for anyone else who tries to do the same in the future.

Contributor

MerelyAPseudonym commented Jun 19, 2013

+1 for "This thread popped up on Google when I got stumped on xcb-shm."
And —what the heck— +1 for the "Cheers." too. =P

(I, too, was briefly baffled by an error, but this page proved useful to me and I solved the problem.)

Specifically, I was trying to install the supporting software for The Haskell School of Expression with cabal install soegtk. I mention that only to lay a Google breadcrumb for anyone else who tries to do the same in the future.

@MylesBorins

This comment has been minimized.

Show comment
Hide comment
@MylesBorins

MylesBorins Oct 13, 2013

Contributor

I know this was closed a little while ago but I ran into this issue this evening trying to install canvas via npm....
This ended up being solved by manually exporting the PKG_CONFIG_PATH with the following command

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

This is not a particularly elegant solution imho

Contributor

MylesBorins commented Oct 13, 2013

I know this was closed a little while ago but I ran into this issue this evening trying to install canvas via npm....
This ended up being solved by manually exporting the PKG_CONFIG_PATH with the following command

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

This is not a particularly elegant solution imho

@syncube

This comment has been minimized.

Show comment
Hide comment
@syncube

syncube Dec 6, 2013

Still while installing canvas via npm manual export of export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig is needed.

syncube commented Dec 6, 2013

Still while installing canvas via npm manual export of export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig is needed.

@zsitro

This comment has been minimized.

Show comment
Hide comment
@zsitro

zsitro commented Dec 13, 2013

+1 for @thealphanerd

@codazzo

This comment has been minimized.

Show comment
Hide comment
@codazzo

codazzo commented Dec 21, 2013

Thanks @thealphanerd !

@mitar

This comment has been minimized.

Show comment
Hide comment
@mitar

mitar Feb 15, 2014

But files from /opt/X11/lib/pkgconfig are those installed by xquartz and not those from Homebrew. So you get a version of Cairo installed by xquartz and not one from Homebrew.

mitar commented Feb 15, 2014

But files from /opt/X11/lib/pkgconfig are those installed by xquartz and not those from Homebrew. So you get a version of Cairo installed by xquartz and not one from Homebrew.

@gilesbutler

This comment has been minimized.

Show comment
Hide comment
@gilesbutler

gilesbutler Mar 18, 2014

Same issue trying to install css-sprite which depends on canvas. This fixed it for me as well:
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

I tried installing Cairo through Homebrew first so I presume I have 2 copies of it installed as the above comment mentions its installed by xquartz as well.

Will this solution hold up in the long term or could updates break it?

gilesbutler commented Mar 18, 2014

Same issue trying to install css-sprite which depends on canvas. This fixed it for me as well:
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

I tried installing Cairo through Homebrew first so I presume I have 2 copies of it installed as the above comment mentions its installed by xquartz as well.

Will this solution hold up in the long term or could updates break it?

@mikatalk

This comment has been minimized.

Show comment
Hide comment
@mikatalk

mikatalk commented Mar 21, 2014

Thanks @adammw !!

@Homebrew Homebrew locked and limited conversation to collaborators Jul 30, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.