Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg-config can't find libxml2.pc on OS X 10.8 Mountain Lion #9

Closed
smackesey opened this issue Feb 12, 2013 · 3 comments
Closed

pkg-config can't find libxml2.pc on OS X 10.8 Mountain Lion #9

smackesey opened this issue Feb 12, 2013 · 3 comments

Comments

@smackesey
Copy link

When running gem install gtksourceview2, I get the following error:

    *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/Users/seanmackesey/.rbenv/versions/1.9.3-p385/bin/ruby
  --with-pkg-config
  --without-pkg-config
  --with-override-variables
  --without-override-variables
/Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:239:in `parse_pc': .pc for libxml-2.0 doesn't exist. (RuntimeError)
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:181:in `declaration'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:130:in `requires_private'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:311:in `all_required_packages'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:195:in `collect_cflags'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:134:in `cflags'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:196:in `block in collect_cflags'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:195:in `collect'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:195:in `collect_cflags'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:134:in `cflags'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:364:in `cflags'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/pkg-config-1.1.4/lib/pkg-config.rb:415:in `have_package'
  from /Users/seanmackesey/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/glib2-1.2.1/lib/mkmf-gnome2.rb:542:in `required_pkg_config_package'
  from extconf.rb:58:in `<main>'

Googling around has provided some clues-- this Homebrew issue suggests that libxml-2.0.pc simply doesn't exist on OS X Mountain Lion. I can confirm that it is not in /usr/lib/pkgconfig on my system. But I know that libxml-2.0 is installed on my system (it comes with Mountain Lion). I have also installed an alternative version via Homebrew. As well as a version of pkg-config via Homebrew, which actually creates the libxml-2.0.pc file and puts it in /usr/local/Cellar/libxml2/2.9.0/lib/pkgconfig/libxml-2.0.pc. How can I make pkg-config look in this directory for the pc file?

@myokoym
Copy link
Member

myokoym commented Dec 29, 2013

I think that the following is a workaround:

% PKG_CONFIG_PATH=/usr/local/Cellar/libxml2/2.9.0/lib/pkgconfig gem install gtksourceview2

or

% PKG_CONFIG_PATH=/usr/local/opt/libxml2/lib/pkgconfig gem install gtksourceview2

@cosmo0920
Copy link
Member

Homebrew provides keg-only feature.
This feature is as follows:

It means the formula is installed only into the Cellar, it is not linked into /usr/local.
homebrew FAQ

And libxml2 Formula is marked keg-only. see: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/libxml2.rb
So, it seems that this issue is caused by homebrew.

@kou
Copy link
Member

kou commented Feb 9, 2019

No response.

@kou kou closed this as completed Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants