It's not the fault of Alien::LibXML. It installs libxml and, if asked, supplies the location. The problem is that nobody is asking. (Alien::LibXML can't simply install libXML in, for example, /usr/lib, because it doesn't have the authority to do so. Also, different distros put libraries in different places and/or might have an older version the distro needs.)

Even when your module says it depends on Alien::LibXML and XML::LibXML, the cpan installer doesn't automatically tell each module it's installing about any other modules. If a module needs information about other modules, it has to get that information itself.

In the case of XML::LibXML, if it's Build.pl (or whatever it uses) can't find libxml, it could then try to require Alien::LibXML. If that succeeds, it could then ask Alien::LibXML where libXML is.

Update: However, I don't think there's a way to make a conditional dependency. If libxml were already installed, Alien::LibXML could skip installing it (unless the user specified otherwise), Alien::LibXML itself would still get installed if listed as a dependency by another module.


In reply to Re^2: loading libxml2 as a prerequisite by RonW
in thread loading libxml2 as a prerequisite by jandrew

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.