libxml2-2.15.0

Introduction to libxml2

The libxml2 package contains libraries and utilities used for parsing XML files.

[Important]

Important

Updating this package is known to break ABI.

Additional Downloads

libxml2 Dependencies

Recommended
ICU-77.1

Installation of libxml2

First, apply a patch from upstream to fix a failure parsing attribute values that are not yet normalized:

patch -Np1 -i ../libxml2-2.15.0-upstream_fix-1.patch

Install libxml2 by running the following commands:

./configure --prefix=/usr           \
            --sysconfdir=/etc       \
            --disable-static        \
            --with-history          \
            --with-icu              \
            --docdir=/usr/share/doc/libxml2-2.15.0 &&
make

Now, as the root user:

make install

Finally, prevent some packages from unnecessarily linking to ICU using the following commands as the root user:

rm -vf /usr/lib/libxml2.la &&
sed '/libs=/s/xml2.*/xml2"/' -i /usr/bin/xml2-config

lib32 Installation of libxml2

Install lib32-libxml2 by running the following commands:

make distclean &&
CC="gcc -m32" CXX="g++ -m32"         \
PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
./configure --prefix=/usr            \
            --libdir=/usr/lib32      \
            --host=i686-pc-linux-gnu \
            --sysconfdir=/etc        \
            --disable-static         \
            --with-history           \
            --with-icu &&
make

Now, as the root user:

make DESTDIR=$PWD/DESTDIR install     &&
rm -vf DESTDIR/usr/lib32/libxml2.la   &&
cp -Rv DESTDIR/usr/lib32/* /usr/lib32 &&
rm -rf DESTDIR                        &&
ldconfig

Command Explanations

[Note]

Note

Run ./configure --help for a full list of options.

--disable-static: This switch prevents installation of static versions of the libraries.

--with-history: This switch enables Readline support when running xmlcatalog or xmllint in shell mode.

--with-icu: This switch enables support for ICU, which provides additional Unicode support. This is needed for some packages outside of GLFS, such as for QtWebEngine.

Contents

Installed Programs: xml2-config, xmlcatalog, and xmllint
Installed Libraries: libxml2
Installed Directories: /usr/include/libxml2, /usr/lib/cmake/libxml2, /usr/share/doc/libxml2-2.15.0, and /usr/share/gtk-doc/html/libxml2

Short Descriptions

xml2-config

determines the compile and linker flags that should be used to compile and link programs that use libxml2

xmlcatalog

is used to monitor and manipulate XML and SGML catalogs

xmllint

parses XML files and outputs reports (based upon options) to detect errors in XML coding

libxml2

provides functions for programs to parse files that use the XML format