source: x/lib/qt.xml@ 78d0e3c

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 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 78d0e3c was 78d0e3c, checked in by Randy McMurchy <randy@…>, 20 years ago

Added optional dependencies to PostgreSQL and Qt; added additional configuration information to Qt

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

  • Property mode set to 100644
File size: 11.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/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 "903cad618274ad84d7d13fd0027a6c3c">
10 <!ENTITY qt-size "14 MB">
11 <!ENTITY qt-buildsize "250 MB">
12 <!ENTITY qt-time "21.2 SBU (full), 13.4 SBU (sub-tools)">
13]>
14
15<sect1 id="qt" xreflabel="Qt-&qt-version;">
16<?dbhtml filename="qt.html" ?>
17<title>Qt-&qt-version;</title>
18
19<sect2>
20<title>Introduction to <application>Qt</application></title>
21
22<para>The <application>Qt</application> package contains a
23<application>C++</application> <acronym>GUI</acronym> library. This is useful
24for creating graphical applications or executing graphical applications that
25are dynamically linked to the <application>Qt</application> library. One of the
26major users of <application>Qt</application> is <application>KDE</application>.
27</para>
28
29<sect3><title>Package information</title>
30<itemizedlist spacing='compact'>
31<listitem><para>Download (HTTP): <ulink url="&qt-download-http;"/></para></listitem>
32<listitem><para>Download (FTP): <ulink url="&qt-download-ftp;"/></para></listitem>
33<listitem><para>MD5 Sum: &qt-md5sum;</para></listitem>
34<listitem><para>Download size: &qt-size;</para></listitem>
35<listitem><para>Estimated Disk space required: &qt-buildsize;</para></listitem>
36<listitem><para>Estimated build time: &qt-time;</para></listitem></itemizedlist>
37</sect3>
38
39<sect3><title><application>Qt</application> dependencies</title>
40<sect4><title>Required</title>
41<para><xref linkend="x-installing"/></para>
42</sect4>
43<sect4><title>Recommended</title>
44<para><xref linkend="libjpeg"/> and <xref linkend="libmng"/>.</para>
45</sect4>
46
47<sect4><title>Optional</title>
48<para><xref linkend="nas"/>, <xref linkend="cups"/>, <xref linkend="mysql"/>,
49<xref linkend="postgresql"/>, <ulink url="http://sqlite.org/">SQLite</ulink>,
50<ulink url="http://firebird.sourceforge.net/">Firebird</ulink>
51and <ulink url="http://www.unixodbc.org/">unixODBC</ulink>.</para>
52</sect4>
53</sect3>
54</sect2>
55
56<sect2>
57<title>Installation of <application>Qt</application></title>
58
59<para>There are several ways to install a complicated package such as
60<application>Qt</application>. The files are not completely position
61independent. Installation procedures execute the program
62<command>pkg-config</command> to determine the location of package executables,
63libraries, headers, and other files. For <application>Qt</application>,
64<command>pkg-config</command> will look for the file
65<filename>lib/pkgconfig/qt-mt.pc</filename> which must be modified if
66relocating the package. This file is set up correctly by the build process.
67</para>
68
69<para>The default installation places the files in
70<filename class='directory'>/usr/local/qt/</filename>. Many commercial
71distributions place the files in the system's
72<filename class='directory'>/usr</filename> hierarchy. The package can also be
73installed in an arbitrary directory.</para>
74
75<para>This section will demonstrate two different methods.</para>
76
77<note><para>The build time for <application>Qt</application> is quite long. If
78you want to save some time and don't want the tutorials and examples, change
79the first make line to:</para>
80
81<para><userinput><command>make sub-tools</command></userinput></para>
82</note>
83
84<sect3>
85<title>Method 1 - Installing in the
86<filename class='directory'>/usr</filename> hierarchy</title>
87
88<para>The advantage of this method is that no updates to the
89<filename>/etc/ld.so.conf</filename> or <filename>/etc/man.conf</filename>
90files are required. The package files are distributed within several
91subdirectories of the <filename class='directory'>/usr</filename> hierarchy.
92This is the method that most commercial distributions use.</para>
93
94<screen><userinput><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf &amp;&amp;
95bash
96export PATH=$PWD/bin:$PATH &amp;&amp;
97export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
98./configure -prefix /usr -docdir /usr/share/doc/qt \
99 -headerdir /usr/include/qt -plugindir /usr/lib/qt/plugins \
100 -datadir /usr/share/qt -translationdir /usr/share/qt/translations \
101 -sysconfdir /etc/qt -qt-gif -system-zlib \
102 -no-exceptions -thread -plugin-imgfmt-png -system-libpng &amp;&amp;
103find -type f -name Makefile | xargs sed -i "s@-Wl,-rpath,/usr/lib@@g" &amp;&amp;
104make &amp;&amp;
105make install &amp;&amp;
106ln -sf libqt-mt.so /usr/lib/libqt.so &amp;&amp;
107cp -r doc/man /usr/share &amp;&amp;
108cp -r examples /usr/share/doc/qt &amp;&amp;
109exit</command></userinput></screen>
110
111</sect3>
112
113<sect3>
114<title>Method 2 - Installing in <filename class='directory'>/opt</filename></title>
115
116<para>This is the method recommended by the <application>Qt</application>
117developers. It has the advantage of keeping all the package files consolidated
118in a dedicated directory hierarchy. By using this method, an update can be made
119without overwriting a previous installation and users can easily revert to a
120previous version by changing one symbolic link.</para>
121
122<para>The <application>Qt</application> developers use a default location of
123<filename class='directory'>/usr/local/qt/</filename>, however this procedure
124puts the files in <filename class='directory'>/opt/qt-&qt-version;/</filename>
125and then creates a symbolic link to <filename>/opt/qt/</filename>.</para>
126
127<screen><userinput><command>bash
128export QTDIR=$PWD &amp;&amp;
129export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
130export PATH=$PWD/bin:$PATH &amp;&amp;
131./configure -prefix /opt/qt-&qt-version; -qt-gif -system-libpng \
132 -system-libmng -system-zlib -system-libjpeg -no-exceptions \
133 -thread -plugin-imgfmt-png &amp;&amp;
134make &amp;&amp;
135make install &amp;&amp;
136ln -sfn qt-&qt-version; /opt/qt &amp;&amp;
137ln -s libqt-mt.so /opt/qt/lib/libqt.so &amp;&amp;
138cp -r doc/man /opt/qt/doc &amp;&amp;
139cp -r examples /opt/qt/doc
140exit</command></userinput></screen>
141
142<note><para>If you're building <application>Qt</application> on top of
143<acronym>LFS</acronym> &gt;=6.0, the build will fail if you pass the
144<option>--plugin-sql-<replaceable>[driver]</replaceable></option> switch to the
145<command>configure</command> command.</para></note>
146</sect3>
147
148</sect2>
149
150<sect2>
151<title>Command explanations</title>
152
153<para><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf</command>:
154<command>install</command> is safer than <command>cp</command> when
155libraries are in use.</para>
156
157<para><command>bash</command>: This command enters a sub-shell to isolate
158environment changes.</para>
159
160<para><command>export QTDIR=$PWD</command>: This command defines where the root
161of the <application>Qt</application> directory is located.</para>
162
163<para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>: This
164command allows the not yet installed <application>Qt</application> libraries to
165be used by the not yet installed <application>Qt</application> programs.</para>
166
167<para><command>export PATH=$PWD/bin:$PATH</command>: This command
168allows the build process to find supporting executables.</para>
169
170<para><parameter>-qt-gif</parameter>: This switch adds support for
171<filename>gif</filename> files to the libraries.</para>
172
173<para><parameter>-system-zlib -system-libpng</parameter>: This switch
174forces the build instructions to use the shared libraries that are on your
175system instead of creating a custom set of support libraries for these
176functions.</para>
177
178<para><parameter>-no-exceptions</parameter>: This switch disables
179the exceptions coding generated by the <application>C++</application> compiler.
180</para>
181
182<para><parameter>-thread</parameter>: This switch adds
183support for multi-threading.</para>
184
185<para><command>find -type f -name Makefile | xargs sed -i
186"s@-Wl,-rpath,/usr/lib@@g"</command>: This command removes hardcoded run-time
187paths. Otherwise, <command>uic</command> always tries to run with
188<application>Qt</application> libraries in <filename>/usr/lib</filename>.</para>
189
190<para><command>ln -s libqt-mt.so /usr/lib/libqt.so</command>: This command
191allows <command>configure</command> scripts to find a working
192<application>Qt</application> installation.</para>
193
194<para><command>cp -r doc/man /usr/share (or /opt/qt/doc)</command>: This command
195installs the man pages which are missed by <command>make install</command>.
196</para>
197
198<para><command>cp -r examples /usr/share/doc/qt (or /opt/qt/doc)</command>:
199This command installs the examples which are missed by
200<command>make install</command>.</para>
201
202<para><command>exit</command>: This command returns to the parent shell
203and eliminates environment variables set earlier.</para>
204
205</sect2>
206
207<sect2>
208<title>Configuring <application>Qt</application></title>
209
210<sect3><title>Configuration Information</title>
211<para>If you installed <application>Qt</application> using Method 2, you need
212to update some configuration files so that <application>Qt</application> is
213correctly found by other packages and system processes.</para>
214
215<para>Update the <filename>/etc/ld.so.conf</filename> and
216<filename>/etc/man.conf</filename> files:</para>
217
218<screen><userinput><command>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF"
219# Begin qt addition to /etc/ld.so.conf
220
221/opt/qt/lib
222
223# End qt addition
224EOF
225ldconfig
226
227cat &gt;&gt; /etc/man.conf &lt;&lt; "EOF"
228# Begin qt addition to man.conf
229
230MANPATH /opt/qt/doc/man
231
232# End qt addition to man.conf
233EOF</command></userinput></screen>
234
235<para>Update the <envar>PKG_CONFIG_PATH</envar> environment variable in your
236<filename>~/.bash_profile</filename> or <filename>/etc/profile</filename> with
237the following:</para>
238
239<screen><userinput>PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig</userinput></screen>
240
241<para>The <envar>QTDIR</envar> environment variable needs to be set when
242building packages that depend on <application>Qt</application>. Add the
243following to the <filename>.bash_profile</filename> initialization script for
244each user that builds packages using the <application>Qt</application>
245libraries. Alternatively, the variable can be set in the system wide
246<filename>/etc/profile</filename> file.</para>
247
248<screen><userinput>export QTDIR=/opt/qt</userinput></screen>
249
250<para>If you want the <application>Qt</application> executables in your shell
251search path, update the <envar>PATH</envar> environment variable in your
252<filename>~/.bash_profile</filename> or <filename>/etc/profile</filename> to
253include <filename class='directory'>/opt/qt/bin</filename>.</para>
254
255<para>As with most libraries, there is no explicit configuration to do. After
256updating <filename>/etc/ld.so.conf</filename> as explained above, run
257<command>/sbin/ldconfig</command> so that <command>ldd</command> can find the
258shared libraries.</para>
259
260</sect3>
261
262</sect2>
263
264<sect2>
265<title>Contents</title>
266
267<para>The <application>Qt</application>/<application>X11</application>
268library contains <acronym>API</acronym>s necessary to use
269programs based on the <application>Qt</application> <acronym>GUI</acronym>
270toolkit.</para>
271
272<para>The <application>Qt</application> package contains
273<command>assistant</command>,
274<command>designer</command>,
275<command>linguist</command>,
276<command>lrelease</command>,
277<command>lupdate</command>,
278<command>moc</command>,
279<command>qm2ts</command>,
280<command>qmake</command>,
281<command>qtconfig</command>,
282<command>uic</command>, and the
283<filename class="libraryfile">libqt-mt</filename> and
284<filename class="libraryfile">libqui</filename> libraries.</para>
285
286</sect2>
287</sect1>
Note: See TracBrowser for help on using the repository browser.