source: x/lib/qt.xml@ ed87c5a

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 ed87c5a was ed87c5a, checked in by DJ Lucas <dj@…>, 18 years ago

Added instructions to Qt about alternate X prefix

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

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