source: general/genlib/libxml2.xml@ 84b29ba

10.1 11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 84b29ba was 84b29ba, checked in by Ken Moffat <ken@…>, 3 years ago

Fix libxml2 build breakage when icu68 is used.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@23856 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!-- Also update the download, md5, size entities in libxml2py2.xml -->
8 <!ENTITY libxml2-download-http "http://xmlsoft.org/sources/libxml2-&libxml2-version;.tar.gz">
9 <!ENTITY libxml2-download-ftp "ftp://xmlsoft.org/libxml2/libxml2-&libxml2-version;.tar.gz">
10 <!ENTITY libxml2-md5sum "10942a1dc23137a8aa07f0639cbfece5">
11 <!ENTITY libxml2-size "5.4 MB">
12 <!ENTITY libxml2-buildsize "87 MB (add 15 MB for tests)">
13 <!ENTITY libxml2-time "0.2 SBU (add 0.3 SBU for tests)">
14 <!ENTITY testsuite-version "20130923">
15]>
16
17<sect1 id="libxml2" xreflabel="libxml2-&libxml2-version;">
18 <?dbhtml filename="libxml2.html"?>
19
20 <sect1info>
21 <othername>$LastChangedBy$</othername>
22 <date>$Date$</date>
23 </sect1info>
24
25 <title>libxml2-&libxml2-version;</title>
26
27 <indexterm zone="libxml2">
28 <primary sortas="a-libxml2">libxml2</primary>
29 </indexterm>
30
31 <sect2 role="package">
32 <title>Introduction to libxml2</title>
33
34 <para>
35 The <application>libxml2</application> package contains libraries
36 and utilities used for parsing XML files.
37 </para>
38
39 &lfs10_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>
45 Download (HTTP): <ulink url="&libxml2-download-http;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download (FTP): <ulink url="&libxml2-download-ftp;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download MD5 sum: &libxml2-md5sum;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download size: &libxml2-size;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated disk space required: &libxml2-buildsize;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated build time: &libxml2-time;
71 </para>
72 </listitem>
73 </itemizedlist>
74
75 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
76 <itemizedlist spacing="compact">
77 <listitem>
78 <para>
79 Optional Testsuite:
80 <ulink url="http://www.w3.org/XML/Test/xmlts&testsuite-version;.tar.gz"/> - This
81 enables <command>make check</command> to do complete testing.
82 </para>
83 </listitem>
84 </itemizedlist>
85
86 <bridgehead renderas="sect3">libxml2 Dependencies</bridgehead>
87
88 <bridgehead renderas="sect4">Optional</bridgehead>
89 <para role="optional">
90 <xref linkend="python2"/> <!--or <xref linkend="python3"/> (to build and
91 install a <application>Python</application> library module, additionally
92 it is required to run the full suite of tests)-->
93 <!-- As discovered by Bruce, itstool needs this module. -->
94 </para>
95
96 <note>
97 <para>
98 Some packages which utilize <application>libxml2</application> (such as
99 <application>GNOME Doc Utils</application>) need the
100 <application>Python3</application> module installed to function properly
101 and some packages will not build properly if the
102 <application>Python3</application> module is not available.
103 </para>
104
105 <para>
106 The old <application>Python2</application> module can be built after
107 <filename class="libraryfile">libxml2.so</filename> has been installed,
108 see <xref linkend="libxml2py2"/>.
109 </para>
110 </note>
111
112 <bridgehead renderas="sect4">Optional</bridgehead>
113 <para role="optional">
114 <xref linkend="icu"/> (see below) and
115 <xref linkend="valgrind"/> (may be used in the tests)
116 </para>
117
118 <para condition="html" role="usernotes">
119 User Notes: <ulink url="&blfs-wiki;/libxml2"/>
120 </para>
121 </sect2>
122
123 <sect2 role="installation">
124 <title>Installation of libxml2</title>
125
126 <para>
127 First fix a problem generating the Python3 module with Python-3.9.0 and later:
128 </para>
129
130<screen><userinput>sed -i '/if Py/{s/Py/(Py/;s/)/))/}' python/{types.c,libxml.c}</userinput></screen>
131
132 <para>
133 To ensure that the <application>Python</application> module can be
134 built by <xref linkend="python3"/>, run:
135 </para>
136
137<screen><userinput>sed -i '/_PyVerify_fd/,+1d' python/types.c</userinput></screen>
138
139 <para>
140 If you are going to run the tests, disable one test that prevents the
141 tests from completing:
142 </para>
143
144<screen><userinput>sed -i 's/test.test/#&amp;/' python/tests/tstLastError.py</userinput></screen>
145
146 <para>
147 If, and only if, you are using <xref linkend="icu"/>, fix a
148 build breakage caused by that version by running the following command:
149 </para>
150
151<screen><userinput>sed -i 's/ TRUE/ true/' encoding.c</userinput></screen>
152
153 <para>
154 Install <application>libxml2</application> by running the following
155 commands:
156 </para>
157
158<screen><userinput>./configure --prefix=/usr \
159 --disable-static \
160 --with-history \
161 --with-python=/usr/bin/python3 &amp;&amp;
162make</userinput></screen>
163
164 <para>
165 If you downloaded the testsuite, issue the following command:
166 </para>
167
168<screen><userinput>tar xf ../xmlts&testsuite-version;.tar.gz</userinput></screen>
169
170 <para>
171 To test the results, issue: <command>make check &gt; check.log</command>.
172 A summary of the results can be obtained with <command>grep -E
173 '^Total|expected' check.log</command>. If <xref linkend="valgrind"/> is
174 installed and you want to check memory leaks, replace
175 <command>check</command> with <command>check-valgrind</command>.
176 </para>
177
178 <note>
179 <para>
180 The tests use <ulink url="http://localhost/">http://localhost/</ulink>
181 to test parsing of external entities. If the machine where you run the
182 tests serves as a web site, the tests may hang, depending on the
183 content of the file served. It is therefore recommended to shut down
184 the server during the tests, as the <systemitem
185 class="username">root</systemitem> user:
186 </para>
187
188<screen role="nodump" revision="sysv"><userinput>/etc/init.d/httpd stop</userinput></screen>
189<screen role="nodump" revision="systemd"><userinput>systemctl stop httpd.service</userinput></screen>
190
191 </note>
192 <para>
193 Now, as the <systemitem class="username">root</systemitem> user:
194 </para>
195
196<screen role="root"><userinput>make install</userinput></screen>
197 </sect2>
198
199 <sect2 role="commands">
200 <title>Command Explanations</title>
201
202 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
203 href="../../xincludes/static-libraries.xml"/>
204<!--
205 <para>
206 <parameter>sed -i '/_PyVerify_fd/,+1d' python/types.c</parameter>: This
207 fixes the <application>Python3</application> code to build with
208 <application>gcc-7</application>.
209 </para>
210-->
211 <para>
212 <parameter>--with-history</parameter>: This switch enables
213 <application>Readline</application> support when running
214 <command>xmlcatalog</command> or <command>xmllint</command> in shell mode.
215 </para>
216
217 <para>
218 <parameter>--with-python=/usr/bin/python3</parameter>: Allows building
219 the libxml2 module with Python3 instead of Python2.
220 </para>
221
222 <para>
223 <option>--with-icu</option>: Add this switch if you have built
224 <xref linkend="icu"/>, for better unicode support.
225 </para>
226
227 <para>
228 <option>--with-threads</option>: Add this switch to enable multithread
229 support.
230 </para>
231
232 </sect2>
233
234 <sect2 role="content">
235 <title>Contents</title>
236
237 <segmentedlist>
238 <segtitle>Installed Programs</segtitle>
239 <segtitle>Installed Libraries</segtitle>
240 <segtitle>Installed Directories</segtitle>
241
242 <seglistitem>
243 <seg>
244 xml2-config,
245 xmlcatalog, and
246 xmllint <!--and the
247 drv_libxml2.py and libxml2.py <application>Python3</application>
248 modules. These are pythin modules, not programs -->
249 </seg>
250 <seg>
251 libxml2.so and
252 libxml2mod.so (<application>Python3</application> module)
253 </seg>
254 <seg>
255 /usr/include/libxml2,
256 /usr/lib/cmake/libxml2,
257 /usr/share/doc/libxml2-&libxml2-version;,
258 /usr/share/doc/libxml2-python-&libxml2-version;, and
259 /usr/share/gtk-doc/html/libxml2
260 </seg>
261 </seglistitem>
262 </segmentedlist>
263
264 <variablelist>
265 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
266 <?dbfo list-presentation="list"?>
267 <?dbhtml list-presentation="table"?>
268
269 <varlistentry id="xml2-config">
270 <term><command>xml2-config</command></term>
271 <listitem>
272 <para>
273 determines the compile and linker flags that should be used to
274 compile and link programs that use
275 <filename class='libraryfile'>libxml2</filename>.
276 </para>
277 <indexterm zone="libxml2 xml2-config">
278 <primary sortas="b-xml2-config">xml2-config</primary>
279 </indexterm>
280 </listitem>
281 </varlistentry>
282
283 <varlistentry id="xmlcatalog">
284 <term><command>xmlcatalog</command></term>
285 <listitem>
286 <para>
287 is used to monitor and manipulate XML and SGML catalogs.
288 </para>
289 <indexterm zone="libxml2 xmlcatalog">
290 <primary sortas="b-xmlcatalog">xmlcatalog</primary>
291 </indexterm>
292 </listitem>
293 </varlistentry>
294
295 <varlistentry id="xmllint">
296 <term><command>xmllint</command></term>
297 <listitem>
298 <para>
299 parses XML files and outputs reports (based upon options) to detect
300 errors in XML coding.
301 </para>
302 <indexterm zone="libxml2 xmllint">
303 <primary sortas="b-xmllint">xmllint</primary>
304 </indexterm>
305 </listitem>
306 </varlistentry>
307<!--
308 <varlistentry id="drv_libxml2.py3">
309 <term><command>drv_libxml2.py</command></term>
310 <listitem>
311 <para>
312 is a SAX <application>Python3</application> driver for libxml2.
313 </para>
314 <indexterm zone="libxml2 drv_libxml2.py3">
315 <primary sortas="b-drv_libxml2.py3">drv_libxml2.py for Python3</primary>
316 </indexterm>
317 </listitem>
318 </varlistentry>
319
320 <varlistentry id="libxml2.py3">
321 <term><command>libxml2.py</command></term>
322 <listitem>
323 <para>
324 is the <application>Python3</application> binding for libxml2.
325 </para>
326 <indexterm zone="libxml2 libxml2.py3">
327 <primary sortas="b-libxml2.py3">libxml2.py for Python3</primary>
328 </indexterm>
329 </listitem>
330 </varlistentry>
331-->
332 <varlistentry id="libxml2-lib">
333 <term><filename class="libraryfile">libxml2.so</filename></term>
334 <listitem>
335 <para>
336 provides functions for programs to parse files that use the XML
337 format.
338 </para>
339 <indexterm zone="libxml2 libxml2-lib">
340 <primary sortas="c-libxml2">libxml2.so</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="libxml2mod3">
346 <term><filename class="libraryfile">libxml2mod.so</filename></term>
347 <listitem>
348 <para>
349 is the interface for <application>Python3</application>
350 to use <filename class="libraryfile">libxml2.so</filename>.
351 </para>
352 <indexterm zone="libxml2 libxml2mod3">
353 <primary sortas="c-libxml2mod">libxml2mod.so</primary>
354 </indexterm>
355 </listitem>
356 </varlistentry>
357
358 </variablelist>
359
360 </sect2>
361
362</sect1>
Note: See TracBrowser for help on using the repository browser.