source: x/lib/qt.xml@ 2d006066

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 2d006066 was b276c41, checked in by Bruce Dubbs <bdubbs@…>, 17 years ago

Add security patch to qt.

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

  • Property mode set to 100644
File size: 21.9 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 <!ENTITY qt-download-http "http://ftp.silug.org/mirrors/ftp.trolltech.com/qt/source/qt-x11-free-&qt-version;.tar.bz2">
8 <!ENTITY qt-download-ftp "ftp://ftp.trolltech.com/qt/source/qt-x11-free-&qt-version;.tar.bz2">
9 <!ENTITY qt-md5sum "cf3c43a7dfde5bfb76f8001102fe6e85">
10 <!ENTITY qt-size "14.3 MB">
11 <!ENTITY qt-buildsize "261 MB">
12 <!ENTITY qt-time "11 SBU (full), 7.5 SBU (sub-tools)">
13]>
14
15<sect1 id="qt" xreflabel="Qt-&qt-version;">
16 <?dbhtml filename="qt.html" ?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Qt-&qt-version;</title>
24
25 <indexterm zone="qt">
26 <primary sortas="a-qt">Qt</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Qt</title>
31
32 <para>The <application>Qt</application> package contains a
33 <application>C++</application> GUI library. This is useful for creating
34 graphical applications or executing graphical applications that are
35 dynamically linked to the <application>Qt</application> library. One of
36 the major users of <application>Qt</application> is
37 <application>KDE</application>.</para>
38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing="compact">
41 <listitem>
42 <para>Download (HTTP): <ulink url="&qt-download-http;"/></para>
43 </listitem>
44 <listitem>
45 <para>Download (FTP): <ulink url="&qt-download-ftp;"/></para>
46 </listitem>
47 <listitem>
48 <para>Download MD5 sum: &qt-md5sum;</para>
49 </listitem>
50 <listitem>
51 <para>Download size: &qt-size;</para>
52 </listitem>
53 <listitem>
54 <para>Estimated disk space required: &qt-buildsize;</para>
55 </listitem>
56 <listitem>
57 <para>Estimated build time: &qt-time;</para>
58 </listitem>
59 </itemizedlist>
60
61 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
62 <itemizedlist spacing="compact">
63 <listitem>
64 <para>Required patch: <ulink
65 url="http://www.trolltech.com/developer/download/Qt-3.3.8-UTF-8-fix.diff"/></para>
66 </listitem>
67 </itemizedlist>
68
69 <bridgehead renderas="sect3">Qt Dependencies</bridgehead>
70
71 <bridgehead renderas="sect4">Required</bridgehead>
72 <para role="required"><xref linkend="x-window-system"/></para>
73
74 <bridgehead renderas="sect4">Recommended</bridgehead>
75 <para role="recommended"><xref linkend="libjpeg"/> and
76 <xref linkend="libmng"/></para>
77
78 <para>Note: if for whatever reason you do not have the recommended
79 libraries installed on your system, you must remove the corresponding
80 <parameter>-system-<replaceable>&lt;library&gt;</replaceable></parameter> and
81 <parameter>-plugin-imgfmt-<replaceable>&lt;library&gt;</replaceable></parameter>
82 parameters from the <command>configure</command> commands shown in the
83 instructions below.</para>
84
85 <bridgehead renderas="sect4">Optional</bridgehead>
86 <para role="optional"><xref linkend="nas"/>,
87 <xref linkend="cups"/>,
88 <xref linkend="mysql"/>,
89 <xref linkend="postgresql"/>,
90 <xref linkend="unixodbc"/>,
91 <ulink url="http://sqlite.org/">SQLite</ulink> and
92 <ulink url="http://firebird.sourceforge.net/">Firebird</ulink></para>
93
94 <para condition="html" role="usernotes">User Notes:
95 <ulink url="&blfs-wiki;/qt"/></para>
96
97 </sect2>
98
99 <sect2 role="installation">
100 <title>Installation of Qt</title>
101
102 <para>The <application>Qt</application> source hard codes the location
103 of the <application>X Window System</application> installtion to
104 <filename class="directory">/usr/X11R6</filename>. If you've installed
105 the <application>X Window System</application> in any prefix other than
106 <filename class="directory">/usr/X11R6</filename>, then you should correct
107 the <application>qmake</application> configuration files with the following
108 commands, replacing <replaceable>&lt;PREFIX&gt;</replaceable> with the
109 installation prefix of the
110 <application>X Window System</application>:</para>
111
112<screen><userinput>for file in $(grep -lr "X11R6" *)
113do
114 sed -i "s@/usr/X11R6@<replaceable>&lt;PREFIX&gt;</replaceable>@g" $file
115done</userinput></screen>
116
117 <para>There are several ways to install a complicated package such as
118 <application>Qt</application>. The files are not completely position
119 independent. Installation procedures execute the program
120 <command>pkg-config</command> to determine the location of package
121 executables, libraries, headers, and other files. For
122 <application>Qt</application>, <command>pkg-config</command> will look
123 for the file <filename>lib/pkgconfig/qt-mt.pc</filename> which must be
124 modified if relocating the package. This file is set up correctly by
125 the build process.</para>
126
127 <para>The default installation places the files in
128 <filename class='directory'>/usr/local/qt/</filename>. Many commercial
129 distributions place the files in the system's
130 <filename class='directory'>/usr</filename> hierarchy. The package can
131 also be installed in an arbitrary directory.</para>
132
133 <para>This section will demonstrate two different methods.</para>
134
135 <warning>
136 <para>Building <application>Qt</application> in a
137 <command>chroot</command> environment may fail.</para>
138 </warning>
139
140 <note>
141 <para>The build time for <application>Qt</application> is quite long. If
142 you want to save some time and don't want the tutorials and examples,
143 change the first <command>make</command> command to:</para>
144
145<screen><userinput>make sub-tools</userinput></screen>
146
147 </note>
148
149 <sect3>
150 <title>Method 1 - Installing in the '/usr' Hierarchy</title>
151
152 <para>The advantage of this method is that no updates to the
153 <filename>/etc/ld.so.conf</filename> or
154 <filename>/etc/man_db.conf</filename> files are required. The package
155 files are distributed within several subdirectories of the
156 <filename class='directory'>/usr</filename> hierarchy.
157 This is the method that most commercial distributions use.</para>
158
159<!--
160 <note>
161 <para>The installation incorrectly uses <command>cp</command> to
162 install the files. This causes problems if the
163 <application>Qt</application> libraries are already in use (e.g.,
164 you are logged into your <application>KDE</application> desktop
165 environment). To avoid problems, <command>cp -f</command> is
166 replaced by <command>install</command> in
167 <filename>qmake.conf</filename>.</para>
168 </note>
169-->
170
171 <note>
172 <para>If <application>Qt</application> is being reinstalled, run the
173 following commands from a console or non-Qt based window manager.
174 It overwrites <application>Qt</application> libraries that should not
175 be in use during the install process.</para>
176 </note>
177
178 <para>A <ulink
179 url='http://www.trolltech.com/company/newsroom/announcements/press.2007-03-30.9172215350'>security
180 vulnerability</ulink> has been identified in the
181 <application>Qt</application> package. Apply the patch to fix this
182 vulnerability with the following command:</para>
183
184<screen><userinput>patch -Np0 -i ../Qt-3.3.8-UTF-8-fix.diff</userinput></screen>
185
186 <para>Continue with:</para>
187
188<screen><userinput>sed -i -e 's:$(QTDIR)/include:&amp;/qt:' \
189 -e 's:$(QTDIR)/lib:&amp;/qt:' \
190 mkspecs/linux*/qmake.conf &amp;&amp;
191
192bash
193export PATH=$PWD/bin:$PATH &amp;&amp;
194export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
195
196./configure -prefix /usr \
197 -docdir /usr/share/doc/qt \
198 -headerdir /usr/include/qt \
199 -plugindir /usr/lib/qt/plugins \
200 -datadir /usr/share/qt \
201 -translationdir /usr/share/qt/translations \
202 -sysconfdir /etc/qt \
203 -qt-gif \
204 -system-zlib \
205 -system-libpng \
206 -system-libjpeg \
207 -system-libmng \
208 -plugin-imgfmt-png \
209 -plugin-imgfmt-jpeg \
210 -plugin-imgfmt-mng \
211 -no-exceptions \
212 -thread \
213 -tablet &amp;&amp;
214
215find -type f -name Makefile | xargs sed -i "s@-Wl,-rpath,/usr/lib@@g" &amp;&amp;
216make &amp;&amp;
217exit</userinput></screen>
218
219 <para>This package does not come with a test suite.</para>
220
221 <para>Now, as the <systemitem class="username">root</systemitem>
222 user:</para>
223
224<screen role="root"><userinput>make install &amp;&amp;
225ln -v -sf libqt-mt.so /usr/lib/libqt.so &amp;&amp;
226cp -v -r doc/man /usr/share &amp;&amp;
227cp -v -r examples /usr/share/doc/qt</userinput></screen>
228
229 </sect3>
230
231 <sect3>
232 <title>Method 2 - Installing in '/opt'</title>
233
234 <para>This is the method recommended by the <application>Qt</application>
235 developers. It has the advantage of keeping all the package files
236 consolidated in a dedicated directory hierarchy. By using this method,
237 an update can be made without overwriting a previous installation and
238 users can easily revert to a previous version by changing one symbolic
239 link.</para>
240
241 <para>The <application>Qt</application> developers use a default location
242 of <filename class='directory'>/usr/local/qt/</filename>, however this
243 procedure puts the files in <filename
244 class='directory'>/opt/qt-&qt-version;/</filename>
245 and then creates a symbolic link to <filename>/opt/qt/</filename>.</para>
246
247 <para>A <ulink
248 url='http://www.trolltech.com/company/newsroom/announcements/press.2007-03-30.9172215350'>security
249 vulnerability</ulink> has been identified in the
250 <application>Qt</application> package. Apply the patch to fix this
251 vulnerability with the following command:</para>
252
253<screen><userinput>patch -Np0 -i ../Qt-3.3.8-UTF-8-fix.diff</userinput></screen>
254
255 <para>Continue with:</para>
256
257<screen><userinput>bash
258export QTDIR=$PWD &amp;&amp;
259export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
260export PATH=$PWD/bin:$PATH &amp;&amp;
261
262./configure -prefix /opt/qt-&qt-version; \
263 -sysconfdir /etc/qt \
264 -qt-gif \
265 -system-zlib \
266 -system-libpng \
267 -system-libjpeg \
268 -system-libmng \
269 -plugin-imgfmt-png \
270 -plugin-imgfmt-jpeg \
271 -plugin-imgfmt-mng \
272 -no-exceptions \
273 -thread \
274 -tablet &amp;&amp;
275
276make &amp;&amp;
277exit</userinput></screen>
278
279 <para>This package does not come with a test suite.</para>
280
281 <para>Now, as the <systemitem class="username">root</systemitem>
282 user:</para>
283
284<screen role="root"><userinput>make install &amp;&amp;
285ln -v -sfn qt-&qt-version; /opt/qt &amp;&amp;
286ln -v -s libqt-mt.so /opt/qt/lib/libqt.so &amp;&amp;
287cp -v -r doc/man examples /opt/qt/doc</userinput></screen>
288
289 </sect3>
290
291 </sect2>
292
293 <sect2 role="commands">
294 <title>Command Explanations</title>
295
296 <para><command>sed -i -e ... mkspecs/linux*/qmake.conf</command>:
297 Directories in <filename>qmake.conf</filename> need to be adjusted
298 to match the BLFS Method 1 installation directories.</para>
299
300 <para><command>bash</command>: This command enters a sub-shell to isolate
301 environment changes.</para>
302
303 <para><command>export QTDIR=$PWD</command>: This command defines where
304 the root of the <application>Qt</application> directory is located.</para>
305
306 <para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>:
307 This command allows the not yet installed <application>Qt</application>
308 libraries to be used by the not yet installed <application>Qt</application>
309 programs.</para>
310
311 <para><command>export PATH=$PWD/bin:$PATH</command>: This command
312 allows the build process to find supporting executables.</para>
313
314 <para><parameter>-qt-gif</parameter>: This switch adds support for
315 <filename>gif</filename> files to the libraries.</para>
316
317 <para><parameter>-system-zlib -system-libpng -system-libjpeg
318 -system-mng</parameter>: These switches force the build instructions to use
319 the shared libraries that are on your system instead of creating a custom
320 set of support libraries for these functions.</para>
321
322 <para><parameter>-plugin-imgfmt-png -plugin-imgfmt-jpeg
323 -plugin-imgfmt-mng</parameter>: These switches enable run-time linking of
324 the referenced libraries.</para>
325
326 <para>If you pass the
327 <option>-plugin-sql-<replaceable>&lt;driver&gt;</replaceable></option> or
328 <option>-qt-sql-<replaceable>&lt;driver&gt;</replaceable></option> switch
329 to the <command>configure</command> command, you must also pass
330 <option>-I<replaceable>&lt;/path/to/sql/headers&gt;</replaceable></option>
331 so <command>make</command> can find the appropriate header files. For
332 instance, building in <application>MySQL</application> support (as opposed
333 to building the plugin) will need to use <option>-I/usr/include/mysql
334 -qt-sql-mysql</option>.</para>
335
336 <note>
337 <para>To check if <application>mysql</application> is autotetected
338 properly, examine the output of <command>./configure -I/usr/include/mysql
339 -help</command>. Other database support will require similar
340 <command>configure</command> parameters.</para>
341 </note>
342
343 <para><parameter>-no-exceptions</parameter>: This switch disables
344 the exceptions coding generated by the <application>C++</application>
345 compiler.</para>
346
347 <para><parameter>-thread</parameter>: This switch adds
348 support for multi-threading.</para>
349
350 <para><command>find -type f -name Makefile | xargs sed -i
351 "s@-Wl,-rpath,/usr/lib@@g"</command>: This command removes hardcoded
352 run-time paths. Otherwise, <command>uic</command> always tries to run
353 with <application>Qt</application> libraries in
354 <filename>/usr/lib</filename>.</para>
355
356 <para><command>ln -v -s libqt-mt.so /usr/lib/libqt.so</command>: This
357 command allows <command>configure</command> scripts to find a working
358 <application>Qt</application> installation.</para>
359
360 <para><command>cp -v -r doc/man examples /usr/share (or
361 /opt/qt/doc)</command>:
362 This command installs the man pages and examples which are missed by
363 <command>make install</command>.</para>
364
365 <para><command>exit</command>: This command returns to the parent shell
366 and eliminates the environment variables set earlier.</para>
367
368 </sect2>
369
370 <sect2 role="configuration">
371 <title>Configuring Qt</title>
372
373 <sect3 id='qt-config'>
374 <title>Configuration Information</title>
375
376 <para>The <envar>QTDIR</envar> environment variable needs to be set when
377 building packages that depend on <application>Qt</application>. Add the
378 following to the <filename>.bash_profile</filename> initialization script
379 for each user that builds packages using the <application>Qt</application>
380 libraries. Alternatively, the variable can be set in the system wide
381 <filename>/etc/profile</filename> file.</para>
382
383 <para>For Method 1 (This is optional, only set this if an application is
384 unable to find the installed libraries):</para>
385
386<screen><literal>export QTDIR=/usr</literal></screen>
387
388 <para>or for Method 2:</para>
389
390<screen><literal>export QTDIR=/opt/qt</literal></screen>
391
392 <para>If you installed <application>Qt</application> using Method 2,
393 you also need to update the following configuration files so that
394 <application>Qt</application> is correctly found by other packages
395 and system processes.</para>
396
397 <para>Update the <filename>/etc/ld.so.conf</filename> and
398 <filename>/etc/man_db.conf</filename> files:</para>
399
400<screen role="root"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF" &amp;&amp;
401<literal># Begin qt addition to /etc/ld.so.conf
402
403/opt/qt/lib
404
405# End qt addition</literal>
406EOF
407ldconfig &amp;&amp;
408cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF"
409<literal># Begin qt addition to man_db.conf
410
411MANDATORY_MANPATH /opt/qt/doc/man
412
413# End qt addition to man_db.conf</literal>
414EOF</userinput></screen>
415
416 <indexterm zone="qt qt-config">
417 <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
418 </indexterm>
419
420 <indexterm zone="qt qt-config">
421 <primary sortas="e-etc-man_db.conf">/etc/man_db.conf</primary>
422 </indexterm>
423
424 <indexterm zone="qt qt-config">
425 <primary sortas="e-etc-profile">/etc/profile</primary>
426 </indexterm>
427
428 <indexterm zone="qt qt-config">
429 <primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
430 </indexterm>
431
432 <para>Update the <envar>PKG_CONFIG_PATH</envar> environment variable
433 in your <filename>~/.bash_profile</filename> or
434 <filename>/etc/profile</filename> with the following:</para>
435
436<screen><literal>PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig</literal></screen>
437
438 <para>If you want the <application>Qt</application> executables in your
439 shell search path, update the <envar>PATH</envar> environment variable
440 in your <filename>~/.bash_profile</filename> or
441 <filename>/etc/profile</filename> to include
442 <filename class='directory'>/opt/qt/bin</filename>.</para>
443
444 <para>As with most libraries, there is no explicit configuration to do.
445 After updating <filename>/etc/ld.so.conf</filename> as explained above,
446 run <command>/sbin/ldconfig</command> so that <command>ldd</command>
447 can find the shared libraries.</para>
448
449 </sect3>
450
451 </sect2>
452
453 <sect2 role="content">
454 <title>Contents</title>
455
456 <segmentedlist>
457 <segtitle>Installed Programs</segtitle>
458 <segtitle>Installed Libraries</segtitle>
459 <segtitle>Installed Directories</segtitle>
460
461 <seglistitem>
462 <seg>assistant, designer, linguist, lrelease, lupdate, moc,
463 qm2ts, qmake, qtconfig, and uic</seg>
464 <seg>libqt-mt.so, libqt.so libqui.so, libdesignercore.a,
465 libeditor.a, and libqassistantclient.a</seg>
466 <seg>/opt/qt-&qt-version; or /usr/lib/qt, /usr/share/qt,
467 /usr/share/doc/qt, /usr/include/qt, and /etc/qt</seg>
468 </seglistitem>
469 </segmentedlist>
470
471 <variablelist>
472 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
473 <?dbfo list-presentation="list"?>
474 <?dbhtml list-presentation="table"?>
475
476 <varlistentry id="assistant">
477 <term><command>assistant</command></term>
478 <listitem>
479 <para>is a tool for presenting on-line documentation.</para>
480 <indexterm zone="qt assistant">
481 <primary sortas="b-assistant">assistant</primary>
482 </indexterm>
483 </listitem>
484 </varlistentry>
485
486 <varlistentry id="designer">
487 <term><command>designer</command></term>
488 <listitem>
489 <para>is a full-fledged GUI builder. It includes
490 powerful features such as preview mode, automatic widget
491 layout, support for custom widgets, and an advanced
492 property editor.</para>
493 <indexterm zone="qt designer">
494 <primary sortas="b-designer">designer</primary>
495 </indexterm>
496 </listitem>
497 </varlistentry>
498
499 <varlistentry id="linguist">
500 <term><command>linguist</command></term>
501 <listitem>
502 <para>provides support for translating applications into
503 local languages. </para>
504 <indexterm zone="qt linguist">
505 <primary sortas="b-linguist">linguist</primary>
506 </indexterm>
507 </listitem>
508 </varlistentry>
509
510 <varlistentry id="lrelease">
511 <term><command>lrelease</command></term>
512 <listitem>
513 <para>is a simple command line tool. It reads a Qt project
514 file and produces message files used by the application.</para>
515 <indexterm zone="qt lrelease">
516 <primary sortas="b-lrelease">lrelease</primary>
517 </indexterm>
518 </listitem>
519 </varlistentry>
520
521 <varlistentry id="lupdate">
522 <term><command>lupdate</command></term>
523 <listitem>
524 <para>reads a Qt project file, finds the translatable
525 strings in the specified source, header and Qt Designer
526 interface files, and produces or updates the translation
527 files listed in the project file.</para>
528 <indexterm zone="qt lupdate">
529 <primary sortas="b-lupdate">lupdate</primary>
530 </indexterm>
531 </listitem>
532 </varlistentry>
533
534 <varlistentry id="moc">
535 <term><command>moc</command></term>
536 <listitem>
537 <para>generates Qt meta object support code.</para>
538 <indexterm zone="qt moc">
539 <primary sortas="b-moc">moc</primary>
540 </indexterm>
541 </listitem>
542 </varlistentry>
543
544 <varlistentry id="qm2ts">
545 <term><command>qm2ts</command></term>
546 <listitem>
547 <para>is a tool for converting Qt message file formats.</para>
548 <indexterm zone="qt qm2ts">
549 <primary sortas="b-qm2ts">qm2ts</primary>
550 </indexterm>
551 </listitem>
552 </varlistentry>
553
554 <varlistentry id="qmake">
555 <term><command>qmake</command></term>
556 <listitem>
557 <para>qmake uses information stored in project files to
558 determine what should go in the makefiles it generates.</para>
559 <indexterm zone="qt qmake">
560 <primary sortas="b-qmake">qmake</primary>
561 </indexterm>
562 </listitem>
563 </varlistentry>
564
565 <varlistentry id="qtconfig">
566 <term><command>qtconfig</command></term>
567 <listitem>
568 <para>is used to customize the appearance of Qt applications.</para>
569 <indexterm zone="qt qtconfig">
570 <primary sortas="b-qtconfig">qtconfig</primary>
571 </indexterm>
572 </listitem>
573 </varlistentry>
574
575 <varlistentry id="uic">
576 <term><command>uic</command></term>
577 <listitem>
578 <para>is a Qt user interface compiler.</para>
579 <indexterm zone="qt uic">
580 <primary sortas="b-uic">uic</primary>
581 </indexterm>
582 </listitem>
583 </varlistentry>
584
585 </variablelist>
586
587 </sect2>
588
589</sect1>
Note: See TracBrowser for help on using the repository browser.