Install XML::LibXML without root

Get a source tarball for libxml2-dev. On `apt` systems:

apt-get source libxml2-dev

Configure it to install locally, and then install it:

cd libxml2-dev/
./configure --prefix=/home/peters/perl5/alien/
make install

Ignoring all other options like LIBS, INC, and the rest of the stuff that's kindly recommended, you only care about showing Makefile.PL where to find xml2config:

perl Makefile.PL XMLPREFIX=~/perl5/alien/

And then it should cleanly make.


A while back I created Alien::LibXML that installs a copy of libxml2 into one of your @INC paths. If you can install Perl modules, you can install it.

Submitting a patch to XML::LibXML's Makefile.PL to check for Alien::LibXML has been on my TODO list for ages.

Do you have the source for your modified Alien::LibXML or anything I can do to help with the patch submission? It seems like the perfect solution for a dev environment issue I'm running into.

I suppose I could just patch it myself, but if you've already road tested it, I like not re-inventing any wheels :)

The gist of how to patch XML::LibXML's Makefile.PL can be found in this ticket.


Leave a comment

About Peter Sergeant

user-pic I blog about Perl.