source: x/lib/qt.xml@ cc25f73

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 cc25f73 was cc25f73, checked in by Bruce Dubbs <bdubbs@…>, 17 years ago

Expanded note on building database support into qt.

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

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