source: x/lib/qt.xml@ 884db0e3

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 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 884db0e3 was 884db0e3, checked in by Randy McMurchy <randy@…>, 19 years ago

Fixed tagging, indentation and typos in Qt instructions

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

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