Skip Navigation

Installing Perl Bundle::XML on Mac OS X

By Robert Crews

The trick to installing the Perl Bundle::XML on Mac OS X 10.4 is to first install Expat, then manually install XML::Parser::Expat, then install Bundle::XML through CPAN, twice.

To install Bundle::XML on Mac OS X 10.5:

Four problematic modules:

Install Expat from source. Then build and install:
$ perl Makefile.PL EXPATLIBPATH=/usr/local/lib EXPATINCPATH=/usr/local/include
$ make
$ make test
$ sudo make install
Change the requirements from 1.1.18 to 1.1.12 in Makefile.PL.
Remove both occurances of xsltRegisterLocalRVT(tctxt,container); from LibXSLT.xs before running make. (You can avoid two warning messages by installing libgcrypt and libgpg-error from source first.)
Force install. (You can fix the faulty test by adding use utf8; to t/grove.t.)
Unable to get XML::Sablotron installed yet….

To install Bundle::XML on Mac OS X 10.4:

  1. Install Expat. There are two easy ways to install Expat on Mac OS X: Install Apple's optional X11 package or install Expat from Fink.

    Apple's X11 installer is available on the operating system installer disk. You can install it by running the operating system installer, choosing a custom installation, and clicking the box next to X11, or by double-clicking the Optional Installs package, then choosing Applications > X11 at the custom install window. You can tell if you already have X11 installed by looking for the X11 application in your Applications > Utilities folder or by checking for the presence of the /usr/X11R6 directory.

    The Fink home page describes how to install software with Fink and how to determine what packages you've already installed with Fink.

  2. Download the latest XML::Parser::Expat from CPAN, unpack the source, and cd to the source directory:
    curl -OL \ ;\
    tar xvfz XML-Parser-2.34.tar.gz ; rm XML-Parser-2.34.tar.gz ;\
    cd XML-Parser-2.34

    Note that the distribution looks like it's called XML::Parser, but don't confuse XML::Parser::Expat with the older XML::Parser. Installing XML::Parser::Expat will also install XML::Parser.

  3. Build and install XML::Parser::Expat.

    If you've installed Apple's X11, install XML::Parser::Expat like this:

    $ perl Makefile.PL EXPATLIBPATH=/usr/X11R6/lib EXPATINCPATH=/usr/X11R6/include
    $ make
    $ make test
    $ sudo make install

    If you've installed Expat with Fink, install XML::Parser::Expat like this:

    $ perl perl Makefile.PL EXPATLIBPATH=/sw/lib EXPATINCPATH=/sw/include
    $ make
    $ make test
    $ sudo make install
  4. Install Bundle::XML from CPAN, twice. Apparently the module dependencies in Bundle::XML are not specified in the correct order so the first attempt will fail. Do not repeat with a force install, just install again and all will be well:
    $ sudo perl -MCPAN -e shell
    cpan> install Bundle::XML
    cpan> install Bundle::XML
    cpan> quit

If you're using Mac OS X 10.3 or earlier, you'll need to install the LibXML2, LibXSLT and Sablotron libraries, then manually install the XML::LibXML, XML::LibXSLT, and XML::Sablotron modules before installing Bundle::XML. LibXML2 and LibXSLT are available through Fink.