librelist archives

« back to archive

libxml2 header file links

libxml2 header file links

From:
Aaron Patterson
Date:
2011-10-01 @ 18:47
Hi,

I've noticed that when I install libxml2, the header files aren't
linked in to /usr/local/include.  Is that expected?

[aaron@higgins /]$ ls /usr/local/Cellar/libxml2/2.7.8/include/libxml2
libxml
[aaron@higgins /]$ ls /usr/local/include/libxml2
ls: /usr/local/include/libxml2: No such file or directory
[aaron@higgins /]$

Thanks!

--
Aaron Patterson
http://tenderlovemaking.com/

Re: [homebrew] libxml2 header file links

From:
Bryan Liles
Date:
2011-10-01 @ 19:03
It would appear so. This is the message from the installer:

==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local.

Mac OS X already provides this program and installing another version in
parallel can cause all kinds of trouble.

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 its lib & include paths to your build variables:

    LDFLAGS  -L/usr/local/Cellar/libxml2/2.7.8/lib
    CPPFLAGS -I/usr/local/Cellar/libxml2/2.7.8/include

On Sat, Oct 1, 2011 at 2:47 PM, Aaron Patterson
<aaron.patterson@gmail.com> wrote:
> Hi,
>
> I've noticed that when I install libxml2, the header files aren't
> linked in to /usr/local/include.  Is that expected?
>
> [aaron@higgins /]$ ls /usr/local/Cellar/libxml2/2.7.8/include/libxml2
> libxml
> [aaron@higgins /]$ ls /usr/local/include/libxml2
> ls: /usr/local/include/libxml2: No such file or directory
> [aaron@higgins /]$
>
> Thanks!
>
> --
> Aaron Patterson
> http://tenderlovemaking.com/
>



-- 
bryanl
http://smartic.us

Re: [homebrew] libxml2 header file links

From:
Aaron Patterson
Date:
2011-10-03 @ 16:12
On Sat, Oct 1, 2011 at 12:03 PM, Bryan Liles <bryanliles@gmail.com> wrote:
> It would appear so. This is the message from the installer:
>
> ==> Caveats
> This formula is keg-only, so it was not symlinked into /usr/local.
>
> Mac OS X already provides this program and installing another version in
> parallel can cause all kinds of trouble.
>
> 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 its lib & include paths to your build variables:
>
>    LDFLAGS  -L/usr/local/Cellar/libxml2/2.7.8/lib
>    CPPFLAGS -I/usr/local/Cellar/libxml2/2.7.8/include

Are the latest paths soft linked somewhere?  The extconf.rb in
nokogiri looks in common places for libxml2 (/usr/local, /opt/local,
/usr).  Since this formula became keg only, it's a PITA for people to
install nokogiri and use libxml2 from homebrew.

If there was a consistent path I could search, then I could add that
to the extconf.  For now we have instructions specific for homebrew
users, but it would be great if we could make it "Just Work" for
homebrew users too!

Thanks.

-- 
Aaron Patterson
http://tenderlovemaking.com/

Re: [homebrew] libxml2 header file links

From:
Charlie Sharpsteen
Date:
2011-10-03 @ 16:25
On Mon, Oct 3, 2011 at 9:12 AM, Aaron Patterson
<aaron.patterson@gmail.com>wrote:

> On Sat, Oct 1, 2011 at 12:03 PM, Bryan Liles <bryanliles@gmail.com> wrote:
> > It would appear so. This is the message from the installer:
> >
> > ==> Caveats
> > This formula is keg-only, so it was not symlinked into /usr/local.
> >
> > Mac OS X already provides this program and installing another version in
> > parallel can cause all kinds of trouble.
> >
> > 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 its lib & include paths to your build variables:
> >
> >    LDFLAGS  -L/usr/local/Cellar/libxml2/2.7.8/lib
> >    CPPFLAGS -I/usr/local/Cellar/libxml2/2.7.8/include
>
> Are the latest paths soft linked somewhere?  The extconf.rb in
> nokogiri looks in common places for libxml2 (/usr/local, /opt/local,
> /usr).  Since this formula became keg only, it's a PITA for people to
> install nokogiri and use libxml2 from homebrew.
>
> If there was a consistent path I could search, then I could add that
> to the extconf.  For now we have instructions specific for homebrew
> users, but it would be great if we could make it "Just Work" for
> homebrew users too!
>
> Thanks.
>
> --
> Aaron Patterson
> http://tenderlovemaking.com/
>

My suggestion would be to do the following

    brew link libxml2 # Generate symlinks for libxml2
    gem install nokogiri # Or other software the needs a newer libxml
    brew unlink libxml2 # Banish the duplicate back to keg-onlyness

`brew --prefix libxml2` will also return the prefix path for libxml2,
whatever the version happens to be.

Hope that helps!

-Charlie

Re: [homebrew] libxml2 header file links

From:
Aaron Patterson
Date:
2011-10-03 @ 16:40
On Mon, Oct 3, 2011 at 9:25 AM, Charlie Sharpsteen <chuck@sharpsteen.net> wrote:
> On Mon, Oct 3, 2011 at 9:12 AM, Aaron Patterson <aaron.patterson@gmail.com>
> wrote:
>>
>> On Sat, Oct 1, 2011 at 12:03 PM, Bryan Liles <bryanliles@gmail.com> wrote:
>> > It would appear so. This is the message from the installer:
>> >
>> > ==> Caveats
>> > This formula is keg-only, so it was not symlinked into /usr/local.
>> >
>> > Mac OS X already provides this program and installing another version in
>> > parallel can cause all kinds of trouble.
>> >
>> > 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 its lib & include paths to your build variables:
>> >
>> >    LDFLAGS  -L/usr/local/Cellar/libxml2/2.7.8/lib
>> >    CPPFLAGS -I/usr/local/Cellar/libxml2/2.7.8/include
>>
>> Are the latest paths soft linked somewhere?  The extconf.rb in
>> nokogiri looks in common places for libxml2 (/usr/local, /opt/local,
>> /usr).  Since this formula became keg only, it's a PITA for people to
>> install nokogiri and use libxml2 from homebrew.
>>
>> If there was a consistent path I could search, then I could add that
>> to the extconf.  For now we have instructions specific for homebrew
>> users, but it would be great if we could make it "Just Work" for
>> homebrew users too!
>>
>> Thanks.
>>
>> --
>> Aaron Patterson
>> http://tenderlovemaking.com/
>
> My suggestion would be to do the following
>     brew link libxml2 # Generate symlinks for libxml2
>     gem install nokogiri # Or other software the needs a newer libxml
>     brew unlink libxml2 # Banish the duplicate back to keg-onlyness
> `brew --prefix libxml2` will also return the prefix path for libxml2,
> whatever the version happens to be.

I think the `brew --prefix` command would work perfectly.  We can
figure out the paths in the extconf and search them (if brew is
installed).

Thanks for the help!

-- 
Aaron Patterson
http://tenderlovemaking.com/