source: x/lib/qt.xml@ c52af0c

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 c52af0c was c52af0c, checked in by Tushar Teredesai <tushar@…>, 19 years ago

Avoid qt reinstallation problems

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

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