source: x/lib/qt.xml@ e8a29f69

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 12.2 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 gimp3 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/for-12.3 xry111/intltool xry111/llvm18 xry111/soup3 xry111/spidermonkey128 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since e8a29f69 was e8a29f69, checked in by Randy McMurchy <randy@…>, 19 years ago

Fixed typos in Qt instructions

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

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