source: x/lib/qt.xml@ 1afe6c26

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 1afe6c26 was 1afe6c26, checked in by Dan Nichilson <dnicholson@…>, 17 years ago

Changed the Qt install so all files accessible from QTDIR=/usr/share/qt

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

  • Property mode set to 100644
File size: 22.1 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 '/QMAKE_RPATH/d' mkspecs/linux*/qmake.conf &amp;&amp;
189
190bash
191export PATH=$PWD/bin:$PATH &amp;&amp;
192export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
193
194./configure -prefix /usr \
195 -docdir /usr/share/doc/qt \
196 -headerdir /usr/include/qt \
197 -plugindir /usr/lib/qt/plugins \
198 -datadir /usr/share/qt \
199 -translationdir /usr/share/qt/translations \
200 -sysconfdir /etc/qt \
201 -qt-gif \
202 -system-zlib \
203 -system-libpng \
204 -system-libjpeg \
205 -system-libmng \
206 -plugin-imgfmt-png \
207 -plugin-imgfmt-jpeg \
208 -plugin-imgfmt-mng \
209 -no-exceptions \
210 -thread \
211 -tablet &amp;&amp;
212
213make &amp;&amp;
214exit</userinput></screen>
215
216 <para>This package does not come with a test suite.</para>
217
218 <para>Now, as the <systemitem class="username">root</systemitem>
219 user:</para>
220
221<screen role="root"><userinput>make install &amp;&amp;
222ln -v -sf libqt-mt.so /usr/lib/libqt.so &amp;&amp;
223ln -v -snf ../../bin /usr/share/qt/bin &amp;&amp;
224ln -v -snf ../../include/qt /usr/share/qt/include &amp;&amp;
225ln -v -snf ../../lib /usr/share/qt/lib &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 '/QMAKE_RPATH/d' mkspecs/linux*/qmake.conf</command>:
297 In Method 1, <application>Qt</application> is being installed into
298 the standard system directories. The runtime library search path does not
299 need to be set in this case.</para>
300
301 <para><command>bash</command>: This command enters a sub-shell to isolate
302 environment changes.</para>
303
304 <para><command>export QTDIR=$PWD</command>: This command defines where
305 the root of the <application>Qt</application> directory is located.</para>
306
307 <para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>:
308 This command allows the not yet installed <application>Qt</application>
309 libraries to be used by the not yet installed <application>Qt</application>
310 programs.</para>
311
312 <para><command>export PATH=$PWD/bin:$PATH</command>: This command
313 allows the build process to find supporting executables.</para>
314
315 <para><parameter>-qt-gif</parameter>: This switch adds support for
316 <filename>gif</filename> files to the libraries.</para>
317
318 <para><parameter>-system-zlib -system-libpng -system-libjpeg
319 -system-mng</parameter>: These switches force the build instructions to use
320 the shared libraries that are on your system instead of creating a custom
321 set of support libraries for these functions.</para>
322
323 <para><parameter>-plugin-imgfmt-png -plugin-imgfmt-jpeg
324 -plugin-imgfmt-mng</parameter>: These switches enable run-time linking of
325 the referenced libraries.</para>
326
327 <para>If you pass the
328 <option>-plugin-sql-<replaceable>&lt;driver&gt;</replaceable></option> or
329 <option>-qt-sql-<replaceable>&lt;driver&gt;</replaceable></option> switch
330 to the <command>configure</command> command, you must also pass
331 <option>-I<replaceable>&lt;/path/to/sql/headers&gt;</replaceable></option>
332 so <command>make</command> can find the appropriate header files. For
333 instance, building in <application>MySQL</application> support (as opposed
334 to building the plugin) will need to use <option>-I/usr/include/mysql
335 -qt-sql-mysql</option>.</para>
336
337 <note>
338 <para>To check if <application>mysql</application> is autotetected
339 properly, examine the output of <command>./configure -I/usr/include/mysql
340 -help</command>. Other database support will require similar
341 <command>configure</command> parameters.</para>
342 </note>
343
344 <para><parameter>-no-exceptions</parameter>: This switch disables
345 the exceptions coding generated by the <application>C++</application>
346 compiler.</para>
347
348 <para><parameter>-thread</parameter>: This switch adds
349 support for multi-threading.</para>
350
351 <para><command>ln -v -sf libqt-mt.so /usr/lib/libqt.so</command>: This
352 command allows <command>configure</command> scripts to find a working
353 <application>Qt</application> installation.</para>
354
355 <para><command>ln -v -snf ../../bin /usr/share/qt/bin</command>: This
356 command and the following two allow the
357 <filename class="directory">/usr</filename> style installation to mimic
358 the <filename class="directory">/opt</filename> style installation by
359 making all binaries, headers and libraries available from a single
360 directory, <filename class="directory">/usr/share/qt</filename>.</para>
361
362 <para><command>cp -v -r doc/man examples /usr/share (or
363 /opt/qt/doc)</command>:
364 This command installs the man pages and examples which are missed by
365 <command>make install</command>.</para>
366
367 <para><command>exit</command>: This command returns to the parent shell
368 and eliminates the environment variables set earlier.</para>
369
370 </sect2>
371
372 <sect2 role="configuration">
373 <title>Configuring Qt</title>
374
375 <sect3 id='qt-config'>
376 <title>Configuration Information</title>
377
378 <para>The <envar>QTDIR</envar> environment variable needs to be set when
379 building packages that depend on <application>Qt</application>. Add the
380 following to the <filename>.bash_profile</filename> initialization script
381 for each user that builds packages using the <application>Qt</application>
382 libraries. Alternatively, the variable can be set in the system wide
383 <filename>/etc/profile</filename> file.</para>
384
385 <para>For Method 1 (This is optional, only set this if an application is
386 unable to find the installed libraries or headers):</para>
387
388<screen><literal>export QTDIR=/usr/share/qt</literal></screen>
389
390 <para>or for Method 2:</para>
391
392<screen><literal>export QTDIR=/opt/qt</literal></screen>
393
394 <para>If you installed <application>Qt</application> using Method 2,
395 you also need to update the following configuration files so that
396 <application>Qt</application> is correctly found by other packages
397 and system processes.</para>
398
399 <para>Update the <filename>/etc/ld.so.conf</filename> and
400 <filename>/etc/man_db.conf</filename> files:</para>
401
402<screen role="root"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF" &amp;&amp;
403<literal># Begin qt addition to /etc/ld.so.conf
404
405/opt/qt/lib
406
407# End qt addition</literal>
408EOF
409ldconfig &amp;&amp;
410cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF"
411<literal># Begin qt addition to man_db.conf
412
413MANDATORY_MANPATH /opt/qt/doc/man
414
415# End qt addition to man_db.conf</literal>
416EOF</userinput></screen>
417
418 <indexterm zone="qt qt-config">
419 <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
420 </indexterm>
421
422 <indexterm zone="qt qt-config">
423 <primary sortas="e-etc-man_db.conf">/etc/man_db.conf</primary>
424 </indexterm>
425
426 <indexterm zone="qt qt-config">
427 <primary sortas="e-etc-profile">/etc/profile</primary>
428 </indexterm>
429
430 <indexterm zone="qt qt-config">
431 <primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
432 </indexterm>
433
434 <para>Update the <envar>PKG_CONFIG_PATH</envar> environment variable
435 in your <filename>~/.bash_profile</filename> or
436 <filename>/etc/profile</filename> with the following:</para>
437
438<screen><literal>PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig</literal></screen>
439
440 <para>If you want the <application>Qt</application> executables in your
441 shell search path, update the <envar>PATH</envar> environment variable
442 in your <filename>~/.bash_profile</filename> or
443 <filename>/etc/profile</filename> to include
444 <filename class='directory'>/opt/qt/bin</filename>.</para>
445
446 <para>As with most libraries, there is no explicit configuration to do.
447 After updating <filename>/etc/ld.so.conf</filename> as explained above,
448 run <command>/sbin/ldconfig</command> so that <command>ldd</command>
449 can find the shared libraries.</para>
450
451 </sect3>
452
453 </sect2>
454
455 <sect2 role="content">
456 <title>Contents</title>
457
458 <segmentedlist>
459 <segtitle>Installed Programs</segtitle>
460 <segtitle>Installed Libraries</segtitle>
461 <segtitle>Installed Directories</segtitle>
462
463 <seglistitem>
464 <seg>assistant, designer, linguist, lrelease, lupdate, moc,
465 qm2ts, qmake, qtconfig, and uic</seg>
466 <seg>libqt-mt.so, libqt.so libqui.so, libdesignercore.a,
467 libeditor.a, and libqassistantclient.a</seg>
468 <seg>/opt/qt-&qt-version; or /usr/lib/qt, /usr/share/qt,
469 /usr/share/doc/qt, /usr/include/qt, and /etc/qt</seg>
470 </seglistitem>
471 </segmentedlist>
472
473 <variablelist>
474 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
475 <?dbfo list-presentation="list"?>
476 <?dbhtml list-presentation="table"?>
477
478 <varlistentry id="assistant">
479 <term><command>assistant</command></term>
480 <listitem>
481 <para>is a tool for presenting on-line documentation.</para>
482 <indexterm zone="qt assistant">
483 <primary sortas="b-assistant">assistant</primary>
484 </indexterm>
485 </listitem>
486 </varlistentry>
487
488 <varlistentry id="designer">
489 <term><command>designer</command></term>
490 <listitem>
491 <para>is a full-fledged GUI builder. It includes
492 powerful features such as preview mode, automatic widget
493 layout, support for custom widgets, and an advanced
494 property editor.</para>
495 <indexterm zone="qt designer">
496 <primary sortas="b-designer">designer</primary>
497 </indexterm>
498 </listitem>
499 </varlistentry>
500
501 <varlistentry id="linguist">
502 <term><command>linguist</command></term>
503 <listitem>
504 <para>provides support for translating applications into
505 local languages. </para>
506 <indexterm zone="qt linguist">
507 <primary sortas="b-linguist">linguist</primary>
508 </indexterm>
509 </listitem>
510 </varlistentry>
511
512 <varlistentry id="lrelease">
513 <term><command>lrelease</command></term>
514 <listitem>
515 <para>is a simple command line tool. It reads a Qt project
516 file and produces message files used by the application.</para>
517 <indexterm zone="qt lrelease">
518 <primary sortas="b-lrelease">lrelease</primary>
519 </indexterm>
520 </listitem>
521 </varlistentry>
522
523 <varlistentry id="lupdate">
524 <term><command>lupdate</command></term>
525 <listitem>
526 <para>reads a Qt project file, finds the translatable
527 strings in the specified source, header and Qt Designer
528 interface files, and produces or updates the translation
529 files listed in the project file.</para>
530 <indexterm zone="qt lupdate">
531 <primary sortas="b-lupdate">lupdate</primary>
532 </indexterm>
533 </listitem>
534 </varlistentry>
535
536 <varlistentry id="moc">
537 <term><command>moc</command></term>
538 <listitem>
539 <para>generates Qt meta object support code.</para>
540 <indexterm zone="qt moc">
541 <primary sortas="b-moc">moc</primary>
542 </indexterm>
543 </listitem>
544 </varlistentry>
545
546 <varlistentry id="qm2ts">
547 <term><command>qm2ts</command></term>
548 <listitem>
549 <para>is a tool for converting Qt message file formats.</para>
550 <indexterm zone="qt qm2ts">
551 <primary sortas="b-qm2ts">qm2ts</primary>
552 </indexterm>
553 </listitem>
554 </varlistentry>
555
556 <varlistentry id="qmake">
557 <term><command>qmake</command></term>
558 <listitem>
559 <para>qmake uses information stored in project files to
560 determine what should go in the makefiles it generates.</para>
561 <indexterm zone="qt qmake">
562 <primary sortas="b-qmake">qmake</primary>
563 </indexterm>
564 </listitem>
565 </varlistentry>
566
567 <varlistentry id="qtconfig">
568 <term><command>qtconfig</command></term>
569 <listitem>
570 <para>is used to customize the appearance of Qt applications.</para>
571 <indexterm zone="qt qtconfig">
572 <primary sortas="b-qtconfig">qtconfig</primary>
573 </indexterm>
574 </listitem>
575 </varlistentry>
576
577 <varlistentry id="uic">
578 <term><command>uic</command></term>
579 <listitem>
580 <para>is a Qt user interface compiler.</para>
581 <indexterm zone="qt uic">
582 <primary sortas="b-uic">uic</primary>
583 </indexterm>
584 </listitem>
585 </varlistentry>
586
587 </variablelist>
588
589 </sect2>
590
591</sect1>
Note: See TracBrowser for help on using the repository browser.